Installing MPD on Windows

MPD is a music player which works a bit different than other music players. It uses a server – client architecture; which means that the music is played as an application, while another application (the client) is used to control the playback. This allows a user to use different clients to play the same music.
An example setup would be to have the server component running on a computer near your stereo, hooked up to it via a jack cable, and you can install a client on your phone, tablet or a different computer to control the playback. The only requirement is for the computers to be able to reach each other via the local network.

Downloading and installing the server component

  • Download the latest zip file from the mpd homepage, select the win32 binary for the windows version
  • Open the downloaded file and extract its contents to your desired location. I used the folder C:\apps\mpd, so that is what I will be using in this post. Simply replace this path with the path you extraced mpd to. I do not recommend installing in your Program Files folder, because you might run into windows UAC (User Account Control) problems.

Configuration

MPD requires a configuration file to work. Create the file mpd.conf in the folder where the mpd file was extracted. The following attributes are important:

  • music_directory: The location where your mp3 files can be found. All backslashes in paths must be replaced by forward slashes
  • log_file: File where mpd output is logged
  • db_file: MPD stores the meta information retrieved from the MP3 files in this database file
  • playlist_directory: folder where the playlists are stored by MPD
music_directory "C:/Music"
log_file "C:/Apps/mpd/mpd.log"
db_file "C:/Apps/mpd/mpd.db"
playlist_directory "C:/Apps/mpd/playlists"
audio_output {
    type "winmm"
    name "Speakers"
    device "Speakers (Realtek High Definition Audio)"
}
audio_output {
    type "httpd"
    name "My HTTP Stream"
    encoder "vorbis" # optional, vorbis or lame
    port "8000"
    # quality "5.0" # do not define if bitrate is defined
    bitrate "128" # do not define if quality is defined
    format "44100:16:1"
}

In order to make this configuration work do the following:

  1. Create the playlist folder (C:\Apps\mpd\playlists)
  2. Create the empty file C:\Apps\mpd\mpd.db, on the first start mpd will display an error, and replace the contents with the collected metadata
  3. Create the file C:\Apps\mpd\mpd.log and save it as an empty file

Starting MPD

You can start the MPD server with the following command:

C:\Apps\mpd\>mpd mpd.conf

This will start the mpd server and allow you to connect to it using an MPD client. In order to connect to the server in a client you need the IP address and the portnumber. The IP address is the local address on your computer running the server, the port number is the default, number 6600. If you have trouble accessing the server, check that the port is not blocked by your local firewall.
My preferred client is MPDroid, an excellent app for Android phones, which allows me the access my music from anywhere in my house.
In the example configuration file the MPD music is also accessible via http audio stream on port 8000; the url is http://[ip adress]:8000/stream.m3u.

Next steps

MPD is now running in a console window. Running it as a service on your windows PC is explained in this post.