Previous Page
Next Page

3.4. Using Dual Video Output

The video circuits of most laptops support two video outputs: one to the built-in LCD panel and one for external devices. The external output is not enabled by default, but you can switch between the internal and external displays using a function key.

More advanced configurations of the two outputs are supported by some video cards. For example, you can configure a single large desktop spanning both displays, or set up the external display to show a subset of what is shown on the internal display.

3.4.1. How Do I Do That?

Output from one card to multiple monitors is supported only by some drivers. The most commonly used ones are the NVIDIA and ATI proprietary drivers, and the open source Radeon driver. All of these drivers have some limitations; for example, the NVIDIA driver, when used on a laptop, will always configure an external monitor as primary (screen 0), and the ATI drivers permit only general monitor positioning (you can specify that one monitor is to the right of another, but you can't indicate a difference in their vertical alignment).

3.4.1.1. Configuring dual video on an NVIDIA card

Note that for the changes described in this section to take effect, you will need to restart the X server in one of these ways: changing to runlevel 3 and then back to 5, restarting the system, or terminating the running X server with Ctrl-Alt-Backspace (save your work first!).

First, configure and test your system using the NVIDIA proprietary driver (see Lab 5.3, "Using Repositories"), and then add the highlighted lines to the Device section of your /etc/X11/xorg.conf file:

Section "Device"
        Identifier "Card0"
        Driver     "nvidia"
        VendorName "nVidia Corporation"
        BoardName  "NV34 [GeForce FX 5200]"
        BusID      "PCI:1:0:0"

        Option     "TwinView"
        Option     "SecondMonitorHorizSync"   "31.0 - 80.0"
        Option     "SecondMonitorVertRefresh" "50.0 - 75.0"
        Option     "TwinViewXineramaInfo"     "on"

        Option     "MetaModes"                "800x600,1024x768"
        Option     "TwinViewOrientation"      "LeftOf"
EndSection

The SecondMonitorHorizSync and SecondMonitorVertRefresh options configure the horizontal and vertical frequency ranges for the second monitor (the settings for the primary monitor are in the Monitor section of the file). The values given here are reasonable for most small monitors. The TwinViewXineramaInfo line configures the driver to inform applications about the fact that the desktop is on two screens, so that windows can be placed intelligently (avoiding dialog boxes that span both screens, for example).

The MetaModes option configures the relative sizes of the two screens; the first screen is always the external display. The TwinViewOrientation specifies the position of the second display relative to the first for the purpose of mouse movement and window positioning (possible values are Above, Below, LeftOf, or RightOf).

For finer control over the monitor relationships, the positions of each monitor may be specified in the MetaModes line as an absolute position within the entire desktop. These values are given in the form + X + Y after each resolution; for example, "800x600+0+0,1024x768+800+0" specifies that the primary monitor is to the left of the secondary monitor and that the two monitors are aligned at the top, and "800x600+1024+168,1024x768+0+0" specifies that the primary monitor is on the right and that the monitors are aligned at the bottom (168 pixels is the difference between the two monitor heights, 768 and 600 pixels).

When using the external monitor connection for projection, it can be convenient to project a subset of what is shown on the laptop's panel. Using the NVIDIA driver, this can be configured by overlapping the two display regions using the MetaModes option. On a laptop with a 1400x1050 display, for example, you can project an 800x600 pixel subset to your audience:

Section "Device"
        Identifier "Card0"
        Driver     "nvidia"
        VendorName "nVidia Corporation"
        BoardName  "NV34 [GeForce FX 5200]"
        BusID      "PCI:1:0:0"

        Option     "TwinView"
        Option     "SecondMonitorHorizSync"   "31.0 - 80.0"
        Option     "SecondMonitorVertRefresh" "50.0 - 75.0"
        Option     "TwinViewXineramaInfo"     "on"

        Option     "MetaModes"      "800x600+200+200,1400x1050+0+0"
EndSection

When you restart the X server, the GNOME panel bars will be located in the middle of the screen, because the smaller 800x600 subset display is considered "Primary." Drag the panels to the top and bottom of the laptop display. You can then start an application and position the portion of the window that you wish to display into the 800x600 pixel area that starts 200 pixels down and 200 pixels to the right of the upper-left corner of the screen.

This works well with OpenOffice.org Impress in "Normal" mode, which displays three panes, including the current image in the center and a preview of slides on the left (the panes can be rearranged if it is more convenient to see the preview on the right). Reposition the dividing line between the panes and scroll the center pane until the current slide completely fills the external display.

This configuration enables you to preview the slides using the OpenOffice.org preview plane as shown in Figure 3-22 without changing the projected slide. Once you select and then click on a slide, it becomes the current slide and is displayed both in the center plane of the LCD image and on the external projector, shown in Figure 3-23.

Figure 3-22. LCD display, including slide preview pane (right)


Figure 3-23. Projected 800 600 subset of LCD image, showing only the current slide


3.4.1.2. Configuring dual video on an ATI graphics card using the open source driver

First, configure and test your system using the ATI open source driver radeon, and then add the lines highlighted in bold to the Device section of your /etc/X11/xorg.conf:

Section "Device"
        Identifier "Card0"
        Driver     "radeon"
        VendorName "ATI"
        BoardName  "ATI 7500"
        BusID      "PCI:1:0:0"

        Option     "MergedFB"       "on"
        Option     "CRT2HSync"      "31.0 - 80.0"
        Option     "CRT2VRefresh"   "50.0 - 75.0"
        Option     "MergedXinerama" "on"

        Option     "MetaModes"      "800x600-1024x768"
        Option     "CRT2Position"   "RightOf"
EndSection

The MergedFB option enables dual video output. CRT2HSync and CRT2VRefresh set the horizontal and vertical frequency ranges for the second monitor (the settings for the primary monitor are in the Monitor section of the file), and the MetaModes option sets the resolution of the two displays. MergedXinerama enables sending display hints to applications, and CRT2Position sets the the position of the second display relative to the first for the purpose of mouse movement and window positioning (possible values are Above, Below, LeftOf, or RightOf).

Restart the X server by changing to runlevel 3 and then back to 5, by restarting the system, or by terminating the running X server with Ctrl-Alt-Backspace (save your work first!). When the X server restarts, both displays should be active.

3.4.1.3. Configuring dual video on an ATI video card using the ATI closed source driver

The ATI closed source driver is configured in much the same way as the other drivers. First, configure and test your system using the ATI closed source driver fglrx, and then add the lines highlighted in bold to the Device section of your /etc/X11/xorg.conf:

Section "Device"
        Identifier "Card0"
        Driver     "fglrx"
        VendorName "ATI"
        BoardName  "ATI 7500"
        BusID      "PCI:1:0:0"

        Option     "DesktopSetup"   "0x00000200"
        Option     "HSync2"         "31.0 - 80.0"
        Option     "VRefresh2"      "50.0 - 75.0"
EndSection

The DesktopSetup option enables dual video output and specifies that the monitor attached to connector 1 is on the left; change this value to "0x00000201" if the monitors are reversed (it's not always apparent whether the internal or external monitor is attached to connector 1). HSync2 and VRefresh2 set the horizontal and vertical frequency ranges for the second monitor (the settings for the primary monitor are in the Monitor section of the file). The resolutions will automatically be selected from available options by the device driver.

Restart the X server by changing to runlevel 3 and then back to 5, by restarting the system, or by terminating the running X server with Ctrl-Alt-Backspace (save your work first!). When the X server restarts, the two monitors should display two halves of the desktop.

3.4.2. How Does It Work?

The X server contains code to manage two (or more) separate video cards, combining them into a single desktop. However, the X.org server and the configuration file layout were never really designed for multiple outputs from one card controlled by one driver; for example, there is no way to associate more than one Monitor section in the configuration file with a single Device (video card) section.

Some video card drivers have been enhanced to support multiple video outputs, and in order to fit within the X.org configuration file format, the configuration information for the second monitor is placed in the Device section.

There are two ways to use multiple monitors as part of a single display in X:

  • Each monitor can be given a distinct Screen number, which enables output to be sent to a specific monitor but prevents windows from spanning displays or being moved from one display to another.

  • Use Xinerama, which is named after the old Cinerama movie technology and that combines multiple monitors into a single large display, permitting windows to span monitors and to be moved between monitors.

All of the X.org video card drivers that support multiple video outputs use the Xinerama approach, but the Xinerama extensions used to inform applications of the underlying monitor geometry may be enabled or disabled using configuration options (with the exception of the ATI driver, which does not offer this capability). This information is particularly useful to window managers because it enables the window manager to correctly center dialogs in the middle of the monitor instead of the middle of the virtual desktop, and to make maximized windows fill a monitor instead of spanning monitors.

3.4.3. What About...

3.4.3.1. ...using dual video output with another video driver?

Very few of the other X.org video drivers support multiple video outputs. If you have another driver and want to see the options supported, look for a manpage for your driver. For example, to see the driver options for the Intel 810 adapter:

$ man i810

3.4.4. Where Can I Learn More?

  • The manpages for the radeon driver

  • NVIDIA closed-source driver information from /usr/share/doc/NVIDIA_GLX-1.0/README.txt


Previous Page
Next Page