For several months - pushing a year, even - I've been thinking about building a Digital Video Recorder. I.e., a TiVo, only not branded and one that doesn't phone home.
We don't watch much television. As a general rule, we'll watch the BBC World News at seven p.m. because it coincides with dinner, and/or the Nightly Business Report or Lehrer News Hour if we are running a bit late. Sometimes we'll watch the previous night's Daily Show when it comes on at eight. My wife likes to watch Gilmore Girls, Tuesdays at 8.
But that's about it. On the weekends I may flip on the History channel and/or the various Music Entertainment channels in the vain hope of something not Hitler-related in the first case or actual music videos in the second place. As I say, it's a vain hope.
There exist shows that we'd like to see. Studio 60 on the Sunset Strip. Lost. Battlestar Galactica. Various History channel specials. We are not, though, at all willing to base our schedules around them. So they come on and we're busy doing other things, and we never watch them.
Additionally, we have a child now, who will start to watch television in a while. And I don't want him being programmed by advertisements. So being able to skip them would also be nice.
Anyhow, as I say, I've been planning to build my own DVR for about a year. Why build my own? Well, for the simple reason that I don't want TiVo in control of, or even knowing about, what I watch.
From a financial perspective, buying a TiVo (or renting a DVR from the cable company) makes slightly more sense. A TiVo set-top box costs about a hundred fifty bucks. The subscription is twelve bucks a month, plus a second phone line, which I'm going to guess wildly and say will cost another thirty dollars a month. So, for a year of service, that's something on the order of six hundred fifty bucks. The cable company's box, without the second phone line, much less than that.
Whereas to build my own cost me over $800. However, I am in complete control of my box. It's phoning home to no one. (Well, yes, unless it gets hacked.)
Now, a good way to save some cash is to repurpose an old computer to use as your new DVR. I did not do this. I do have many old computers, but my old computers are old. So old they print onto stone tablets old. None of them have the chops to act as a media center. So I bought an entirely new computer to act as my PVR, or rather I bought the components and built an entirely new computer. I went with solid, middle-of-the road components, as cheap as possible without using technology that was close to obsolescence.
Here's what my new PVR consists of:
I purchased absolutely everything from Newegg.com aside from the video card and the Powerline network bridge. My Newegg invoice was $633.03 with shipping, and the other gear was about $180, so in total I spent $813.03 on my all-new PVR. Ouch.
Let me run through the components:
So that's the hardware. I ordered it on a Friday, had it all (in three boxes from three different warehouses) by Wednesday. I unpacked and inventoried it all, which is when I realized that the video on the motherboard did not have a means of connecting with our television. So I ran out to a local MicroCenter during the week and picked up the video card and the network bridge.
Friday night was assembly night. We had a friend over to help - he's a contract programmer at NASA who works on satellite simulators, and as much of a techno-geek as I am, only better at it - and we slowly put the machine together. Motherboard into the case, case wires connected to the motherboard, CPU installed on motherboard, RAM installed, hard drive connected, DVD-ROM drive connected, TV Tuner card seated and finally video card seated. And that was that.
Matching some of the case wires, for the front audio jacks and LEDs and whatnot, to their respective pins on the motherboard was the trickiest part. The rest was quite straightforward even with the minimalist instructions we had from the motherboard and case pamphlets.
Well, we had it all together and flipped the switch. And... it would turn on but not spin up any of the drives nor even load the BIOS. Tired, we called it a night.
Saturday morning I realized that we had not connected the auxiliary power supply from the case to the motherboard. I did that, and suddenly everything worked.
And I mean everything. It just worked. The DVD-ROM drive, the video card, on-board networking, etc. etc. Just worked. No having to update the BIOS, nothing.
So that was the hardware sorted.
Now it was time to install the operating system. My plan was to use KnoppMyth. Knoppix is a distribution of Linux which runs off of a CD. In other words, Knoppix is designed to be dead simple to use - insert CD, turn on computer. KnoppMyth leverages Knoppix to install the Linux OS onto your system with the MythTV program already installed and configured. In theory, once I put in the CD (which I downloaded as an ISO and burned earlier), in ten minutes I could be watching TV on my new PVR.
Yeah, it didn't work out that way. But, to be honest, it came fairly close.
I picked Linux, by the way, because I have a pretty decent layman's understanding of it - the server you are reading this column on for instance is my Debian box - and, of course, because it's free. I could have instead used, say, Windows Media Center, only they want something over $200 for that. Also, if I was going to build my own damn PVR, I was going to go all the way and use Linux. Because I am a techno-stud. Or at least, I want my wife to think so.
So, I popped the CD in and hit the first big software hurdle.
It wouldn't format my hard drive.
I was using a SATA hard drive (rather than the older style IDE), and for some reason the damn KnoppMyth drive just would not write to it. Said it had read-only permissions. Needless to say, the damn drive was blank and unformatted, being new, so WTF?
I let the KnoppMyth pamphlet be my guide. It was semi-helpful. Here's the part that turned out to be relevant:
Currently if you have an SATA drive, you must use Manual Install. You will see two options 1. Partition and 2. Quit, on a new drive or a drive with an invalid partition table. If you see six options, KnoppMyth recognizes the partition table. Either way, you must partition the drive. Select partition and create 3 partitions using cfdisk. The first will be /, the second swap, the third /cache and fourth /myth. I recommend 5 gigs for /, swap should be 1.5 times memory. Use the rest of the drive for /myth. Ensure /dev/xda1 is bootable, write the partition table and quit cfdisk. Once the partitions have been created, press
Now, I couldn't use the KnoppMyth disk to partition the drive. What I did was, I obtained GNU Parted, burned it to a CD, and used that to format the drive and create the partitions listed above. Then I told KnoppMyth to skip the partitioning part and just go ahead with the installation.
I ran the 'mkswap' and the 'swapon' commands... the 'mkswap' command worked but the 'swapon' one failed. Dunno why, went ahead anyway. This of course meant that for the entire rest of the software installation I believed that I had probably screwed things up irrevocably back at the beginning with that stupid 'swapon' command.
However, after the hard disk formatting snafu was resolved, the installation proceeded and went perfectly smoothly. I ran through the following:
You should now see six option. Choose 4. Load config. You should now see /KNOPPIX/knoppmyth. Press
And by God that all happened just the way they said it would. Even the 'sit back' part.
I got the Powerline bridge set up (which required connecting it to a different computer which had the Powerline software installed, setting the password on the new bridge because of course my powerline network is password protected, and only then moving it back and connecting it to the PVR) and the system got its DHCP address from my router on the first try. I had already gone to Zap2It and created an account, and KnoppMyth downloaded the channel listing and show times and was off and running!
Then it was done, and I was sitting in front of the main menu. Everything seemed to have gone perfectly. Even the remote control worked. I pointed it at the box and selected 'Watch Television'.
Static.
Snafu #2! For some reason, the PVR-150 was not decoding the cable signal, or some such thing. Much googling ensued. I tested various things and finally discovered that I needed the following line in my /etc/modprobe.conf file:
options ivtv tuner=50
Once I had that and rebooted, viola! I could watch teevee! Through my new PVR!
Except there was no sound.
Snafu #3! I plugged in the speakers but there was nothing coming out of them. Apparently the software used by Knoppix to do sound is called ALSA, which has utilities such as 'alsamix'. I tried fooling around with these utilities but to no avail. Finally I went to the KnoppMyth Wiki and found:
If your motherboard or sound card uses AC'97 sound hardware then you may find after booting your installed system that the boot message indicates that aumix could not load, and, executing lsmod as root does not display the sound card support modules. To fix this (at least in my case), as root, execute the command alsa_init with no arguments. This should indicate a successful install. When next you boot you should have audio modules loaded (confirm with lsmod executed as root again.)
Sure enough, after I ran 'alsa_init' and rebooted, I had sound! Hooray!
I ran through the rest of the install guide at the wiki, and since I am using a television set I made sure to edit /etc/X11/XF86Config-4 to include the lines HorizSync 30 - 50 and VertRefresh 60. Sure, it's a cheap teevee, but I don't want to destroy it.
And that's it! I now have a fully functional PVR. It records shows, has a channel guide, skips ads... all the good stuff. I'm still getting used to the MythTV GUI layout, but hey - it works! And it should expand nicely to larger televisions and/or better sound. The total time I spent from opening the component boxes to having a fully functional PVR probably adds up to about 10 hours, spread over a week or so. Some of it spent on dead-end solutions to the snafus I encountered. All things considered, it was a remarkably smooth and successful project.
- Sun Ra