Talk:HOWTO Setup TV Input for MythTV/Previous

From Gentoo Linux Wiki

Jump to: navigation, search
Split-arrows.gif It has been suggested that this article be split into multiple articles accessible from a disambiguation or index page.   (Discuss)
This article is part of the HOWTO series.
Installation Kernel & Hardware Networks Portage Software System X Server Gaming Non-x86 Emulators Misc

MythTV Series

MythTV

Installation

Tips/Tweaking

Usage

edit

Contents

[edit] BT848

For those who have the Hauppauge cards with the BrookTree 848 or 878 chipset (such as the WinTV-GO), the BT848 module is all you need for drivers. Those of you with the WinTV-GO-FM can use this driver too, as it also has radio support. So please skip the ivtv section below, if you have one of those cards.

If you are using the Hauppauge DVR-150 or DVR-500, use the "Conexant 2388x (bt878 successor)" driver instead of the "BT848 Video For Linux".

The module is located here in your kernel menuconfig so there is no additional driver setup needed.

Note: If your card does not work by default, or gives you a scrambled picture, it may be necessary to force a card and tuner type. To find your card/tuner ID, refer to:

  • /usr/src/linux/Documentation/video4linux/CARDLIST.bttv
  • /usr/src/linux/Documentation/video4linux/CARDLIST.tuner

Once you have a card number and tuner number, pass them as options to your bttv kernel module.

 modprobe bttv card=nn tuner=xx

Where nn is the card number as defined in CARDLIST.bttv and where xx is the tuner number as defined in CARDLIST.tuner.

To make sure your card and tuner type have been set correctly, check your dmesg output:

dmesg | grep bttv && dmesg | grep tuner

Also, you'll want to make sure the tuner is set properly on boot. If you have compiled bttv support as a module, you'll need to create a file in /etc/modprobe.d to pass the tuner and card options. For example, if you have an ATI TV Wonder VE in an NTSC region:

#echo options bttv card=64 tuner=2 > /etc/modprobe.d/bttv
#update-modules

Or if bttv is built-in to the kernel, add bttv.card=nn bttv.tuner=xx to your list of kernel arguments to pass at boot time.

It is very important to have your card and tuner type set correctly before running mythsetup and mythfilldatabase, otherwise your channel frequencies may be set incorrectly!

[edit] Hauppauge PVR-150/PVR-250/PVR-350/PVR-500 & Avermedia m179

These cards use the ivtv driver. A good and comprehensive guide about installing ivtv can be found here.

[edit] pcHDTV HD-3000 Card

The drivers for the pcHDTV HD-3000 card are included in the 2.6.12 (and later) kernel. Use a kernel 2.6.12 or later kernel and enable the HD-3000 card support:

Linux Kernel Configuration: HD-3000 Kernel Options
Multimedia devices --->
    <M> Video For Linux
        Video For Linux --->
            <M> Conexant 2388x (bt878 successor) support
            <M>   DVB Support for cx2388x based TV cards
        Digital Video Devices Broadcasting --->
            [*] DVB For Linux
            <M> DVB Core Support
            Customize DVB Frontends --->

If the drivers were compiled as a kernel module, you must load the drivers. You can only load either the DVB or Video 4 Linux drivers, but not both. Assuming you want to load the DVB drivers:

Code: Loading the HD-3000 Drivers
# modprobe -v cx88-dvb

You should see output similar to the following:

