What's New

2008-12-08

The MythTV video on demand system described here is for sale! See my eBay auction.

2008-12-02

Need to buy a serial LIRC cable? I'm selling one! See my eBay auction.

Building a MythTV box

Okay, so this has absolutely nothing to do with the GIMP. However, I recently built a MythTV box, and I thought others may find these notes useful (or at least interesting).

Ever count the steps needed to play a DVD? You have to put the disc in the player, skip past the FBI warnings and trailers, navigate the main menu and select "play," then skip the THX promo. My wife and I have a two year-old daughter, and she has a small collection of movies that she likes to watch. Every time she wanted to watch a movie, we had to go through the above steps.

We own a TiVo, so we have gotten used to being able to watch our favorite programs on demand anytime, so we figured that there had to be an easier way to play our daughter's movies. Fortunately, there is an open source project called MythTV that fits the bill. MythTV is primarily intended to be a PVR, but it also has the ability to rip DVD movies to its hard drive and play them on demand. So I set out to build a MythTV box.

Installing the software

I borrowed an old 750MHz computer from work to experiment with MythTV. MythTV runs on Linux, and I had several choices for which Linux distro to install: Fedora Core, Ubuntu, Mandriva, or KnoppMyth.

Jarod Wilson's instructions for installing MythTV on Fedora Core were by far the most complete and easiest to follow, but at the time, Axel Thimm's MythTV packages for Fedora Core had a dependancy issue which broke DVD ripping. Installing MythTV on Ubuntu was a breeze with synaptic. Unfortunately, it did not have support for encrypted DVDs (in other words, all the DVDs out there). I was never even able to install MythTV on Mandriva. I found a document on setting up MythTV under Mandrake 10.1, but I ran into dependency hell. I finally had success with KnoppMyth. Although it initially would not play or rip encrypted DVDs, I eventually found a note that told what to install to enable it. The only other problem I had was that it was looking for mplayer in /usr/local/bin, though it was actually located in /usr/bin. I could not play any of my ripped DVDs until I fixed the path.

At one point, I also tried installing Freevo. Freevo was nice, but I like MythTV better, for several reasons:

  1. Since MythTV is more popular, a lot more people are writing documentation and tutorials for it. In contrast, helpful documentation for Freevo is hard to find. For example...
  2. Freevo was hard to install. I found a web page describing how to install it on Fedora Core, but it only showed how to set up the yum repositories, not how to actually install Freevo. I guessed yum install freevo, which worked. However, yum then complained of GPG signature errors and refused to install the packages. I finally figured out how to fix that, though.
  3. Once Freevo is installed, how do you run it? I ran freevo, but it complained that I needed to run freevo setup first. I did, then ran freevo again. It then complained that I was missing a local_conf.py file. I copied over the sample file that came with it and was finally able to launch Freevo.
  4. Freevo apparently cannot rip DVDs "out of the box." There is a plugin to do that, but again, there was very little helpful documentation on installing it. Even after finally installing it, I did not see any way of using it from the Freevo menus. Apparently, you have to use the "options" button on the remote, but I could not find it. Also, there is no status indicator for the encoding process.

Eventually, Axel resolved the ssue with DVD ripping, and MythTV could once again play and rip encrypted DVDs on Fedora Core. Since Fedora Core is my preferred Linux distro, I decided to stick with that.

Importing a DVD

MythTV can import a DVD title in one of three quality levels:
  1. perfect
  2. excellent
  3. good

"Perfect" quality is a straight copy of the VOB to the hard drive. "Excellent" and "good" quality both transcode the title to an XviD AVI file. I ripped a couple of DVDs in various quality levels to test things out. Here are my results:

Star Wars: Episode II (runtime: 2hr 22min)

quality level file size transcode time
perfect 6.7GB 15min
good 1.2GB 6hr

Finding Nemo (runtime: 1hr 40min)

quality level file size transcode time
perfect 3.9GB 11min
excellent 1.4GB 13hr

As you can see, transcoding to "good" quality compresses the title to about 1/5 of its original size, and transcoding to "excellent" quality compresses to about 1/3 of its original size.

Currently, though, I can only rip to "perfect" quality or transcode to "good" quality. (After some investigation, I discovered that transcode was segfaulting, though it appears that other people are also having the same issue.) I was planning to rip everything to "perfect" quality, anyway, so that is not a big deal for me.

Choosing the hardware

Since I was upgrading our home computer, anyway, I decided to reuse the old hardware as a MythTV box:

  • Asus A7V400-MX motherboard
  • AMD Athlon XP Mobile 2500+ processor
  • 512MB PC2700 (DDR333) memory
  • GeForce4 MX440-8x AGP video card

