TV-out with Matrox G400DH using the Linux frame buffer device (obsolete)

Version 0.1.1
May 2002 , April 2005
This document may be distributed under the terms set forth in the LDP license at
Copyright (c) 2002, 2005 by

This document is free documentation; you can redistribute it and/or modify it under the terms of the LDP license. This document is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See the LDP license for more details.

Why is this description obsolete now?

If you are looking for TV-out you usually want to display movies on your TV. Meanwile the well-known MPlayer supports DirectFB and DirectFB supports the Matrox G400 very well. Hence there is no need to use the frame buffer device for this any more. If you want TV-out for something else - go ahead!

Why using frame buffer for TV-out instead of XFree?

I have tried it with XFree but I have never got overscan. With XFree there were broad black bands around the TV picture. Nobody likes that.
Another reason: the frame buffer device is much easier to handle than two different XFree configurations (one for normal work and one for TV-out).

How do I get my DVDs fullscreen and accelerated on my TV using the Matrox G400DH with Linux?

You just need:
MPlayer [link removed to regard the prevailing german case law]
Kernel 2.3.48 or later

I have described TV-out for use with MPlayer because it is the main application for TV-out and it comes with almost all necessary tools you need for TV-out and a G400DH.

Please refer the MPlayer documentation for the usage of MPlayer and for more information about G400 and frame buffer. The frame buffer method is described there but it doesn't work on my system with the settings described there - that's why I wrote this dokument.  :-)

First compile a kernel with the following options:

Processor type and features
  [*] MTRR (Memory Type Range Register) support

Console drivers  --->
  Frame-buffer support  --->
    [*] Support for frame buffer devices
    <M>   Matrox acceleration
    [*]     G100/G200/G400/G450/G550 support
    <M>       Matrox I2C support
    <M>       G400 second head support

After booting the new kernel and compiling  and installing MPlayer go in the directory 'drivers' in the MPlayer source directory and do 'make'.
Now become root.
Than execute 'insmod mga_vid.o mga_ram_size=XX'. Replace 'XX' with your video RAM in megs (16 or 32).

Execute the following (if your monitor doesn't support TV refresh rates you should turn it off now because it could be damaged):

modprobe i2c-matroxfb
modprobe matroxfb_Ti3026
modprobe matroxfb_crtc2
modprobe matroxfb_maven

Go in the directory 'TVout/matroxset' of your MPlayer source directory, do 'make' and execute the following:

./matroxset -f /dev/fb1 -m 0
./matroxset -f /dev/fb0 -m 3

Then  do './matroxset 1' if you are using PAL or './matroxset 2' if you want NTSC.

PAL users now type:

fbset -g 832 768 832 768 32 -t 20203 40 0 63 29 56 4 -bcast true

(If you haven't already installed 'fbset' go in the directory 'TVout/fbset' of your MPlayer source directory and compile it.)

Now enjoy full size and accelerated TV-out with the following commands:

setterm -cursor off
setterm -blank 0
setterm -foreground black
mplayer -vo mga -fs movie.avi

If you are a NTSC user you have a little problem because I don't have a NTSC compatible TV. So you have to discover your own fbset command line for a full screen picture. Refer MPlayer documentation!

Some fine tuning:

On my TV the picture was too dark and a litte colorless with default settings. You just need a little tool  to set some Registers for the second head. For me the following settings made the TV-out picture perfect:

matrox 0x1e 0xd0
matrox 0x20 0xff
matrox 0x22 0xff

These sets contrast and saturation (2 registers). On an other system with these settings the picture looked terrible. So you probably have to find settings fitting your system.

You can change hue with reg 0x25 and brightness with reg 0x0e.

Have fun!