Search:  
Gentoo Wiki

HOWTO_Xorg_HDTV


 XOrg IndexConfigurationHIDevices
FontsVideo CardsMonitors  


Contents

Introduction

This HOWTO explains how to get your NVIDIA video card to work with your new HDTV setup in Xorg.

Currently, it is far from complete, as the modelines required for particular televisions/monitors can be different for practically every monitor.

NVIDIA

I will assume you already have the nvidia kernel driver installed, as it is required for some of the tricky stuff we are doing, and I find it tends to be faster and stabler than the normal nv. I will also assume that you have it working on a normal monitor.

EDID Modelines

Most modern monitors/TVs can be probed for (EDID) data concerning their capabilities and requirements.

EDID data are recorded in PROM (programmable read-only) or EEPROM (electrically erasable PROM) memory within the monitor/TV itself. The modelines recorded in the EDID data, are those recommended by the manufacturer (and as such, usually give great results (although occasionally, the manufacturer supplied data is incorrect)).

EDID modelines are recorded for many different monitor/TV screen resolutions.

EDID information includes manufacturer name, product type, phosphor or filter type, timings supported by the display, display size, luminance data and (for digital displays only) pixel mapping data.

On Linux the EDID modelines can be found by running the command:

startx -- -logverbose 6

from the console. The EDID information is written to the file /var/log/Xorg.0.log (or /var/log/XFree86.0.log).

As an example: Some of the EDID data for A Philips 170S 17" TFT.

EDID Version                 : 1.3
Manufacturer                 : PHL
Monitor Name                 : Philips 170S
Product ID                   : 2078
32-bit Serial Number         : 693129
Serial Number String         :  CF  693129
Manufacture Date             : 2003, week 32
DPMS Capabilities            : Standby Suspend Active Off
Prefer first detailed timing : Yes
Supports GTF                 : No
Maximum Image Size           : 340mm x 270mm
Valid HSync Range            : 30.0 kHz - 82.0 kHz
Valid VRefresh Range         : 56 Hz - 76 Hz
EDID maximum pixel clock     : 140.0 MHz
Validating Mode "1280x1024":
  1280 x 1024 @ 60 Hz
  Mode Source: EDID
    Pixel Clock      : 108.00 MHz
    HRes, HSyncStart : 1280, 1328
    HSyncEnd, HTotal : 1440, 1688
    VRes, VSyncStart : 1024, 1025
    VSyncEnd, VTotal : 1028, 1066
    H/V Polarity     : +/+
  Mode is valid.

Validating Mode "1280x960":
  1280 x 960 @ 60 Hz
  Mode Source: EDID
    Pixel Clock      : 108.00 MHz
    HRes, HSyncStart : 1280, 1376
    HSyncEnd, HTotal : 1488, 1800
    VRes, VSyncStart :  960,  961
    VSyncEnd, VTotal :  964, 1000
    H/V Polarity     : +/+
  Mode is valid.

Validating Mode "1152x864":
  1152 x 864 @ 70 Hz
  Mode Source: EDID
    Pixel Clock      : 96.76 MHz
    HRes, HSyncStart : 1152, 1224
    HSyncEnd, HTotal : 1344, 1536
    VRes, VSyncStart :  864,  865
    VSyncEnd, VTotal :  868,  900
    H/V Polarity     : -/+
  Mode is valid.

and many more such. 

The modelines obtained from the three results above, are:

ModeLine "1280x1024_60.00" 108.0  1280 1328 1440 1688 1024 1025 1028 1066 +hsync +vsync
ModeLine "1280x960_60.00"  108.0  1280 1376 1488 1800 960  961  964  1000 +hsync +vsync
ModeLine "1152x864_70.00"   96.76 1152 1224 1344 1536 864  865  868  900  -hsync +vsync

The term in the quotes, e.g., 1280x1024_60.00, is just a user defined name for the mode.

Also see: A list of Common Video Mode-Lines.

Monitor Section

The most important section is the monitor section. This contains what modes you find that your TV can do. Here is the one for my Philips 30" CRT (Model No. 30PW9100D).

File: /etc/X11/xorg.conf
Section "Monitor"
       Identifier      "Philips30"
       VendorName      "Philips"
       ModelName       "HD30"
       Option          "IgnoreEDID"
       VertRefresh     30-90
       HorizSync       20-150
       ModeLine        "720p" 73.825 1280 1320 1368 1640 720 722 724 751 +hsync +vsync
       ModeLine "1080i" 74.52 1920 1952 2016 2208 1080 1084 1096 1126 -hsync -vsync interlace
       DisplaySize             320 180
       #DisplaySize            1085.34125 610.504451
