TV tuner card

From Gentoo Linux Wiki

Jump to: navigation, search
This article is part of the Hardware series.
Laptops TV Tuner Cards Wireless Servers Storage Other Hardware Motherboards Related

Contents

[edit] (Preamble)

Here I would like to see generic instructions on how to set up a TV tuner card in Gentoo as most howtos seem either outdated or not adapted to Gentoo. (Please erase this comment soon :-)

[edit] Introduction

Installing a TV board in Gentoo is quite simple, all you really need to do is activate the correct kernel parameters and emerge some software and it should "just work".

[edit] Configuring the Kernel - Linux 2.6 only

Get into the kernel configuration as normal (i.e. cd /usr/src/linux && make menuconfig). To start off you must activate Video4Linux : navigate to >Device drivers->Multimedia Devices and activate Video For Linux either as built in or a module. Remember that if you choose this as a module you must either modprobe it every time you want to use it or add it to /etc/modules.autoload.d/kernel-2.6.

Next you must add drivers for your specific card in >Device drivers->Multimedia Devices->Video_For_Linux, under the video adapters section. I selected the bt848 driver for my Hauppauge WinTV Go, this driver is for boards with the Brooktree Bt848/848A/849/878/879 chips, it may be worth noting that the cx2388x driver, which is marked as the successor for the bt878, does not work with bt878 boards. The bt848 driver requires I2C support, so if you can't find the bt848 driver in your menu enable I2C first, under >Device drivers->I2C support.

Now all that is left is to save the new configuration and then to recompile the kernel (i.e. make && make modules_install), not forgetting to copy the compiled kernel to wherever it is kept for booting.

[edit] Installing TV viewer software (Analogue)

I recommend TVtime to anyone wanting to watch TV, wether you want a PVR solution or not, TVtime will at least allow you to reliably test your setup. This is where you come to really appreciate Gentoo's style ;-) Simply type "emerge tvtime" as root, and voila ("emerge --pretend --verbose tvtime" if you want to check dependences and use flags).

Now just type tvtime as a regular user (it's a good idea to do this in a console under X, as if there are any problems the text output of tvtime could be very useful at this stage) and use the OSD menus to set up your channels.

There are other useful packages in portage, such PVRs as freevo or mythtv and xmltv for TV listings.

[edit] Installing TV viewer software and scanning for channels (DVB)

If you have a DVB card, then you cannot use tvtime. Two other options are mplayer and xine, but first you will need to create a channels.conf file. Also, you will need to make sure that whatever package you are using has been emerged with the appropriate use flags, i.e. DVB support.

To do this, first we

# emerge linuxtv-dvb-apps


This will install several small and useful utilities, the one we will be using is dvbscan. Next, navigate to /usr/share/dvb/dvb-t/ - this will have a number of files in it, you need to find the transmitter nearest to you. For example, my closest transmitter is the one at Crystal Palace, so I need the file uk-CrystalPalace. If you don't know your nearest transmitter and you're in the UK, head over to the UK digital TV reception predictor and type in your postcode, then your nearest transmitter will be displayed. If there is no transmitter file for your location, emerge the w_scan utility to bootstrap dvbscan (w_scan searches the whole DVB-C/DVB-T range for used frequencies):

# emerge media-tv/w_scan


Once w_scan has been emerged we can create our own frequency file:

$ w_scan -x > uk-CrystalPalace


Now we can pass this transmitter data to dvbscan, and it will create a channels.conf file for us (Replace uk-CrystalPalace with your transmitter file):

$ dvbscan uk-CrystalPalace > channels.conf


Next we copy this channels.conf file to xine and/or mplayer:

$ cp channels.conf ~/.mplayer/channels.conf
$ cp channels.conf ~/.xine/channels.conf


Xine can then be launched and clicking on the dvb button should display your television, if you're using mplayer then mplayer "dvb://CHANNELNAME" should provide the output of whatever channel name you selected (these can be found in the channels.conf file.)

[edit] Troubleshooting

If Video4Linux is correctly configured you should have many "Video(x)" devices in /dev.

If the driver is correctly installed "cat /dev/video0" should output infinite garbage (Ctrl+C to stop !!!). Otherwise you will get "/dev/video0: No such device", in which case you may have selected the wrong driver, the card may not be supported...

With DVB cards, there should be a device registered at something similar to /dev/dvb. However, this is not a video device, it is actually a directory containing the components of the card.

Typing "dmesg" as root can provide useful information as to whether the card was detected. With a PCI card, you would see references to the board by typing "lspci" as root, this is also very useful in determining the correct driver. Typing "dmesg | grep Hauppage" (replacing Hauppage with the card brand / name) will strip the dmesg output down, just providing information on your tvtuner.

If a DVB card has been successfully registered, dmesg should output (somewhere) "registered new device at /dev/dvb" (or something similar)

If you have a problem with firmware, whereby dmesg just reports "found a (cardname) in cold state, attempting to load firmware" and you dual boot with windows, try booting into windows first, activate the device, then reboot into Gentoo. While not a great fix, it can be useful if you dual-boot and you're having big firmware problems.

[edit] Links

Personal tools