Adding an Internet radio stream (such as RadioFreeFedi) to mpd

I am using mpd, running on an Intel NUC, connected to some old speakers, for playing music in my office, controlled by ncmpcpp on my laptop, or an app on my phone.

This means I can easily control and play music from my own media library, but I’ve only just got around to looking at playing Internet radio streams this way.

Fortunately, it is easy.

On the machine running mpd, go to the playlists directory. For me, this was /var/lib/mpd/playlists, but you can check your path in your config file (in my case, /etc/mpd.conf).

If your Internet radio station offers a .m3u file, just copy it here.

If it does not - for example, RadioFreeFedi, which I used to test this, and which only offers .mp3 or .xspf files - you’ll need to create your own.

This is easy - just put the URL of that file into a file with a .m3u extension.

For example:

echo "http://relay.radiofreefedi.net/listen/rff/rff.mp3" > /var/lib/mpd/playlists/RadioFreeFedi.m3u

I needed to restart ncmpcpp before it would show in the playlists tab (5), but I did not need to restart mpd.

In the ncmpcpp interface, this shows up as the file name, rff.mp3. Functional, but not attractive.

If you want to make it a bit nicer, you can do more with the .m3u file:

#EXTM3U

#EXTINF:-1, RadioFreeFedi -  Main

http://relay.radiofreefedi.net/listen/rff/rff.mp3


#EXTINF:-1, RadioFreeFedi -  Comfy

http://relay.radiofreefedi.net/listen/comfy/comfy.mp3

This now includes both of the RadioFreeFedi streams, and they show up as “RadioFreeFedi - Main” and “RadioFreeFedi - Comfy” in the ncmpcpp interface.