Building My MythTV Box, Part 2: Software
Pages: 1, 2, 3

Sound Configuration

I have used the Advanced Linux Sound Architecture (ALSA) with MythTV, and it's clearly the way to go. My nForce3-based motherboard has an nVidia CK8S chip for built-in sound, which is supported by the intel8x0 driver in ALSA.

The nForce sound chip can provide both regular analog stereo output as well as digital output. Sound is configured for each user with the .asoundrc file in the user home directory. The definitive configuration file for nForce motherboards is found here. I have used it successfully on an nForce3 motherboard, even though the title says it is for nForce2 and nForce4 motherboards. I am currently using analog stereo output, and a future home theater upgrade will use the 5.1 audio capabilities.

With ALSA, the audio mixer is muted by default. On many distributions, you must use alsamixer to unmute the mixer channels and turn the volume up, otherwise there will be no sound. Some distributions also require that these settings be saved on shutdown. Gentoo includes scripts to start up and shut down ALSA that automatically save and restore audio settings.

Network Time Protocol (NTP)

Recording TV is only useful if it starts and ends at the correct time. Many recording devices have a way to update their clocks for accuracy. One of my VCRs uses a time signal from PBS. Network devices can use NTP. (In fact, one of the first steps when a TiVo connects to the TiVo service is a time update from NTP.)

I installed two NTP programs, following the Gentoo NTP HOWTO. The ntpdate program is a one-shot time update that runs as part of the system boot process, and updates the time. On an ongoing basis, I use ntpd to keep the system clock accurate.

LCD Panel

The Silverstone LC03V case has a small vacuum fluorescent display (VFD) panel with a parallel port connector. Support for LCD devices on Linux is provided by LCDproc. MythTV can control an LCD panel through LCDproc. In most cases, it will display the time. With NTP configured, the LCD panel became the most accurate clock in the house.

LCDproc has drivers for many common display-control chips. The LC03V uses the NEC D16314AGJ, which is fully compatible with the Hitachi HD-44780. When configuring LCDproc, I configured the HD-44780 driver. By default, it is set up for a two-row panel with 20 characters. The LC03V has only a sixteen-character display, however. I also had to use a ConnectionType of "winamp" to make the screen light up.

# LCDd.conf


# All clients can control backlight

# I/O port.  0x378 is the usual place for the first parallel port

Compiling & Configuring MythTV

Before installing MythTV, you need to get all the prerequisite pieces in place. First, you will need to build a custom kernel with the features needed to support MythTV, most notably support in the kernel for video capture. You will also need to install the Qt toolkit, LAME, and MySQL. While it is possible to compile MythTV from source code, there are also many package systems that will check dependencies and fetch everything for you. On my Gentoo box, I issued the command "emerge mythtv" and it went off and fetched everything, though it was quite time consuming to compile several of the intermediate steps. Before setup, it will also be necessary to sign up for a free account with Zap2It Labs; see the MythTV HOWTO for the sign-up code.

Setting up the HD-3000 Card

There are two threads of development in Linux video. The older API, Video For Linux (V4L), supports mainly older video capture cards. The newer API, the Digital Video Broadcasting (DVB) API, was originally designed for cards that support DVB, the European standard for digital TV broadcasts. Initially, the DVB API was designed only for DVB cards, but it is generic enough that it now supports many capture cards, including the HD-3000.

I chose the DVB driver because it looks like will be the main development platform for video capture cards in the future. Starting with kernel version 2.6.12, DVB drivers for the HD-3000 are included in the kernel source tree. To configure the kernel, DVB must be enabled. However, the driver for the HD-3000 is selected under the Video for Linux configuration. When the right module is selected, an option to build a DVB driver will be revealed.

The driver is not the end of the software support for the card. In addition to a driver, the HD-3000 needs firmware loaded every time it starts. The Linux hotplug system can download firmware from /lib/firmware every time it starts. The firmware is the only component that must be copied from the HD-3000 CD or downloaded from the Web site. There are two different firmware versions for the API in use, so be sure to get the DVB firmware.

When the system first attempts to use the HD-3000, it will need to load firmware. Firmware load is accompanied by a pause as the firmware is located and loaded into the card, and it looks as if the system hangs. Firmware loading is only required once. If the MythTV software crashes, it can be restarted without needing to load firmware on the cards.

Creating the Channel Lineup

When I first went to scan the airwaves and create a channel lineup, I added a splitter into my antenna system. I have one antenna, and I split the signal in three parts: one to my existing digital TV receiver and TiVo (as described in my earlier article), and two separate feeds for the two tuners in the MythTV machine. A four-way splitter, though, splits the signal four ways, so even strong signals start to fade away. Once I replaced the splitter with a ChannelMaster 3044 distribution amplifier, though, most of the signals were strong enough to lock on to.

MythTV organizes channels through the Zap2It guide data. Every channel throughout the country is given a number, the XMLTVID. When the DVB drivers are used, MythTV does not learn the XMLTVID numbers for DVB channels. You will need to retrieve the listings from DataDirect, note the XMLTVID number, and then copy it into the scan results for the DVB card.

Stay Tuned

At this point, I had a running system, though not one that performed well. Straight off the installation, performance was inadequate when playing back full high-definition recordings, and I had a problem with setting up the audio on one particular channel. In the next installment, I'll write about performance tuning, and some of the major troubleshooting to get the system running well enough to be usable on a daily basis.

Matthew Gast is the director of product management at Aerohive Networks responsible for the software that powers Aerohive's networking devices.

Return to