Using multiple monitors

From LQWiki
Jump to navigation Jump to search

This is often called DualHead or MultiHead. All information described here applies to XFree86 4.x.x versions and Xorg 6.8.x.

Different methods

There are a couple of different layouts possible:

  1. Clone mode -- Every monitors output the exact same thing.
  2. 'Normal' MultiHead -- Every monitor has a different seperate X screen and session
  3. Combined mode -- The different monitors are combined into one big virtual screen. There are a couple different implementations for this:
    1. Xinerama -- The XFree86 extension
    2. Nvidia's TwinView -- What the Nvidia drivers call it
    3. ATI's Big Desktop -- What the ATI drivers call it
    4. MergedFB -- New method supported in some xfree86 drivers, currently mga,sis,ati drivers (These last two only in recent experimental/CVS versions)

Requirements

Hardware

Obviously multiple monitors are needed. For the video cards different methods are available:

  1. Using multiple seperate video cards
  2. Using a single multihead capable video card. This requires special support in the XFree86 driver.
  3. A combination of the two above.

Note: It's also possible to use the Voodoo1/2 3D-only add-on cards as an extra output, see the Glide driver manual page.

Software

A window manager that supports your chosen multihead method. Especially for Xinerama it's required that the window manager supports this extension (both KDE and Gnome support it). For TwinView and MergedFB it's not needed, because these methods 'fake' one big desktop for the xserver itself.

Configuration

Depending on your distribution there are different steps to take to get to your multiple monitor setup. So, find out your distribution and read on...

SUSE

Start yast2, chose hardware->Graphics Card and Monitor. Configure your primary screen. Chose "Activate Dual Head Mode" and click on "Configure". Chose the second screen's resolution. Chose if your screens are aligned horizontally or vertically.

Generic

MultiHead Configuration

Some basic knowledge of the config file is needed for this. The XF86Config page should describe it.

Remember to backup your original xorg.conf:

cp /etc/X11/xorg.conf /etc/X11/xorg.conf.old

login to default a command line and try calling

X -configure

then add:

Section "ServerFlags"
  Option "Xinerama" "true"
 
EndSection

and test this

Note: Many people have found that having agp as the default boot screen is required if you are having problems try this out. Example:

In AWARD BIOS menu: Integrated Peripherals -> Init Display First -> AGP

In other bios: Bios First Boot -> [AGP/PCI]

Multihead

Each videocard should have a working 'Device' section. (Test this by using it as the single output). Add a matching BusID option to each Device section so it knows which driver to use for each physical device. The proper BusID can be found by using lspci or hwinfo --pci. Example BusID line looks like this:

BusID "PCI:1:0:0"

(Note that even AGP cards use the 'PCI:' prefix)
For single videocards that support multihead it depends on the used driver. In most cases these cards have a second entry in lspci/scanpci. Each head on the card should have a seperate Device section, each with the same 'Driver' option but different 'Identifier and'BusID' options. A special option needs to be added for multihead configuration. Each Device sections needs a 'Screen' option with a number. For example:

Screen "0"

This would indicate that this particular device section if for the primary head, the other device sections should have a similar option, but with the number increased. The other configuration options of the driver should be only used in the device section of the primary head.

Each monitor should have a working 'Monitor' section. (Also test these as single output). Now create a 'Screen' section for every monitor-videocard combination.

After this it's time to set up a multihead 'Layout' section in the XF86Config. To get normal Multihead, just add Screen options to your normal Layout. Example:

Screen 0 "Normal"
Screen 1 "TV"
Screen 2 "Fridge-LCD"

etc.
Now if you start up X, you should have seperate X sessions running on each screen.

Xinerama

Almost the same as above. Only need to enable the Xinerama extension. This can be done either by starting XFree86 with the '+xinerama' option, or adding 'Option "Xinerama" "On" to the 'ServerFlags' section of the XF86Config.
And you need to specify the position of the screen relative to another. This can be done in the 'Layout' section. Choices are: LeftOf,RightOf,Above,Below,Absolute X,Y, Relative X Y Example:

Screen 0 "Main"
Screen 1 "Secondary" LeftOf "Main"
Screen 2 "TV" relative "Main" 0 2000

etc.

Nvidia TwinView

If you are using an NVIDIA card, the README for the Linux drivers on the NVIDIA.com website have excellent instructions on how to set up Xinerama (currently Appendix I in the README). Also see Installing_NVIDIA_drivers

ATI Big Desktop

Easiest way is to let the fglrxconfig app generate a config file for you. Select 'Big Desktop' in the screen layout question.

MergedFB

To enable MergedFB one only has to add some options to the Device section of the multihead video card. Multiple 'Device','Screen' and 'Monitor' sections aren't needed. It's also not needed the change the 'Layout' section. Everthing is configured in the 'Device' section of the videocard. These options can normally be found in the manual page of the driver. And example piece out of a 'Device' section:

Option "MergedFB" "On"
Option "CRT2HSync" "30-70"
Option "CRT2VRefresh" "50-150"
Option "CRT2Position" "LeftOf"

These options can differ between card drivers, since this is a relatively new method and there isn't a standard option set for it yet.

Links