Over-the-Air Digital TV with Linux

by Alolita Sharma

My ten-year-old TV set gave out recently. Being a Linux geek, I use a variety of open-source distributions on my notebook and desktop. So, the demise of my TV was a great opportunity to see if I could watch television on Linux instead of getting another TV set. It's just in time too, because over-the-air television broadcasts in the US will convert to all digital in February 2009. So, it was exciting to switch over to digital TV on my desktop.

In my quest to understand the state of digital TV (DTV) on Linux, I looked at digital TV tuner cards, antennas and accessories. I chose to set up MythTV, and by the end of the entire experience, I had a cool digital TV right on my Linux desktop with Picture-in-Picture and remote control. It was enough high-definition (HD) TV to turn me into a serious couch potato. I'm happy to report that Linux, along with hardware support from digital TV tuner cards, video cards, LCD monitors and rich software, such as MythTV, is ready for prime time.

Digital TV Environment

For this review, I used a PC with an Intel Core 2 Duo 3GHz, with 4GB memory, an NVIDIA 8800 GT graphics card, and a 750GB SATA hard disk. The display was a Samsung SyncMaster 245BW, with a resolution of 1920x1200. I ran Ubuntu 7.10, with all the latest updates, as my operating system. Using a powerful graphics card was essential for viewing HD programs on a high-resolution, wide-screen display.

A good antenna also is a critical component of the DTV setup. I tested both indoor and outdoor antennas, and discovered that the reception improved dramatically when using an outdoor antenna. The reception also improved with amplified indoor antennas. Standard indoor antennas performed adequately only when positioned very carefully. Because HDTV content is high-resolution (1920x1080), if your signal is weak, you may see a lot of artifacts. Frequent artifacts result in a very poor viewing experience. Hence, choosing an amplified indoor antenna or an outdoor antenna is recommended. Standard-definition TV (SDTV) is not as high-resolution and has greater tolerance for weak broadcast signals. But, even here a good antenna is essential.

I used MythTV (version 0.20.2) to view over-the-air DTV channels. MythTV is an open-source home entertainment software application for Linux and Mac OS. It has grown to become one of the most comprehensive, feature-rich platforms for viewing and recording television programming from over-the-air and cable broadcasts. I also used another open-source software application called tvtime (version 1.0.2) to view over-the-air analog NTSC channels.

So, what can we watch? There are a lot of over-the-air programs available in all major US metropolitan areas. For example, ABC, CBS, FOX and NBC offer standard and high-definition programming in addition to analog NTSC. In my location, the San Francisco Bay area, local public broadcasting stations (PBS) broadcast high-quality educational and topical content in HDTV format from 5pm to 6am each day.

Digital Tuner Card Evaluation

To evaluate various digital tuner cards, I tested first whether the hardware was recognized by Linux at boot time by checking the system logs. If it wasn't recognized, I had to find and build a device driver manually. Once this step was successful, I configured the tuner card within MythTV. As a part of configuration, MythTV scans for channels available in the broadcast area. On average, it took MythTV about seven minutes to find more than 25 digital channels. Once the channels were found, we were ready to watch digital TV.

I evaluated a range of digital tuners that included PCI, PCI Express and USB bus types.

pcHDTV HD-5500

The pcHDTV HD-5500 is a PCI card and is the only hardware designed and marketed to support Linux right out of the box. The HD-5500 supports digital (ATSC), analog (NTSC) and unencrypted cable TV signals. This low-profile PCI card provides a coaxial input for a TV antenna, a stereo audio output jack for analog TV and a nine-pin port for an adapter cable. The adapter cable provides inputs for S-Video and stereo audio, an RCA video output, and an IR transmitter (to control a set-top box). pcHDTV ships a CD with the HD-5500 tuner card, which includes drivers for 2.4 and older 2.6 kernels, command-line tools to capture and manipulate digital (ATSC) data streams and signals, and a version of the Xine video player customized to support HDTV.

