个人工具

UbuntuHelp:NvidiaTVOut

来自Ubuntu中文

Oneleaf讨论 | 贡献2007年5月13日 (日) 11:42的版本 (New page: {{From|https://help.ubuntu.com/community/NvidiaTVOut}} {{Languages|php5}} With this howto for your Nvidia graphic card, you can view X simultaneously on your monitor and TV. === Using Twi...)

(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航, 搜索

With this howto for your Nvidia graphic card, you can view X simultaneously on your monitor and TV.

Using TwinView

Backup your xorg.conf

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup
</code>

Edit your xorg.conf
<pre>
gksudo gedit /etc/X11/xorg.conf
</code>

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 <code>Device</code> section of your xorg.conf file as
<pre>

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

</code>
Now save it. If you are using an S-Video cable change <code>"COMPOSITE"</code> to <code>"SVIDEO"</code>
If your TV uses PAL change <code>"NTSC-M"</code> to <code>"PAL-B"</code>, or other TVStandard. A modestly comprehensive list is available below.
You may also change <code>MetaModes</code> to whatever is appropriate for your system!

Note: With a Geforce FX 5200 using Ubuntu Edgy I had to add the following to the <code>Device</code> section in order for the above to work:
<pre>
Option "ConnectedMonitor" "CRT,TV"
</code>

'''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 [http://www.mythtv.org/ mythtv]. 


First, backup your original xorg.conf.
<pre>
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup
</code>

Opening up the file with the command <code>gksudo gedit /etc/X11/xorg.conf</code>, you will first need to edit the <code>Device</code> section.

<pre>
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
</code>

The <code>NoLogo</code> and <code>RenderAccel</code> options are completely optional, but it is very important that you put in the <code>BusID</code>. You can find this using <code>lspci</code> or checking the contents of '''/var/log/Xorg.0.log'''.  

Next, find the <code>Monitor</code> section and edit it as in the following example.
<pre>
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
</code>
The Nvidia documentation suggest that you can use <code>HorizSync</code> values for your TV of 30-50, but I had no luck with that.  Running <code>startx</code> 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 [[UbuntuHelp:FixVideoResolutionHowto|here]]

Next, find the <code>Screen</code> section and edit it as in the following example. Naturally, you'll have to supply your own <code>Modelines</code> 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.
<pre>
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
</code>
Other <code>TVOutFormat</code> values can be <code>COMPOSITE</code> or <code>SVIDEO</code>, 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 <code>TVStandard</code> 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 [http://archive.avsforum.com/avs-vb/showthread.php?threadid=438201 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 <code>ServerLayout</code> section and set it up as follows. If you prefer, you can use <code>leftof</code> instead of <code>rightof</code>. Other options can be found in the xorg.conf man page.

<pre>
Section "ServerLayout"
        Identifier      "Basic Layout"
        Screen 0        "Screen0"
        Screen 1        "Screen1" rightof "Screen0"
        InputDevice     "Generic Keyboard"
        InputDevice     "Configured Mouse"
EndSection
</code>

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 [ftp://download.nvidia.com/XFree86/Linux-x86/1.0-7667/README.txt 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: 
* [http://www.ubuntuforums.org/showthread.php?t=50749&highlight=simultaneously+monitor+TV kayas80]
* [ftp://download.nvidia.com/XFree86/Linux-x86/1.0-7667/README.txt Nvidia ReadMe]
----
CategoryHardware CategoryDocumentation
----
=== 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.

[[category:UbuntuHelp]]