BBC Streaming Radio Script for MPD

BBC Streaming Radio Script for MPD

UPDATE: Changes the BBC have made to their streaming service means the below no longer works. Bit of a shame…

Following on from my earlier post, this details the steps taken to get the Pi to operate as a BBC radio player. This is aimed at people in the UK as it uses the UK-only stream URLS.

The end result is the ability to select and play the main BBC radio stations from another computer (over ssh) or from your iPhone using the app MPoD.

Firstly, install MPD and MPC:
$ sudo apt-get install mpd mpc
Change the permissions of mpd (just to make sure):
$ sudo service mpd stop
$ sudo chmod -R g+w /var/lib/mpd
$ sudo chmod -R g+w /var/run/mpd

Make a change to the mpd config file /etc/mpd.conf
$ sudo nano /etc/mpd.conf
Comment OUT the line:
bind_to_address "localhost"

Uncomment the ZeroConf lines and alter the name to “RaspiRadio” and restart the mpd service: sudo service mpd start. This should now be a functioning MPD / MPC install.

The next step is to generate a playlist file that includes each stream address. What I have done is different to other scripts found online – they make a different file for each station. I prefer having all the streams in a single playlist so I can select any station using the MPoD app on my phone, without having to deal with finding / loading playlists. It just works.

The below code can be run as a cron job to update the streams (their details change periodically) every 2 or so hours.