This tuner card worked out of the box—configuration was as easy as installing the card into the PCI slot of my desktop test machine. Both the digital (ATSC) and analog (NTSC) tuners on the hardware were recognized right away and were fully functional at system bootup. Configuring the tuner as a “DVB DTV capture card (v3.x)” in MythTV was simple. If I had installed additional pcHDTV cards, I could have tested out multicard features, such as Picture-in-Picture (PiP) in MythTV. pcHDTV claims you can put up to four such cards in a single system.

The picture quality for both high-definition and standard-definition programs was superb. To top it off, the whole idea of having an end-to-end Linux DTV solution with a no-fuss setup and a great viewing experience is just plain cool. The HD-5500 is an ideal choice for a desktop Linux system. It would be nice to have a USB version for laptops as well. A remote control, as offered by several other DTV tuner products, would be icing on the cake.

I had the chance to catch up with pcHDTV's CEO, Jack Kelliher, by e-mail (see the Interview with Jack Kelliher, CEO and Cofounder of pcHDTV sidebar).

Pinnacle PCTV HD Pro Stick

Pinnacle's PCTV HD Pro Stick is a USB 2.0 tuner card that supports both digital (ATSC) as well as analog (NTSC) TV signals. This tuner card comes with a portable telescopic antenna, a mini-remote control with batteries, a USB extender cable and an A/V adapter cable with inputs for S-Video, composite video (RCA) and stereo audio (1/8" jack). An integrated infra-red (IR) receiver on the device supports the remote control. This tuner card is slightly bigger than a typical USB thumbdrive and has a coaxial TV antenna input on one end and a USB connector on the other. When plugged in to my system, the tuner's width blocked adjacent USB ports. However, using the USB extender cable that came with the tuner card circumvented this problem. The portable antenna that comes with this card is good enough for viewing nearby HDTV channels, but it always helps to have an amplified antenna.

Out of the box, this card is not supported under Linux. To get this card to work with Linux, I had to download and compile its driver. I discovered that this tuner is based on an Empiatech EM2880 chipset, whose support has been added to the latest development version of the Video for Linux Digital Video Broadcasting (v4l-dvb) Project. I downloaded the v4l-dvb development source code and compiled the necessary modules for the running kernel (see the Building Device Drivers for Pinnacle PCTV HD Pro Stick and Hauppauge WinTV-HVR-950 on Ubuntu 7.10 sidebar). Compiling the kernel modules went through without a hitch, and after a system reboot, the Pinnacle PCTV HD Pro Stick was recognized by the system. Its digital (ATSC) tuner was registered as a DVB front end (/dev/dvb/adapter0), and its analog (NTSC) tuner was accessible as a v4l video device (/dev/video0).

Building Device Drivers for Pinnacle PCTV HD Pro Stick and Hauppauge WinTV-HVR-950 on Ubuntu 7.10

First, enable universe and multiverse package repositories by selecting System→Administration→Software Sources from the GNOME desktop menu. Click on the tab labeled Ubuntu Software, and make sure the boxes are checked for Community-maintained Open Source software (universe) and Software restricted by copyright or legal issues (multiverse). Click Close.

Next, apply all latest updates from Ubuntu by selecting System→Administration→Update Manager from the GNOME desktop menu, apply all system updates, and reboot the system.

Then, in a terminal, do sudo su to become the root user. Install the necessary packages to build em28xx kernel modules:

aptitude install mercurial build-essential linux-source

Download firmware version 4, necessary for USB tuner cards:

wget -q http://konstantin.filtschew.de/v4l-firmware/firmware_v4.tgz
↪-O /usr/local/src/firmware_v4.tgz

Unpack the firmware files into /lib/firmware:

tar xzf /usr/local/src/firmware_v4.tgz -C /lib/firmware

Grab the latest copy of the V4L DVB source code from mcentral.de:

cd /usr/local/src
hg clone http://mcentral.de/hg/~mrec/v4l-dvb-kernel

