Nvidia TV-Out

Hopefully you're using an Nvidia video card. Nvidia is kind and has given source to a FreeBSD driver. ATI is unkind and gives us FreeBSD users, well, nothing. First of all, let's install the nvidia driver (it is the same for all nvidia cards).

cd /usr/ports/x11/nvidia-driver
make install clean

Now that the nvidia driver is installed, we have a lot of configuring to do. It might not be a bad idea to backup your old configuration

cd /etc/X11
cp xorg.conf xorg.conf.back
vi xorg.conf

I will now put the relevant pieces from my configuration, and then give an explanation. Alternatively, you can download my entire configuration here.

section "ServerLayout"
    Identifier "layout0"
    Screen 0 "Screen0" 0 0
    InputDevice "Keyboard0" "CoreKeyboard"
    InputDevice "Mouse0" "CorePointer"
EndSection

# use -display :0.1 to use screen 1
section "ServerLayout"
    Identifier "dual"
    Screen 0 "Screen0" 0 0
    Screen 1 "Screen1" RightOf "Screen0"
    InputDevice "Keyboard0" "CoreKeyboard"
    InputDevice "Mouse0" "CorePointer"
EndSection

~snip

Section "Monitor"
    Identifier "Monitor0"
    HorizSync 30.0 - 70.0
    VertRefresh 50.0 - 130.0
    Option "dpms"
EndSection

Section "Monitor"
    Identifier "Monitor1"
    HorizSync 30 - 50
    VertRefresh 30 - 60
    Option "dpms"
EndSection

Section "Device"
    Identifier "nvidia0"
    Driver "nvidia"
    Card "Nvidia Geforce FX 5200"
    Option "nologo" "1"
    BusID "PCI:1:0:0"
    #Screen 0
EndSection

Section "Device"
    Identifier "nvidia1"
    Driver "nvidia"
    Card "Nvidia Geforce FX 5200"
    Option "nologo" "1"
    BusID "PCI:1:0:0"
    Screen 1
EndSection

Section "Screen"
    Identifier "Screen0"
    Device "nvidia0"
    Monitor "Monitor0"
    DefaultDepth 24
    SubSection "Display"
        Depth 24
        Modes "1152x864" "1024x768"
    EndSubSection
EndSection

Section "Screen"
    Identifier "Screen1"
    Device "nvidia1"
    Monitor "Monitor1"
    DefaultDepth 24
    SubSection "Display"
        Depth 24
        Modes "1024x768" "800x600"
    EndSubSection
EndSection

The first is just the regular old server layout. This is what you'll get when you do a regular old startx. The second layout is for when you want to use TV out. I also made a comment in there, so I would remember the flag for starting applications on screen two. I'll explain that later. The first monitor section is your normal monitor. The second is your TV. For a plain old NTSC TV you can probably use the same settings I did. I think both of the device sections should be the same for you as mine. You can rename your card as you like of course. The nologo option will prevent the nvidia logo from coming up when you start X. If you like you can take it out, as to remember whose great card you are using (or not). The first screen will be your normal screen, and the second one is the setup for your TV. Once again, you can probably use the same options as I am. OK, now that xorg.conf is setup, you'll need to exit X, and start it back up again.

One word of caution before you do so however. You will need to make sure that your TV is properly plugged in, otherwise your second screen will appear on top of your first one, rendering X useless. If that happens you can kill it with Ctrl+Alt+Backspace.

startx -- -layout dual

OK, that is how you will start X anytime you want to use TV-Out. When you don't want to do so, you can start it the normal way. Now let's try viewing something to see how this works.

mplayer /path/to/movie -display :0.1

For full screen and other options you'll want to have the terminal you started it in active. Enjoy watching your movie while on the computer. Or playing a movie for your friends while on the computer. Or, however you want to use it. I haven't tested much else, but go ahead and see what other programs you can run using the display flag, and see what interesting ways you can use the TV.