I knew from my earlier testing that a 750MHz computer is more than capable of ripping and playing movies, so I did everything I could to underclock the processor and run it as slow as possible. (Lower speeds means less heat is produced by the processor, which helps keep temperatures lower in the computer.) I managed to get the CPU frequency down to just 600MHz. All that remained was to purchase a case, a CPU cooler, a hard drive, a DVD ROM drive, and a remote control.

  • MythTV box standing vertically next to our TV

Since the MythTV box was to reside in our family room, the case must be unobtrusive. The AOpen A340A aluminum MicroATX slim case looks very much like a TiVo or a set-top box, and it looks perfect in our entertainment center. However, we quickly discovered that airflow within the case suffered when the case is oriented horizontally. The case got very warm after only a few minutes. I put the feet back on the case, and we now have it standing vertically next to our TV. The power supply is now at the top of the case, and the PSU fan exhausts the hot air as convection brings it to the top.

The AOpen A340A case is a slim case, and many CPU coolers are too tall to either fit or to allow for adequate airflow. At 55mm high, the Cooler Master Vortex Dream 7 (ACC-L72) is shorter than most CPU coolers, and it fit in the case with room to spare. It also operates at 21dBA, which is important, since the MythTV box must be silent. However, we later realized that although the CPU fan is relatively quiet, it is still loud enough to hear from across the room. Once I put a FanMate controller on the CPU fan, though, it became dead silent! I was concerned that the CPU might run too hot, but the CPU temperature did not rise very much. The CPU previously ran at 137F or 138F, and it now runs at 141F under load (playing a movie).

For storage, I chose the Seagate ST3120026A 120GB hard drive. It is quiet (2.5 bels) and large enough to store our daughter's movies ripped at "perfect" quality. The DVD ROM drive is a Samsung TS-H352A.

We did not want to have a computer keyboard (even a wireless one) in the family room, so I ordered an ATI Remote Wonder RF remote control. There is a kernel module for it (ati_remote), so getting it to work was a snap—all I had to do was plug it in! It emulates a mouse and keyboard, though with a limited subset of keys. I can move the mouse around, press the left and right mouse buttons, and use the arrow keys, Enter key, 0-9, and A-F. Using xev and xmodmap, I was able to map the play, pause, fast-forward, rewind, info, menu, volume, and mute buttons to MPlayer and MythTV commands.

However, the ATI Remote Wonder does have its drawbacks. For example, pressing a button on our remote sometimes sends multiple key commands. Also, the many buttons on the Remote Wonder are overkill for our needs. We only need navigation buttons (up, down, left, right, enter, and menu) and play control buttons (play, pause, and stop).

A friend pointed me to the weemote dV. (A review is here.) It is a programmable IR remote that is designed for young children. It has large buttons and gives children just enough control to play, pause, stop, etc. a DVD while preventing them from accidentally ejecting the DVD, turning off the TV, or cranking up the volume to ear-splitting levels. A soft rubber bumper surrounds the remote to protect it if and when the child drops it. It is a great little remote, and I thought it would make an ideal IR remote for our MythTV box.

Building a LIRC receiver

I began experimenting with building an IR receiver and getting it to work with LIRC.

  • prototype LIRC receiver
  • soldered LIRC receiver

Building the receiver was easy enough. Schematics are available on the LIRC site, and I already had most of the parts needed. I picked up the remaining parts (an infrared receiver IC and a DB9 connector) from a local Radio Shack and built a prototype IR receiver on a breadboard. I eventually soldered together a proper IR receiver on some proto board. As you can see from the picture, it is roughly half an inch wide and about an inch long.

Installing LIRC was pretty easy, thanks to Jarod Wilson's instructions. However, his section on configuring a serial IR receiver was pretty brief, and I had to figure out the remaining few steps for myself. I struggled through it, though (configuring LIRC is not a trivial task!), and I finally got it working.

To get the weemote dV to work with LIRC and MythTV, first follow Jarod Wilson's instructions for configuring /etc/modprobe.conf. Next, run irrecord --force /etc/lircd.conf (you may have to run modprobe lirc_serial first). Finally, configure lircd to start at boot. Also, to load lirc_serial at boot, I had to add modprobe lirc_serial to my /etc/rc.d/rc.local file.

After that, it was a matter of creating a .lircrc file to map button presses to key commands. Here is mine: .lircrc

LIRC in a TIE fighter

So I had my IR receiver. However, it sat conspicuously on top of our TV, and wires snaked down to the back of the MythTV box. In short: it looked ugly. My next project was to camoflage the receiver so it would blend in with the other items in our entertainment center. This guy built his receiver inside a TIE fighter model. That sounded like a good idea.

  • LIRC receiver in a TIE fighter

I ordered a FineMolds 1/72 TIE Fighter model and promptly avoided working on it. It took me two months just to paint and glue it, but I finally finished assembling it. (I still need to paint and attach the cockpit window, though.) I stopped building models nearly twenty years, so I am out of practice. Also, since my focus was more on the function than the form, I did not spend the extra time necessary to detail the model. However, I think it turned out pretty well.

