# Dual Monitors

## Rinkhals

Hi,

I've got a couple of ATI video cards, an AGP Rage 2 (I think), and an elderly All-in-wonder PCI.

Both have 8 meg of RAM

I have a 17" monitor and a 15" one.

Can anyone give me a little advice (other than "spend some mony, you tightwad") ie: what software to emerge, how to configure XF86Config, etc

Dave

----------

## mrjohnston

Hey,

  I have never done this in linux, but I know that I have heard of people doing it using xinerama.

I know on xfce.org they specifically state you can do multiple monitors with it: "xfwm, Xfce window manager, now features really powerfull Xinerama support in Xfree 4, including automatic window translation, edge resistance between physical screens, etc. "

https://forums.gentoo.org/viewtopic.php?t=51049&highlight=xinerama

This link shows it can be done with xinerama (just emerge xinerama) and apparently if you use gnome 2.2 its built in.  Keep searching and I think it will work ok and pretty easily, except for maybe some problems with 2 cards instead of one, but I'm not sure

Good luck

----------

## Disquiet

I did this recently (before I went and bought a GeForce 4 with dual output  :Smile: )...Basically from what I remember, to get a almost working config run:

X -configure 

as root. This will create XF86config-4.new in root's home directory.

Hopefully this will detect your cards and set up the right entries in the config...but you'll have to fine tune it.

Cheers

Simon

----------

## Rinkhals

Just to say thanks, guys.

It works a treat.

I typed in X -configure as advised, after which a prompt came up with an additional command line. After entering the command parameters which the X -configure command suggested, I had a new file called XF86Config.new (just a point, this file was produced in the current directory, so it took me ages to figure out if anything had happened) I backed up my working /etc/X11/XF86Config and then substituted the XF86Config.new, started kdm and ....... hey, presto!

The 15" monitor needs tweaking as it's 16 colours and 640x400 pixels, but hey, I'm only intending to use it to input text into my scripts.

----------

## darktux

I have an on-board graphics card, which I don't use because I got a nvidia one which is better.

My question is, I can't force the BIOS to enable both of them, but am I missing something and is it possible?

----------

## curtis119

 *darktux wrote:*   

> I have an on-board graphics card, which I don't use because I got a nvidia one which is better.
> 
> My question is, I can't force the BIOS to enable both of them, but am I missing something and is it possible?

 

If the onboard card and the new nvidia card are both agp then, NO, you can't use them both. 

If one is agp and the other is pci then, YES, you can: Enable the onboard in bios,  install the pci card and edit your XF86Config to use both. You may or may not want to enable xinerama.Use the above examples to get a base XF86Config file. Good Luck!

----------

## darktux

They are both AGP.

DAMN IT!   :Crying or Very sad: 

----------

## curtis119

Oh well. You could try taking the nvidia card back and exchanging it for PCI.

----------

## cynninge

i tried the autoconfigure but x creates two seperate desktops on each card i'd like an extended desktop like in windows any ideas?

----------

## curtis119

 *cynninge wrote:*   

> i tried the autoconfigure but x creates two seperate desktops on each card i'd like an extended desktop like in windows any ideas?

 

The auto-configure is nice to use to get a base Xfree86Config file but you almost always have to hand edit it.

If you have 2 video cards You have to use Xinerama. If you have 1 dual-headed card and it is nvidia you use Twinview. If not use Xinerama.

Here are links on both:

ftp://download.nvidia.com/XFree86/Linux-x86/1.0-4363/README.txt

http://www.linux.se/doc/HOWTO/Xinerama-HOWTO.html

these should help.

Good Luck.

----------

## The Shadow Surfer

 *curtis119 wrote:*   

> 
> 
> If one is agp and the other is pci then, YES, you can: Enable the onboard in bios,  install the pci card and edit your XF86Config to use both. You may or may not want to enable xinerama.Use the above examples to get a base XF86Config file. Good Luck!

 

What about 2 PCI cards... I can't seem to force it to use both?!?

----------

## curtis119

If you are using 2 pci cards on a motherboard with built-in AGP video card you have to turn off the AGP in the BIOS (make pci the default video). If that's not it then try this.

For all cards (nvidia, ati, s3, whatever) specify the busid# from /proc/pci in you're xf86config file.

sample /proc/pci   (notice the Bus and the Device numbers)

