Whatbox Logo
Login for certain variables to be updated with your slot's information

Wiki > MPD

Music Player Daemon (MPD) is a flexible, powerful, 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, refer to the official website.

Installation

  1. Connect to your slot through SSH

  2. Downloads the latest release of MPD

     git clone https://github.com/MusicPlayerDaemon/MPD
    
  3. Build MPD

     cd ~/MPD
     meson . output/release --buildtype=debugoptimized -Db_ndebug=true --prefix=$HOME
     ninja -C output/release; ninja -C output/release install
    
  4. Create ~/.config/mpd and copy the example configuration file

     mkdir -p ~/.config/mpd; cp ~/MPD/doc/mpdconf.example ~/.config/mpd/mpd.conf
    
  5. Create all the files that you will need to run mpd

     mkdir -p ~/.config/mpd/playlists   
     touch ~/.config/mpd/{database,log,pid,state,sticker.sql}
    
  6. Edit ~/.mpdconf (nano ~/.config/mpd/mpd.conf) to use files and directories that you just created:

     music_directory    "~/files"
     playlist_directory "~/.config/mpd/playlists"
     db_file            "~/.config/mpd/database"
     log_file           "~/.config/mpd/log"
     pid_file           "~/.config/mpd/pid"
     state_file         "~/.config/mpd/state"
     sticker_file       "~/.config/mpd/sticker.sql"
    
  7. Uncomment and change the TCP port to 14615. Optionally, uncomment and specify a password in the Permissions block if you don't want anyone else to be able to listen to or control your music.

  8. Uncomment the httpd output example. Specify whatever options suit you. If you want to stream lossless FLAC files, set encoder to "flac", format to "44100:16:2" and comment out quality and bitrate. Set the port to 18307. If you are still using nano to edit the configuration file, save and exit by pressing Ctrl+X, y, Enter

  9. Start mpd

     ~/bin/mpd
    

mpd can be shutdown with ~/bin/mpd --kill

Usage

There are many clients that can control MPD for you (do an internet search for 'MPD client'). For android, MPDroid is a popular choice which in addition to controlling MPD can also play the httpd stream. Ncmpcpp is a popular desktop choice (in order to play the http stream with ncmpcpp, control the whatbox MPD server with ncmpcpp -h server.whatbox.ca -p 14615, and after configuring a local mpd server add the stream by running mpc add http://server.whatbox.ca:18307 and then connect to your local mpd server with ncmpcpp (without any options added)). XBMC also has an MPD client with support for streaming.