Compile the V4L DVB drivers:

cd /usr/local/src/v4l-dvb-kernel
make
make install

And, finally, reboot the system.

After configuring the tuner as a “DVB DTV capture card (v3.x)” in MythTV, I was able to tune into standard-definition and high-definition programs. Picture quality for HD programs was fantastic, with astonishing crispness and clarity compared to SD programs. The viewing experience for this USB device was excellent.

I used tvtime to evaluate the analog TV performance. The picture quality was significantly better for stations with transmission towers that were geographically closer. Initially, sound did not work in tvtime. Using sox to route audio from tvtime to the default ALSA sound device solved the problem. Research on the Web indicated that many others have faced this same issue when using tvtime.

Hauppauge WinTV-HVR-950

The Hauppauge WinTV-HVR-950 is a USB 2.0 HDTV tuner card, which is very similar to the Pinnacle PCTV HD Pro Stick, except the Hauppauge device does not come with a remote control. Like the Pinnacle PCTV HD Pro Stick, it supports digital (ATSC), analog (NTSC) as well as unencrypted cable TV signals. This card comes with a portable telescopic antenna, USB extender cable and A/V adapter cable with inputs for S-Video, composite video and stereo audio. I found that the antenna provided with this card was not as good as the one supplied with the Pinnacle PCTV HD Pro Stick. In fact, I had to use a better indoor amplified antenna or an outdoor antenna instead. This card also blocked adjacent USB ports when plugged in to my system.

