在Hoary中设置TV-out(NVIDIA)

参与到Ubuntu的翻译中来
回复
头像
freeflying
帖子: 521
注册时间: 2005-03-26 9:38

在Hoary中设置TV-out(NVIDIA)

#1

帖子 freeflying » 2005-04-08 13:14

HOWTO: TV-out in Hoary (nVidia?) (From Ubuntu WebForums)
My first HOWTO, so don't shout at me, if there is anything wrong
Let me know, if it's working on ATIs card too

Some parts borrowed from Official Gentoo HOWTOs.

Becouse I want to use TV-out only sometimes, eg. to watch movie, listen to music, play in DOOM, or show my little sister kids movie, in this time doing something on my lappy, I had to set up separate screens. So, get up and go work :]

At first, you had to made this in term:

Code:
$ sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup
It will make backup of your x.org config file.
Now, apt-get nvtv by this:

Code:
$ sudo apt-get install nvtv
Next thing which you need to do is edit your xconf file.

Code:
$ sudo gedit /etc/X11/xorg.conf
First thing, which we will change in conf file, will be adding TV as next monitor and changing name of default monitor. Seek for Monitor section, and change monitor identifier to:

Code:
Identifier "Monitor[0]" #CRT
Now, under this section, add following:

Code:
Section "Monitor"
Identifier "Monitor[1]" #TV
HorizSync 60
VertRefresh 30-150
EndSection
If you need, change HorizSync and VertRefresh, but this values should work fine on most new TVs.
Second thing, which we will change in config file, will be adding TV-output as next device and changing name of default device. Seek for Device section, and change monitor identifier to:

Code:
Identifier "Device[0]"
In the same section add:

Code:
screen 0.
Now, under this section, add following:

Code:
Section "Device"
Driver "nvidia"
Identifier "Device[1]"
Screen 1
Option "TVOutFormat" "Composite" #or S-VIDEO etc
Option "TVStandard" "PAL-G" #or NTSC etc
Option "ConnectedMonitor" "Monitor[1]"
BusID "PCI:1:0:0" #adjust using 'lspci' or cat /proc/pci
EndSection
If you are in country which don't use PAL, change it to your TV standard.
Now, seek for Screen section, and change Identifier, Monitor and Screen to following:

Code:
Identifier "Screen[0]"
Device "Device[0]"
Monitor "Monitor[0]"
Under this add:

Code:
Section "Screen"
Device "Device[1]"
Identifier "Screen[1]"
Monitor "Monitor[1]"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1024x768"
EndSubSection
EndSection
And change/add to your config file serverlayout:

Code:
Section "ServerLayout"
Identifier "Simple Layout"
Screen 0 "Screen[0]"
Screen 1 "Screen[1]" RightOf "Screen[0]"
InputDevice "Mouse1" "CorePointer"
InputDevice "Keyboard1" "CoreKeyboard"
EndSection
Remember to check name of your mouse and keyboard, and change it names. You can find names of input devices in Input device section as following:

Code:
Section "InputDevice"
Identifier "Generic Keyboard"
Driver "keyboard"
Option "CoreKeyboard"
Option "XkbRules" "xfree86"
Option "XkbModel" "pc105"
Option "XkbLayout" "gb"
EndSection

Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ImPS/2"
Option "Emulate3Buttons" "true"
Option "ZAxisMapping" "4 5"
EndSection
Identifier is name of device. If name of your input device is diffrent, change Mouse1 or Keyboard1 from above server layout code to your needs.
Now save xorg.conf.
At now, we will add small bash feature, which will let us to run players on second screen easly.
Do following in terminal:

Code:
$ sudo gedit /etc/bash.bashrc
Add following section on end:

Code:
tv()
{
if [ "$1" == "" ]; then
echo "usage: tv program name"
else
DISPLAY=:0.1 $1
fi
}
And you will be able to run e.g. Totem on second display by typing in terminal (or ALT+F2 and checked "Run in terminal"):

Code:
$ tv totem movie.avi

Nice feature for Kubuntu users, which will allow them to run movies from context menu. If somebody know trick like this for GNOME, let me know.
Add this entry to:

Code:
~/.kde/share/apps/konqueror/servicemenus/nameofyourchoice.desktop

