Raspberry Pi Internet Radio
I’ve mentioned already that the Raspberry has become a rather integral part of my flat. And now I mention that I’m a great consumer of ska, reggae, soul, house, samba, sambass, funk and liquid funk.
And that’s where internet radios come into the picture. But it’s been so awkward so far. Hook up the phone to the stereo’s AUX cable? Start an entire desktop session on a laptop to play them in a browser and hook it up to the stereo’s AUX cable?
But now the Raspberry is in place, and it’s permanently connected to both the TV and the stereo. So I had to find a way to play internet radio stations from the command line. The internet did not reveal definitive answers, so I wrote a little Perl program.
It does some data-mining on www.internet-radio.com and presents an extremely simple interactive command line interface to choose genres and stations, start playback on the audio-jack or on HDMI, to play or pause, to quit or quit but continue playback in the background.
It’s very easy to use. I ssh sometimes into the Raspberry to change the station, and then it plays LiquidBass.net or something else all day long.
It’s called rpi.fm. Please find it on GitHub.
I tested it on Raspbian Wheezy. It uses omxplayer for playback. Important: the user must be in the “audio” group. The default user “pi” is, for new users edit /etc/group as root:
audio:x:29:pulse,pi,youruser
Next project: web-app for the same thing. And then the phone can be used as a remote control.