For those who are curious, the body color is Testors Flat Gull Gray (#1930); the detail pieces on either side of the cockpit are painted Testors Light Sea Gray (#1926); and the solar panels are painted Testors Flat Black (#1249). When I get around to painting it, the cockpit window will be painted Testors Euro I Gray (#1788).

It is very difficult to see, but the IR receiver sits inside the semicircular cockpit window. One interesting note is that the circuit board is permanently mounted inside the model. The model is too small to allow the circuit board to be mounted after assembly, so I literally assembled the model around the board.

Reactions

MythTV meets my wife's and my needs perfectly. It makes it much easier for us to play our daughter's movies. All we have to do is highlight a movie in the movie list and press "play". However, our daughter was not so quick to like MythTV. She presented her Finding Nemo DVD to us and asked to watch it. No problem: we turned on MythTV and started playing the movie for her. That apparently was not what she wanted, though, and she proceeded to try and remove the DVD from its case. (Ever see a two year-old try and do that? Scary stuff.)

Once we helped her remove the DVD, she happily put it in the DVD player. Only then did she sit down to watch her movie! Maybe she was just used to the routine of putting in the DVD. Maybe putting in the DVD herself gave her a sense of accomplishment. Maybe both. Whatever the reason, she initially preferred to watch her movies on the DVD player. However, she now likes to watch them on the MythTV box.

MythTV alternatives

We love our MythTV box. However, in all honesty, it was a lot of work to set up. I built the computer, installed and configured Linux and MythTV, and built an IR receiver for it. I actually enjoyed working on it, but not everyone will be as eager to tackle such a complicated project. The Mvix Multimedia Player (or the wireless version) would replace the MythTV box I spent all that time building and setting up, and it costs less, too! Just add a 3.5 inch IDE drive.

If you want to build a MythTV box but don't want to build an IR receiver, then check out the Ira-3. It is a LIRC compatible IR receiver that is roughly the size of a deck of cards.

What About Apple TV?

A coworker and I watched with great interest the events unfold at Macworld 2007. (We did not attend but instead watched via macrumorslive.com.) He was anticipating the iPhone, and I was waiting to hear about the iTV (now Apple TV). I initially applauded the Apple TV and started making plans to replace our MythTV box with it. However, the Reality Distortion Field has since worn off, and I have had some time to reconsider. I now have several concerns about whether Apple TV would make a good replacement for our MythTV box.

First, Apple TV is widescreen HDTV only, but we still own a 4:3 standard definition TV. (We will not switch to HDTV until 2008. Still too many little girl fingerprints on our TV screen for me to be comfortable with dropping a couple grand on a new TV.) Our TV is not compatible, though it apparently "scales down on a regular TV." I take that to mean that its widescreen would be letterboxed on a 4:3 TV, which probably result in fullscreen movies being surrounded by a thick black border.

Second, Apple TV uses iTunes as its sole media source, so a Mac or Windows PC needs to be somewhere on our home network. However, we run Linux, so we would have to buy a Mac just to use Apple TV. That seems like an unnecessary expense.

Apple TV lists the title names as text in a column and only shows the cover art for the selected title. That is fine for adults but would make it more diffult for our daughter (who is now four years old and has a very limited reading vocabulary) to pick out the movie she wants to watch. MythTV shows 12 titles (with cover art for each) per screen on a 4x3 grid. That makes it very easy for our daughter to quickly choose a movie.

Almost all of our daughter's DVDs are ripped to XviD. Initial reports are that Apple TV will play anything that the iPod plays, and since the iPod does not support XviD, neither does Apple TV. Therefore, I would have to re-rip all of her DVDs for Apple TV. That would be painful, but possible.

If we had a HDTV and a Mac, we might consider replacing our MythTV box with Apple TV. However, given what we currently know about Apple TV, I will not be buying one anytime soon. Maybe I will take another look at Apple TV next year when we have a HDTV. Our daughter should be better at reading by then, and we may even own a Mac, too.

In the meantime, perhaps I will upgrade our MythTV case to a smaller, sexier HTPC case. Compared to the Apple TV (which is about the same size as a Mac mini), our AOpen A340A case is a hulking giant. (I should note that our case is quite nice and works well, and replacing it is unabashed vanity on my part.) The Silverstone LC19 looks great. It is a bit pricey but seems practically perfect: slim design, fanless power supply, good ventilation, and blends in with AV equipment. Unfortunately, it only supports one expansion card, and I need two: one for the video card, and one for the Wi-Fi card. I suppose I could replace the Wi-Fi card with a WAP, though. What I would really like is a 4-port WAP. Any suggestions? I already own a WRT54G wireless router; can I get a second one and have it act as a WAP?