Code:
[Desktop Entry]
Actions=PlayOnTV
Encoding=UTF-8
ServiceTypes=video/*

[Desktop Action PlayOnTV]
Exec=mplayer -display localhost:1 %F
Name=Play this movie on TV
Icon=yast_tv
Before you ask! Check twice:
did you changed names of all devices, screens and monitors in xorg.conf?
did you rebooted Xs (by CTRL+ALT+Backspace)
did you ended script in bash.rc by } ?
did you close all sections in xorg.conf?
did you installed nvtv?

Have a nice day!
头像
ct
帖子: 2201
注册时间: 2005-04-06 21:15
来自: 安徽黄山
联系:

HOWTO:在Hoary中设置TV-out(NVIDIA)

#2

帖子 ct » 2005-04-08 15:09

这是我的第一个HOWTO,所以如果不正确请不要骂我,如果有什么问题请你告诉我,如果你用的是ATI的显卡也请告诉我。

一些部分参考了Gentoo的HOWTOs。

由于有时我想使用TV-out功能,比如看电影、听音乐、玩DOOM,或是一边放些儿童片给我的小妹妹,一边在我的本本(lappy)上做点事情,我需要设置分屏显示。所以,让我们开始吧:

首先,你需要输入这条命令:

代码:
$ sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup
这将会备份你的x.org设置文件
然后,这样apt-get下来 nvtv

代码:
$ sudo gedit /etc/X11/xorg.conf
首先我们需要给默认的显示器改名并且添加另一个显示器设备。查找显示器设备,改变它的设置:

代码:
Identifier "Monitor[0]" #CRT
好,完成这部分后,添加如下部分:

代码:
Section "Monitor"
Identifier "Monitor[1]" #TV
HorizSync 60
VertRefresh 30-150
EndSection
如果你需要,可以改变垂直同步和刷新频率,使得它在大部分的新电视上能工作的更好。
然后,我们将通过改变设置文件,改变默认设备的名称并将TV-output添加为第二个设备。找到设备部分,改变显示器设备的配置文件:

代码:
Identifier "Device[0]"
再同样的添加:

代码:
Section "Device"
Driver "nvidia"
Identifier "Device[1]"
Screen 1
Option "TVOutFormat" "Composite" #or S-VIDEO etc
Option "TVStandard" "PAL-G" #or NTSC etc
Option "ConnectedMonitor" "Monitor[1]"
BusID "PCI:1:0:0" #adjust using 'lspci' or cat /proc/pci
EndSection
如果你的国家不使用PAL制式,请改变你的TV设置。
好,找到屏幕设置部分,改变设置,显示器和屏幕这么设置:

代码:
Identifier "Screen[0]"
Device "Device[0]"
Monitor "Monitor[0]"
下面再添加:

代码:
Section "Screen"
Device "Device[1]"
Identifier "Screen[1]"
Monitor "Monitor[1]"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1024x768"
EndSubSection
EndSection
记住检查并设置你的鼠标和键盘型号,你能找到输入设备和输出设备部分的设置就比如这样:

代码:
Section "InputDevice"
Identifier "Generic Keyboard"
Driver "keyboard"
Option "CoreKeyboard"
Option "XkbRules" "xfree86"
Option "XkbModel" "pc105"
Option "XkbLayout" "gb"
EndSection

Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ImPS/2"
Option "Emulate3Buttons" "true"
Option "ZAxisMapping" "4 5"
EndSection
identifier是设备名,如果你的输入设备名不一样,请按需要设置Mouse1或Keyboard1 来覆盖掉系统设置代码。然后当然是保存 xorg.conf文件了。
现在,我们将要添加一个简短的bash特征,可以让我们更方便的在第二个视频设备上运行播放器软件。
在终端里这样输入:

代码:
$ sudo gedit /etc/bash.bashrc
在末尾添加如下内容:

代码:
tv()
{
if [ "$1" == "" ]; then
echo "usage: tv program name"
else
DISPLAY=:0.1 $1
fi
}
你可以通过终端试着运行Torem播放机在第二个显示设备(ALT+F2然后在终端里运行):

代码:
$ tv totem movie.avi

对于Kubuntu的用户很方便,可以通过下拉菜单来播放电影。如果你知道如何在GNOME里也实现类似的效果,请告诉我。添加如下内容:

代码:
~/.kde/share/apps/konqueror/servicemenus/nameofyourchoice.desktop

代码:
[Desktop Entry]
Actions=PlayOnTV
Encoding=UTF-8
ServiceTypes=video/*

[Desktop Action PlayOnTV]
Exec=mplayer -display localhost:1 %F
Name=Play this movie on TV
Icon=yast_tv
问问题之间,请检查两遍:
你在xorg.conf里改变了所有的设备(device)、屏幕(screen)和显示器(monitor)没有?
你有没有重启X(CTRL+ALT+Backspace)?
你有没有在xorg.conf中关闭所有部分?
你有没有安装 nvtv?

祝你好运!
头像
millenniumdark
论坛版主
帖子: 4159
注册时间: 2005-07-02 14:41
系统: Ubuntu 14.04 (Kylin)
联系:

#3

帖子 millenniumdark » 2006-08-01 4:41

不知道有没有过时,先放着
头像
millenniumdark
论坛版主
帖子: 4159
注册时间: 2005-07-02 14:41
系统: Ubuntu 14.04 (Kylin)
联系:

#4

帖子 millenniumdark » 2006-08-01 4:41

不知道有没有过时,先放着
回复