Next Previous Contents

5. Drivers

5.1 Installing the video drivers

The first trick is to get the video card to work. To do this, the various drivers must be installed into the kernel. But first you must know what your video card and tuner model and type are. This may require some experimentation if you do not know or your card is not listed in the Makefile for the driver (available in the separate package). See Appendix A of this HOWTO for a (possibly outdated) list of known cards and Appendix B for a list of tuner modes.

As of writing, only two brands of tuner are supported, the Temic and the Philips tuners. Some cards can support both NTSC (North America) and PAL or SECAM (the rest of the world), some have only the crystal installed for one of these.

You can inspect your board easily for the tuner type and available crystals. The tuner is the large silver box with the external F connector attached to it. It should either bear ``Temic'' or ``Philips.'' Some manufacturors may stick their own labels on top of the labels that are already there, so check if that is the case. The crystal(s) are the small shiny canisters near the large decoder chip. For PAL, this is marked 28.xxxMHz (where xxx are three digits). For NTSC, the canister should bear 35.xxxMHz (again, the xxx are three digits).

Getting down to it

You can edit and use the ``update'' script included with the separately available driver to install the modules, or you can use the the instructions below to remove and insert the drivers.

Use ``lsmod'' to see the modules that are currently installed. If any of videodev, i2c, i2c-char, tuner, msp3400 or bttv are listed, remove them in the order below using ``rmmod:''

rmmod bttv
rmmod msp3400
rmmod tuner
rmmod i2c_chardev
rmmod i2c-dev
rmmod algo-bit
rmmod i2c
rmmod videodev

Use ``modprobe'' to install your new drivers. First, try default module arguments to see if that works:

modprobe videodev      # Not required if you answered Y to Video for Linux
modprobe i2c     verbose=1 scan=1 i2c_debug=0
modprobe tuner   debug=0 type=6   # for Temic NTSC tuner
modprobe msp3400
modprobe bttv    card=0 radio=0 pll=0

Verifying the driver found the card

At this point, you should check that the driver actually detected and found your video grabber card. Inspect /proc/pci (eg cat /proc/pci) and look for an entry with the line similar to the following:

    Multimedia video controller: Brooktree Bt848 (rev xx).

If you see this, continue.

If not, you have a problem -- try removing and re-installing the bttv driver again, just in case it was having a bad hair day. If necessary, power down the machine and check that the card is firmly seated in the socket. Check the card in another machine or a machine with a supported operating system, if it still doesn't work.

5.2 Getting the video card to work

Once you have installed the bttv driver, you can then start X in 16-bit or higher mode (startx -- -bpp 16), then run the ``v4l-conf'' program to configure your system for the TV application. It will report something like the following:

using X11 display :0.0 (dga available)
video mode: 1280x1024, 16 bit/pixel, 2560 byte/scanline
framebuffer at 0xf0800000
ok

The presence of ``(dga available)'' on the first line and ``ok'' on the last line are good signs. You should run v4l-conf after everytime you modprobe or install the bttv driver. You only need to do it once each time. (v4l-conf comes with xawtv.) Xawtv seems to work here without using it, though.

Now, in X, start your TV software and turn on video capture. In xawtv, right click on the black screen. This should bring up a menu box. Click on the line that reads ``Capture,'' near the bottom just above the slider bars at the bottom. Select ``grabdisplay.'' (For xtv, select the window {click on the title bar} and press C.)

The black window should turn blue or otherwise be not black. If the window remains black, then try ``overlay'' mode. If it still remains black, your card is not working with the parameters given. Close the TV application and retry with another invocation of bttv.

Use ``rmmod'' to remove the bttv driver and ``modprobe'' again with a specific card number from the list in Appendix A. Try running the TV application and capture again. Run v4l-conf after modprobing. See the PROBLEMS file with the documentation for bttv for additional hints.

5.3 Video card shows blue screen

Once you get a blue screen, you know the driver is working. Once you get composite or S-video video in and a video signal verified working, you can move onto the tuner. First, check if you get an image with the ``Overlay'' mode (click on the ``Capture'' line in xawtv). If you get a black screen, overlay is not working.

If overlay does not work, go and change all occurrences of ``overlay'' in the ~/.xawtv file to ``grabvideo'' now. Then quit and restart xawtv for the changes to take place. The author had a problem with overlay not working, and solved it by installing a new video card. You might be able to solve it by compiling xawtv with no X extensions (no DGA).

You might also have to tell the bttv module where the memory for the video card is. Inspect /proc/pci for the memory region used by the video card (eg cat /proc/pci). Use vidmem parameter to specify video card memory region using first five characters of the address. eg. If the memory is at 0xf0000000, then use: vidmem=0xf00 Now, if you have a tuner on your card, you can move on to see if that works. If you have no tuner, you are done, proceed to the ``Configuring Modules'' section!

5.4 Setting up the tuner

If you have selected the correct tuner, then you should get something just by selecting a ``Video Source'' of ``Television.''

What you might get is just ``static,'' perhaps just a portion of the display is randomly coloured, changing dots. If so, you may have a working tuner. Change the channel by either using the ``Channel Window'' (click on that line in the menu or press ``C,'' then click on the channel title in the bar presented). If there is an RF signal present, one of Channel 2, 3 or 4 should show a picture, if you have such a channel available. You can also left click on the display for a selection of channels.

If you are outside North America, you may have to choose a ``TV Norm,'' either PAL or SECAM. Also, an appropriate ``Frequency Table'' may have to be chosen. Xawtv comes with 11 preset tables. You can save these parameters in the ~/.xawtv file with the norm and freqtab variables,respectively. If necessary, you can read the xawtv documentation to make your own frequency table, or use a program such as xtvscreen which has a continuously variable channel selector.

Before going to far changing the application, be sure you have the correct tuner parameters for the module. There are several types available. Use ``rmmod'' and ``modprobe'' just as for bttv, but with the appropriate parameters for the tuner module (debug and tuner). See Appendix B for a list of tuner types.

You will have to rmmod the bttv module before you can remove the tuner module. Remember to use the correct parameters for the bttv module when you modprobe it, or take hints from the next section on how to save your working parameters. The command line parameters override the ones in /etc/conf.modules.

5.5 Configuring Modules

For future use, you can configure your modules to start with the correct parameters automatically. Edit your module configuration file:

/etc/conf.modules

and add the following lines with appropriate values that you determined are necessary (eg. for a Zoltrix TV-Max in North America using kernel 2.2):

# TV
alias   char-major-81   bttv
pre-install bttv        modprobe -k tuner
options bttv            card=15 radio=0 pll=0
options tuner           debug=0 type=6

If you compiled your 2.2 kernel with kmod or use kerneld, the modules will be installed automatically whenever you start your TV software.


Next Previous Contents