```
 Bus  0, device   12, function  0:

    VGA compatible controller: nVidia Corporation NV17 [GeForce4 MX440] (rev 163).

 Bus  0, device   17, function  0:

    VGA compatible controller: nVidia Corporation NV17 [GeForce4 MX440] (rev 163).
```

In you're xf86config file add a BusID option in the Device section for each card (again, notice the BusID) :

```

Section "Device"

   Identifier   "card0"

   BusID   "PCI:0:12:0"

   Identifier   "card1"

   BusID   "PCI:0:17:0"

```

If that doesn't work and 1 or both cards are nvidia try putting this option in you're nvidia card device section in xf86config (this will turn off the built-in second card boot in the nvidia kernel module and pass the function to Xfree instead):

```

Option "UseInt10Module" "yes"

```

good luck.

----------

## wrs4

In any case, for the two displays, I think you're going to need a "Merged" section in your XF86Config file.  I could be wrong for different cards/monitors, but this is what my Matrox G450 XF86Config file looks like:

```

# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Conf.cpp,v 3.45 2003/02/20 04:05:12 dawes Exp $

#

# Copyright (c) 1994-1998 by The XFree86 Project, Inc.

#

# Permission is hereby granted, free of charge, to any person obtaining a

# copy of this software and associated documentation files (the "Software"),

# to deal in the Software without restriction, including without limitation

# the rights to use, copy, modify, merge, publish, distribute, sublicense,

# and/or sell copies of the Software, and to permit persons to whom the

# Software is furnished to do so, subject to the following conditions:

# 

# The above copyright notice and this permission notice shall be included in

# all copies or substantial portions of the Software.

# 

# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR

# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,

# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL

# THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,

# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF

# OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE

# SOFTWARE.

# 

# Except as contained in this notice, the name of the XFree86 Project shall

# not be used in advertising or otherwise to promote the sale, use or other

# dealings in this Software without prior written authorization from the

# XFree86 Project.

#

# $XConsortium: XF86Conf.cpp /main/22 1996/10/23 11:43:51 kaleb $

# **********************************************************************

# This is a sample configuration file only, intended to illustrate

# what a config file might look like.  Refer to the XF86Config(4/5)

# man page for details about the format of this file. This man page

# is installed as /usr/X11R6/man/man5/XF86Config.5x 

# **********************************************************************

# The ordering of sections is not important in version 4.0 and later.

# **********************************************************************

# Files section.  This allows default font and rgb paths to be set

# **********************************************************************

Section "Files"

# The location of the RGB database.  Note, this is the name of the

# file minus the extension (like ".txt" or ".db").  There is normally

# no need to change the default.

    RgbPath   "/usr/X11R6/lib/X11/rgb"

# Multiple FontPath entries are allowed (which are concatenated together),

# as well as specifying multiple comma-separated entries in one FontPath

# command (or a combination of both methods)

    FontPath   "/usr/X11R6/lib/X11/fonts/local/"

    FontPath   "/usr/X11R6/lib/X11/fonts/misc/"

    FontPath   "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"

    FontPath   "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"

    FontPath   "/usr/X11R6/lib/X11/fonts/Type1/"

    FontPath   "/usr/X11R6/lib/X11/fonts/CID/"

    FontPath   "/usr/X11R6/lib/X11/fonts/Speedo/"

    FontPath   "/usr/X11R6/lib/X11/fonts/75dpi/"

    FontPath   "/usr/X11R6/lib/X11/fonts/100dpi/"

# ModulePath can be used to set a search path for the X server modules.

# The default path is shown here.

#    ModulePath   "/usr/X11R6/lib/modules"

EndSection

# **********************************************************************

# Module section -- this is an optional section which is used to specify

# which run-time loadable modules to load when the X server starts up.

# **********************************************************************

Section "Module"

    Load   "dbe"

    Load   "dri"

    Load   "glx"

# This loads the miscellaneous extensions module, and disables

# initialisation of the XFree86-DGA extension within that module.

    SubSection   "extmod"

        Option   "omit xfree86-dga"

    EndSubSection

# This loads the Type1 and FreeType font modules

    Load   "type1"

    Load   "freetype"

EndSection

# **********************************************************************

# Server flags section.  This contains various server-wide Options.

# **********************************************************************

Section "ServerFlags"

# Uncomment this to cause a core dump at the spot where a signal is 

# received.  This may leave the console in an unusable state, but may

# provide a better stack trace in the core dump to aid in debugging

#    Option   "NoTrapSignals"

# Uncomment this to disable the <Crtl><Alt><Fn> VT switch sequence

# (where n is 1 through 12).  This allows clients to receive these key

# events.

#    Option   "DontVTSwitch"

# Uncomment this to disable the <Crtl><Alt><BS> server abort sequence

# This allows clients to receive this key event.

#    Option   "DontZap"

# Uncomment this to disable the <Crtl><Alt><KP_+>/<KP_-> mode switching

# sequences.  This allows clients to receive these key events.

    Option   "DontZoom"

# Uncomment this to disable tuning with the xvidtune client. With

# it the client can still run and fetch card and monitor attributes,

# but it will not be allowed to change them. If it tries it will

# receive a protocol error.

#    Option   "DisableVidModeExtension"

# Uncomment this to enable the use of a non-local xvidtune client.

#    Option   "AllowNonLocalXvidtune"

# Uncomment this to disable dynamically modifying the input device

# (mouse and keyboard) settings.

#    Option   "DisableModInDev"

# Uncomment this to enable the use of a non-local client to

# change the keyboard or mouse settings (currently only xset).

#    Option   "AllowNonLocalModInDev"

# Set the basic blanking screen saver timeout.

    Option   "blank time"   "10"   # 10 minutes

# Set the DPMS timeouts.  These are set here because they are global

# rather than screen-specific.  These settings alone don't enable DPMS.

# It is enabled per-screen (or per-monitor), and even then only when

# the driver supports it.

    Option   "standby time"   "20"

    Option   "suspend time"   "30"

    Option   "off time"   "60"

# On some platform the server needs to estimate the sizes of PCI

# memory and pio ranges. This is done by assuming that PCI ranges

# don't overlap. Some broken BIOSes tend to set ranges of inactive

# devices wrong. Here one can adjust how aggressive the assumptions

# should be. Default is 0.

# Option   "EstimateSizesAggresively" "0"

EndSection

# **********************************************************************

# Input devices

# **********************************************************************

# **********************************************************************

# Core keyboard's InputDevice section

# **********************************************************************

Section "InputDevice"

    Identifier   "Keyboard1"

    Driver   "keyboard"

# Set the keyboard auto repeat parameters.  Not all platforms implement

# this.

#    Option   "AutoRepeat"   "500 5"

# Specifiy which keyboard LEDs can be user-controlled (eg, with xset(1)).

#    Option   "Xleds"   "1 2 3"

# If you'd like to switch the positions of your capslock and

# control keys, use:

#

#    Option   "XkbOptions"   "ctrl:swapcaps"

# These are the default XKB settings for XFree86

#

    Option   "XkbRules"   "xfree86"

    Option   "XkbModel"   "pc105"

#    Option   "XkbModel"   "pc101"

    Option   "XkbLayout"   "us"

EndSection

# **********************************************************************

# Core Pointer's InputDevice section

# **********************************************************************

Section "InputDevice"

# Identifier and driver

    Identifier   "Mouse1"

    Driver   "mouse"

# The mouse protocol and device.  The device is normally set to /dev/mouse,

# which is usually a symbolic link to the real device.

    Option   "Protocol"   "PS/2"

    Option   "Device"   "/dev/mouse"

    Option  "ZAxisMapping"  "4 5"

EndSection

Section "InputDevice"

    Identifier   "Mouse2"

    Driver   "mouse"

    Option   "Protocol"   "PS/2"

    Option   "Device"   "/dev/mouse2"

    Option  "ZAxisMapping"  "4 5"

EndSection

# **********************************************************************

# Monitor section

# **********************************************************************

# Any number of monitor sections may be present

Section "Monitor"

   Identifier   "Display 1"

   VendorName   "Monitor Vendor"

   ModelName    "E90fb"

   DisplaySize  360   270

   HorizSync    30.0 - 86.0

   VertRefresh  50.0 - 150.0

   Option       "dpms"

EndSection

Section "Monitor"

   Identifier   "Display 2"

   VendorName   "Monitor Vendor"

   ModelName    "E90fb"

   DisplaySize  360   270

   HorizSync    30.0 - 86.0

   VertRefresh  50.0 - 150.0

EndSection

Section "Monitor"

   Identifier   "Display Merged"

   VendorName   "Monitor Vendor"

   ModelName    "E90fb"

   DisplaySize  360   270

   HorizSync    30.0 - 86.0

   VertRefresh  50.0 - 150.0

EndSection

# **********************************************************************

# Graphics device section

# **********************************************************************

Section "Device"

   Identifier  "MATROX CARD 1"

   Driver      "mga"

   VendorName  "Videocard vendor"

   BoardName   "Matrox Millennium G450"

   VideoRam    32768

   Option      "hw cursor" "off"

   BusID       "PCI:1:0:0"

EndSection

Section "Device"

   Identifier  "MATROX CARD 2"

   Driver      "mga"

   VendorName  "Videocard vendor"

   BoardName   "Matrox Millennium G450"

   VideoRam    32768

   Option      "hw cursor" "off"

   BusID       "PCI:1:0:0"

   Screen      1

EndSection

# **********************************************************************

# Screen sections.

# **********************************************************************

Section "Screen"

   Identifier "Display 1"

   Device     "MATROX CARD 1"

   Monitor    "Display 1"

   DefaultDepth     24

   SubSection "Display"

      Depth     24

      Modes    "1600x1200"

   EndSubSection

   SubSection "Display"

      Depth     8

      Modes    "1600x1200"

   EndSubSection

   SubSection "Display"

      Depth     16

      Modes    "1600x1200"

   EndSubSection

EndSection

Section "Screen"

   Identifier "Display 2"

   Device     "MATROX CARD 2"

   Monitor    "Display 2"

   DefaultDepth     24

   SubSection "Display"

      Depth     24

      Modes    "1600x1200"

   EndSubSection

   SubSection "Display"

      Depth     8

      Modes    "1600x1200"

   EndSubSection

   SubSection "Display"

      Depth     16

      Modes    "1600x1200"

   EndSubSection

EndSection

Section "Screen"

   Identifier "Display Merged"

   Device     "MATROX CARD 1"

   Monitor    "Display Merged"

   DefaultDepth     24

   Option      "Monitor2Position" "LeftOf"

   Option      "MergedFB"

   Option      "MetaModes" "1600x1200-1600x1200 1600x1200 "

   Option      "Monitor2HSync" "30.0-86.0 "

   Option      "Monitor2VRefresh" "50.0-150.0 "

   SubSection "Display"

      Virtual   3200 1200

      Depth     24

      Modes    "1600x1200"

   EndSubSection

EndSection

Section "DRI"

   Mode         0666

EndSection

# **********************************************************************

# ServerLayout sections.

# **********************************************************************

# Any number of ServerLayout sections may be present.  Each describes

# the way multiple screens are organised.  A specific ServerLayout

# section may be specified from the X server command line with the

# "-layout" option.  In the absence of this, the first section is used.

# When now ServerLayout section is present, the first Screen section

# is used alone.

Section "ServerLayout"

   Identifier     "Matrox PowerDesk configured."

   Screen      0  "Display Merged" 0 0

   InputDevice    "Mouse1" "CorePointer"

#   InputDevice    "Mouse2" "SendCoreEvents"

   InputDevice    "Keyboard1" "CoreKeyboard"

EndSection

```

