Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Other Community Discussions > Tutorials & Tips
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Tutorials & Tips
The place to find Ubuntu related Tips & Tricks.

 
Thread Tools Display Modes
Old April 3rd, 2005   #1
Promethe
5 Cups of Ubuntu
 
Join Date: Mar 2005
Beans: 18
HOWTO: TV-out in Hoary (nVidia?)

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!

Last edited by Promethe; April 3rd, 2005 at 08:16 AM..
Promethe is offline   Reply With Quote
Old April 3rd, 2005   #2
bihe
Just Give Me the Beans!
 
bihe's Avatar
 
Join Date: Dec 2004
Location: Austria / Hallein
Beans: 49
Ubuntu 7.10 Gutsy Gibbon
Send a message via ICQ to bihe
Smile Re: HOWTO: TV-out in Hoary (nVidia?)

really cool howto. i will use it for my dvr box in the living room
bihe is offline   Reply With Quote
Old April 3rd, 2005   #3
Bo Rosén
A Carafe of Ubuntu
 
Bo Rosén's Avatar
 
Join Date: Oct 2004
Location: Sweden
Beans: 117
Re: HOWTO: TV-out in Hoary (nVidia?)

Great initiative, well done.
One thing though, I don't think nvtv works will all nvidia cards.
Bo Rosén is offline   Reply With Quote
Old April 7th, 2005   #4
Klin'Targ
Just Give Me the Beans!
 
Join Date: Apr 2005
Beans: 48
Re: HOWTO: TV-out in Hoary (nVidia?)

Quote:
Originally Posted by Bo Rosén
Great initiative, well done.
One thing though, I don't think nvtv works will all nvidia cards.
This is true, and my card is one of them (Geforce 420 GO). I got tv-out working via an alternate method though. Simply add this to the Device section of your xorg.conf file:
Code:
Option "TwinView" "true"
Option "TwinViewOrientation" "Clone"
Option "TVOutFormat" "COMPOSITE"
Option "TVStandard" "NTSC-M"
Option "SecondMonitorHorizSync" "30-50"
Option "SecondMonitorVertRefresh" "60"
Option "MetaModes" "1024x768,1024x768;800x600,800x600;640x480,640x480;512x384,512x384"
You can set MetaModes, TVStandard and TVOutFormat to whatever is appropriate to your setup.
The way this works is if you have a tv plugged in when the x server starts, it will clone your main screen, if you don't it will ignore this section. So, if you want to watch something on a tv, just connect the cable and restart the x server. Arguably this is not as elegant as the nvtv solution, but it is less complex and seems to work on my hardware at least.

Last edited by Klin'Targ; April 8th, 2005 at 12:01 AM..
Klin'Targ is offline   Reply With Quote
Old April 8th, 2005   #5
Promethe
5 Cups of Ubuntu
 
Join Date: Mar 2005
Beans: 18
Re: HOWTO: TV-out in Hoary (nVidia?)

Klin - above solution let's you create two diffrent, independent from each other X sessions - so you can play DOOM 3 on one, and on second you can watch newest SG-1
Your solution lets only clone desktop...
Promethe is offline   Reply With Quote
Old April 8th, 2005   #6
RedDwarf
Gee! These Aren't Roasted!
 
Join Date: Feb 2005
Beans: 159
Re: HOWTO: TV-out in Hoary (nVidia?)

If you want to play Doom3 and watch SG-1 on new cards (without nvtv nor TwinView):

Code:
Section "Monitor"
    Identifier "monitor1"
    VendorName "LG"
    HorizSync 30-71
    VertRefresh 50-160
EndSection

Section "Monitor"
    Identifier "monitor2"
    VendorName "Philips"
    HorizSync 30-40
    VertRefresh 50
    DisplaySize 412 310
    ModeLine "720x576/50p" 27 720 744 800 864 576 581 583 625 #27.0 MHz, 31.2 kHz, 50.0 Hz
    Modeline "800x600/50p" 31.60 800 824 968 1000 600 602 603 632 #31.6 MHz, 31.6 kHz, 50.0 Hz
EndSection

Section "Device"
    Identifier "device1"
    VendorName "nVidia"
    BoardName "NVIDIA GeForce FX5200"
    Driver "nvidia"
    Option "DPMS"
    Option "NoLogo" "true"
    Option "RenderAccel" "true"
    BusID  "PCI:1:0:0"
    Option "ConnectedMonitor" "CRT"
    Option "HWCursor" "On"
    Option "NvAGP" "2"
    Screen 0
