MythTV Write-up
As promised, I have just finished an in-depth write-up of my experiences with setting up MythTV which we talked about on the last episode of the podcast. I have also included a few pictures of the different stages of progression through the project. I think the end result looks very slick. If you liked our MythTV episode and you want to know a bit more about my experiences, read on. As always: If you have any questions about this or want to tell us about your experiences with MythTV, use the “contact” button at the top.
I wanted to have a TiVo for ages, but after fruitlessly waiting for quite some time for the damn things, or some comparable solution to be available here in Germany, I finally decided to roll my own. Once I reached that conclusion, there was no question to make it Linux based, of course. If I go through the trouble of researching all this stuff to build my own system instead of choosing an appliance, I want it as flexible as possible.
That led me to picking MythTV as the software solution and I had been busily planning the project for a few months in advance while saving enough money to start buying the hardware. That point finally came and I ordered a sleek little XPS 210 and a stylish 19” widescreen LCD monitor from Dell. I have been very happy with their laptops for years and the XPS 210 is exactly the form factor I was looking for; the plan was to find a really nice looking, compact machine since it has to sit in my living room all year round.
I had been toying with the idea of buying a Mac mini from Apple but that system, while being smaller, isn’t upgradable at all and since it doesn’t include a DVB-S card, it wasn’t a a good choice for what I had in mind. Not to mention that it is way overpriced for what it is. Still to get DVB-S functionality in the Dell machine, I had to find a low profile PCI compliant DVB-S tuner card, which luckily I did — although it wasn’t easy and did involve a lot of research on the topic. Finally, with all parts ordered, I was ready to build my very own open source, next-gen DVR system running Linux. Or so I thought…
After about three weeks of waiting for Dell to build my system (as it turns out some parts were backordered), I finally got my XPS210. As I started to unpack this gorgeous system, I immediately realised that I’d made a mistake when I spec’d out the hardware. I had bought an PCI tuner card inspite the fact that this system only has PCIe slots! This was an especially grave mistake, since there are currently no drivers for PCIe devices in Linux.
Well, since I hadn’t really expected this to be easy — if I had been looking for an easy, albeit crippled, solution I would’ve used Vista’s Media Center for this — I just treated it as another challenge on the long way to becoming a Linux guru and pushed it to my backlog for the moment, set up the system anyway, opened it up for the first time and just enjoyed the wonderful engineering for a bit. The XPS210 really is an amazing little PC. It’s only about 9.5 cm wide and the inside of the chassis is totally crammed, but it’s a beautiful system nonetheless. It is also totally tool-less, meaning that you can take all the main components apart without having to use a screwdriver — it’s all pins and doohickeys. I am also really happy I bought a Dell monitor; this 19” widescreen has a really nice design and the picture is impeccable. It has the solid feel of high quality hardware about it, which I like a lot.
First on the list was getting MythTV up and running. I definitely wanted to try Mythbuntu because I liked the idea of the project. Unfortunately, the Live CD wouldn’t even boot (and yes, I did check the MD5 hash). I suspect a conflict with the BIOS since even in my working setup now, the machine refuses to reboot, it just halts — Dell probably put some new exotic BIOS into this thing that the Linux kernel doesn’t fully support yet. I resorted to downloading the alternate install CD of Ubuntu Feisty and following this guide which turned out to work quite well. I basically had to install a command line only version of Feisty and then use aptitude to install the MythTV packages, which wasn’t hard. MythTV automatically installs Openbox as a desktop environment for itself and then displays the GUI configuration screens so that you can complete the install. I had no problems whatsoever in setting it up.
Since I didn’t have a working DVB-S capture card yet, I did not configure the TV functions at this point, which obviously means that there wasn’t much MythTV could actually do at this stage. I therefore turned my attention to installing some plugins like MythDVD, MythMusic, MythVideo and MythWeb. All this went quite well and I then spend some more time at configuring those to my liking (using xine as my player for video and DVD content and Firefox as the browser for MythWeb, for example). Since I have quite a big video collection of DVD rips residing on several hard drives around here, I spend most of the next day copying that content over to the mythbox. For that purpose, I set up an OpenSSH server to access the mythbox from my laptop which allows me to mount the /var/lib/mythtv directory directly onto my desktop and copy the stuff over using a GUI. I could’ve also used the command line, but since I have multiple backups of everything I was glad for the graphical interface, it was hard enough to sort it all out as it was.
After getting all of this to work, I could finally watch some Firefly episodes on this thing. Everything worked great and the system was very stable, except that I had some pretty noticeable tearing effects in the video playback. This was of course due to the fact that hardware acceleration wasn’t enabled by default. I knew when I bought the system, that getting this to work might turn out to be hairy since the machine has got an ATI graphics chip in it; a Radeon X1300 to be precise — and ATI is notorious for providing very poor support for open source solutions. Their fglrx driver is crap, a poor implementation if I ever saw one, and it took me about two days of heavy duty hacking to get it to work with my 2.6.20-16-generic kernel. It sure wasn’t fun, but I’m pretty proud of myself that I got it working. That it took two days to do this is manifest to the fact that ATI’s proprietary, crapshot driver needs a complete overhaul. That their drivers are supposed to be open sourced soon will fix this, I hope. The only little problem that remains is the fact that for some weird, random reason (as documented on the MythTV bug tracker) I cannot use the IMDb information grabbing script in MythVideo without the DRI component of the fglrx driver crashing mythfrontend as I found out via this blog post. For now I just don’t use that script and enter all my data manually until I can upgrade to a fixed version without using the nightly builds. At this point the video plugin with all my ripped content, the music playback and the web surfing parts did work and were very stable, but I still couldn’t watch live TV yet. That was the next hurdle I had to overcome: I needed to find a DVB-S card for this thing.
After I had decided my only hope at this point would be a USB receiver, I looked around on nearly a hundred sites, forums and wikis for the right hardware that would work with my kernel version and setup. The first USB box I bought, a TechniSat SkyStar USB Plus, should have worked, except it turned out to be a rebranded card from another manufacturer whos drivers weren’t supported. I resold the thing on eBay and kept searching until I finally came across another card that I could actually buy here in Germany and which did work: The Pinnacle PCTV 400e. I found a used one pretty cheap somewhere on the ‘net and I was very, very happy to see the thing announce itself properly via dmesg when I plugged it into the machine. After a quick hunt on the web for the proper firmware for the box, I just dumped the .fw file into Ubuntu’s /lib/firware directory and it now gets automatically loaded on startup when the kernel registers the PCTV device.
The next step then was to set up the TV functions in mythtv-setup, that’s the step I skipped earlier, and then have it automatically scan all available channels and put that data into MythTV’s database. Configuring this wasn’t hard, but some choices seem kinda arbitrary when you don’t know what you’re actually doing. In cases like this, wikis and forums will be your saviour! Next, I assigned sensible numbers to the three dozen or so channels I mostly watch and started scheduling recordings and finally watched some live TV.
The last piece of the puzzle that still eluded me at this point was a working remote control. The Pinnacle USB box does come with one, but it turns out that the driver for the device doesn’t support sending the RC signals back to Linux. Although I was very happy at finally having found a capture card that worked, the remote problem still irked me. After all, what’s a TV without a remote control? I knew that to get a remote control to work with most programs in Linux, you need to set up something called LIRC so I had a look around for remotes that were compatible with that program. I figured out that I could get what they call an MCE remote very cheaply on eBay. The irony here is that those things are specifically made to control XP and Vista Media Center machines. Therefore mine has an ugly Vista logo bubble in the middle — I really have to put a Tux sticker over that some time… Anyway, the remote I bought wasn’t that hard to configure and after assigning all the buttons and fixing some smaller startup issues with LIRC, it works perfectly. The best thing about this remote control is the fact that it uses RF instead of infrared signals, which vastly improves the range of the remote and means it doesn’t need a line of sight to the receiver to work. With everything in place, this meant that after over six weeks of work, I finally had finished my project.
As you can see from this account, hacking together a MythTV box isn’t exactly an easy or very userfriendly process. For me, something immediately looses the label “user friendly” at the point it asks you to compile anything. But despite all of the sweat and blood, it is definitely worth it. MythTV is a great system; it is very powerful, very flexible and getting it to work is a hugely rewarding process. And on top of all this, I learned incredibly much in solving all the problems along the way. Spending a lot of money on a box you just plunck down beside your TV may be very easy, but mastering the skill and knowledge to hack together the system yourself is much more fun! But the most important selling point of MythTV for me is the ability to customise every aspect of the user experience. You just can’t do that with an out-of-the-box solution.