By the way... enlightenment actually works under Gentoo... see this link

----------

## curtis119

wrs4,

 I read the three posts you have on the Matrox Linux Forum. The information in this thread:

http://forum.matrox.com/mgaforum/Forum2/HTML/002329.html

was interesting and correct for THAT situation. However, the question at hand is how to use 2 physical cards each with a monitor, not 2 monitors on the same dual-headed card. 

Use of the "Merged Section" is only relevant on Matrox cards using the Matrox beta Linux driver.

If The cards are from different manufacturers then Xinerama MUST be used to get 1 desktop across both monitors.

Shadow Surfer, if you are still reading this thread and still can't get it to work then post you're xf86config file and the log file from /var/log/xfree86.log along with the EXACT model number from both cards and from both monitors and I will edit it for you.

----------

## wrs4

As I said, it was a stab at the solution for that kind of setup; I stand corrected.

----------

## curtis119

Thanks for trying though. You have enthusiasm, that's what's important. And the How-To you wrote at Matrox was really good.

I give out the wrong advice about 3 times a week on average  :Very Happy: 

Besides, Shadow Surfer hasn't replied yet. You're solution may be exactly what s/he was looking for.

----------

## wrs4

The howto was written on this forum first and cross-posted to the matrox forum (if you read the matrox one, carefully, you'll notice that it says "this forum and the matrox forum" ....woops)

I try to be better in the future   :Very Happy: 

----------

## 0ctane

 *Rinkhals wrote:*   

> Just to say thanks, guys.
> 
> It works a treat.
> 
> I typed in X -configure as advised, after which a prompt came up with an additional command line. After entering the command parameters which the X -configure command suggested, I had a new file called XF86Config.new (just a point, this file was produced in the current directory, so it took me ages to figure out if anything had happened) I backed up my working /etc/X11/XF86Config and then substituted the XF86Config.new, started kdm and ....... hey, presto!
> ...

 

Hey Rinkhals,

can you post your XF86config file?  I have a AGP Radeon 9000 and PCI Radeon 7500.  I want to get both cards running (I require the DVI output from each).  However, the command "X -configure" did not work for me.  Thanks

----------

## 0ctane

well I got my setup working.  My problem was that 1)  I declared Section "Screen" for screen1 before screen0.  2) My device sections had  "Screen 0" and "Screen 1" for the different video cards, but I think these are just used for a multihead card.  Here is my XF86Config file:

