Paco

Personal Content Organiser

Home / Linux

Navigation

Menu

Search

Configuration Nvidia TV-Out

TwinView

NVidia cards have something called TwinView. This uses some built in features in the NVidia drivers to configure the TV-Out. In it's simplest form, it can be set up as a clone of your primary display. It can also be set up as an extension of your desktop, and the resolution can be different on your primary display. Xinerama comes into play here, but not all applications are aware of this (when I checked my packages, these had xinerama support: mplayer, firefox, and thunderbird. Everything else spans over both the LCD and TV and well, it doesn't look right.

'

Xorg

Second, Xorg also can treat the device as seperate displays. This is how I currently have my system set up: by default, my primary display is my LCD screen running at 1280x1024, and the TV-Out is unused. When I want to watch something on my TV, I start a new desktop on the TV and the control switches from my LCD Panel to my TV. When I'm finished, I end the session on the TV, and control returns to my LCD panel. (Keep in mind that my LCD panel's native resolution will not work with my TV. I've found this solution works the best for me.)

Getting Started

Warning

First of all, this guide assumes you have the NVidia drivers set up already. If you don't, it is rather meaningless continuing reading this HOWTO.



What configuration should I use?
This section is a list of possible uses and configurations you may want to try.

I'm trying to use my TV as the primary device (no LCD/CRT.) NVidia's TwinView Clone mode should work for this. This way, if you decide to hook up a CRT/LCD later you should be able to.

I just want the TV to show what the LCD/CRT is currently showing. Use NVidia's TwinView Clone mode.

I'm trying to extend my desktop onto my TV.
Use NVidia's TwinView mode.

I just want to watch stuff on my TV, and don't need both LCD/CRT and TV to be active at the same time.See the Xorg screen setup below.

These are the ones I've tried, and have had working.


NVidia TwinView Clone mode

Warning

REMEMBER: this guide assumes you have the NVidia drivers set up already.


There is one restriction with Clone mode: you must use the same resolution on both your TV and LCD/CRT, which means you must choose a resolution that both devices can display. Both of my TVs will display 1024x768, but it isn't very clear. All TVs should be able to display 800x600.

First thing to do is disable xinerama in Xorg (the NVidia driver provides its own.) Search for the "ServerFlags" section in your xorg.conf, and disable Xinerama:
Section "ServerFlags" ... Option "Xinerama" "false" ... EndSection

With that out of the way, we need to set up the Monitor, Device, and Screen sections in xorg.conf to enable clone mode, an example is below, setting clone mode to 1024x768:
Section "Monitor" Identifier "NEC LCD1760V" HorizSync 31.5-81.1 VertRefresh 56-75 EndSection Section "Device" Identifier "ASUS GEFORCE4" Driver "nvidia" VideoRam 65536 BusID "PCI:2:0:0" Screen 0 Option "TwinView" "true" Option "TwinViewOrientation" "clone" Option "MetaModes" "1024x768,1024x768; 800x600,800x600; 640x480,640x480" Option "SecondMonitorHorizSync" "30-50" Option "SecondMonitorVertRefresh" "60" Option "TVOutFormat" "SVIDEO" Option "TVStandard" "NTSC-M" EndSection Section "Screen" Identifier "Screen 1" Device "ASUS GEFORCE4" Monitor "NEC LCD1760V" DefaultDepth 24 Subsection "Display" Depth 24 Modes "1024x768" "800x600" "640x480" ViewPort 0 0 EndSubsection EndSection


Note

1. For the Monitor section, make sure you set the correct values for the refresh rates (HorizSync/VertRefresh)! The ones shown work with my monitor, but not necessarily yours!

2. You might have to change VideoRAM and BusID to suit your card.

3. If your TV can't display 1024x768, remove 1024x768,1024x768; from the MetaModes line in the Device section, and "1024x768" from the Modes line in the Screen section. This should force Xorg to start in 800x600.

4. Output type: In this example, I am using the SVIDEO output, as stated by the TVOutFormat line in the Device section. The other valid value is COMPOSITE (which is usually a yellow RCA plug.)

5. Region issues: The SecondMonitorHorizSync, SecondMonitorVertRefresh, and TVStandard lines in the Device section are for TVs in North America. You may need to change these values for your region.


NVidia TwinView mode

Warning

REMEMBER: this guide assumes you have the NVidia drivers set up already.


First thing to do is disable xinerama in Xorg (the NVidia drivers provides its own.) Search for the "ServerFlags" section in your xorg.conf, and disable Xinerama:
Section "ServerFlags" ... Option "Xinerama" "false" ... EndSection


Here is a sample xorg.conf that extends the desktop on the TV to the right of the LCD/CRT (the LCD/CRT has a resolution of 1280x1024, the TV 800x600):