insmod /lib/modules/2.6.12-gentoo-r6/kernel/drivers/media/dvb/frontends/dvb-pll.ko
insmod /lib/modules/2.6.12-gentoo-r6/kernel/drivers/media/dvb/frontends/cx22702.ko
insmod /lib/modules/2.6.12-gentoo-r6/kernel/drivers/media/video/video-buf.ko
insmod /lib/modules/2.6.12-gentoo-r6/kernel/drivers/media/dvb/dvb-core/dvb-core.ko
insmod /lib/modules/2.6.12-gentoo-r6/kernel/drivers/media/video/video-buf-dvb.ko
insmod /lib/modules/2.6.12-gentoo-r6/kernel/drivers/base/firmware_class.ko
insmod /lib/modules/2.6.12-gentoo-r6/kernel/drivers/media/dvb/frontends/or51132.ko
insmod /lib/modules/2.6.12-gentoo-r6/kernel/drivers/media/video/videodev.ko
insmod /lib/modules/2.6.12-gentoo-r6/kernel/drivers/media/video/tveeprom.ko
insmod /lib/modules/2.6.12-gentoo-r6/kernel/drivers/media/video/btcx-risc.ko
insmod /lib/modules/2.6.12-gentoo-r6/kernel/drivers/media/common/ir-common.ko
insmod /lib/modules/2.6.12-gentoo-r6/kernel/drivers/i2c/algos/i2c-algo-bit.ko
insmod /lib/modules/2.6.12-gentoo-r6/kernel/drivers/media/video/cx88/cx88xx.ko
insmod /lib/modules/2.6.12-gentoo-r6/kernel/drivers/media/dvb/frontends/mt352.ko
insmod /lib/modules/2.6.12-gentoo-r6/kernel/drivers/media/video/cx88/cx8802.ko
insmod /lib/modules/2.6.12-gentoo-r6/kernel/drivers/media/video/cx88/cx88-dvb.ko

[edit] Firmware

Users of the pcHDTV HD-3000 card will need to load the card's firmware when the drivers are initialized. This uses the hotplug utility

Code: Install Hotplug
emerge hotplug

The media-tv/linuxtv-dvb-firmware package provides the necessary firmware files. The latest version of udev should contain all the compatible rules needed for dvb devices. Make sure you set DVB_CARDS in /etc/make.conf first.

Code: Install HD-3000 Firmware and udev rules
# grep DVB_CARDS /etc/make.conf
DVB_CARDS="or51132 or51211"
 # emerge media-tv/linuxtv-dvb-firmware

Note: The HD-3000 card firmware doesn't actually load until the system attempts to access the card. In MythTV this occurs during a channel scan in mythtv-setup, or when attempting to tune in a channel (can occur when starting mythbackend if a default channel is set). After MythTV starts the up the following entries in dmesg will confirm the firmware loaded successfully:

Code: Verify the Firmware Loaded
# dmesg
or51132: Waiting for firmware upload(dvb-fe-or51132-vsb.fw)...
or51132: Version: 10001134-19430000 (113-4-194-3)
or51132: Firmware upload complete.

[edit] Troubleshooting HD-3000 Firmware

On some systems the kernel is calling /sbin/udevsend instead of /sbin/hotplug, which results in failures to load the HD-3000 firmware.

Code: Verify The udev Configuration
# cat /proc/sys/kernel/hotplug
/sbin/udevsend

A pcHDTV forum post has this work-around:

1) emerge the udev source, I grabbed the latest, udev-064.

Code: Download udev Source
ACCEPT_KEYWORDS="~x86" ebuild $(equery w udev) clean unpack

this created a directory in /var/tmp/portage with the src that I could compile manually.

2) compile

Code: Compile udev
make && make install


3) compile and copy the extra hotplug binary

Code: Compile udev_run_hotplug
make EXTRAS=extras/run_directory
 cp extras/run_directory/udev_run_hotplugd /sbin

4) add a line to the end /etc/udev/rules.d/50-udev.rules

NOTE: as of udev-079-r1 this line already exists

File: /etc/udev/rules.d/50-udev.rules
echo "ENV{UDEVD_EVENT}==\"1\", RUN+=\"/sbin/udev_run_hotplugd\"" >> /etc/udev/rules.d/50-udev.rules

I then rebooted, not sure if that is necessary or if simply restarting hotplug would suffice.

[edit] Confirming the card was recognized

Something similar to the following should be found with dmesg:

