Inside a Linux powered FM Radio Station

An interesting job I took in a few months back was for a licensed FM Radio station who desired to use Linux because of the lack of licensing fees – which is an issue because of their tiny operational budget. The station also pointed out a number of “live assist” applications that are Linux based, that are designed to aid in broadcasting live audio from a desktop computer. A live Internet stream of their FM broadcast was also required.

I was quite surprised by a customer, with no real technical capabilities, had specifically requested Linux. We ended up using Debian, NIS & NFS for ‘account roaming’ across multiple machines, and the Gnome Desktop.

The Internet stream initially seemed simple to solve but proved to be quite a challenge. Reliability was the major issue. I setup an Icecast stream and found due to my DSL connection dropping out, the stream would drop out some 6-12 times per day. Once every 2 hours did not seem acceptable.

The solution to that problem now encompasses two physically separated sites with their own independent Internet connections uploading the stream to two public Icecast servers. In order to allow for redundancy, the stream uploaders run Icecast servers and the public servers are configured to relay streams from these machines. With stream fallbacks, one of the stream uploaders can go offline, or one of the public servers can go offline, and the stream will remain in a working state. Even still, its important enough to warrant SMS notifications in the event any equipment in this pool goes offline – so we monitor it around the clock.

The only form of Internet available to us is ADSL from Telstra and their resellers. There simply are no other affordable options in our area since the OPEL project was canned by Krudd. This limits us to 384kB/sec at each stream uploader site. We can only afford one line at each uploader site, and there are other uses of the Internet connection, so the realistic available bandwidth is even less.

The bandwidth limitations meant we could only upload one high quality stream. However, we required several in different formats and bitrates to suit listeners requirements. Stream transcoding at the server end seemed the only possible solution – and it seems the Icecast developers aren’t interested in stream transcoding at all due to ‘quality loss’. There are very few applications available to handle this task. I ended up making numerous watchdogs for the buggy streamtranscoder package from oddsock. This enabled us to transcode the stream into another 3 formats.

Playback in web browsers seemed to be another drawback for Icecast/Shoutcast. Two methods are possible – use HTML <embed> tags to request a plugin the user may or may not have installed, or use Adobe Flash. Adobe Flash seems sensible, but its lack of handling for live streams makes it the worst choice – playback is distorted, or non-existant, in many mainstream browsers. I’m still to develop a reliable method to play the stream in a browser that “works everywhere”.

Another problem the station faced was broadcast recordings. By law, ACMA requires the broadcast is recorded and copies are retained for 6 weeks. The old solution was huge piles of VCR machines which would fall over frequently for many different reasons including tapes only lasting 6 months with the duty cycle the station imposed on them.

A couple shell based tools made recording possible with just a shell script executed from cron. But like always, it took some time to perfect. We had also added a terabyte of RAID5 so there was plenty of storage for 2 months of recordings at a high bitrate which seemed an easier number to archive. The implementation of this quite simplistic shell script has been a huge success – with many presenters pulling their own shows, for their own archiving purposes, from the recording system I setup. It is the primary method for recording radio shows today.

Better software for broadcasting from the PC is in the works at last. It seemed the station was initially interested, but then failed to locate a presenter who was willing to use such a system. We now have one – and hopefully can use this presenter to turn more. Its still unclear how we can wire it to the FM broadcasting equipment while retaining reliability.

Given the special requirements for a radio station, and the costs of licensing software to handle it – seems you’d be crazy to not take the Linux route. But it isn’t an easy route – but that seems true for any PC solution for public radio broadcasting.

Tags: , ,

Leave a Reply