Section "Monitor" Identifier "NEC LCD1760V" HorizSync 31.5-81.1 VertRefresh 56-75 EndSection Section "Device" Identifier "ASUS GEFORCE4" Driver "nvidia" VideoRam 65536 BusID "PCI:2:0:0" Screen 0 Option "TwinView" Option "MetaModes" "1280x1024,800x600" Option "TwinViewOrientation" "RightOf" Option "SecondMonitorHorizSync" "30-50" Option "SecondMonitorVertRefresh" "60" Option "TVOutFormat" "SVIDEO" Option "TVStandard" "NTSC-M" Option "Xinerama" "on" EndSection Section "Screen" Identifier "Screen 1" Device "ASUS GEFORCE4" Monitor "NEC LCD1760V" DefaultDepth 24 Subsection "Display" Depth 24 Modes "1280x1024" "1024x768" "800x600" "640x480" ViewPort 0 0 EndSubsection EndSection


Note

1. For the Monitor section, make sure you set the correct values for the refresh rates (HorizSync/VertRefresh)! The ones shown work with my monitor, but not necessarily yours!

2. You might have to change VideoRAM and BusID to suit your card.

3. You can change where the TV is by changing the TwinViewOrientation line in the Device section to something else, such as "LeftOf".

4. To change the resolution, set the MetaModes line in the Device section. As an example, to set the monitor to 1024x768 and the TV to 640x480, try using Option "MetaModes" "1024x768,640x480".

5. Output type: In this example, I am using the SVIDEO output, as stated by the TVOutFormat line in the Device section. The other valid value is COMPOSITE (which is usually a yellow RCA plug.)

6. Region issues: The SecondMonitorHorizSync, SecondMonitorVertRefresh, and TVStandard lines in the Device section are for TVs in North America. You may need to change these values for your region.

7. You might want to add the xinerama use flag to your make.conf and recompile applications that support it. Otherwise, they will span over both monitors when maximized.


Xorg screen setup

Warning

REMEMBER: this guide assumes you have the NVidia drivers set up already.


First thing to do is disable xinerama in Xorg. Search for the "ServerFlags" section in your xorg.conf, and disable Xinerama:
Section "ServerFlags" ... Option "Xinerama" "false" ... EndSection


This section will show how to set up your X server to use the TV as a completely seperate display, and switch to it when needed. To do this, we need to define two Monitor sections, and two Screen sections in addition to the Device and ServerLayout sections.

First, we define the video device (change the VideoRam and BusID if necessary):

Section "Device" Identifier "ASUS GEFORCE4" Driver "nvidia" VideoRam 65536 BusID "PCI:2:0:0" Screen 0 EndSection


Now we need to define the two monitors, the LCD/CRT and the TV. Set your monitor's refresh rates accordingly! Also, you may need to change the TV's refresh rates (the ones shown are for North America):
Section "Monitor" Identifier "NEC LCD1760V" HorizSync 31.5-81.1 VertRefresh 56-75 EndSection Section "Monitor" Identifier "nvidiatv" HorizSync 30-50 VertRefresh 60 EndSection


Now that we have the Monitors and the Video Card defined, now we need to associate them in the Screen section, and define the valid resolutions. When defining the TV section, note the TVStandard setting; the example is shown for North America. Change it if needed.

Section "Screen" Identifier "CRT" Device "ASUS GEFORCE4" Monitor "NEC LCD1760V" DefaultDepth 24 Subsection "Display" Depth 24 Modes "1280x1024" "1024x768" "800x600" "640x480" ViewPort 0 0 EndSubsection EndSection Section "Screen" Identifier "TV" Device "ASUS GEFORCE4" Monitor "nvidiatv" DefaultDepth 24 Option "TVStandard" "NTSC-M" Option "ConnectedMonitor" "TV" Subsection "Display" Depth 24 Modes "800x600" ViewPort 0 0 EndSubSection EndSection


Now we need to tell X to use the CRT when starting up, in the ServerLayout section.

Section "ServerLayout" Identifier "Simple Layout" Screen "CRT" InputDevice "Mouse1" "CorePointer" InputDevice "Keyboard1" "CoreKeyboard" EndSection




Now that the configuration is out of the way, we need to make sure X will load the desktop when it starts. If you haven't done this, now is the time to do it:
# echo "exec startkde" > ~/.xinitrc

Now you should be able to start X and it will load up on your LCD/CRT. Now, to test the TV, turn the TV on, fire up a console and tell X to start a new desktop on it using:
# startx -- :1 -bpp 24 -screen TV


If all is successful, your LCD/CRT will blank, and you will see your desktop loading up on your TV. To return to your LCD/CRT, end your session and the TV will turn off and your monitor will turn on.

Now, I'm rather lazy, so I have copied the startx command into a script, and created an entry on my KDE menu. When I click on it, the desktop starts on the TV. ;) To do this, copy this into /usr/bin/watchtv:

#!/bin/bash startx -- :1 -bpp 24 -screen TV


and then make it executable:
# chmod +x /usr/bin/watchtv


With this done, load up your KDE Menu Editor (or other WM Menu Editor) and add an entry, pointing to the script you just created. If you are using KDE, you might want to make sure the Enable launch feedback is unchecked.

Conclusion



Hopefully one of the 3 solutions presented here will work for you. I found switching the desktop over to the TV was the easiest for me; I would just use my wireless keyboard on the couch and choose stuff to watch.





This HowTo was orginaly published on Gentoo forums!
http://forums.gentoo.org/viewtopic-t-414055.html