Hauppauge does not officially support Linux for this product. But, this tuner card also is based on the Empiatech EM2880 chipset (same as Pinnacle's PCTV HD Pro Stick). Hence the same kernel modules built for the HD Pro Stick worked with this tuner. Follow the steps in the Building Device Drivers for Pinnacle PCTV HD Pro Stick and Hauppauge WinTV-HVR-950 on Ubuntu 7.10 sidebar to build the driver.

The viewing experience for both SD and HD programs and analog TV was similar to that provided by the Pinnacle PCTV HD Pro Stick.

Hauppauge WinTV-HVR-1800

The Hauppauge WinTV-HVR-1800 is a PCI Express x1 tuner that also supports digital (ATSC), analog (NTSC) and unencrypted cable TV signals. This card has coaxial inputs for analog cable TV, digital ATSC/QAM TV and FM radio. It also has inputs for S-Video/composite and L/R stereo audio. An integrated hardware MPEG-2 encoder offloads the system processor when recording analog TV or cable channels. Accessories include a remote control, USB IR receiver and IR transmitter cable (to control a set-top unit).

Out of the box, this tuner is not supported by Linux. However, you can get the digital (ATSC) tuner to work reliably with Ubuntu 7.10 after you build its driver (see the Building a Device Driver for Hauppauge WinTV-HVR-1800 on Ubuntu 7.10 sidebar). The analog TV features for this tuner could not be evaluated under Linux, because the driver does not yet support the analog circuitry.

Building a Device Driver for Hauppauge WinTV-HVR-1800 on Ubuntu 7.10

First, enable universe and multiverse package repositories, by selecting System→Administration→Software Sources from the GNOME desktop menu. Click the tab labeled Ubuntu Software, and make sure the boxes are checked for Community-maintained Open Source software (universe) and Software restricted by copyright or legal issues (multiverse). Click Close.

Next, apply all latest updates from Ubuntu by selecting System→Administration→Update Manager from the GNOME desktop menu, and apply all system updates. Then, reboot the system.

Next, launch a terminal and do sudo su (to become the root user). Install the necessary packages to build the latest v4l-dvb drivers:

aptitude install mercurial build-essential linux-source

Grab the latest copy of V4L DVB source code from linuxtv.org:

cd /usr/local/src
hg clone http://linuxtv.org/hg/v4l-dvb

Compile the V4L DVB drivers:

cd /usr/local/src/v4l-dvb
make
make install

And, reboot the system.

After setting up the tuner in MythTV, I was able to view both HD and SD programs. There was no noticeable difference in picture quality compared to the USB tuners. The remote control worked well and is fully supported by LIRC (Linux Infra-Red Control) using the Windows Media Centre Remotes (new version Philips, et al.) configuration settings in LIRC. If you're a couch potato, a working remote control in MythTV is absolutely essential.

Digital TV on Linux Is Here Today

You can experience a great HDTV show on your desktop with the right equipment and some tweaking. If you're looking to build a full-fledged media center based on Linux, MythTV does it all—from program listings, Picture-in-Picture, remote control support, Web administration with MythWeb, programmable recording, to watching your favorite shows. If you're a minimalist and don't want to dedicate an entire system, Me-TV looks promising.

It goes without saying that you should do your homework before buying components for your DTV Linux system. Visit popular on-line forums, such as the MythTV Wiki, LinuxTV Wiki, Ubuntu Forums and Ubuntu Wiki to tap into the wisdom of the crowd.

In summary, my recommendations for a great DTV experience include outdoor antenna, fast multicore processor, medium to high-end video card with at least 256MB video memory and a fast high-capacity hard drive. For your desktop, the pcHDTV HD-5500 works right out of the box. The Hauppauge WinTV-HVR-1800 is a close second. For your laptop, the Pinnacle PCTV HD Pro Stick and the Hauppauge WinTV-HVR-950 USB tuners work well.

Table 1. Tuners at a Glance

TunerOverall Rating (5 stars are best)Out-of-the-box Linux supportPriceInterfaceVendor Web Site (Linux helpfulness—5 stars is best)Accessories
pcHDTV HD-5500*****Yes$129PCI****A/V adapter cable
Hauppauge WinTV-HVR-1800****No$120PCI Express x1***Remote control, USB IR receiver, A/V adapter cable
Pinnacle PCTV HD Pro Stick***No$90USB 2.0*Telescopic portable antenna, remote control, USB extender cable, A/V adapter cable
Hauppauge WinTV-HVR-950**No$70USB 2.0***Telescopic portable antenna (lower quality than the one provided by the Pinnacle Pro Stick), USB extender cable, A/V adapter cable

Interview with Jack Kelliher, CEO and Cofounder of pcHDTV

AS: How did you become interested in building HDTV cards for Linux? Was it because the technology is open source, or was it a personal interest?

JK: Actually, both. I had an early HD card for Windows but almost exclusively used Linux and wanted one for Linux. As there were open-source MPEG players available and a niche market for Linux, I felt that it was a very doable project that could grow into a small business.

AS: What have been your challenges in making the pcHDTV products successful?

JK: Of course, the first challenge was developing the card, drivers and modifying a player to handle HD playback, followed by problems in production. We thought we had a fairly small window of opportunity, as the FCC was planing to enforce the broadcast flag [a set of status bits sent in the data stream of a digital television program that indicates whether the data stream can be recorded, or if there are any restrictions on recorded content], which would not have been very compatible with Linux. Luckily, the Supreme Court struck this down, although Congress has considered it a couple times since.

AS: What do you find exciting about Linux after many years of working with the technology?

JK: The extraordinary advances in open-source software, like MythTV, and very usable video viewing, editing and animation applications—even medical applications, like MRI viewers.

AS: How do you see your products evolving?

JK: We want to support PCI Express in the future, and we are considering a small USB product as well.

AS: What are your thoughts about targeting your product for European users (non-ATSC users)?

JK: We have been and are continuing to work on a world-wide solution, and this has been using up most of our time. The project is fairly large for us, but we hope to introduce something by the end of the year.

Alolita Sharma has been involved with open source since the early days of Linux. As a software engineer and industry consultant, she promotes disruption through open source. She is cofounder and CEO of Technetra and OSI Board Member. She can be contacted at alolita.sharma@gmail.com.

Load Disqus comments

Firstwave Cloud