EndSection

Section "Device"
    Identifier "device2"
    VendorName "nVidia"
    BoardName "NVIDIA GeForce FX5200"
    Driver "nvidia"    
    Option "NoLogo" "true"
    Option "RenderAccel" "true"
    BusID  "PCI:1:0:0"
    Option "ConnectedMonitor" "TV"
    Option "TVStandard" "PAL-B"
    Option "TVOutFormat" "SVIDEO"
    Option "IgnoreEDID" "true"
    Option "HWCursor" "On"
    Option "NvAGP" "2"
    Screen 1
EndSection

Section "Screen"
    Identifier "screen1"
    Device "device1"
    Monitor "monitor1"
    DefaultColorDepth 24
    
    Subsection "Display"
        Depth 8
        Virtual 1024 768
    EndSubsection
    
    Subsection "Display"
        Depth 15
        Virtual 1024 768
    EndSubsection
    
    Subsection "Display"
        Depth 16
        Virtual 1024 768
    EndSubsection
    
    Subsection "Display"
        Depth 24
        Virtual 1024 768
    EndSubsection
EndSection

Section "Screen"
    Identifier "screen2"
    Device "device2"
    Monitor "monitor2"
    DefaultColorDepth 24
EndSection

Section "ServerLayout"
    Identifier "layout0"
    InputDevice "Keyboard1" "CoreKeyboard"
    InputDevice "Mouse1" "CorePointer"
    Screen 0 "screen1"
    Screen 1 "screen2" rightOf "screen1"
EndSection
Note this is MY x.org, there are extra options not needed and I use a PAL 50Hz TV (1024 is supported, but I still have to find a 1024x768 50Hz modeline that is accepted).

But this is explained better on the readme of nVidia drivers. Basically you must create two "Screen", "Device" and "Monitor" and use that 'Screen 1 "screen2" rightOf "screen1"' on "ServerLayout".
In "Device" is VERY IMPORTANT to put "BusID" and "Screen".
RedDwarf is offline   Reply With Quote
Old April 15th, 2005   #7
chronos
First Cup of Ubuntu
 
Join Date: Apr 2005
Location: Espoo, Finland
Beans: 6
Ubuntu 6.06 Dapper
Re: HOWTO: TV-out in Hoary (nVidia?)

Thanks for the nice howto, I think I got it working. Is it somehow possible to switch completely to the tv screen, so that I could use mouse and everything there? The tv-script works with totem at least, but it's not too convenient when you have to use keyboard shortcuts and stuff...

edit: some typos
__________________
Currently running Ubuntu 6.06 LTS Server Edition
chronos is offline   Reply With Quote
Old April 15th, 2005   #8
dermotti
Dark Roasted Ubuntu
 
dermotti's Avatar
 
Join Date: Feb 2005
Location: Minnesota
Beans: 778
Send a message via ICQ to dermotti Send a message via AIM to dermotti Send a message via MSN to dermotti Send a message via Yahoo to dermotti
Re: HOWTO: TV-out in Hoary (nVidia?)

Wow i cant wait to try this at home
dermotti is offline   Reply With Quote
Old April 15th, 2005   #9
yarc
First Cup of Ubuntu
 
Join Date: Dec 2004
Location: Umeå, Sweden
Beans: 2
Re: HOWTO: TV-out in Hoary (nVidia?)

Is there any way to disable mouse-switching-thingy. So it doesent swith screen when moving the mousecursor to the edge of the screen.
yarc is offline   Reply With Quote
Old April 15th, 2005   #10
chronos
First Cup of Ubuntu
 
Join Date: Apr 2005
Location: Espoo, Finland
Beans: 6
Ubuntu 6.06 Dapper
Re: HOWTO: TV-out in Hoary (nVidia?)

Quote:
Originally Posted by yarc
Is there any way to disable mouse-switching-thingy. So it doesent swith screen when moving the mousecursor to the edge of the screen.
Hehe, thanks for answering my question... I didn't notice that
__________________
Currently running Ubuntu 6.06 LTS Server Edition
chronos is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:08 AM.


vBulletin ©2000 - 2010, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. bilberry