How to configure Linux for use with TV

One interresting application for VGA to TV converter is to use it with Linux operating system. Linux is a goox operating system for hardware experimenter because it allows quite much user configurability for many of it's settings, including video parameters.

Text console

Using DOS drivers for getting Linux textmode to TV

Santiago Garcia Mantinan mentions that you can use Paulo Sergio Coelho's VGATV driver to get Linux text mode to work (theoretically should work other drivers also). DOS VGA to TV driver can be used to be able to get the Linux cosole to the apropiate frecuencies for your TV. The process is simple:

Now the Linux console on text mode will look just like the DOS text mode screen looked, even if you start X or launch dosemu when you come back from this linux restores the VGA registers, so everything looks great.

The problem with dosemu is that it starts with a vga startup, so the boot process is carried out like a DOS one and you need to load again the driver under dosemu to be able to see the dosemu stuff ok, but even though you don't load it if you come back to linux the screen will be OK.

Configuring console with SVGATextMode

For console text mode to work on PAL TV, program SVGATextMode with line:

"PAL" 14.161   640 720 784 904 260 276 280 313 +hsync +vsync font 8x8
This configurate is reported to work on old VGA trident card but is expected to work on generic VGA card too. Credits for this configuration line go to Uros Indihar.

Here are console settings for Matrox Millenium for SVGATextMode for Linux (TextConfig) to get the text console screen to work (from http://www.cam.org/~lucky/ntsc.html):

Chipset "matrox"
clockchip "ti3026"      #for the Millennium
Option "ClockDiv2"
HorizSync 15-16
VertRefresh 57-63
DefaultMode "80x25"

#Mode 15.314kHz/58.45Hz
"80x25"   14.31818   640 728 792 896   200 222 226 263   +Hsync +Vsync  font 8x8

Option "LoadFont"
FontProg "/usr/bin/setfont"
FontPath "/usr/lib/kbd/consolefonts"
FontSelect "Cyr_a8x16"   8x16 9x16 8x15 9x15
FontSelect "Cyr_a8x14"   8x14 9x14 8x13 9x13
FontSelect "8x12alt.psf" 8x12 9x12 8x11 9x11
FontSelect "Cyr_a8x8"    8x8  9x8  8x7  9x7
FontSelect "Cyr_a8x32"   8x32 9x32 8x31 9x31

Using the converter with X-windows

This free X-windowing system provides plenty of configuration options in it's Xconfig configuration file. You can easily modify the parameters of the display just by editing that configuring file with any ASCII file editor. The Hitchhiker's Guide to XFree86 Video Timings is a good tutorial on making your own video configurations.

Generic Xfree86 settings

Most generic setting for Xfree86 for PAL might be the following modeline:

ModeLine "PALi"  14.16  704 756 828 976 552 556 589 629 +hsync +vsync interlace
This configurate is reported to work on old VGA trident card but is expected to work on generic VGA card too. Credits for this configuration line go to Uros Indihar.

Another suggested configuration:

Modeline  "Pal"     15.00  688 790 810 960  530 560 580 625 Interlace
This configuration was sent to me by Alan Forster. It was tested on W32 X server and Legend 128T6 graphics card (ET6100 chipset).

I have received comment that the Tomi Sarvela's modelines do not work correctly on some PAL TVs and some graphics cards. If this happens to you, then try some of the next configurations.

Santiago Garcia Mantinan ([email protected]) recommends using the following modelines for PAL TV:

Modeline  "MaxTV"       15.00   688 768 800 960  516 529 537 573 Interlace
Modeline  "640x480xTV"  15.00   640 728 792 960  480 509 517 573 Interlace
You must notice that the modes above are not 50Hz modes but 54Hz. Santiago's TV did support it nicely and you can try if your TV will do it also. To make those modelines to 50 Hz just put 625 lines instead of the 573 and then center it and you have a 50Hz mode!

And some more modelines to try:

Modeline "PALi" 14.16   704 756 828 976 552 556 589 629 +hsync +vsync Interlace
Modeline "Pal"  15.00   688 790 810 960 530 560 580 625 Interlace
Modeline "MAXtv" 15.00 688 768 800 960 516 529 537 573 Interlace
Modeline "736x575i"     14.16   736 760 824 904 575 580 585 625 Interlace -hsync -vsync
Note: Remeber to turn of the screen saver option on Xfree86 if you are running it with the TV settings!

Tip: If you want to get rid of mouse cursot (for demonstration purposes etc.) then do the following:

Chipset specific settings for Xfree86

Configuration for Cirrus SVGA cards (5434 chipset)

Tomi Sarvela has made a suitable configuration for running 704x552 Interlaced screen mode in PAL televisions using Cirrus 5434 SVGA-card. This configuration does not work on Cirrus 542x based SVGA-cards, because they don't have good enough clock programming capabilities. But all chips in Cirrus 543x series should theoretically work.

To add this TV mode, you simply add the following file to your Xconfig file and start the Xfree86 then in mode "PALi":

ModeLine "PALi"       13.5  704 720 792 864  552 572 605 625 Interlace
That same configuration has been also tested to work well when VGA card is directly wired to Commodore 1084 color video monitor RGB connector. That monior used same screen refresh rate as a normal TV.

Setting for old Trident VGA chipsets

ModeLine "PALi"  14.16  704 756 828 976 552 556 589 629 +hsync +vsync interlace
This configurate is reported to work on old VGA trident card but is expected to work on generic VGA card too. Credits for this configuration line go to Uros Indihar.

Setting for Legend 128T6 graphics card (ET6100 chipset)

Modeline  "Pal"     15.00  688 790 810 960  530 560 580 625 Interlace
This configuration was sent to me by Alan Forster. It was tested on W32 X server and Legend 128T6 graphics card (ET6100 chipset).

Matrox Xfree86 settings

Re-use of your old CGA monitors with X-Windows/Console/Win95 article by Philippe Lantin has Matrox Millenium settings Xfree86 (X-windows), text screen (using SVGAtextmode) and Windows 95 for VGA to TV operation in NTSC TV.

Here are the XF86Config setting (Very close to NTSC):

#Mode 15.314kHz/58.45Hz
Modeline "NTSCi"    14.31818  640 728 792 896   400 444 452 526 Interlace  +Hsync +Vsync

Notes on usign S3 based cards

Some people have reported on problems on configuring S3 cards to see my Linux X server on TV. According one response S3 has a limit in dot clock, the minimum frequency for it is 16.875MHz. This is greater than 13.5-15 MHz as requested in the example configuration files. The only way to address this kind pf problem is to increment the orizontal resolution stratching the resulting image.

Here is a modeline for S3 by Giancarlo Capella

Modeline "TV" 16.90 792 848 920 1080 532 554 559 625 -hsync -vsync interlace
As you note, 792x532 is not a 4:3 format. This is the reason for the stretched image resulting on TV. This resolution also fits exactly the viewing area of the screen. The modeline is originally designed for X to TV circuit but should be as well usable with my VGA to TV converter circuit.

If you want to use conventional resolution with S3, the image becomes stretched. For example the modeline below shows stretched 640x480 resolution (looks like 536x480):

Modeline "TV" 16.90 640 792 864 1080 480 532 537 625 -hsync -vsync interlace
The second one is the resolution that looks like a normal 640x480 (but is 760x480):
Modeline "TV" 16.90 760 840 912 1080 480 532 537 625 -hsync -vsync interlace
It might be necessary to adjust those parameters (especially 3rd and 4th) to get the best results. You can adjust those parameters manually by exiting xfree86 configuration files or by using xvidtune program.

Riva TNT based cards

Andre Dias got 2 stable modes that work with Diamond Viper:

# horizontal 15.77khz vertical 54hz
   Modeline "Viper 550"        9.3 541 561 571 591 255 256 265 290 Interlace

#horizontal 15.77khz 60hz
   ModeLine "SIS 530"       15   800 856 872 952 470 490 510 525 Interlace

The Viper is a TNT card from Diamond and SIS530 is an onboard chipset found at ASUS p5S-B and many other motherboards.

STB Velocity 128

According report I have got STB Velocity 128 does not seem support interlacing at all (missing in firmware??). It can be made to work at a useless risolution like:

# STB Velocity 680x264 for TV
   Modeline "STB Vel128" 14.16 680 728 792 904 264 280 296 313 +hsync +vsync

Other useful Velocity 128 settings to work with XF86_VGA16 server:

Modeline "PALTV2" 14.161  690 728 792 904 271 272 288 313 +hsync +vsync

Modeline "PALTV" 14.16 690 728 792 904 540 544 608  625 interlace +hsync +vsync

Section "Device"
   Identifier      "Primary Card"
   VendorName      "Unknown"
   BoardName       "None"
   Chipset         "3dimage985"
   VideoRam        4096
EndSection

The interlaced seems a "false" interlace cause it suppresses odd lines, the fonts become unreadable and the use of obove interlaced configuration not much worth of use.


Tomi Engdahl <[email protected]>