Digital Television
Sorry to start off with such a bunch of alphabet soup, but it seems
unavoidable when trying to make sense of the subject of digital television.
In the USA, terrestrial digital video broadcasts are transmitted in
8VSB-modulated (see also here) ATSC-encoded MPEG-2 transport streams containing high
definition content in progressive 720p/59.94 (1280x720) and interlaced
1080i/29.97 (1920x1088) formats.
I'm still not even sure what the official name for this stuff is, so let's just call it HDTV.
Curiously, even movies which originated as 1080p/24 edit masters are broadcast as 1080i/29.97
(if you're lucky and they're not down-converted to standard definition but still broadcast within 1080i).
Because 1080 isn't a multiple of 16, broadcasters send 1920x1088 and define the last 8 lines to be blank.
So How Can I Get This HDTV Stuff?
There are two aspects to consider. The first is the antenna,
and the second is the card to use in your Linux box.
Antenna Considerations
You can check what sort of antenna you're likely to need by
going to Antenna Web and also
by looking up the particular stations you find there in the
FCC database to get
an idea of their transmission power (ERP) and height above the terrain (HAAT).
The FCC provide the antenna locations in terms of latitude and longitude.
You can find the entire table of stations in this directory,
in the following files: table1.pdf table2.pdf table2a.pdf.
For example, doing a search for Zip code CA94065 you'll find plenty of
stations which can be
received with nothing more than a regular indoor TV antenna (i.e., a
plain piece of wire, nothing
special). Since the digital TV transmitters tend to have been installed
on the same towers as are used by
the analog TV transmitters, apparently a fairly good indicator of
whether or not you'll be able to receive
digital TV is to see what sort of analog TV reception you currently get
with just a basic VHF antenna. If you can get even a few "snowy"
channels with analog TV, your chances are good for digital TV.
The PC Card
As of March 2005, there seem to be only three HDTV cards for use in Linux PCs,
the pcHDTV, the Air2PC card, and the FusionHDTV card.
I've tried the pcHDTV card.
Results So Far
So to get going, I installed a pcHDTV HD-3000 card into a Dell Dimension XPS,
and an Asus P4R8L Barebone, installed the
KnoppMyth distribution from KnoppMythR5A12,
then built and installed the xine-hd sources provided by pcHDTV on their accompanying CD, and
followed the advice in their very amazing three-page printed handout to use the command:
dtvscan /dev/dtv > $HOME/.xine/channels.atsc
This created a file with the following contents (using only a wire antenna):
KNTV-HD: :11.1 :12: 4:0
NBC Wea: :11.2 :12: 5:0
KNTV-HD: :11.1 :12: 4:0
NBC Wea: :11.2 :12: 5:0
KGO-DT : : 7.1 :24: 3:0
KGO-DT : : 7.2 :24: 4:0
KTSF D1: :26.1 :27: 2:0
KTSF D2: :26.2 :27: 3:0
KPIX DT: : 5.1 :29: 1:0
KQED-HD: : 9.1 :30: 3:0
ENCORE : : 9.2 :30: 4:0
KMTP-DT: :32.1 :33: 3:0
KCNS : :38.1 :39: 3:0
KCSM : :43.1 :43: 2:0
JazzTV : :43.2 :43: 3:0
KBHK-DT: :44.1 :45: 1:0
KSTS-DT: :48.1 :49: 3:0
KNTV-DT: :48.2 :49: 4:0
KTEH-DT: :54.1 :50: 1:0
KDTV-DT: :14.1 :51: 1:0
KICU-HD: :36.1 :52: 3:0
: :56.1 :56: 2:1
KRON-SD: : 4.1 :57: 3:0
KRON-HD: : 4.2 :57: 4:0
After that, to view HDTV channels, it was a matter of configuring xine-hd to
use the xine-hd "skin", then launching xine-hd using:
xine dtv://
Recording is done by selecting the number from the second numeric column corresponding
to the channel. For example, to record from KQED-HD use the command:
getatsc /dev/dtv0 30 > filename.mpg
To play back such recordings, just use either xine-hd (which is a version of xine patched by pcHDTV for viewing HDTV streams) or mplayer.
It seems that oftentimes multiple program streams are recorded within
the mpeg transport, due to the transmitting station making use of multicasting
.
Multicasting is a process whereby a station which is not broadcasting in
HDTV can provide multiple Standard DTV channels.
So what does that mean for us? Essentially, that we'll need to read up
in the manuals for our video playback tools for info on how to go about
selecting the right program stream. For mplayer use -tsprog
followed by the program number. For xine, use the channel number from
the middle column followed by a dot followed by the stream number from
the third column, and use this with the uppercase -C
flag
according to the pcHDTV documentation. Depending on when you initiate
the recording, one or other stream may become the default stream played
back by xine or mplayer. For example, to playback substream number 3
from your recording of channel 30 (KQED-HD in the list above), use one
of the following:
xine -C 30.3 filename.mpg
mplayer -tsprog 3 filename.mpg
For software deinterlacing with mplayer, use -vf pp=lb
and try using -monitoraspect 16:9
if things look "stretched":
mplayer -tsprog 3 -vf pp=lb -monitoraspect 16:9 filename.mpg
So what's this I hear about surround sound?
Some of the digital channels, for example KTVUHD (channel 56, program stream 3) and
KPIX (channel 29, program stream 1), transmit audio using an A/52 5.1 channel 48000 Hz stream.
Essentially, this means that the audio stream contains five regular
audio channels (center, front left, front right, side left and side
right) plus one low-frequency effects channel (subwoofer). It's the same
sort of audio stream commonly used for DVD movies.
If you have an external audio decoder (for example, I tried this using a Pioneer VSX-D711 receiver),
and your sound card supports AC3 passthrough, then you can simply connect up the digital output from the soundcard to the digital input
of the receiver, and let the receiver do all the work of decoding the audio.
To select AC3 passthrough with xine
, just go into setup, pick the Audio
tab, and select AC3 passthrough
from the list, then restart xine. Pressing Ctrl-I
in xine will show the info on the
audio stream you're tuned to, and if it shows A/52 5.1 48000 Hz
then your receiver should indicate
that it's decoding a surround sound stream, usually by lighting up an
indicator displaying the message "Dolby Digital". Most channels transmit
audio in stereo, and xine
will indicate this when you press Ctrl-I
with the message A/52 2.0 (stereo) 48000 Hz
To get mplayer
to do AC3 passthrough, use the -ao alsa -ac hwac3
flags, for example:
mplayer -ao alsa -ac hwac3 -tsprog 3 filename.mpg
Electronic Program Guide
In case you've still not quite gotten around to setting up MythTV, Andy Balaam's freeguide
is a nifty
Java tool which can download XML program guides, parse them and display
them in a nice human-readable channel guide format. On Debian unstable, freeguide
is even available as a package. For the USA, freeguide
will download the program guides from Zap2it. You can create yourself an account at Zap2it Labs. The freeguide
tool displays the "Certificate Code" needed to create your Zap2it
account, or if you prefer you could use the Certificate Code from the EFF's MythTV Guide.
These ATSC files are huge. Can I squash them?
Using mencoder
, the following recipe seems to work relatively reliably to compress single program stream video files that you've recorded. It uses the lavc mpeg4
codec, and does two-pass encoding at a very high 5000
bitrate. This high bitrate is only needed if you want to preserve the
high resolution. To determine the resolution of the stream you're
viewing, use the Ctrl-I
key with xine-hd
tells
you the resolution is). This recipe also preserves the original audio
stream (which could be 5.1 channel), rather than compressing it using lame
to mp3
. Some folks may not have lame
support built in to their mencoder
. Compressing the audio to mp3
at a low bitrate of 96kbps
would provide quite significant space saving, see the mencoder
manual page for the explanation of the options to use.
mencoder -oac copy -ovc frameno -o frameno.avi ABC.3.ts
mencoder -sws 2 \
-oac copy \
-ovc lavc -lavcopts \
vcodec=mpeg4:vhq:vbitrate=5000:vpass=1 \
-vf pp=hb/vb/dr/al/lb \
-vop scale=1280:720,crop=1280:720:0:0 -o ABC.3.avi ABC.3.ts
mencoder -sws 2 \
-oac copy \
-ovc lavc -lavcopts \
vcodec=mpeg4:vhq:vbitrate=5000:vpass=2 \
-vf pp=hb/vb/dr/al/lb \
-vop scale=1280:720,crop=1280:720:0:0 -o ABC.3.avi ABC.3.ts
Extracting the audio track
So far, the only way I've found that works to extract the A52 audio
stream from ATSC recordings is to use mplayer's -dumpaudio
flag. This
extracts the A52 audio channel (also known as AC3 audio) into a file
called stream.dump
, suitable for processing with a52dec
and lame
into an mp3
, as follows. On Debian, the a52dec
utility can be found in package liba52-0.7.4-dev
.
mplayer -dumpaudio input.atsc
/usr/bin/a52dec -o wav stream.dump | lame - output.mp3
Strangely, using extract_a52
, as one would normally expect to use for this
purpose in place of mplayer -dumpaudio
, usually results in audio that plays
at the wrong speed. To hear what it sounds like, use:
mplayer -frames 0 input.atsc 2>&1 |grep "AUDIO A52"
# The mplayer output line we're interested in will look something like this:
#
# VIDEO MPEG2(pid=49)...AUDIO A52(pid=52) NO SUBS (yet)! PROGRAM N. 3
#
# Convert the pid=52 into hex, and give it as "-t 0x34" parameter to extract_a52:
extract_a52 -t 0x34 input.atsc | a52dec -o wav | lame - output.mp3
Multiple monitors
Using two monitors at the same time turns out to be very convenient when viewing digital TV,
as the primary monitor can be used for other stuff while keeping the TV output running on the
secondary monitor. For recent ATI graphics cards, I try to explain the required configurations here.
Details of building the pcHDTV 1.6 drivers for Debian Sarge
For Debian Sarge running with the 2.6.8-2-386 kernel, installed from Netinst booted using the "linux26" option and
installed with the "Workstation" package selection group, you can build the 1.6 drivers as follows:
apt-get install kernel-headers-2.6.8-2-386
wget http://www.pchdtv.com/downloads/pcHDTV-1.6.tar.gz
tar zxvf pcHDTV-1.6.tar.gz
cd pcHDTV-1.6/kernel-2.6.x/driver
make
make install # (run this as root)
The build output should look similar to the following:
/pcHDTV-1.6/kernel-2.6.x/driver$ make
make -C /lib/modules/2.6.8-2-386/build SUBDIRS=/pcHDTV-1.6/kernel-2.6.x/driver modules
make[1]: Entering directory `/usr/src/kernel-headers-2.6.8-2-386'
CC [M] /pcHDTV-1.6/kernel-2.6.x/driver/bttv-driver.o
/pcHDTV-1.6/kernel-2.6.x/driver/bttv-driver.c: In function `bttv_register_video':
/pcHDTV-1.6/kernel-2.6.x/driver/bttv-driver.c:3836: warning: int format, pointer arg (arg 2)
CC [M] /pcHDTV-1.6/kernel-2.6.x/driver/bttv-cards.o
CC [M] /pcHDTV-1.6/kernel-2.6.x/driver/bttv-if.o
CC [M] /pcHDTV-1.6/kernel-2.6.x/driver/bttv-atsc.o
CC [M] /pcHDTV-1.6/kernel-2.6.x/driver/bttv-risc.o
CC [M] /pcHDTV-1.6/kernel-2.6.x/driver/bttv-vbi.o
CC [M] /pcHDTV-1.6/kernel-2.6.x/driver/bttv-i2c.o
CC [M] /pcHDTV-1.6/kernel-2.6.x/driver/bttv-gpio.o
CC [M] /pcHDTV-1.6/kernel-2.6.x/driver/cx88-video.o
CC [M] /pcHDTV-1.6/kernel-2.6.x/driver/cx88-tvaudio.o
CC [M] /pcHDTV-1.6/kernel-2.6.x/driver/cx88-i2c.o
CC [M] /pcHDTV-1.6/kernel-2.6.x/driver/cx88-vbi.o
CC [M] /pcHDTV-1.6/kernel-2.6.x/driver/cx88-atsc.o
/pcHDTV-1.6/kernel-2.6.x/driver/cx88-atsc.c: In function `btatsc_read':
/pcHDTV-1.6/kernel-2.6.x/driver/cx88-atsc.c:717: warning: long unsigned int format, pointer arg (arg 2)
/pcHDTV-1.6/kernel-2.6.x/driver/cx88-atsc.c:717: warning: long unsigned int format, pointer arg (arg 3)
/pcHDTV-1.6/kernel-2.6.x/driver/cx88-atsc.c:717: warning: long unsigned int format, pointer arg (arg 4)
/pcHDTV-1.6/kernel-2.6.x/driver/cx88-atsc.c:717: warning: long unsigned int format, dma_addr_t arg (arg5)
/pcHDTV-1.6/kernel-2.6.x/driver/cx88-atsc.c:718: warning: long unsigned int format, pointer arg (arg 2)
/pcHDTV-1.6/kernel-2.6.x/driver/cx88-atsc.c:718: warning: long unsigned int format, pointer arg (arg 3)
/pcHDTV-1.6/kernel-2.6.x/driver/cx88-atsc.c:661: warning: `ndst' might be used uninitialized in this function
/pcHDTV-1.6/kernel-2.6.x/driver/cx88-atsc.c: At top level:
/pcHDTV-1.6/kernel-2.6.x/driver/cx88-atsc.c:273: warning: `write_regs' defined but not used
CC [M] /pcHDTV-1.6/kernel-2.6.x/driver/cx88-cards.o
CC [M] /pcHDTV-1.6/kernel-2.6.x/driver/cx88-core.o
LD [M] /pcHDTV-1.6/kernel-2.6.x/driver/cx8800.o
LD [M] /pcHDTV-1.6/kernel-2.6.x/driver/cx88xx.o
LD [M] /pcHDTV-1.6/kernel-2.6.x/driver/bttv.o
CC [M] /pcHDTV-1.6/kernel-2.6.x/driver/tuner.o
CC [M] /pcHDTV-1.6/kernel-2.6.x/driver/v4l2-common.o
CC [M] /pcHDTV-1.6/kernel-2.6.x/driver/v4l1-compat.o
CC [M] /pcHDTV-1.6/kernel-2.6.x/driver/video-buf.o
CC [M] /pcHDTV-1.6/kernel-2.6.x/driver/btcx-risc.o
Building modules, stage 2.
MODPOST
CC /pcHDTV-1.6/kernel-2.6.x/driver/btcx-risc.mod.o
LD [M] /pcHDTV-1.6/kernel-2.6.x/driver/btcx-risc.ko
CC /pcHDTV-1.6/kernel-2.6.x/driver/bttv.mod.o
LD [M] /pcHDTV-1.6/kernel-2.6.x/driver/bttv.ko
CC /pcHDTV-1.6/kernel-2.6.x/driver/cx8800.mod.o
LD [M] /pcHDTV-1.6/kernel-2.6.x/driver/cx8800.ko
CC /pcHDTV-1.6/kernel-2.6.x/driver/cx88xx.mod.o
LD [M] /pcHDTV-1.6/kernel-2.6.x/driver/cx88xx.ko
CC /pcHDTV-1.6/kernel-2.6.x/driver/tuner.mod.o
LD [M] /pcHDTV-1.6/kernel-2.6.x/driver/tuner.ko
CC /pcHDTV-1.6/kernel-2.6.x/driver/v4l1-compat.mod.o LD [M] /pcHDTV-1.6/kernel-2.6.x/driver/v4l1-compat.ko
CC /pcHDTV-1.6/kernel-2.6.x/driver/v4l2-common.mod.o LD [M] /pcHDTV-1.6/kernel-2.6.x/driver/v4l2-common.ko
CC /pcHDTV-1.6/kernel-2.6.x/driver/video-buf.mod.o
LD [M] /pcHDTV-1.6/kernel-2.6.x/driver/video-buf.ko
make[1]: Leaving directory `/usr/src/kernel-headers-2.6.8-2-386'
The install output will look like this:
/pcHDTV-1.6/kernel-2.6.x/driver# make install
install -d /lib/modules/2.6.8-2-386/kernel/drivers/media/video /lib/modules/misc /lib/modules/2.6.8-2-386/kernel/drivers/media/video/cx88
install -c tuner.ko /lib/modules/2.6.8-2-386/kernel/drivers/media/video
install -c tuner.ko /lib/modules/misc
install -c bttv.ko /lib/modules/2.6.8-2-386/kernel/drivers/media/video
install -c bttv.ko /lib/modules/misc
install -c cx8800.ko /lib/modules/2.6.8-2-386/kernel/drivers/media/video/cx88
install -c cx8800.ko /lib/modules/misc
install -c cx88xx.ko /lib/modules/2.6.8-2-386/kernel/drivers/media/video/cx88
install -c cx88xx.ko /lib/modules/misc
install -c video-buf.ko /lib/modules/2.6.8-2-386/kernel/drivers/media/video
install -c video-buf.ko /lib/modules/misc
install -c v4l2-common.ko /lib/modules/2.6.8-2-386/kernel/drivers/media/video
install -c v4l2-common.ko /lib/modules/misc
install -c v4l1-compat.ko /lib/modules/2.6.8-2-386/kernel/drivers/media/video
install -c v4l1-compat.ko /lib/modules/misc
install -c btcx-risc.ko /lib/modules/2.6.8-2-386/kernel/drivers/media/video
install -c btcx-risc.ko /lib/modules/misc
install -c linux/videodev.h /usr/include/linux
install -c linux/videodev2.h /usr/include/linux
/sbin/depmod -a 2.6.8-2-386
./minstall
FATAL: Error inserting bttv (/lib/modules/2.6.8-2-386/kernel/drivers/media/video/bttv.ko): Unknown symbol in module, or unknown parameter (see dmesg)
The error is due to the Sarge kernel already having modules similar to
the ones we're building, so at this stage
we need to reboot the system. Once the system is rebooted, the following
errors loading the bttv and cx8800 modules will no longer be seen:
bttv: disagrees about version of symbol btcx_riscmem_alloc
bttv: Unknown symbol btcx_riscmem_alloc
bttv: disagrees about version of symbol btcx_riscmem_free
bttv: Unknown symbol btcx_riscmem_free
cx8800: disagrees about version of symbol btcx_riscmem_free
cx8800: Unknown symbol btcx_riscmem_free
cx8800: disagrees about version of symbol cx88_risc_disasm
cx8800: Unknown symbol cx88_risc_disasm
cx8800: disagrees about version of symbol cx88_card_setup
cx8800: Unknown symbol cx88_card_setup
cx8800: disagrees about version of symbol cx88_card_list
cx8800: Unknown symbol cx88_card_list
cx8800: disagrees about version of symbol cx88_sram_channel_dump
cx8800: Unknown symbol cx88_sram_channel_dump
cx8800: disagrees about version of symbol cx88_sram_channel_setup
cx8800: Unknown symbol cx88_sram_channel_setup
OK, so the above is due to the kernel still making use of the old module
symbol versions of the old modules.
If you see the above errors, it's time to reboot, there's apparently no way around it.
After reboot of Sarge, the Debian kernel will automatically have the cx8800 module
loaded, but if you redo the sequence:
rmmod cx8800
modprobe cx8800
Now you should get this from "dmesg" for the unload of cx8800 (this is for two HD3000 cards):
cx88atsc0: shutdown_dvr
cx88: shutdown_dvr completed
Unregistered device dtv
cx88atsc1: shutdown_dvr
cx88: shutdown_dvr completed
Unregistered device dtv
and "dmesg" should show the following for the load of cx8800 (this is for two HD3000 cards):
cx2388x v4l2 driver version 0.0.4 loaded
pcHDTV HD3000 Driver Version 1.6
ACPI: PCI interrupt 0000:04:02.0[A] -> GSI 18 (level, low) -> IRQ 201
cx8800[0]: found at 0000:04:02.0, rev: 5, irq: 201, latency: 64, mmio: 0xdb000000
cx8800[0]: subsystem: 7063:3000, board: pcHDTV HD3000 HDTV [card=14,autodetected]
tuner: chip found at addr 0xc2 i2c-bus cx8800[0]
tuner: type set to 51 (Thomson DDT 7610 ATSC/NTSC)) by cx8800[0]
cx8800[0]: i2c attach [client=Thomson DDT 7610 ATSC/NTSC)]
cx8800[0]: i2c register ok
cx8800[0]: registered device video0 [v4l2]
cx8800[0]: registered device vbi0
cx88: registered device dtv0
cx8800[0]: pcHDTV_HD3000 calling init_dvr
ACPI: PCI interrupt 0000:04:02.2[A] -> GSI 18 (level, low) -> IRQ 201
cx88:: 0 Version Data: 10001134-19430000
cx88:: 1 Version Data: 10001134-19430000
cx88:: Version: 113-4-194-3
pcHDTV HD3000 Driver Version 1.6
ACPI: PCI interrupt 0000:04:03.0[A] -> GSI 16 (level, low) -> IRQ 169
cx8800[1]: found at 0000:04:03.0, rev: 5, irq: 169, latency: 64, mmio: 0xdd000000
cx8800[1]: subsystem: 7063:3000, board: pcHDTV HD3000 HDTV [card=14,autodetected]
tuner: chip found at addr 0xc2 i2c-bus cx8800[1]
tuner: type set to 51 (Thomson DDT 7610 ATSC/NTSC)) by cx8800[1]
cx8800[1]: i2c attach [client=Thomson DDT 7610 ATSC/NTSC)]
cx8800[1]: i2c register ok
cx8800[1]: registered device video1 [v4l2]
cx8800[1]: registered device vbi1
cx88: registered device dtv1
cx8800[1]: pcHDTV_HD3000 calling init_dvr
ACPI: PCI interrupt 0000:04:03.2[A] -> GSI 16 (level, low) -> IRQ 169
cx88:: 0 Version Data: 10001134-19430000
cx88:: 1 Version Data: 10001134-19430000
cx88:: Version: 113-4-194-3
After reboot, it seems to also be necessary to re-run the pcHDTV-1.6/kernel-2.6.x/driver/minstall
script,
to create the device /dev/dtv0
which is used to access the kernel module from userspace.
I'm not sure why the /dev/dtv0
inode gets removed, but this brings it back:
cd pcHDTV-1.6/kernel-2.6.x/driver && ./minstall
mkdir pchdtvr-1.0 && cd pchdtvr-1.0 && tar zxvf ../pchdtvr-1.0.tar.gz
gcc pchdtvr.c -o pchdtvr -Wall -O3 -lpthread -lm -lrt
First, you'll need to use pchdtvr
to scan for channels (always run it as root):
mkdir /dtv # (this is where pchdtvr will save the recordings)
./pchdtvr -S
This creates the /etc/pchdtvr.0.conf
configuration file.
Now you can run pchdtvr
without the -S, to record as usual.
To playback you can install xine:
apt-get install xine-ui
xine /dtv/N30.ts
To build pcHDTV's xine-hd for Debian, these development packages need to be installed first:
apt-get install zlib1g-dev
apt-get install libasound2-dev
apt-get install libpng12-dev
apt-get install libcurl3-dev
apt-get install libreadline5-dev
apt-get install libxft-dev
apt-get install x-window-system-dev
When unpacking xine-hd, be sure to unpack it into a subdirectory,
as otherwise unpacking will erase the original file you downloaded. xine-hd
is useful, in that it is patched to include the -C
flag to playback
virtual channels within a full capture, similar to the -tsprog
flag in mplayer.
Experience with other Linux distros
The pcHDTV drivers built from the pcHDTV-1.6/kernel-2.6.x/driver module sources work with
the following distros. Note: the module to load is called cx8800
, and there's a script called minstall
which can be used to create the device
file /dev/dtv0
.
- Debian Testing
- Novell Linux Desktop 9
- Novell SuSE SLES-9 SP1, which has kernel 2.6.5-7.139.
- Novell SuSE Linux 9.2 professional (the shrink-wrap bundle, also installable by ftp, using SuSE's mini-installation boot CD).
- Fedora Core 3 (First remove the line
/sbin/modprobe bttv
from the minstall
script when building the pcHDTV-1.6/kernel-2.6.x/driver
modules for the HD-3000 card, as otherwise the cx8800
module won't work properly).
- Red Hat RHEL-4, which has kernel 2.6.9-5.EL.
The pcHDTV drivers built from the pcHDTV-1.6/kernel-2.4.x/driver module sources work with:
I've tried the newer DVB drivers for the pcHDTV HD3000 card only with:
- Debian Unstable, with kernel 2.6.12.3, see here for details on how to build this kernel.
The Air2PC card
According to the Myth TV project documentation,
the Air2PC is an ATSC card manufactured by BBTI which makes nothing but
digital TV capture cards.
They are the maker of the SkyStar2 card.
The Air2PC is supported by the linuxtv-dvb driver set, and uses a 4th
Generation NXT2002 demodulator.
This driver set has been used for many years, and is designed for
Digital TV.
The Air2PC driver has been included in Linux since the 2.6.11 kernel.
The Air2PC supports hardware filtering of the Transport Stream, and the
driver implements the demux API. This relieves your computer's
PCI bus of the burden of passing the entire transport stream over to the
dvb_demux
module, which would otherwise need to be used to do software filtering.
The Air2PC card also supports QAM, which allows it to receive unencrypted digital cable.
The Air2PC card CANNOT be used to receive European DVB, although it does use
drivers that are commonly used for European DVB, hence the confusion.
The Air2PC cannot work with a satellite receiver because the Air2PC only
accepts 8VSB or QAM modulated input. This means you can only hook up a TV
antenna or cable TV wire to the Air2PC and get it to work.
Satellite HDTV tends to use QPSK modulation rather than 8VSB or QAM modulation.
At the time of writing, March 2005, the Air2PC card was around $169.95,
although it is out of stock until August 2005. More details may be found on the
following pages: Mythic TV and Cyberstore
Update: The Air2PC rev 3.1 is now available, with the name AirStar-HD5000-PCI.
Taylor Jacob is working on a
patch and a
cleanup patch
to attach the LG DT3303 frontend (lgdt3303), discussed here
and here on the linux-dvb mailing list,
and Jan Kansky reported that the first patch already works well with vanilla 2.6.13.2 from kernel.org, following the
Mythtv Air2PC FC3 guide.
The cleanup patch must be compiled against dvb-kernel CVS, not against a vanilla kernel, as explained
here on the linux-dvb mailing list.
Using the Air2PC card, it may be awkward to get the driver to capture the full transport stream, as discussed here on the linux-dvb mailing list.
For more discussion, see the non official Air2PC/Airstar HD-5000 Forum.
The pcHDTV Card
The Linux folks at pcHDTV supply two HDTV cards with Linux drivers, the
HD-2000 and HD-3000 cards. The following is a list of some of the
details on the HD3000 card:
- The HD3000 is an NTSC (analog capture) and ATSC (digital) card for HDTV in North America.
- It uses a 2nd generation Oren demodulator.
- It is supported by a modified bttv driver that will not be
included in the Linux Kernel, as well as by the new DVB drivers which
are now included.
- It does not support hardware filtering and needs to send the
entire raw transport stream over the PCI bus. With the new DVB drivers,
instead of hardware filtering, the driver for the HD3000 makes use of
the kernel demux API to the
dvb_demux
module. The dvb_demux
module contains a complete DVB demultiplexer with PID, PES and section filters implemented in software.
- With the DVB drivers, it now supports QAM for digital cable.
- It has one RF input, one S-Video input, one Composite Video/Audio input and one Stereo Audio output for NTSC.
- It is not a universal PCI card.
- It is a PCI 2.2 compliant 5-Volt card. That means, there may be mother-boards (which
only accept 3.3 Volt cards) that the HD-3000 cannot be used with, so check that the PCI slot has
a 5V key/riser toward the center of the mother-board and not a 3.3V-only key/riser toward the
connector-end of the mother-board.
In March 2005, the HD3000 card was $169.98 plus shipping, with a volume discount, e.g.,
you get a $9.96 discount if you buy two, from pchdtv. Mythic TV also sells them at $172.50 with free shipping.
For driver support, see the pcHDTV HD-2000 and HD-3000 driver wiki.
There's also a fledgling page on the LinuxTV Wiki.
So What's the difference between the Air2PC card and the pcHDTV card?
There's a (perhaps somewhat biased) comparison here.
Video Card Considerations
Playback of HDTV streams uses quite a lot of CPU resources. One
remarkably effective way (although it does depend on using proprietary
drivers) to get around
the issue of HDTV playback on slower machines is to use XvMC
to offload the MPEG-2 decoding task to the video card itself, as described in more detail here. There are some video cards which support XvMC
, have DVI
outputs, and work in Linux, for example the nVidia 5200. For a more in-depth discussion, check out the Linux HTPC Howto.
More Antenna Considerations
The frequencies for the channels used for ATSC broadcasts tend to be higher,
so the UHF antennas used for HDTV reception tend to be physically a lot smaller
than the VHF antennas used for NTSC analog reception, because the wavelength of
the signal is shorter.
If the signal strength at your location is high enough, you may be able to
receive HDTV just fine using a plain loop of wire hooked up to a piece of coaxial feed line.
To get an idea of the frequencies corresponding to the mysterious FCC channel numbers, refer to the
following list. This
list of channels
allotted by the FCC for digital television may also be of interest.
To find the wavelength, you can use this handy little calculator. (Ideally, the antenna loop diameter should match the wavelength of the channel you want to receive.)
Although a simple HDTV antenna can be made by stripping 12.5cm of coaxial cable as explained on the VDR Wiki, you may also want to try the guide
to building a UHF Log-Periodic Array Antenna
(also discussed here).
If you are planning to really go all-out and design an antenna, it may be best
to start by having a professional spectrum analysis performed at your location.
Most satellite installation technicians will have the equipment
to do this, and it will help to know whether you need to consider multipathing
(reflections) of the received signals in your design.
Inkling pointed out this article on Propagation of Waves by the Navy. Thanks, Ink!
Redistribution Control Descriptor
The Redistribution Control Descriptor, also known as the broadcast flag, is described on page 79 of the ATSC Standard A_65B.
To check whether the transport stream you are receiving has this 0xAA flag set, you can build
the NIST DASE ATSC/MPEG2 parser,
which will print out Content_Protect_Copy_Mngt_descr
when it sees the 0xAA flag set in the stream.
Credits
Thanks to Tony Godshall (Bay Area Debian) for organising and hosting an EFF PVR Build-In.
News Articles
http://www.sfbg.com/39/22/cover_fcc.html
Update: DVB drivers for pcHDTV cards
The DVB drivers for the pcHDTV cards are now in the mainstream Linux kernel. See this guide for more details.
Links
- 1959.mid: The MIDI file generated by Rosegarden for 1959.rg above...
- 1959.pdf: Printout of the 1959.rg Rosegarden file (generated by LilyPond)
- 1959.k25: The 1925.mid file imported into a Kurzweil K2500RS (with the program change events removed, so you can play it back using whatever onboard piano sound your Kurzweil happens to have)
- 1959_layers.rg: New attempt, using an additional layer to handle the second "voice" which starts running in bars 17 and 18.
- 1959_layers.mid: The MIDI file generated by Rosegarden for 1959_layers.rg above.
- Kurzweil-2500RS.rgd: gzip'd XML file for the Rosegarden bank definitions for the ROM sounds in a Kurzweil K2500RS.