Music Player Daemon Community Wiki

Executable Songs

522pages on
this wiki
Add New Page
Talk0 Share


I think it would be a good idea to add the possibility for execute "tracks". This would be good for creating webservice-scripts which authoricate to the webservice, fetch its url and play it in mpd. This would have to advantages: the services can be accessed through normal clients (so no client sided scripts required) and when playing a webservice-stream, then stopping mpd and start it a day after (may while pc is down) it would continue playing this station.

Working wiseEdit

If the execute flag of a file in the database-folder is set, and this function is enabled in the mpd configuration, mpd execute the file while indexing with the indexing parameter and use this as default title (see Title-Response). If the track is playing, the mpd should parse executables output on the parameter information like described (see Information-Response) and after stopped, reset all fields. The interval in which mpd should refetch the information from the script may be set in the mpds configuration or as an extra response-field on the indexing parameter.

File specificationsEdit

As first parameter, one of the following statements is given to the executable file:

  • start when the client load the "song" (see Start-Response)
  • stop when the client stop the "song" (no response)
  • indexing when indexing in the database
  • information when mpd wants to get the current informations from the executable (see Information-Response)


The reponse should contain one or more http urls like described following (newline between urls): url: <url which mpd have to play>


The response contains the default title of the "track": <default title>


title: <title of current track>
artist: <artist of the current track>
album: <album of the current track>
genre: <genre of the current track> url: <change url to this url> [optional, may for a podcastreader script]



  • MPD starts indexing
  • MPD find a executable in music_directory
  • MPD executes file ans parse its output
  • (file is with its default title imported to the database)


  • User want to play this song
  • MPD executes file with parameter start
  • script may log in or did something and return the start
  • MPD executes with parameter information every few seconds while track is playing to get informations of the current played track
  • MPD send the song informations to the clients
  • User stops the song (or switch to another playlist item) then MPD executes script with stop


This sounds like a great idea, but I store my files on a shared vfat/ntfs partition, which doesn't have executable flags. Maybe some other way - like a name-based method, such as: add a '.mpd' suffix to denote an executable, and have mpd try to exec() that file and append its output as entries in the playlist. -- Skaman Sam <skamansam AT gmail>

One thought that came into my mind while reading this is that there could be a scheme (exec:// or exe://), which, when used as a prefix, would fetch the specified file, execute it and interpret the output as some kind of music file. --jn

To my mind the number of scripts will be low and the parameters very rich. I would like the scripts where in a peudo directory,


For just scripts with a config file enabling them selectively with appropriate patters such as



exe=streamBBCRadio --control stdctrl --sound stdout --channel radio4  

\# %o -- Ipod Owner 
exe=streamIpod --dbLoad -dbBackup -stream 

# %o -- Ipod Owner 
# %g -- Genre 
exe=streamIpod --dbLoad --dbBackup --stream --dynamicPlaylist Genre %g 

# %o -- Ipod Owner
exe=streamIpod --dbLoad --dbBackup --stream --dynamicPlaylist PlayCount Decending

The script would then listen for control messages such as indexing, pausing, streaming, and effectively work, and jump to next track, replying always on a signal to the control channel, (Unix id4) and behaving not to different to udev. Messages on the Control Channel should be of a similar format to MPD. -- oms101

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.