How to quickly setup MPD on a Linux system
Have you ever heard about cloud computing? I hope so. BTW, isn’t necessary to got an internet connection to create a “cloud”: I mean, you don’t need any web server.
Well, using the web should help you to remotely access your files… but this time I’m going to explain you how to install and configure an MPD server on your system — sharing your playlists in a LAN.
This is very quick and easy on Linux, that requires a minimal configuration: even if the next steps apply to Ubuntu, you could install similar packages under any distribution.
I use it daily with Karmic Koala: once a server is up and running, you may use any client to access and play your music tracks (from other machines too, if you need this).
$ sudo apt-get install mpd
After installing this package – the one and only you need, right now – you have to configure the server with very few options. I prefer to do this system-wide instead a per-user configuration.
$ sudo gedit /etc/mpd.conf music_directory "/path/to/music" playlist_directory "/path/to/playlist" bind_to_address "192.168.1.2" port "6600"
I followed the order (which may vary) of the default configuration file I found: you should leave the rest unchanged. Just notice that in the example I used 192.168.1.2 – my system’s local IP in the LAN – instead localhost: this is particularly useful if you plan to access your playlist from other devices.
Remember to change the address to fit your system’s configuration: assuming that you’re using ALSA and PulseAudio, you could go on with the setup — it supports Jack too, I don’t use it. Try running mdp --version if you installed MPD in a different distribution.
audio_output {
type "pulse"
name "foo"
server "192.168.1.2"
sink "alsa_output"
}
While ALSA should have been configured properly during the installation, you must manually de-comment PulseAudio’s lines: check both and make sure the set address is correct. The name option doesn’t matter.
Now that you’re server is ready, you just need to restart its daemon to start playing your tracks:
$ sudo /etc/init.d/mpd restart
Of course, the configuration file is longer and you may choose other settings to optimize the stream. But this works and it’s enough to get started.