EndSection

A note on the last bit. Normally, you should tell it your exact height and width of the screen in this, but in the case, I lied (the real one is commented out). If I don't lie, then X will automatically select fonts that are unreadable from the comfort of my couch, so I reduced it down a bit (maintaining the aspect ratio) so that I can read text from far away. Tune to your own discretion.

The IgnoreEDID option is required because sometimes your TV doesn't know what's good for it, and it will lie to your video card. And X is silly and listens to what your TV says if you let it (for instance, lazy Philips programmers decided to not change the EDID for my TV from a different, lower sized model, resulting in inappropriate modelines).

It took me forever to find the right modelines. The interlaced mode 1080i looks like crap for me though, so I normally use the 720p setting, which gives a nice, sharp display, with quite a bit of overscan. Luckily, since I am using MythTV, I can use software to counter-act the overscan.

Finding the modelines is a matter of lots of luck. At the end of this I will post all of the modelines I have found, although most do not work on my TV, maybe they will for you.

Nvidia Settings

Your mileage may vary based on what particular chipset you have. The following is what I need for my GeForce4 Ti 4200 AGP 8x. (Obviously, the BoardName, VendorName, and BusID might be different on your system).

File: /etc/X11/xorg.conf
Section "Device"
       Identifier  "Card0"
       Driver      "nvidia"
       VendorName  "nVidia Corporation"
       BoardName   "NV28 [GeForce4 Ti 4200 AGP 8x]"
       BusID        "PCI:1:0:0"
       Option       "RenderAccel" "true"
       Option       "UseEvents" "True"
       Option       "AllowGLXWithComposite" "true"
       Option       "ConnectedMonitor" "DFP"
       #Option       "NoLogo" "1"
EndSection

Specifically, mine is using the DVI interface on the computer to an HDMI interface on the television. If you want to use VGA out, just change the ConnectedMonitor portion from "DFP" to "CRT". But be careful, often you need to specify which VGA port, as if you have a DVI and a VGA, the VGA port is often referred to as "CRT-1", and the DVI as "CRT-0" and "DFP".

I normally have the NoLogo option turned on so I don't see the Nvidia screen when X starts, but it can be kind of reassuring while testing.


