Frequently Asked Questions

If you don't find the answer to your question here, check the MPDWiki FAQ and contribute any questions or answers that you have.

Q1: How do I stop MPD?
Q2: How do I update the db?
Q3: MPD skips/stutters during playback (and I am running MPD on an old machine). How can I fix this?
Q4: MPD skips or sounds distorted and I use ALSA, what can I do?
Q5: My db is corrupted, how do I fix it?
Q6: There is a delay before my songs start playing
Q7: I have enabled crossfading but I hear no crossfading.
Q8: What are the various config parameters in the MPD config file?
Q9: Is it possible to make MPD more secure?
Q10: Is it safe to run MPD as root?
Q11: Can MPD restore its playlist and start playing when it is restarted?


Answers

Q1: How do I stop MPD?
A1: "killall mpd" works for me ;-)

Q2: How do I update the db?
A2: With phpMp click the update link on the bottom of the main page, with mpc just type "mpc update".

Q3: MPD skips/stutters during playback (and I am running MPD on an old machine). How can I fix this?
A3: Try this in the mpd source directory:
1) make distclean
2) export CFLAGS="-O2 -mpentium"
3) ./configure --enable-mpd-mad --enable-speed
4) make

Q4: MPD skips or sounds distorted and I use ALSA, what can I do?
A4: Update your libao (also known as ao) to 0.8.4 or better.

Q5: My db is corrupted, how do I fix it?
A5: Run mpd with the "--create-db" option. This will recreate the mpd db from scratch.

Q6: There is a delay before my songs start playing
A6: Adjust the "buffer_before_play" parameter in your config file to "0%". If you don't have a config file, one is included with the mpd source.

Q7: I have enabled crossfading but I hear no crossfading.
A7: MPD does crossfading by using the buffer. The amount of buffer used for crossfading is the size of the buffer minus the amount of space reserved for "buffer_before_play". By default (2MB buffer and 25% buffer_before_play) this is approximately 9 seconds of crossfading for 44.1 khz, 16-bit, stereo audio. If you have the "buffer_before_play" set to 100%, there will be no crossfading. If you'd like more crossfading than the default buffer settings permit, increase the "buffer_size" and/or decrease "buffer_before_play" in your config file (a sample config file is included with the MPD source and in the man page). Note that setting the crossfade amount only sets the maximum amount of crossfading, it does not guarantee that much crossfading will be performed.

Q8: What are the various config parameters in the MPD config file?
A8: Check the man page for mpd. Also there is a sample config file included with the mpd source.

Q9: Is it possible to make MPD more secure?
A9: By default MPD binds to all addresses, thus allowing anyone to connect to MPD and manipulate MPD. There are two options to making MPD more secure. One is to set "bind_to_address" option in the mpd config file (an example config file is provided with the MPD source and there is an example in the MPD man page). For example, to only allow connections for localhost host, set "bind_to_address" to "localhost". Another option is to enable password authentication. Please read the mpd man page for more info on enabling password authentication. And of course, another route to securing MPD would be to use iptables or ipchains.

Q10: Is it safe to run MPD as root?
A10: This question should be, "Should I run MPD as root?", and the answer is no. Don't run MPD as root! There are no known root exploits in running MPD as root, but just don't do it. If you want to start MPD in an init script or just want to start MPD using your root account, then use the "user" configuration parameter of MPD (an example config file is included with the MPD source and an example is located in the MPD man page). Setting "user" will drop root priveleges and run MPD as the user specified (some might call this "setuid" support).

Q11: Can MPD restore its playlist and start playing when it is restarted?
A11: Yes! The config file option (an example config file is included with the MPD source and an example is in the MPD man page) is "state_file". The state file is specified like: state_file "~/.mpdstate". If a state file is specified, when MPD is killed, the current playlist, current song playing, player state (play, pause, stop), random mode, repeat mode, and crossfade settings will be saved to the state file. When MPD is restarted, it will restore the settings and playlist from the state file.