On my recent travels, I read an article in an in-flight magazine titled "Digital Studs and Duds," which panned the idea of putting a computer next to the TV, saying that "if your computer is next to your TV, the first website it should take you to is one that teaches you to overcome your interior-design problems." Even as it mocked those of us who have computers specifically designed to handle our televisions, it told us that DTV was like "discovering the secret of the universe. Only better." In mid-flight, I quietly snickered to myself because my case looks quite nice, and a MythTV computer makes HDTV much better.

In the first article in this series, I went through picking out the hardware for my new machine. Now, it's time to make the software work. Once again, I'll need to break with the guide put together by the Electronic Frontier Foundation. I tried KnoppMyth, but it didn't work straight out of the box. After my failure with KnoppMyth, I started working on a traditional operating system installation so that I had better control. This article is the story of the software installation and basic configuration.

Strike One: I am 0wn3d!

The biggest constraint with using an Athlon64 is that I needed to use a distribution that supported the x86_64 architecture. I didn't put too much thought into it. I chose Fedora Core because it was well documented by Jarod Wilson's MythTV on Fedora Howto. I was able to follow the first half of the Howto closely until some architecture-dependent problems cropped up. I finished off the system by compiling several packages directly from source, which made the final system an odd mishmash of packaged software and locally-built software. I rushed through the last few steps because I was about to take a month-long business trip. As I looked forward to, or dreaded, the many long plane flights ahead, I wanted to have the ability to export video to my laptop.

Partway through my first stop, I logged in remotely to my machine. As it sourced my profile, I received ominous error messages like "/bin/grep: unable to execute binary file." A touch of digging through the log showed that my system had been invaded, and a root kit installed. Although I had only exposed the ssh daemon to the outside world, it was enough. My system was taken over too badly, and I shut it down remotely.

If at First You Fail, Reinstall the Operating System

Related Reading

Linux Desktop Hacks
Tips & Tools for Customizing and Optimizing your OS
By Nicholas Petreley, Jono Bacon

When I returned home at the end of the trip, I restarted from scratch. I returned to the list of Linux distributions that supported the AMD64 architecture, and decided to go with Gentoo for two important reasons. The major reason is the high level of control over the software packages that get installed, which keeps the system simpler and easier to understand, as well as conserving disk space. Gentoo is also easy to keep up-to-date, and I knew from my experience with the first Fedora-based system that a more recent kernel would be welcome. Many of the drivers that are useful to MythTV are available as part of the 2.6.12 kernel distribution.

A secondary reason for Gentoo is that packages get compiled from source, and can be optimized to the hardware in use. HDTV playback is a taxing process, which makes any performance optimization worthwhile. The main drawback to compiling everything directly is that the installation process takes a much longer time, especially if you need to compile the X Window System.

The long build time is mitigated somewhat by Gentoo's package system. If you ask for a high-level package name, it may install a large number of required prerequisite packages. Although it takes a long time to build the X Window System, it is somewhat easier if you can set the system to the task overnight.

The package system also keeps track of multiple versions of the same package. Newer versions of many packages, especially those under heavy development, are flagged as unstable, and must be specifically requested.

Disk Partition

MythTV needs a lot of space to store video streams. With HDTV, count on five to seven GB per hour of TV. Some of that can be recovered with transcoding after the program is complete, but expect the system to suck up as much disk space as you can find for recordings. The Linux Logical Volume Manager (LVM) allows you to create a "virtual" disk that is supported by several physical partitions. I store my video streams in /video, which is an LVM partition. If I ever need more space to store recordings, I can just drop in another disk and add it to /video.

  • /boot: 100 MB for kernel and other bootloader support files
  • /: 10 GB for program files, configurations, and other data
  • swap: 2 GB, following the rule of thumb of twice memory. In retrospect, this was probably a bit too big. Even under load, my system hardly ever uses swap.
  • The remaining 100 GB is a single partition, mounted through LVM as /video. This virtual mount point can grow as large as I need by adding space.

Both /boot and / are ext3 file systems, which is the native Linux file system. ext3 is not the best file system for large files, though. I am currently using ReiserFS, which is a good all-around file system, though its large-file deletion performance is not quite as good as XFS or JFS. At some point, I may do a comparison of file system performance and change the type of filesystem in /video.

I am using a custom-built kernel. The main modifications I needed were customizing the build to my processor (with AMD64 extensions and the CPUfreq driver to enable throttling down the CPU when idle), a change to the I/O scheduler to improve disk performance, and the video subsystem (both Video4Linux and DVB support, with necessary hardware drivers). My current kernel configuration is here: mythtv-kernel-config.txt.

Pages: 1, 2, 3

Next Pagearrow