HDTV Working with MythTV!

Some time back, I bought a pcHDTV HD-3000 card to use with MythTV. For various reasons, I never got around to getting it set up. Until now.

First, a quick background. HDTV is a means to transmit television signals digitally. In the USA, a standard called ATSC is used for over-the-air transmissions. ATSC transmissions can come in several different resolutions, ranging from no better than a basic analog signal to 1080i (1920×1080, interlaced).

To get HDTV to work with MythTV, there are several components that must be working first: HDTV playback in the frontend, HDTV kernel driver support, and HDTV tuner setup in the MythTV backend. I’ll talk about each of these in turn.

Click here to read more…

HDTV Playback

I was initially surprised at how much of an issue this is, when when you pause to think about it, it makes sense. HDTV pictures can be at up to 1920×1080 (1080i) or 1280×720 (720p) or 960×540 (540p). DVD pictures are typically 720×480. That means that a HDTV frame can have up to 6 times the number of pixels as a DVD frame. Bitrates for HDTV broadcasts are far higher than for DVD broadcasts as well.

This all combines to make a situation that can be extremely challenging even for systems with powerful CPUs and video cards.

In my own case, the frontend I was trying to configure is an Athlon64 system with a Radeon 9600 video card. Yet it still couldn’t keep up with even a 720p HDTV signal. I tried both the standard XFree86 radeon drivers, as well as the ATI proprietary fglrx ones, and none worked.

However, X.org CVS (NOT the latest release, I tried it!) has an extension to the radeon driver that permits DMA transfers for Xv. I grabbed this release, and with Steve’s intstructions and the wiki instructions, got it installed. (Note: I would advise against the lndir approach, and also make sure you put the #defines at the *TOP* of the file.) My custom lines were:

#define ProjectRoot /usr/local/X11R6.8
#define NothingOutsideProjectRoot YES
#define HasFreetype2 YES
#define HasFontconfig YES
#define DefaultGcc2i386Opt -O2 -march=athlon-xp -mmmx -mfpmath=sse -msse -msse2 -m3dnow

Restart kdm and test out a few things and… SUCCESS! HDTV playback works.

Now, on to:

HDTV Kernel Driver Support

For a pcHDTV card, there are two different kernel drivers you can use. One set uses the Video4Linux system for everything. The other uses the Linux Digital Video Broadcasting (DVB) infrastructure. This latter one is generally considered to be better and the way of the future, but it’s not very well documented.

The support for the pcHDTV card is in the mainline kernel as of 2.6.12-rc2. I downloaded and built 2.6.12-rc4.

There are a few surprises. First, in the video4linux config area (NOT the DVB area!), you must enable CONFIG_VIDEO_CX88 and CONFIG_VIDEO_CX88_DVB. I also enabled CONFIG_VIDEO_BT848 because some online resources said to, but I believe that is for the HD-2000, not the HD-3000.

Then, in the DVB area, you must enable CONFIG_DVB and CONFIG_DVB_CORE. HD-2000 owners, I think you want CONFIG_DVB_BT8XX. For the HD-3000, I set CONFIG_DVB_OR51132. HD-2000 owners will want CONFIG_DVB_OR51211. If you’re not using IVTV, you’ll also want to enable CONFIG_VIDEO_{TUNER,TVEEPROM}.

Also, you’ll want to follow the firmware download instructions. On a Debian system, you’ll want to put this into /usr/lib/hotplug/firmware.

Boot into your kernel. Now, you’re ready for:

HDTV Tuner Setup in MythTV Backend

This step configures MythTV to record from the HDTV tuner. I am using MythTV 0.18.

But before you begin, you’ll need to recompile MythTV. I’m using Matt’s debs, so it’s a simple matter of rebuilding from source.

The problem is that the files in /usr/include/linux on a default Debian install don’t include the latest DVB api. Workaround: move /usr/include/linux out of the way, symlink it to /include/linux, rebuild mythtv, restore /usr/include/linux, and install new mythtv and libmyth debs.

Next, go to labs.zap2it.com and make sure you have the digital channels selected and analog ones deselected.

Now, you are ready to run mythtv-setup. Make sure you kill the backend before you do this. You’ll want to add a new input source, DVB type, card 0. In input connections, connect your zap2it broadcast setup to this card. Then do a channel scan in the channel setup. Exit, run mythtv-filldatabase, then go back in. You’ll see duplicates for each channel. Note the XML id in the newly-created ones, copy it to the ones you created with the auto scan, then delete the new ones with mythweb. Finally, run mythtv-filldatabase again. The DVB setup HOWTO helped me with this.

Now you’re ready to enjoy HDTV!

12 thoughts on “HDTV Working with MythTV!

  1. Unfortunately, the pcHDTV only handles the over-the-air ATSC, not QAM as used over cable. In my area, at least, that means about three channels.

    1. I’m not sure — I use ATSC only here — but I noticed there are QAM firmware files out there. No idea if they work.

  2. Building X.org dies about 20 minutes into it on a parse error in a header file. I can fix it to compile locally in its own directory but the main build cleans everything before building. Don’t people know how to make Makefiles anymore?

  3. This goes very easily with Opensuse 10.0 and Mythtv.19. While there is a HD3000 card type setup in .19, it gets you the v4l drivers! Instead select a dvb card profile and it will drive the HD3000 just fine using dvb drivers.
    I’m still working on getting the analog side of this card setup in Mythtv. Anyone got both analog and digital working at the same time?

    1. I have been using two separate databases to get pchdtv3000 to work with both analog and digital. Set it up analog the backup the database with mysqldump. That database can be reloaded with mysql. Then create a new setup for the digital channels ans dump that to another database. This allows you to run either analog or digital, but of course, not at the same time.

Leave a Reply

Your email address will not be published. Required fields are marked *