
MythTV is go
News ·Thursday October 26, 2006 @ 22:46 EDT (link)
And we're up and running, after a couple of all-nighters and a few evenings' work. Let me continue where I left off Wednesday morning: links successfully emerged, and I also installed screen for convenience. I used various sources all over the web to tweak various settings and learn things, so there's no way I can mention them all; the Gentoo and MythTV wikis were of course foundational in setting everything up.
(Let me offer this disclaimer if there are any scoffers reading this: Although a TiVo or a similar pre-built PVR may be cheaper (although monthly subscription costs are more and I pay none), I'm building this box for more reasons than cost, among them, the experience—until now I knew nothing about computer-TV I/O, volume management, infrared devices, etc.—and the freedom of having complete control over my system—nobody can make me watch anything, or expire my recordings, or prevent me from exercising fair use rights. Also, can you play games or browse the web on a TiVo?)
This is going to be long, so it probably merits some headers.
Kernel: I set up the kernel (Linux 2.6.17) with the necessary drivers and settings, using GRUB as the bootloader, managed to get it to boot fairly quickly.
Graphics: I started by trying to get the system to recognize the graphics card, which meant using the proprietary nVidia drivers, and following these instructions. No trouble there, except the generated xorg.conf had the wrong mouse device, which was easily fixed. I installed the nVidia kernel module (modprobe nvidia) and was able to startx and was greeted by the uncomplicated frank ugliness that is twm, but at least it worked. I'm still working with the monitor; nothing's connected to the TV or cable yet.
TV Capture: Next, the TV capture card, the Hauppauge PVR-500 (MythTV page). I found out that I needed IVTV (yep, another wiki), and a few more kernel drivers (Gentoo told me what I was missing when I tried to install). IVTV's versions match particular kernel versions; for 2.6.17 I needed the latest 0.7, which turned out to be 0.7.1. I had to "unmask" this and the pvr-firmware package for AMD64, since the Gentoo maintainers hadn't officially declared them safe yet. modprobe ivtv worked flawlessly and dumped bunches of information about the PVR-500 and its dual tuners to the kernel log, viewed via dmesg. The previous link also had some steps for testing the device (just grabbing a random stream), which didn't work until I changed the input source to be 0, the tuner.
Setup: I was able to run mythtv-setup in the X session I'd started, and set up the capture cards and outputs and tweak a few other sessions. It's a strange little application; it hides the mouse so everything has to be done with the keyboard using a UI that looks like Motif.
Remote: I'd purchased a Microsoft MCE remote from the company store, which I now attempted to set up. The IR receiver is USB; I determined it was the newer MCE remote, so I emerged lirc with the lirc_devices_mceusb2 USE flag, installed the module with modprobe lirc_mceusb2, installed the configuration file for the remote as /etc/lircd.conf, and started lircd, the Linux infrared remote control daemon. I had to add one button later, but in all it worked fine; irw showed the correct interpretation for the various keypresses. (lircd translates the data received from the IR receiver into usable data about keys pressed, and broadcasts that data on a socket which programs such as MythTV can listen on.)
Program Guide: The standard for receiving channel data for MythTV is the Zap2it.com TV and movie guide, which offers free subscriptions to an XML feed, so I set that up and ran the mythfilldatabase script to grab a sufficient quantity of listings and store them in the local listings (MySQL—their choice, not mine) database; I also set up a cron job to synchronize the listings daily.
TV Out: Next I connected the machine to the TV; the nVidia card had S-Video output, but since the TV's S-Video input was already being used for the DVD player, I used an included S-Video to component video dongle included in the package, and then used RCA ("composite") cables (same connectors) to connect it to the TV. I read further and found out the Option directives needed in xorg.conf to tell it to output to the TV. First I dialed back the resolution a bit and deleted all of the depth lines except 24-bit. It worked reasonably well; X came up on the TV and I could run mythfrontend, but the colors were wrong; black and white, with some pink tones. I borrowed the S-Video cable from the DVD player, and that fixed the colors; just recently I learned how to do component out with nVidia cards on MythTV (thanks to Freenode #mythtv-users).
Cable in: Eventually I hooked our cable to the TV capture card (between my wife's shows...). When I did the default-record test, I just got static, since I wasn't tuned to a channel, but it was black before, so something was being read. I emerged the minimalist evilwm and set it to exec /usr/bin/mythfrontend via .xinitrc (note that MythTV runs as a non-root user, although it needs to be in the audio and video groups naturally, which is a good thing). When I ran startx as that user the MythTV menu came up; I selected the first option, "Watch Live TV", which promptly did nothing. I forget what the issue was; it may have been permissions, but I resolved it, and was able to navigate around our cable lineup, but it was super-grainy and very splotchy in the lower channels.
Shopping trip: Unfortunately it seems grainy video is endemic to the Hauppauge PVR-500MCE with the Samsung chip (ones with the Philips chip are fine), and mine had the Samsung chip. I returned it and was going to get dual PVR-150MCEs, but they only had one in stock so I'll need to pick up a second one later. (I also picked up an ASUS DVD writer for my other machine to make backing up the system—photographs take up a lot of space—easier.) I also picked up a 2m Monster component video cable ($55! but cheaper than the series 2 which was $75) (and Broken Arrow, The Butterfly Effect 2, and The Wicker Man) from Circuit City, a 4-way RF (cable) splitter (the dual PVR-150s each need a signal, as does the cable modem, and they don't make 3-ways) and a phone plug to RCA connector from Radio Shack, and a (wired, since it's USB) X-Box controller ($25, vs. $40 from Target) and a wireless keyboard and mouse (Optical Desktop 4000) from the Microsoft company store. Amazingly the wireless keyboard/mouse worked right away, standard PS/2 connectors, and the PVR-150 card required no changes to work correctly, and it produced an excellent picture.
Finishing up: I installed all of the various MythTV plugins (except MythFlix), but I haven't had a chance to play with them yet. There are still a few things to iron out with the system: it seems to be getting the wrong data for channels 2 and 3; on boot, it complains about a filesystem check error, but there's no actual problem and /etc/fstab is fine; also, I need to set it to boot directly to MythTV which means having it autoload some modules and then run startx as the MythTV user. Not difficult, just things to do.
Altogether it's a great system and we're very happy with it. It's name is cirith-ungol, joining minas-tirith, khazad-dum, and imladris (R.I.P. barad-dur).
Update: looks like autoloading the needed modules is just a simple matter of adding them to /etc/modules.autoload.d/kernel-2.6; done. Startup scripts can be added to /etc/conf.d/local.start; added su mythtv -c /usr/bin/startx. Still not sure about the fsck issue, but commercial flagging is now working.