MPD: Music Player Daemon


by ross at 13:36:01 on January 25, 2014

Install the daemon:

# cd /usr/ports/audio/musicpd
# make install clean

Install the command line client:

# cd /usr/ports/audio/musicpc
# make install clean

Optionaly install GTK client:

# cd /usr/ports/audio/ario
# make install clean

Enable MPD, add to /etc/rc.conf:


Edit the config: /usr/local/etc/musicpd.conf:

  • Replace all occurences of /var/mpd with /share/music (or what is place of your music)
  • Uncomment bind_to_address "any"
  • Uncomment OSS audio device

Initialize MPD:

# rehash
# mkdir /share/music/.mpd
# mkdir /share/music/.mpd/playlists
# touch /share/music/.mpd/database
# chown -R mpd /share/music/.mpd
# service musicpd start

Now watch the database file:

# ls -l /share/music/.mpd/database

When the size of this file changes from zero to any — it means MPD finished searching for your music.

Run man mpc to get list of all commands. Create playlist with all your music:

> mpc clear
> mpc ls | mpc add
> mpc random on

Commands for hotkeys:

  • Play: mpc play
  • Pause: mpc pause
  • Stop: mpc stop
  • Previouos song: mpc prev
  • Next song: mpc next
  • Remove song from current playlist: mpc del 0