CMP – Central Music Playback System using MPD

Geek, Lighting Tech, Maker

CMP – Central Music Playback System using MPD

Using MPD/MPC for Radio Paradise morning wakeups

Install mpd and mpc

sudo apt-get install mpd mpc

By default MPD looks for music files in the folder /var/lib/mpd/music playlist files are stored in the folde/var/lib/mpd/playlists

Add radio paradise playlist

Add the following lines to the file  /var/lib/mpd/playlists/rp.m3u
If the file does not exist then create it.

Start script


mpc clear
mpc load rp
mpc play 

Then make the file executable

chmod +x ~/bin/rp

This file clears the current MPD play queue, loads the radio paradise playlist into the play queue and starts the stream

Stop script


mpc clear

Make the file executable

chmod +x ~/bin/off

with nothing in the play queue MPD automatically stops playing


Change the following lines in your /etc/mpd.conf file

bind_to_address "localhost"
bind_to_address "any"

and check that

auto_update "yes"

is correct and uncommented


For a wakeup alarm at 7 AM every weekday

Run crontab -e and add the line

0 7 * * 1-5 ~/bin/rp

For a wakeup alarm at 6 AM every weekday

Run crontab -e and add the line
0 6 * * 1-5 ~/bin/rp

To run in the system wide crontab
make an /opt/bin folder
copy, or symlink ~/bin/rp to /opt/bin
add the following line to your /etc/crontab file
0 6 * * 1-5 mpd /opt/bin/rp

NOTE: For system crontab usage you MUST add a user to run the script as, I recommend the mpd user.

For a simple GUI MPD Client

sudo apt-get install gmpc

Edit your ~/.bashrc file and add the following line at the end of the file


Then restart MPD to allow the new configuration to be set

sudo service mpd restart

Starting / Stopping

Now to start radio paradise use the command rp and to stop radio paradise / your alarm use the command off

Example Use Case:

If flint wanted to play an audiobook like neuromancer I would recommend unpacking the tar.gz file of the audiobook in the /var/lib/mpd/music folder and using the following /var/lib/mpd/playlists/neuromancer.m3u}}} file


To load and play the book I would use the following commands

mpd clear mpd load neuromancer mpd play 1 

Where 1 is the track number

To pause the playback use

mpc pause

Travel Uses

For travelling in the car it may be nice for the audio to auto pause to do this I recommend setting your laptop up as a hotspot and using


After installing connect to your laptop’s ad-hoc wifi network and enter in the IP information of the laptop into MPDroid on the phone, in the MPDroid settings set the options “Pause when in a call” and ” resume playback when call ends”

To remotely control the MPD from another linux box install mpc
sudo apt-get install mpc

and then run
mpc -h <hostname or ip address of MPD computer> command

mpc -h pause
mpc -h music play 

Note “music” is the hostname of on the flint network }}}

Quick Tips

Make an alias for mpc on remote computers such as the following

alias mpc='mpc -h'

Another useful alias is
alias mpt='mpc toggle'

This toggles between pause/play

For more information on MPC

man mpc

Comments: 1

  1. rashid noman says:

    Excellent article, congratulations & thanks for sharing! 🙂

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.