Edit: This guide is ridiculously ancient, and I haven't used it in years, so take anything it says with a pinch of salt!
Note: This is an update of the original post Here by Zenwhen
What is Music Player Daemon ?
Music Player Daemon (MPD) allows remote access for playing music and managing playlists. MPD is designed for integrating a computer into a stereo system that provides control for music playback over a local network. It is also makes a great desktop music player, especially if you are a console junkie, like frontend options, or restart X often.
Why should I use it instead of Rhythmbox or Muine?
MPD is light on your resources, and high on extensibility. The daemon is easy to interact with, develop front ends for, and configure with intuitive configuration scripts. If that doesn't convince you, perhaps the pretty screenshots and features coming later in this thread will. I personally use it mainly so that I can sit on my sofa with my laptop, yet still play music through my main speaker system using my main computer.
How do I get Music Player Daemon?
As log as you have configured your repositories correctly, installing mpd is as simple as typing into the console:
Code:
apt-get install mpd mpc gmpc
How do I configure Music Player Daemon
In these instructions, we shall be configuring mpd to run as a system service. This will mean that it will start on boot, and run as it's own user (for security). We will also have a seperate folder where it stores it's music list (we can use symbolic links to add other directories)
Type this into the console:
Code:
sudo dpkg-reconfigure mpd
This will bring up a console-interface to configure mpd. Use the keyboard to move around. Do the following:
- When it asks if you want to configure as a system service, choose <Yes>
- Hit Enter on the next three windows - where it asks you for the directories for the music and playlist, and the port number to use
- Hit <Yes> for the state file. This means that it will save your playlist and music position when you turn off the computer (or restart mpd)
- Choose either <Yes> or <No> for restart on upgrade. I chose <No>
It will then quit and start mpd for you.
Now, people have been having trouble getting this to work on Hoary (myself included) and I found that this was easily solved by adding a single line to the mpd.conf saying 'ao_driver "alsa09"'. If you type the following into the console this will be done automatically:
Code:
sudo echo ao_driver \"alsa09\" >> /etc/mpd.conf
after this restart mpd with the following command:
Code:
sudo /etc/init.d/mpd restart
How do I add music to Music Player Daemon
You add music by adding symbolic links to the music directory, which is set to /usr/share/mpd/music/ with the above steps.
Say, for example, you store your music in your home directory, under the "mp3s" folder, you would issue the following command:
Code:
sudo ln -s $HOME/mp3s /usr/share/mpd/music
you then need to tell mpd to rebuild it's music database. You can do this through the graphical client, gmpc, or using mpc by typing How do I use Music Player Daemon
The GTK client for mpd is called gmpc.
Using this to manage MPD and update your database will make using MPD effortless, and its playlist options are as as good as any, though not as complicated. You may have noticed a set of panel launchers there on that screenshot that look like media player controls. Those are custom application launchers added to the gnome panel with a right click that point to some commands that can be sent to mpc (the command line media player daemon client). Some of the more common commands are:
Code:
mpc Displays status
mpc play <number> Start playing at <number> (default: 1)
mpc next Play the next song in the current playlist
mpc prev Play the previous song in the current playlist
mpc pause Pauses the currently playing song
mpc stop Stop the currently playing playlists
For a complete list of commands for mpc, type
The icons on the launchers are the same as used in gmpc, and they should be installed to the folder /usr/share/mpc/
If you decided not to install mpd as a system service, you will have to start mpd with the "mpd" command before music playing works. You can either add a launcher to run that command, run it from the terminal whenever you start up, or you can add it to "gnome-session-properties" as a startup command.
After that, you will be able to run GMPC, have a nice pop-up window whenever the song changes, control it in a winamp like fashion with he GUI, and control it from your taskbar. You can control it from the terminal without booting into X with the mpc commands, and can control it with FoxyTunes.
If you noticed that I said the word "control" a lot in that last paragraph, you are right. MPD gives you total control over your music library, and gives you the ability to control it from wherever you wish, however you wish, access it how you wish, and from any OS you wish using any desktop environment you wish. There are also clients for all of the major desktop environments; including KDE and even Windows.
I will answer any questions you raise to the best of my ability. Enjoy! 
Troubleshooting
Here will be a list of errors people hhve had and the possible fixes. If you have a problem not listed here, it is worth taknig a look at the /var/log/mpd/errors.log file (by default this is only accesible by root):
When I click play on gmpc, it flickers the song title and then does nothing
- Make sure you have the correct sound driver chosen, for me this was adding the ao_driver line to the mpd.conf
Getting Extra Help
As I said, I and anybody else who knows will help here, but there are a couple of other good places to ask for help:
- The Music Player Daemon Wiki
- On IRC, the #mpd channel on freenode
- The man page for mpd is very helpful and explains the mpd.conf file settings ( man mpd )
Note: This post is mostly based off of a post by Zenwhen Here , but I thought I would re-create it in the Hoary section, and update it with hoary specifics.
Bookmarks