Home > Uncategorised > Recording DVB Radio

Recording DVB Radio

September 16th, 2006 Leave a comment Go to comments

I said recently that I had managed to successfully record DVB radio on my Linux media centre PC. I must admit that it was very easy to do, but it was difficult to find the information on how to do it. Eventually, I managed it, and now I’m putting it here so people can view it if they want to.

First, you’ll need a couple of sets of tools. The first is the LinuxTV.org DVB Apps package. This can be downloaded from this location. You’re looking for the most recent version of “linuxtv-dvb-apps-x.x.x.tar.gz” (version 1.1.1 at time of writing). Download this, uncompress it (tar -xzf <filename>), change into the directory and then run configure and then make. The chances are, you may already have used these programs so scan for DVB signals in the first place, so don’t bother downloading them twice! All we are really going to use them for is to change the channel on the DVB capture card.

Secondly, you’ll need the libdvb package, available from this location. Although this is a small webpage, it’s quite difficult to work out what file you want. It’s the one labelled “LIBDVB 0.x.x.x (Updated xxxxxxxx)” – the current version is “”. This contains the dvb-mpegtools package which we will use to do the recording. Once this has downloaded, follow the same unpackage, configure, make routine for that file too.

Now, to do the recording: You need to identify the name of the DVB channel that you wish to record. You can determine this using the output of the scan utility in the DVB Apps package. You need to determine the exact name of the channel as specified in it’s output (e.g. “BBC Radio 1”. Once you’ve determined the name, you also need to know the PID of the audio stream of that channel – after the name of the channel, on the same line, there is a load of configuration information. Go to the very end of the line, and working back towards the beginning, find the last and the second to last colon on the line (“:”). The number between the two colons is the PID for that radio stations audio stream. (e.g. for my region BBC Radio 1 has a pid of 6210).

Once you have determined both these things, you need to tune the capture card to that channel. Use the tzap program (only use tzap for terrestrial DVB, use czap for cable and szap for satellite) to tune one of your capture cards to the correct channel. e.g.:

./tzap -a 1 "BBC Radio 1"

In this case, I am tuning my second capture card to the channel by using the “-a 1” parameter (the cards are numbered from zero up). I should point out here, that you should ensure that no other application will tune the capture card away from that channel whilst you are recording it! I.e. Make sure there are no recordings scheduled in MythTV.

Once this is done, you can then start to record the audio stream using the “dvbaudio” program from the libdvb package. To do this, use this command line as an example:

./dvbaudio -a 1 6210 > outputfile.mp2

This will take the audio stream (with a PID of 6210) from the second capture card (again, set using the “-a 1”) parameter, and pipes it into the file “outputfile.mp2” (it will be recorded in MPEG Layer 2 format – this means it will need converting before it can be played on portable MP3 players).

So there you have it, that is all there is to it! I managed to successful record a program using the technique, so I know that it should work. It’s also fairly obvious that you could create a shell script to do all this grunt work for you, using grep and sed, but I just haven’t got around to it yet.

Also, MythTV v0.20 is out now, which now supports DVB radio channels as well, which kind of makes this information slightly redundant!

Categories: Uncategorised Tags:
  1. No comments yet.
  1. No trackbacks yet.