Simple PVR on Linux

This project was born out of a wish to capture radio shows for timeshifting. I wanted to

– be able to set a timer to record radio shows (especially BBC 7) in my absence

– be able to listen to the shows on my laptop or iPod

Additionally, I would be pleased if

– shows could be captured with the best possible quality

– timers could be set in my remotely

– shows could be transferred to my laptop/iPod in better than real time

Designing the system

DAB was out because of the of the low bandwith (BBC 7 on DAB is broacast in mono at 80kbs on DAB compared to 160kbs stereo on Freeview). The alternative in the UK is DVB (several radio stations are available on both satellite and terrestrial). I looked at some standalone receivers, but non of them currently provide the option of transferring files across a network.

So it had to be based around a computer with a TV card and a large hard drive. Given that I only wanted to record, not watch (and record radio at that) the computer (a G3 iBook) need not be highly specified. Unfortunately, the only Mac product was the the EyeTV 400 which (a) wants a G4 processor and (b) doesn’t officially support for DVB radio. So I bought a WinTV USB box to use with iTele on my iBook. However, there were technical issues and ultimately I wanted a permenant solution so a laptop wasn’t ideal. It was then I set up my old PC with FC3 and I plugged the WinTV box into that.

As a bonus, it would turn out my old PII 350 has enough heft to show live TV pictures and play back recordings!

Software setup

The first thing was test the box – and the easiest setup for this was to install Xine, which is capable of showing live TV from a digital source. All it needs is a channel tuning info in ~/.xine/channels.conf. To create this file you need to find Linux DVB Apps, and make and run the utility scan: ./scan uk-Heathfield >> channels.conf where uk-Heathfield is a file containing initial tuning information. For Heathfield, this is:

# Heathfield, South-east England

# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy

T 578000000 8MHz 3/4 NONE QAM16 2k 1/32 NONE

You can find details for many more transmitters about half way through this thread.

With Xine allowing me to play TV and radio, I looked for software to dump them to disk. dvbd, a package containing a deamon and three clients provided the solution and more – it has support for timer recordings using one of the three clients: dvbsched. Better still, there is a web interface webdvbd that allows the scheduling and even retreival of recordings via the internet.

The dvb deamon should be run at startup (levels 2345). Use chkconfig to make changes.

The radio recordings I made would not playback cleanly in iTunes. However, by using ffmpeg to clean them up and remove the empty video stream they play fine. The iPod won’t support .mp2 but iTunes will, and I transcode selected recordings within iTunes if I want to listen to them on the ‘pod.

Ultimately I’d like to integrate listings with the web interface and include more programme details in the id tags of the recording files. There is a web interface – dvbdguide – that takes listings from an xmltv feed and sets recordings with dvbsched, but I’ve never managed to make it work.

Alternatives

Since starting the project, things have moved on. There is now a Freeview box that will let you transfer its recordings across a network: the Topfield 5800PVRt. This is an attractive option since it is a standalone receiver with two tuners capable of simultaneous recording and a spacious 160Gb hard drive. However, there are issues with reliability and it’s not Ethernet ready (you have to use USB or add an unSlung NSLU2 with puppy or ftp-topfield for transferring recordings).

Since EyeTV 1.8.3 radio recording is now supported and the EyeTV for DTT is an attractive and affordable solution. The advantages include close integration with iTunes (export radio shows directly to iTunes), iDVD and Toast 7 and an online EPG in the form of tvtv.co.uk. Ultimately this is a solution that, when combined with a Mac Mini, is little short of irresistable, and I don’t expect to be able to resist it for too much longer.

One thought on “Simple PVR on Linux

Leave a Reply