Sunday, 19 May 2013

Raspberry Pi and the HD PVR.. coping with dropouts..

The HD PVR is a great bit of kit, but it does have one slight drawback.. it's either lazy, or it's easily distracted ;p You request data from it.. and wheee... it comes back in nice h264 format, great you think, and go make a cup of tea, bake some cookies, etc.. and come back to find the recording just.. stopped?!!

Read on for a quick guide of what I've tried so far.. and what hasn't worked ;p

Firstly, from the last post, dd vs cat.. I've seen very little difference between the two, dd might ride out some situations where cat doesn't, but at the end of the day neither dd or cat handle the signal drop out.

So I've moved over to my own little C application, based an awful lot on the code available from here..

Except I've rebuilt the retry logic so it waits a little while before closing & reopening the device after each open.. otherwise my HD PVR never locks onto the signal, and sits there trying to emulate a strobe unit. I've also added date/timestamps to the output messages, which really helps to get a feel for how often the unit drops during recordings.

I think I'll rebuild the code a little further still to add a simple socket listener data relay from the source, and possibly add a simple socket based 'start/stop' recording interface.

For now I'm using dd straight from the video0 node to the fifo when not recording. When I want to record, I kill off the dd, start the capture, then relaunch the dd with it's input as the file being recorded. Once the capture app is able to stream the data itself, this will become a lot simpler =)

The end goal is to have a simple recording app in C that can run all the time, with the ability to connect & monitor the current input remotely. After that, I can port some old java scheduler code over that I can use to issue channel changes to the set top box, and coordinate recordings etc.. Lots of fun ahead!

No comments :

Post a Comment