```
Section "dri"

    Mode 0666

EndSection

Section "Module"

    Load        "dbe"   # Double buffer extension

    SubSection  "extmod"

      Option    "omit xfree86-dga"   # don't initialise the DGA extension

    EndSubSection

    Load        "type1"

    Load        "freetype"

    Load        "glx"   # libglx.a

   Load        "dri"   # libdri.a

EndSection

Section "Files"

    RgbPath     "/usr/X11R6/lib/X11/rgb"

    FontPath   "/usr/X11R6/lib/X11/fonts/local/"

    FontPath   "/usr/X11R6/lib/X11/fonts/misc/"

    FontPath   "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"

    FontPath   "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"

    FontPath   "/usr/X11R6/lib/X11/fonts/Type1/"

    FontPath   "/usr/X11R6/lib/X11/fonts/Speedo/"

    FontPath   "/usr/X11R6/lib/X11/fonts/75dpi/"

    FontPath   "/usr/X11R6/lib/X11/fonts/100dpi/"

EndSection

Section "ServerFlags"

    Option "Xinerama" "true"

    Option "Dont Zoom"

EndSection

Section "InputDevice"

    Identifier  "Keyboard1"

    Driver      "Keyboard"

    Option "AutoRepeat" "500 30"

    Option "XkbRules"   "xfree86"

    Option "XkbModel"   "pc104"

    Option "XkbLayout"  "us"

EndSection

Section "InputDevice"

    Identifier  "Mouse1"

    Driver "mouse"

    Option "Protocol"   "ImPS/2"

    Option "ZAxisMapping"   "4 5"

    Option "Device"     "/dev/input/mouse0"

EndSection

Section "Monitor"

        Identifier  "Monitor0"

        HorizSync       31.5 - 48.4

        VertRefresh     60 - 75

        Option "DPMS"

EndSection

Section "Monitor"

    Identifier  "Monitor1"

    HorizSync   31.5 - 48.4

    VertRefresh 60 - 75

    Option "DPMS"

EndSection

Section "Device"

        Identifier      "Radeon 7500"

        Driver          "radeon"

        BusID           "PCI:0:15:0"

#       Screen 0

EndSection

Section "Device"

    Identifier                          "Radeon 9000"

    Driver                              "radeon"

    BusID "PCI:1:0:0"    # vendor=1002, device=496e

#    Screen 1

EndSection

Section "Screen"

    Identifier  "Screen0"

    Device      "Radeon 7500"

    Monitor     "Monitor0"

    DefaultDepth 24

    #Option "backingstore"

    Subsection "Display"

        Depth       24

        Modes       "1024x768" "800x600" "640x480"

        ViewPort    0 0  # initial origin if mode is smaller than desktop

    EndSubsection

EndSection

Section "Screen"

        Identifier      "Screen1"

        Device          "Radeon 9000"

        Monitor         "Monitor1"

        DefaultDepth 24

        Subsection "Display"

                Depth 24

                Modes   "1024x768" "800x600" "640x480"

                ViewPort        0 0

        EndSubsection

EndSection

Section "ServerLayout"

    Identifier  "Server Layout"

    Screen 0 "Screen0" 0 0

    Screen 1 "Screen1" RightOf "Screen0"

    InputDevice "Mouse1" "CorePointer"

    InputDevice "Keyboard1" "CoreKeyboard"

EndSection

```

I am no longer using the firegl drivers and xinerama disables DRI.  Consequentially, the glxgears performance is abismal (72 fps on the 7500 screen).  Oh, well...at least it is running both cards.  Must do some more tweaking...  :Very Happy: 

----------