Code: Verify the HD-3000 Card is Recognized
# dmesg
cx2388x v4l2 driver version 0.0.4 loaded
ACPI: PCI Interrupt 0000:03:02.0[A] -> GSI 17 (level, low) -> IRQ 17
cx88[0]: subsystem: 7063:3000, board: pcHDTV HD3000 HDTV [card=22,autodetected]
cx88[0]/0: found at 0000:03:02.0, rev: 5, irq: 17, latency: 64, mmio: 0xfc000000
tuner 0-0061: chip found @ 0xc2 (cx88[0])
tuner 0-0061: type set to 52 (Thomson DDT 7610 (ATSC/NTSC))
cx88[0]/0: registered device video0 [v4l2]
cx88[0]/0: registered device vbi0
cx88[0]/0: registered device radio0
cx2388x dvb driver version 0.0.4 loaded
ACPI: PCI Interrupt 0000:03:02.2[A] -> GSI 17 (level, low) -> IRQ 17
cx88[0]/2: found at 0000:03:02.2, rev: 5, irq: 17, latency: 64, mmio: 0xfd000000
cx88[0]/2: cx2388x based dvb card
DVB: registering new adapter (cx88[0]).
DVB: registering frontend 0 (pcHDTV HD3000 HDTV)...

At this point, assuming the HD-3000 drivers are loaded in the kernel and the udev rules are in place the device files should exist. If the permissions are not correct, look in the file /etc/udev/permissions.d/10-pcHDTV.

Code: Verify the /dev files
# ls /dev/dvb/adapter0/*
/dev/dvb/adapter0/demux0
/dev/dvb/adapter0/dvr0
/dev/dvb/adapter0/frontend0
/dev/dvb/adapter0/net0

Now lets make sure we can tune and watch HD contents using the HD3000.

1) Install DVB Applications

Code: Install dvb applications
# emerge linuxtv-dvb-apps

2) create the ~/.azap/channels.conf

Code: channels.conf
# mkdir ~/.azap
# atscscan /usr/share/dvb/atsc/us-NTSC-center-frequencies-8VSB >> ~/.azap/channels.conf

your channels.conf might look like follow:

File: channels.conf
WETA-DT:551000000:8VSB:49:52:1
WETAPRM:551000000:8VSB:65:68:2
WETAFML:551000000:8VSB:81:84:3
WETAPLS:551000000:8VSB:97:100:
WUSA-HD:593000000:8VSB:49:52:1
9-Radar:593000000:8VSB:65:68:2
WTTG-DT:605000000:8VSB:49:52:3
WJZ-DT:617000000:8VSB:49:52:1
Default:623000000:8VSB:49:52:3

3) See if we can receive any HD content in X

# azap -r WETA-DT (replace this with any channels you see in your channels.conf)

you should see the following:

using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
tuning to 551000000 Hz
video pid 0x0031, audio pid 0x0034
status 00 | signal d1a9 | snr f94f | ber 00000000 | unc 00000000 |
status 1f | signal d3b5 | snr f985 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 1f | signal d3b5 | snr f979 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 1f | signal d3b5 | snr f987 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 1f | signal d3b5 | snr f969 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 1f | signal d3b5 | snr f97d | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 1f | signal d5c1 | snr f979 | ber 00000000 | unc 00000000 | FE_HAS_LOCK

If you do not see output similar to above or you do not receive constant FE_HAS_LOCK, then the channel you are trying to tune does not have very good signal. Try pick another channel.

4) While azap is running in one terminal, see if we can actually watch what is being captured

# mplayer /dev/dvb/adapter0/dvr0

If you were able to get pictures, you now have a working HD3000.

Once you verify that the card is recognized, you should configure gentoo to autoload the HD-3000 drivers.

File: Additions to /etc/modules.autoload.d/kernel-2.6
# pcHDTV 3000 drivers
cx88-dvb

[edit] For over the Air in the US

Select a card type of "dvb" for ATSC/HDTV/digital.

Select a card type of "pcHDTV 2000/3000" for analog.

[edit] Use Flags

You must have the "dvb" use flag enabled. If you have not previously enabled this flag be sure to recompile the affected packages:

Code: Rebuild System with DVB USE Flag
emerge -avuDN world

[edit] Matrox G400 - TV

works as of 2.6.12

  1. Basic steps are go and get the source from mgavideo at sf.net.
    1. use the cvs version and get driver_fb
  2. patch, config your kernel as explained in the readme on cvs. the 2.6.7 patch works fine for 2.6.12
  3. run ./iv on boot before running mythbackend

don't use emu10k with via and this sound card => crackly sound

Personal tools