16

We're about to embark upon implementing a device running Linux that (among other things) will be attached to a software defined FM/AM radio that can also receive RDS data describing playlists and other such stuff. It's a relatively stupid device that mostly contains a DSP or two that act as tuners and otherwise does very little processing of the signal.

I was thinking that kernel drivers for the device and then a userland hardware abstraction layer that provided a standardized interface and abstracted away the details of exactly when the RDS data was received and dealt with error handling and all the other messy stuff. Is there already a userland layer like this? It would be nice to either avoid making it at all, or make our stuff plug-compatible with something that already exists so we could use other projects for the radio UI if we wanted.

Omnifarious
  • 54,333
  • 19
  • 131
  • 194

3 Answers3

12

Radio support in linux

It sounds like you are creating a new hardware radio device? You'll probably need to build a driver for this device. Some help getting started can be found here, here, and here. If your device is not new, it may already have a driver in the Video4Linux2 project.

It looks like there are some RDS related projects based on the saa6588 kernel module currently.

According to this page, these cards are currently have a SAA6588 chipset:

  • Terratec Cinergy 600
  • KNC ONE TV-Station RDS
  • KNC One TV-Station DVR
  • TYPHOON TV TUNER CARD RDS
  • Sundtek MediaTV Pro (supported by the manufacturer)
  • Sundtek USB FM Radio (FM Transmitter/Receiver, supported by the manufacturer)

RDS specific information

I'd recommend to check out some of the projects related to Video4Linux2 (v4l2), there is an RDS decoding library. This library runs in userspace, so the RDS decoding work can be done there for you:

According to V4L2 specifications, raw data from RDS decoders is read from the radio device. Data consists of blocks where each block is 3 bytes long. All decoding has to be done in user space.

RDS API

Here is a complete API reference for Video4Linux2. Here is an article series to get acquainted with it.

The particular section for the RDS API is here. This page provides information about how to get an update about whether RDS data is available:

Whether an RDS signal is present can be detected by looking at the rxsubchans field of struct v4l2_tuner: the V4L2_TUNER_SUB_RDS will be set if RDS data was detected.

SDR RDS decoder DSP in Gnu Radio Companion

Although it's not an official API I found one last small project that might be worth looking into:

Here are some more radio related projects worth looking into.

TrinitronX
  • 4,959
  • 3
  • 39
  • 66
  • So, it looks like V4L2 specifies a standard interface for RDS data in userland? One of the problems with RDS of course is partial reception two different standards and all kinds of other headaches. It would be very nice if programs that used the radio didn't have to deal with this at all, and just got updates about RDS data as it became available. Does V4L2 specify a userland interface that's standard so that clients can pretend that RDS is simple and easy? – Omnifarious Feb 21 '13 at 18:44
  • And yes, it looks like we'll be writing our own driver. The hardware we're using is USB-based and doesn't seem to be supported at all currently. I would be more open about it if I were sure exactly how much I could publicly reveal about our project. :-) – Omnifarious Feb 21 '13 at 18:45
  • @Omnifarious: I figured you might be working on a proprietary project ;-) Sadly a lot of hardware still lives behind proprietary copyright protection, which I feel might be a bit to blame for the sometimes paltry support of such hardware in Linux. To answer your question, I've added another link pointing to the [RDS API](http://linuxtv.org/downloads/v4l-dvb-apis/rds.html) – TrinitronX Feb 21 '13 at 18:53
  • Well, I'm going to try to get them to GPL it. There are some really good reasons to do so. Partly because our core business is not really doing radio. – Omnifarious Feb 21 '13 at 19:45
  • That's good to hear! That could also help to decrease maintenance costs in the future if the project becomes public domain, as well as add value to the worldwide community. Win-win scenario ^_^ – TrinitronX Feb 21 '13 at 23:30
2

It may be worth looking into whether the GENIVI consortium (http://www.genivi.org/) has a standard application for this yet. They're developing standards of this sort specifically for automotive "infotainment" purposes, and this seems like it would fall within their area of standardization.

Unfortunately, they don't seem to publish their stuff publicly, so you may need to ask around or send them an email directly.

Brooks Moses
  • 9,267
  • 2
  • 33
  • 57
1

How about GNU Radio? They have hardware support for lots of software defined radio components, and a data flow easily connected via GUI with their "GNU Radio Companion" (GRC).

They use Python and C++ APIs that can be accessed for your UI layer. There are a number of examples to be found online.

Voider
  • 454
  • 3
  • 12