With this howto for your Nvidia graphic card, you can view X simultaneously on your monitor and TV.
This documentation is deprecated. Nowadays we have GUI from Nvidia for settings TV out. Please see this forum thread.
Using TwinView
Backup your xorg.conf
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup
Edit your xorg.conf
gksudo gedit /etc/X11/xorg.conf
What follows is for a 1400x900 display. "..." indicates stuff left out. In the "meta modes" option, we indicate that we are not expecting TV by using a NULL. So the resolutions will probably differ for your device, but you modify the Device section of your xorg.conf file as
Section "Screen" ... Option "TwinView" Option "TVOutFormat" "SVIDEO" Option "TVStandard" "NTSC-M" Option "MetaModes" "1440x900,640x480; 1440x900,NULL; 1024x768,NULL; 800x600,NULL; 640x480,NULL" SubSection "Display" ... Modes "1440x900" "1280x1024" "1024x768" "720x450" "640x480" EndSubSection EndSection
Now save it. If you are using an S-Video cable change "COMPOSITE" to "SVIDEO" If your TV uses PAL change "NTSC-M" to "PAL-B", or other TVStandard. A modestly comprehensive list is available below. You may also change MetaModes to whatever is appropriate for your system!
Note: With a Geforce FX 5200 using Ubuntu Edgy I had to add the following to the Device section in order for the above to work:
Option "ConnectedMonitor" "CRT,TV"
Now you need to restart X
A more complicated way - Running 2 X-Screens
Some cards are not able to use twinview, or you might not have much luck with the above. This configuration will enable you to run 2 X-Screens (one for the TV, the other one for your monitor) what's very handy if you want to use your PC while watching a movie, or running Media Center software like mythtv.
First, backup your original xorg.conf.
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup
Opening up the file with the command gksudo gedit /etc/X11/xorg.conf, you will first need to edit the Device section.
Section "Device" Identifier "Device0" Driver "nvidia" Screen 0 Option "NoLogo" "true" Option "RenderAccel" "true" BusID "PCI:02:09:0" EndSection Section "Device" Identifier "Device1" Driver "nvidia" Screen 1 BusID "PCI:02:09:0" EndSection
The NoLogo and RenderAccel options are completely optional, but it is very important that you put in the BusID. You can find this using lspci or checking the contents of /var/log/Xorg.0.log.
Next, find the Monitor section and edit it as in the following example.
Section "Monitor" Identifier "Monitor" #CRT HorizSync 30-70 VertRefresh 50-140 Option "DPMS" EndSection Section "Monitor" Identifier "Television" #TV HorizSync 30-50 VertRefresh 60 EndSection
The Nvidia documentation suggest that you can use HorizSync values for your TV of 30-50, but I had no luck with that. Running startx with verbose logging can give you the correct values for your television if neither work for you. For your monitor, you can find additional information here
Next, find the Screen section and edit it as in the following example. Naturally, you'll have to supply your own Modelines depending what what resolutions you want / are supported. This example is about as generic as you can get, however, and will work on many TV and CRT combinations.
Section "Screen" Identifier "Screen0" Device "Device0" Monitor "Monitor" DefaultDepth 24 Option "ConnectedMonitor" "CRT" SubSection "Display" Depth 24 Modes "1024x768" "800x600" "640x480" EndSubSection EndSection Section "Screen" Identifier "Screen1" Device "Device1" Monitor "Television" DefaultDepth 24 Option "TVOutFormat" "SVIDEO" Option "TVStandard" "NTSC-M" Option "ConnectedMonitor" "TV" SubSection "Display" Depth 24 Modes "640x480" EndSubSection EndSection
Other TVOutFormat values can be COMPOSITE or SVIDEO, depending on what version of the nvidia drivers you are using (SVIDEO does not work with the 1.0-7667 drivers, do not use the hyphen). The proper value for TVStandard can be found in the table below.
On some systems it is necessary to explicitly set what 'head' that was used with the ConnectedMonitor option. For example 'CRT-0' and 'TV-0'. This is also documented under Multiple X Screens with Nvidia cards. On other systems, specifying this option is known to _prevent_ TV-out from working, possibly with a message like "Unable to find available display devices for screen 1" in Xorg's log/output. Try commenting the ConnectedMonitor lines out if it doesn't work for you.
Finally, find the ServerLayout section and set it up as follows. If you prefer, you can use leftof instead of rightof. Other options can be found in the xorg.conf man page.
Section "ServerLayout" Identifier "Basic Layout" Screen 0 "Screen0" Screen 1 "Screen1" rightof "Screen0" InputDevice "Generic Keyboard" InputDevice "Configured Mouse" EndSection
Now simply restart the X server, and it might actually work. If it doesn't, all errors will be in /var/log/Xorg.0.log, allowing you to find error messages and make the suggested changes.
Finding your TVStandard
Due to various historical reasons, there are two main standards; NTSC in the Americas and Japan, and PAL in Europe and much of the rest of the world. Nvidia also supports HDTV standareds such as 1080i and 720p. This list can also be found in Nvidia's ReadMe
PAL-B |
Australia, Belgium, Denmark, Finland, Germany, Guinea, Hong Kong, India, Indonesia, Italy, Malaysia, The Netherlands, Norway, Portugal, Singapore, Spain, Sweden, and Switzerland |
PAL-D |
China and North Korea |
PAL-G |
Denmark, Finland, Germany, Italy, Malaysia, The Netherlands, Norway, Portugal, Spain, Sweden, and Switzerland |
PAL-H |
Belgium |
PAL-I |
Hong Kong, Ireland, and United Kingdom |
PAL-K1 |
Guinea |
PAL-M |
Brazil |
PAL-N |
France, Paraguay, and Uruguay |
PAL-NC |
Argentina |
NTSC-J |
Japan |
NTSC-M |
Canada, Chile, Colombia, Costa Rica, Ecuador, Haiti, Honduras, Mexico, Panama, Puerto Rico, South Korea, Taiwan, United States of America, and Venezuela |
HD480i |
480 line interlaced |
HD480p |
480 line progressive |
HD720p |
720 line progressive |
HD1080i |
1080 line interlaced |
HD1080p |
1080 line progressive |
HD576i |
576 line interlace |
HD576p |
576 line progressive |
Credits:
An Alternative Way. (Also complicated)
The problem with the above two methods is that you are likely to experience tearing on the tv display as I did. This is because the graphics card only supports video overlay on one screen at a time and by default chooses the AGP/DVI connection. The method described at http://en.wikibooks.org/wiki/NVidia/TV-OUT chooses a setup that will only display one screen at a time, but nevertheless allows you to, for example, launch a movie on your tv screen and when finished go back to your desktop on your monitor. I find this ideal for my mythtv and desktop setup.
A word of advice: The guide describes a script to launch mplayer. In order for this to work, you must change your /etc/X11/Xwrapper.config so that allowed_users=anybody . This might be a security risk.