Rpi Music Player Daemon

From eLinux.org
Jump to: navigation, search


Music Player Daemon (MPD) is a flexible, powerful, server-side application for playing music.


To install MPD on the Debian release for Raspberry Pi you will need the mpd package. You may also want to install mpc (a very simple console based MPD client, useful for debugging) and ncmpc (another console based client, but more useful for playing music).

Running as a Normal User

The developers of MPD recommend that you do not run the server as "root". To run the server as the "pi" user:

Stop MPD with:

sudo service mpd stop

Files that MPD needs to access are owned by the "audio" group, and the "pi" user is a member of the audio group, but the files are not set to be writeable by the group. Make the the files group writeable with:

sudo chmod -R g+w /var/lib/mpd
sudo chmod -R g+w /var/run/mpd

You will also need to remove the log file created by "root" when MPD was first started:

sudo rm /var/log/mpd.log

And now restart MPD:

sudo service mpd start

Loading Music

The default location for music is /var/lib/mpd/music. You can fill this directory with music, replace it with a symlink or change the location in the configuration file. To update the MPD database run mpc update on the MPD server or initiate the update with another client.


You can make changes to the configuration by editing /etc/mpd.conf

Remote Access

To allow connections from other devices comment out the line:

bind_to_address "localhost"

Volume Control

If sound works but you don't have volume control you need to change the mixer_control setting. Find the name of the mixer you want with alsamixer and enter it into the mixer_control setting in the audio_output section you are using.

For example; to control the main volume on a Sound Blaster Play! you would use:

mixer_control "Speaker"