Small edit by Ro@dRunn3R, for recent nvidia drivers, always activate the option(do NOT activate this on 7900 cards!!!): Option "UseEvents" "True", this reduces the X overhead when playing HD movies more then 30% (for more info: see the nvidia README's or google :))

Alternate Nvidia Settings

I was able to achieve 1080i display on my HDTV by letting the nvidia driver determine the correct settings using EDID with the latest nvidia driver.(>= 1.0.8672) Older versions on this driver required disabling EDID because it would only set up a 720x480p display on my TV. nVidia version 1.0.8672 added options for fine tuning EDID. I first downloaded and compiled the new nvidia tool: nvidia-xconfig(is it in portage?) which I used to generate a xorg.conf file. I then start X windows from the command line using: startx -- -logverbose 6

This option adds EDID information in the file /var/log/Xorg.0.log. At the end of this file, each EDID reported mode is listed, if it is invalid and why it is invalid. Here again, the first time I did this, the nvidia drive had select 720x480p. Checking in the log file I saw that nvidia was not validating 1920x1080 mode because the Horizaontal Frequency was .8 Hz out of the Frequency range my HDTV was reporting. I added the option "ModeValidation" to xorg.conf and after a few tries found the following line worked for my TV: Option "ModeValidation" "NoMaxSizeCheck, NoHorizSyncCheck, NoVertRefreshCheck"

Great but what about Overscan? My quick fix is to use KDE panels. I added a custom size panel bar to the top, bottom, left and right sides of the screen so that the only part of screen where windows are placed is in the visible region.

Screen Section

This is the section of /etc/X11/xorg.conf that actually tells the computer what to display. Here are the contents for my particular TV, although all others should be fairly similar.

File: /etc/X11/xorg.conf
Section "Screen"
   Identifier "Screen0"
   Device     "Card0"
   Monitor    "Philips30"
   DefaultDepth 24
   SubSection "Display"
       Viewport   0 0
       Depth     24
       Modes "720p"
   EndSubSection
EndSection


PowerStrip

There is a utility for Windows called PowerStrip that can help you fine tune your monitor. However, this utility is not free, and does not work with Linux.

I have used it, but found it a bit confusing, and managed to solve my problem without it.

[Note] Powerstrip can help you find the correct mode for your HDTV under windows in a much friendlier way than xvidtune under linux for instance, although it is 'powerful' and 'complex'. You can then use it and its special feature to output the so found modeline for .. xorg !

Troubleshooting

Here are some tips that might help you out. YMMV.

  1. Turn your computer on when the TV is on. Basically, if your computer is turned on with no monitors hooked up, it will tell X that there are no monitors hooked up, even if you hook one up later. So boot your computer up while it is hooked up to the TV.
  2. Turn your TV on when the computer is on. Although this might seem contradictiory with the previous tip, it is not. If you booted the computer up with it plugged into the TV, then you might still need to reboot the TV to get it to recognize the monitor. This seems to be especially prevelant with HDMI connections, as they are very picky.
  3. Ctrl-Alt-Backspace. In case you didn't know, Ctrl-Alt-Backspace is the combination to shut down X. If you have X start on boot, it will actually restart X. It is useful to have another computer to hack your /etc/X11/xorg.conf file in case you can no longer see the screen.


Some linux (xterm)utilities which might help you in getting correct modeline for your Monitor/HDTV

xvidtune: It allows you to shrink, expand and move your screen. When you are satisfied with your screen, it will generate ModeLine for you.

xrandr: It allows you to change resolution and refrest rate.

Appendix: All Modelines

Note: Based on the specs of your monitor, you can create your modelines using the wonderful page xtiming

Here are all of the modelines I hunted for on the Internet. Not all are given credit where it is due. This is not intentional, I am merely putting this up to help someone in need who might be looking for some elusive modeline to get their TV working.

File: Additional Modelines for /etc/X11/xorg.conf
#ModeLine "ATSC-720p60Hz" 74.160 1280 1352 1392 1648 720 725 730 750
#ModeLine "My480p" 28.6 720 744 768 900 480 484 492 525
#ModeLine "My540p" 37.26 960 976 1008 1104 540 542 548 563 +hsync +vsync
#ModeLine "My720p"  73.825 1280 1320 1368 1640 720 722 724 751 +hsync +vsync # 74.086 MHz 44.955 kHz 5$
#ModeLine "My720p2" 73.825 1280 1320 1368 1640 720 722 724 751 +hsync +vsync # 74.086 MHz 44.955 kHz 5$
#ModeLine "My1080i" 79.84 1920 2040 2200 2368 1080 1090 1106 1125 +vsync -hsync interlace
#ModeLine "My1080i2" 74.52 1920 1952 2016 2208 1080 1084 1096 1126 -hsync -vsync interlace
#ModeLine "Another1080i" 74.250 1920 1960 2008 2200 1080 1084 1096 1126 interlace -hsync -vsync
#Modeline "My1920x1080_i" 74.52 1920 1952 2016 2208 1080 1084 1096 1126 -HSync -VSync Interlace
#Modeline "in1080_i" 74.52 1760 1888 2096 2208 960 1012 1028 1126 -HSync -VSync Interlace
#Modeline "1920x1080_59i" 76.11 1920 1952 2240 2272 1080 1104 1110 1135 interlace
#Modeline "1920x1080_60i" 77.60 1920 1952 2240 2272 1080 1104 1110 1135 interlace
#Modeline "1920x1080_61i" 79.08 1920 1952 2248 2280 1080 1104 1110 1135 interlace
#Modeline "1776x1000_60i" 65.91 1776 1808 2056 2088 1000 1023 1028 1051 interlace
#Modeline "1920x1080_30" 77.60 1920 1952 2240 2272 1080 1104 1110 1135
#Modeline "1760x960_60i" 62.39 1760 1792 2024 2056 960 982 987 1009 interlace
#Modeline "1280x720_60.00" 74.25 1280 1352 1432 1648 720 725 730 750 -hsync -vsync
#Modeline "1280x720_50.00" 74.25 1280 1360 1400 1984 720 725 730 750 -hsync -vsync
#
#Analog-RegularModes
#ModeLine "NTSCspec-59.94i" 14.318 768 784 848 910 483 484 492 525 Interlace
#ModeLine "NTSCspec-59.94p" 28.636 768 784 848 910 483 484 492 525
#ModeLine "Laserdisk-59.94i" 567 583 647 684 483 484 492 525 Interlace
#ModeLine "Laserdisk-59.94p" 567 583 647 684 483 484 492 525
#ModeLine "Broadcast-59.94i" 483 484 492 525 Interlace
#ModeLine "Broadcast-59.94p" 483 484 492 525
#ModeLine "VHS-59.94i" 483 484 492 525 Interlace
#ModeLine "VHS-59.94p" 483 484 492 525
#
#DVD-NativeModes
#ModeLine "NTSC-DVD-59.94i" 13.5 720 736 800 858 480 484 492 525 Interlace
#ModeLine "NTSC-DVD-60i" 13.514 720 736 800 858 480 484 492 525 Interlace
#ModeLine "NTSC-DVD-59.94p" 27.0 720 736 800 858 480 484 492 525
#ModeLine "NTSC-DVD-60p" 27.027 720 736 800 858 480 484 492 525
#ModeLine "NTSC-DVD-71.93p" 32.4 720 736 800 858 480 484 492 525
#ModeLine "NTSC-DVD-72p" 32.432 720 736 800 858 480 484 492 525
#ModeLine "NTSC-DVD-119.88p" 54.0 720 736 800 858 480 484 492 525
#ModeLine "NTSC-DVD-120p" 54.054 720 736 800 858 480 484 492 525
#
#DILA-Projector-NativeModes
#ModeLine "DILA-47.95p" 91.493 1360 1464 1608 1800 1024 1026 1028 1060
#ModeLine "DILA-48p" 91.584 1360 1464 1608 1800 1024 1026 1028 1060
#ModeLine "DILA-50p" 95.4 1360 1464 1608 1800 1024 1026 1028 1060
#ModeLine "DILA-59.94p" 114.366 1360 1464 1608 1800 1024 1026 1028 1060
#ModeLine "DILA-60p" 114.48 1360 1464 1608 1800 1024 1026 1028 1060
#ModeLine "DILA-71.93p" 137.239 1360 1464 1608 1800 1024 1026 1028 1060
#ModeLine "DILA-72p" 137.376 1360 1464 1608 1800 1024 1026 1028 1060
#ModeLine "DILA-MarkR-71.997" 139.202 1360 1464 1608 1824 1024 1026 1028 1060
#
#DTV-StandardModes
#ModeLine "ATSC-480-59.94i" 11.958 640 664 736 760 480 484 492 525 Interlace
#ModeLine "ATSC-480-60i" 11.97 640 664 736 760 480 484 492 525 Interlace
#ModeLine "ATSC-480-59.94p" 23.916 640 664 736 760 480 484 492 525
#ModeLine "ATSC-480-60p" 23.94 640 664 736 760 480 484 492 525
#ModeLine "ATSC-480a-59.94i" 11.958 640 664 736 760 480 484 492 525 Interlace
#ModeLine "ATSC-480a-60i" 11.97 640 664 736 760 480 484 492 525 Interlace
#ModeLine "ATSC-480a-59.94p" 23.916 640 664 736 760 480 484 492 525
#ModeLine "ATSC-480a-60p" 23.94 640 664 736 760 480 484 492 525
#ModeLine "ATSC-720-59.94p" 74.176 1280 1320 1376 1650 720 722 728 750
#ModeLine "ATSC-720-60p" 74.25 1280 1320 1376 1650 720 722 728 750
#ModeLine "ATSC-1080-59.94i" 74.176 1920 1960 2016 2200 1080 1082 1088 1125 Interlace
#ModeLine "ATSC-1080-60i" 74.25 1920 1960 2016 2200 1080 1082 1088 1125 Interlace
#ModeLine "ATSC-1080-59.94p" 148.352 1920 1960 2016 2200 1080 1082 1088 1125
#ModeLine "ATSC-1080-60p" 148.5 1920 1960 2016 2200 1080 1082 1088 1125
#
#DTV-MovieModes
#ModeLine "ATSC-480-71.93p" 28.699 640 664 736 760 480 484 492 525
#ModeLine "ATSC-480-72p" 28.728 640 664 736 760 480 484 492 525
#ModeLine "ATSC-480-119.88p" 47.832 640 664 736 760 480 484 492 525
#ModeLine "ATSC-480-120p" 47.88 640 664 736 760 480 484 492 525
#ModeLine "ATSC-720-71.93p" 89.011 1280 1296 1360 1650 720 722 728 750
#ModeLine "ATSC-720-72p" 89.1 1280 1296 1360 1650 720 722 728 750
#ModeLine "ATSC-720-119.88p" 148.351 1280 1296 1360 1650 720 722 728 750
#ModeLine "ATSC-720-120p" 148.5 1280 1296 1360 1650 720 722 728 750
#ModeLine "ATSC-1080-71.93i" 1920 1960 2016 2200 1080 1082 1088 1125 Interlace
#ModeLine "ATSC-1080-72i" 1920 1960 2016 2200 1080 1082 1088 1125 Interlace
#ModeLine "ATSC-1080-71.93p" 178.022 1920 1960 2016 2200 1080 1082 1088 1125
#ModeLine "ATSC-1080-72p" 178.2 1920 1960 2016 2200 1080 1082 1088 1125
#
#DTV-PCTweakedModes
#ModeLine "NTSC-59.94i" 14.35 768 808 864 912 483 485 491 525 Interlace
#ModeLine "NTSC-59.94p" 28.699 768 808 864 912 483 485 491 525
#ModeLine "NTSC-DVD-59.94i" 13.469 720 760 816 856 480 482 488 525 Interlace
#ModeLine "NTSC-DVD-60i" 13.482 720 760 816 856 480 482 488 525 Interlace
#ModeLine "NTSC-DVD-59.94p" 26.937 720 760 816 856 480 482 488 525
#ModeLine "NTSC-DVD-60p" 26.964 720 760 816 856 480 482 488 525
#ModeLine "NTSC-DVD-71.93p" 32.324 720 760 816 856 480 482 488 525
#ModeLine "NTSC-DVD-72p" 32.357 720 760 816 856 480 482 488 525
#ModeLine "ATSC-480-59.94p" 23.916 640 664 736 760 480 482 488 525
#ModeLine "ATSC-480-60p" 23.94 640 664 736 760 480 482 488 525
#ModeLine "ATSC-480-71.93p" 28.699 640 664 736 760 480 482 488 525
#ModeLine "ATSC-480-72p" 28.728 640 664 736 760 480 482 488 525
#ModeLine "ATSC-720-59.94p" 74.086 1280 1320 1376 1648 720 722 728 750
#ModeLine "ATSC-720-60p" 74.16 1280 1320 1376 1648 720 722 728 750
#ModeLine "ATSC-720-71.93p" 88.903 1280 1320 1376 1648 720 722 728 750
#ModeLine "ATSC-720-72p" 88.992 1280 1320 1376 1648 720 722 728 750
#ModeLine "ATSC-1080-59.94i" 74.176 1920 1960 2016 2200 1080 1082 1088 1125 Interlace
#ModeLine "ATSC-1080-60i" 74.25 1920 1960 2016 2200 1080 1082 1088 1125 Interlace
#ModeLine "ATSC-1080-59.94p" 148.352 1920 1960 2016 2200 1080 1082 1088 1125
#ModeLine "ATSC-1080-60p" 148.5 1920 1960 2016 2200 1080 1082 1088 1125
#ModeLine "ATSC-1080-71.93p" 178.022 1920 1960 2016 2200 1080 1082 1088 1125
#ModeLine "ATSC-1080-72p" 178.2 1920 1960 2016 2200 1080 1082 1088 1125

#Others people have sent me
#ModeLine "Pioneer1280x768" 81 1280 1304 1440 1688 768 769 777 802
#ModeLine "Mitsubishi-WD52725-1200x666 74.556 1200 1296 1432 1664 666 694 697 746 -hsync -vsync

#This modeline is reported to work on:
# - Toshiba REGZA HDTV, models 52RV530U / 46RV530U / 42RV530U / 37RV530U / 32RV530U
# - Toshiba 26" A3030 LCD TV, even if Toshiba says it only takes 1024x768 from VGA input
# - Samsung LE32R51B / LE26Rx / LE26M5 / LE37R4 / LE40R5
# - Viewsonic N3760W
#Modeline "HDTV-1360x768" 85.500 1360 1424 1536 1792 768 771 777 795 +Hsync +Vsync
Retrieved from "http://www.gentoo-wiki.info/HOWTO_Xorg_HDTV"

Last modified: Mon, 22 Sep 2008 22:22:00 +0000 Hits: 41,543