Wikia

Music Player Daemon Community Wiki

How to play an audio cdrom

Talk0
514pages on
this wiki

To play an audio CD in MPD, it must first be 'ripped' onto your hard drive.

Ripping ClientsEdit

Console Edit

KDE Edit

Mac OsX Edit

  • iTunes

GnomeEdit

Play without RippingEdit

There is also a posibility to play Audio-CDs using gvfs - the new Gnome Virtual File System.

The useraccount under wich mpd is running must be a "normal" User. To run mpd as user "mpd" dose not work (i didn´t find out a way to mount a Audio-CD with gvfs as user "mpd")

If you use gnome (or only nautilus under another windowmanager), the mounting of a audio-CD works automatically. The following steps are for manually mounting.


Even, if you don´t run gnome, you can use gvfs. To mount a Audio-CD use

gvfs-mount cdda://sr0 (or gvfs-mount -d /dev/cdrom)

sr0 (or /dev/cdrom) must be your cdrom-device. You can find out the right code with

gvfs-mount -l

gives:

Drive(1): CD/DVD-Laufwerk
  Type: GProxyDrive (GProxyVolumeMonitorGdu)
  Volume(0): Audio-CD
    Type: GProxyVolume (GProxyVolumeMonitorGdu)
    Mount(0): Audio-CD -> cdda://sr0/
      Type: GProxyShadowMount (GProxyVolumeMonitorGdu)

for the cd-device


You find content of the CD in ~/.gvfs as tracks in *.wav-Format. The ~/.gvfs-directory has only acces from the owner. Even root has no access in this directory!!! That´s the reason why you have to run mpd as a "normal" user. The permissionmask is 700. I didn´t find out a way till now, how to change the file-permissions or how to mount a cd as user "mpd" whith gvfs...


I symlinked the whole ~/.gvfs-directory to my music-directory from mpd.

cd /var/lib/mpd/music

ln -s /home/jakob/.gvfs

(this is the directory given in /etc/mpd.conf)

update the database of mpd using mpc

mpc update music/.gvfs

and you can play the audio-CD directly without ripping it to the HD. Have fun.


If someone finds out, how to mount a Audio-CD with gvfs as user "mpd", please update this article

to use gvfs without GUI (via ssh or on a terminal as user mpd) you can use

dbus-launch gvfs-mount ....

but this doesn´t work for me here on my computer.

Automatic mounting und updating the mpd-db without gnome/nautilusEdit

If you don´t use nautilus or gnome (here is fvwm2 at work) you can automatic this mounting and updating using cdde.

You find a file ~./cdde.xml after you install cdde in your home-directory. cdde recognize when you insert a CD/DVD in your drive and can start some action.

The content originally is:

<?xml version="1.0"?>
<cdde delay="5000000">
  <drive path="/dev/cdrom">
    <audio command="echo An audio cd was inserted."/>
    <data command="echo A data cd was inserted."/>
    <dvd command="echo A dvd was inserted."/>
    <vcd command="echo A vcd was inserted."/>
    <svcd command="echo A svcd was inserted."/>
    <blank command="echo A blank cdr/dvdr was inserted."/>
    <mixed command="echo A mixed (audio/data) cd was inserted."/>
  </drive>
</cdde>


This produces only a message with the CD/DVD-type in the log (syslog).

A script mounts the cd automatically and updates the mpd-database:

change the line in .cdde-xml for the audio-cd to

<audio command="/usr/local/bin/cdde-audio %dev%"/>

and /usr/local/bin/cdde-audio has the following content:

#!/bin/bash
DRIVE=`readlink -f "$1"`
ID="cdde($USER)"
echo "A audio cd was inserted" |logger -t $ID
echo "${DRIVE##/dev} $2"|logger -t $ID
echo "mount Audio-CD in $HOME/.gvfs"|logger -t "$ID"
gvfs-mount cdda:/"${DRIVE#/dev}" 2>&1 |logger -t "$ID"
echo "update mpd-database"|logger -t "$ID"
mpc -v --wait update Musik/andere_Filesysteme|logger -t "$ID"

Playing CDs directly from MPD Edit

If you configured MPD with the cdio_paranoia input plugin, you can add cdda:// to the playlist to play a CD. See the MPD user documentation for more information.

Advertisement | Your ad here

Around Wikia's network

Random Wiki