MPD (Music Player Daemon) is a flexible, server-side application for playing music. Through plugins and libraries it can play a variety of sound files while being controlled by its network protocol. For more information, read about what mpd is and is not.
- 1 Installation
- 2 Configuration
- 3 Clients
- 4 Troubleshooting
- 5 External resources
Install media-sound/mpd. Following minimal USE flags set is needed to be able to play most known audio file formats, and to listen to audio streams. For more features review the USE flags.
|alsa||Yes||Yes||Adds support for media-libs/alsa-lib (Advanced Linux Sound Architecture)|
|curl||Yes||Yes||Support for web stream listening|
|flac||No||Yes||Adds support for FLAC: Free Lossless Audio Codec|
|id3tag||Yes||Yes||Support for ID3 tags|
|mad||Yes||Yes||Adds support for mad (high-quality mp3 decoder library and cli frontend)|
|ogg||No||Yes||Adds support for the Ogg container format (commonly used by Vorbis, Theora and flac)|
|unicode||No||Yes||Adds support for Unicode|
|vorbis||No||Yes||Adds support for the OggVorbis audio codec|
|wavpack||No||Yes||Add support for wavpack audio compression tools|
Note that a number of these flags are added by the desktop profile.
After finished installation MPD should be working with the Gentoo shipped default configuration.
Below an example of a simple configuration:
At this point MPD should be able to run as a system daemon with its own user called mpd, which is the default setting of MPD.
You can now start MPD:
To start MPD at boot time, add it your default runlevel:
If MPD was build with PulseAudio support (pulseaudio USE flag), add a dedicated audio_output section to your /etc/mpd.conf:
Built-in HTTP streaming server (optional)
If MPD was build with network USE flag, add a dedicated audio_output section to your /etc/mpd.conf:
Replace localhost with 0.0.0.0 or a specific interface IP. Bind to address 0.0.0.0 means here: stream on all local found IP interfaces. You could change it to a specific interface IP address like f.e. 192.168.1.2 then the streaming server is bound to that interface IP only.
Running as a specific user (optional)
Sometimes it may be handy to run MPD as a specific user.
Start with copying /etc/mpd.conf to ~/.mpdconf. There are some changes that you will have to change in order to run MPD as a user, most importantly user and group, also make sure the various path settings are correct:
Make sure your user has read access to the directory you specify in music_directory.
Bluetooth Headset (optional)
Setup your Bluetooth headset first, according to this wiki. Put a user level ~/.asoundrc file in MPD's $HOME directory, which is /var/lib/mpd by default.
To be able to switch between the Bluetooth headset and the default sound card, add these lines to the audio_output section in /etc/mpd.conf:
- media-sound/mpc – A commandline client for Music Player Daemon (media-sound/mpd) (useful for key-bindings)
- media-sound/ncmpc – A ncurses client for the Music Player Daemon (MPD)
- media-sound/ncmpcpp – ncurses mpd client, ncmpc clone with some new features, written in C++
- media-sound/vimpc – An ncurses based mpd client with vi like key bindings
- Ampc – Asynchronous Music Player Controller for Emacs
For general troubleshooting refer to the excellent MPD troubleshooting section.