MPD: The Music Player Daemon
March 14th, 2007 edited by TinchoEntry submitted by Igor Stirbu. DPOTD needs your help, please contribute !
Music Player Daemon is a server that plays sound files and streams and can be controlled through remote clients. MPD supports Ogg-Vorbis, MP3, FLAC, Wave and AIFF for sound files and Ogg-Vorbis and MP3 for streams. Also has support for cross-fade.
MPD is a very flexible media player due to it’s client/server nature. MPD can be configured to use your sound card or interact with an icecast server and send the stream over the network. It can be controlled with clients that may reside on the same machine or all over the network.
When MPD starts, it reads first ~/.mpd.conf
and then /etc/mpd.conf
, if the former can’t be read. So it may be configured to run at startup or be started by any user. Here is the content of my .mpd.conf
file:
# ~/.mpdconf music_directory "/home/igor/media/mp3" playlist_directory "/home/igor/.mpd" state_file "/home/igor/.mpd/state_file" db_file "/home/igor/.mpd/tag_cache" error_file "/home/igor/.mpd/error_file" log_file "/home/igor/.mpd/log_file" pid_file "/home/igor/.mpd/pid_file" mixer_type "alsa" mixer_device "default" mixer_control "PCM" filesystem_charset "UTF-8" audio_output { type "alsa" name "Local sound card" } audio_output { type "shout" name "Icecast2 stream ( http://keo:8000/stream.ogg)" host "keo" port "8000" mount "/stream.ogg" password "hackme" # quality "7.0" bitrate "128" format "44100:16:1" # Optional Paramters user "source" description "All your music are belong to us" genre "rock" }
This setup allows me to directly use my sound card when working on the computer where MPD runs or enable the icecast stream and listen over the network when using the laptop.
The modifications to icecast.xml
are these:
<hostname>keo</hostname> <mount>/stream.ogg</mount>
Nice features for MPD are available due to it’s configuration files. If you specify a pid_file
you can use mpd --kill
to stop the daemon. The state_file
saves the state of the player (i.e. the playlist, the time and the name of the current song, the enabled outputs, etc.) If stopped gracefully, it writes the state_file
and when started, resumes playback and restores the playlist.
Visit MPD’s home page for more information regarding releases, clients, FAQ. Packages for MPD are available in Debian since Sarge, and in Ubuntu since Hoary.
Clients
In Debian a few clients are available for MPD and more of them listed on the MPD web page. The one I use is Gmpc. It supports notification area integration, pop-up notification, playlist manager, server settings panel. There are ncurses, command line, web and other types of clients.
In the following screenshot, you can see a bunch of clients connected to the same mpd daemon: gmpc, pympd, ncmpc (ncurses), and phpMp2 (web).
March 14th, 2007 at 6:23 am
Don’t forget Sonata! It’s hands-down better than Gmpc.
http://sonata.berlios.de/
March 14th, 2007 at 9:42 am
the above site gives good description about Music Player Daemon is a server that plays sound files and streams and can be controlled through remote clients and i have gone through a site related to music player Daemon which gives sufficient information about MPD
music
March 14th, 2007 at 10:36 am
A web client I also like:
http://mroyer31.hd.free.fr/~roy/wiki/doku.php?id=ajaxmp
March 14th, 2007 at 9:54 pm
More apps should be built like this with a separation between daemon and front-end. It exemplifies Unix philosophy of modularization and doing one thing and one thing well.
I’m dying for a torrent app that is just a back-end. (BTG is too buggy and doesn’t seem to be aiming for third-party front-ends.)
March 15th, 2007 at 11:52 am
Best client I’ve found is qmpdclient http://havtknut.tihlde.org/qmpdclient/
It also has a deb repository, just put
deb http://havtknut.tihlde.org/debian qmpdclient main
in your sources.list, update and install
mpd wiki: http://mpd.wikia.com/wiki/Main_Page
March 19th, 2007 at 4:50 am
Another Client/Server Music Player is XMMS2.
See http://wiki.xmms2.xmms.se/index.php/Main_Page
April 28th, 2007 at 12:13 pm
cartruck: I am dying to know why you just complain about BTG and do not use the bugtracker (http://developer.berlios.de/bugs/?group_id=3293) to add some of those bugs you found.
Also, BTG uses XML-RPC and the list of commands the daemon accepts is not a secret. While it is not something that has any priority for me, I am adding additional commands when people want me to.
August 14th, 2007 at 6:39 am
cartruck: Take a look at mldonkey. It’s a fantastic backend. Frontends available are a little limited, but let me know what you think. opensourcedds @t gmail d0t com