This guide describes how to install mpd as a user service in ubuntu.
The screenshots are taken on xubuntu jaunty, but should also work on ubuntu intrepid.
Step 1
Install mpd. In a terminal, write the below:
sudo apt-get install mpd
Step 2
By default ubuntu installs mpd as a system service. We don't want this, so let's remove it from startup.
If mpd is running stop it first. (not in screenshot)
/etc/init.d/mpd stop sudo update-rc.d mpd disable
Alternatively you can edit the file /etc/default/mpd as root and set the value of START_MPD to false.
Step 3
Extract and copy the default config file.
gunzip -c /usr/share/doc/mpd/examples/mpd.conf.gz > ~/.mpdconf
Step 4-7
Now we are going to edit the config file
gedit ~/.mpdconf
First we change all paths to point to: ~/.mpd. You need to change the following entries:
- music_directory
- playlist_directory
- db_file
- log_file
- error_file
- pid_file
- state_file
This is important, comment the user entry. This is normally used if mpd runs as system service. But we don't need it now.
If you don't comment this field, you will get an error trying to run it.
Now we are going to setup an audio_output {} This step is optional, you can also choose to let mpd autodetect.
I setup an pulse output, because this is what ubuntu intrepid uses by default.
Insert in the audio output section the following block
audio_output { type "pulse" name "My Pulse Output" }
Step 8
Create the needed directories.
mkdir -p ~/.mpd/playlists
If the music_directory you specified does not exist, create that one too. On jaunty ~/Music exists by default.
Step 9
run mpd.
mpd
If everything is ok, it directly detaches itself. (so it looks like it exits)
It might complain that the db_file cannot be found, you can safely ignore this.
Step 10
Run gmpc. As you can see in the below screenshot I do not see any music. This is because I have no music in my music directory.
Step 11-13
Add music to the music directory and tell mpd to update its database.
Step 14
Gmpc should tell you when mpd finished updating its database. You will then see the music in the file browser.
Step 15
Add the music and press play.
Step 16
Listen to your music.
If you encountered errors using this guide, you can get help via several channels, as described in getting help.
Step 17 (optional)
You most likely want to have mpd started automatically when logging into your desktop.
How this is done depends on the desktop you run.
On gnome you can add it using the session manager. (System -> Preferences -> Sessions -> Startup Programs -> Add)
A new system to have this consitent between desktops, is to create an autostart file in ~/.config/autostart/.
In the screenshot below is an example.
[Desktop Entry] Encoding=UTF-8 Version=0.9.4 Type=Application Name=Music Player Daemon Comment= Exec=mpd StartupNotify=false Terminal=false Hidden=false