Raspberry Pi DVR

From Alnwlsn - Projects Repository
Jump to navigation Jump to search

I am one of a few people whose main TV reception comes from regular old radio signals picked up with an antenna, just like those used over the last 60ish years. While the radio spectrum has remained pretty much the same, the signal has changed from an analog signal to high definition digital signal. Unfortunately, this means that our old way of recording TV such as the VCR no longer works as easily or smoothly as it once did, and even at that we would only get a standard definition signal anyways. There seem to be few options for recording live TV without paying somebody a subscription, either. However, it is very possible to do so.

At this point I should say that I really don't watch a lot of TV, and the fact that streaming is extremely and cheaply available these days makes this entire project moot. However, like many of my projects this one comes down to making things for the fun of it.

This all started when I picked up a modern digital tuner at a garage sale. Mine is a hauppauge wintv-hvr-950q. This is the main piece of the puzzle, all that the recording process does it take the de-multiplexed MPEG stream that is transmitted digitally over radio and write it to disk. We don't even need to decode the signal, because that only needs to happen when we play it back and need to see what the stream contains (which in my case is done on my laptop).

But, we need some other software tools to make it easier than this. I use one called Tvheadend, which runs as a server on a raspberry pi (you can access it with a web browser to make, schedule, and view recordings) and takes care of setting up the tuner and recording to disk.

General Setup Procedure

Install Raspbian. Add a blank SSH named file in the boot partition to enable ssh server. Run rasppi-config and go through all the usual setup stuff, but allocate more memory to the CPU (no need for GPU memory when headless).

Get an external drive and set it up with a linux file system (this is where recordings will go). Create mount point as empty folder /mnt/disk0. Edit fstab located at /etc/fstab and add line

UUID=34bc2462-9358-424a-b27a-fa1803efd097 /mnt/disk0 ext4 defaults,nofail 0 0

replacing with your disk's uuid. Now the drive will automatically mount to /mnt/disk0 on boot.

Install missing firmware for your tv tuner. For mine, I needed to get a file called dvb-fe-xc5000-1.6.114.fw and put it in /lib/firmware/ though I found it was already there in the newer raspbian releases. Check dmesg to make sure the tuner is recognized after a reboot.

Do apt-get update and upgrade at some point, just cuz.

Install tvheadend using the procedures listed at https://tvheadend.org/projects/tvheadend/wiki/AptRepositories.