Bug 164242

Summary: TwinView: Second screen not detected
Product: [Unmaintained] plasma4 Reporter: Elad Lahav <elad_lahav>
Component: multiscreenAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED DUPLICATE    
Severity: normal CC: aseigo, finex, ionut.ciocirlan, jonas.vejlin, kris, lucas, mail, rhavenn, riccardo
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: xorg.conf file

Description Elad Lahav 2008-06-16 19:31:34 UTC
Version:            (using Devel)
Installed from:    Compiled sources
Compiler:          GCC 4.3.0 
OS:                Linux

Two screens connected to the same video card, using Nvidia's TwinView.
The second screen is not detected on startup, so no desktop is drawn on that screen (though the mouse cursor shows up as usual). Plasma debug output on startup confirms that it only detects a single screen.
This setup works perfectly with both KDE 3.5.9 and WindowMaker. Moreover, a simple Qt4 application that checks the number of screens (QApplication::desktop()->numScreens()) reports two screens when run from startx.

The xorg.conf file:

# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 1.0  (buildmeister@builder3)  Wed Sep 12 14:30:30 PDT 2007

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 1.0  (buildmeister@builder3)  Wed Sep 12 14:29:35 PDT 2007

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 1280 0
    Screen      1  "Screen1" LeftOf "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
    RgbPath         "/usr/X11R6/lib/X11/rgb"
EndSection

Section "Module"
    Load           "dbe"
    Load           "extmod"
    #Load           "type1"
    Load           "freetype"
    Load           "glx"
EndSection

Section "ServerFlags"
    Option         "Xinerama" "0"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Keyboard0"
    Driver         "keyboard"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "LG L206W"
    HorizSync       30.0 - 83.0
    VertRefresh     56.0 - 75.0
    Option         "DPMS"
EndSection

Section "Monitor"
    Identifier     "Monitor1"
    VendorName     "Unknown"
    ModelName      "Samsung SyncMaster"
    HorizSync       30.0 - 81.0
    VertRefresh     56.0 - 75.0
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
EndSection

Section "Device"
    Identifier     "Videocard0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce 6150 LE"
    Option         "UseDisplayDevice" "DFP"
    Option         "UseEdidDpi" "FALSE"
    BusID          "PCI:0:5:0"
    Screen          0
EndSection

Section "Device"
    Identifier     "Videocard1"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce 6150 LE"
    Option         "UseDisplayDevice" "CRT"
    Option         "UseEdidDpi" "FALSE"
    BusID          "PCI:0:5:0"
    Screen          1
EndSection

Section "Screen"

# Removed Option "metamodes" "CRT: nvidia-auto-select +0+0"
# Removed Option "metamodes" "CRT: 1280x1024_75 +0+0; CRT: nvidia-auto-select +0+0"
    Identifier     "Screen0"
    Device         "Videocard0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "TwinView" "0"
    Option         "metamodes" "DFP: 1680x1050 +0+0; DFP: 1280x1024_75 +0+0; DFP: nvidia-auto-select +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"

# Removed Option "metamodes" "DFP: 1680x1050 +0+0"
# Removed Option "metamodes" "CRT: 1280x1024_75 +0+0"
    Identifier     "Screen1"
    Device         "Videocard1"
    Monitor        "Monitor1"
    DefaultDepth    24
    Option         "TwinView" "0"
    Option         "metamodes" "CRT: 1280x1024_60 +0+0; CRT: 1280x1024_75 +0+0"
    Option         "RandRRotation" "true"
EndSection
Comment 1 Elad Lahav 2008-06-16 21:50:26 UTC
This seems to be an issue with qt-copy.
When I build my simple application with qt-copy, it reports a single screen. On the other hand, building against a stock Qt 4.4 results in two screens reported. 
Comment 2 Kris Moore 2008-08-14 16:02:14 UTC
Same here on FreeBSD. I have setup a dual-head system using Nvidia's Twinview, and on startup, both screens do come on, but Plasma was only loaded in the left one. The right screen I could move my mouse to, or drag open windows over to, but Plasma was *not* running on it. 

I found a kludge to force it to work though. I created a new panel on my left screen, and dragged it over to the right screen. Then I re-logged in, and plasma started properly on the right screen now. 
Comment 3 Kris Moore 2008-08-23 15:42:49 UTC
Additional, if I remove my .kde4/share/config/plasma-appletsrc and login, then it detects the 2nd screen. However, if I already have this file configured for 1 screen, and then attempt to add a 2nd, it never auto-detects the 2nd monitor. 
Comment 4 Henrik Hudson 2008-09-22 07:16:03 UTC
Created attachment 27505 [details]
xorg.conf file
Comment 5 Henrik Hudson 2008-09-22 07:17:37 UTC
Whoops. Here's the text regarding my attachment. 

I have the same issue as well.

OS: FreeBSD 7.1-PRERELEASE
nvidia drivers: current from ports; nvidia agp and no linux compat

I first setup the system using twinview and although "Desktop" control panel showed the full combined resolution the 2nd desktop wouldn't display. I could drag items over to it, but they would leave fragments of the desktop and window streaks.

I switched my xorg.conf to be 2 independent monitors not using twinview. Now, I get nothing and I can't even drag windows over to the second. However, if I wait for the screen saver to kick on it will display on both screens. kxrandr control shows 2 screens as an option, but otherwise KDE doesn't seem to think their are 2 monitors. The "Desktop" control panel now thinks there is just one monitor of 1680x1050.

Attached is my xorg.conf
Comment 6 Riccardo Iaconelli 2008-11-24 15:40:37 UTC
can you please check again with a more recent trunk (or soon beta1)? the inclusion of kephal should have made things work more nicely toghether. =)
Comment 7 Sebastian Sauer 2008-12-08 21:59:07 UTC
/me seconds the question from comment #6 ... would be great to know if that problem is still there and/or what other probs do exist now. Thanks in advance for any feedback :)
Comment 8 Ionut Ciocirlan 2009-01-13 14:18:44 UTC
Yup, the problem is still there. Using svn 907177, this is what happens:

My setup:
-------------------------------
|                |            |
|   1680x1050    | 1280x1024  |
|                |            |
|                |-------------
------------------

1. Login with a single display:
$ xrandr
Screen 0: minimum 512 x 384, current 1680 x 1050, maximum 1680 x 1050
default connected 1680x1050+0+0 0mm x 0mm
   1680x1050      50.0*
   1600x1024      51.0
   [etc...]
   512x384        65.0

After using nvidia-settings to enable the second display:
$ xrandr
Screen 0: minimum 512 x 384, current 2960 x 1050, maximum 2960 x 1050
default connected 2960x1050+0+0 0mm x 0mm
   1680x1050      50.0     66.0
   1600x1024      51.0
   [etc...]
   512x384        65.0
   2960x1050      66.0*

There is no root window / no plasma on the second display. You can drag windows onto it, but Xinerama hints are ignored: trying to maximise a window from the second display gets it maximised on the first.

Restarting kwin / plasma doesn't help, and neither does further switching of modes.

2. Login with both displays:
$ xrandr
Screen 0: minimum 2960 x 1050, current 2960 x 1050, maximum 2960 x 1050
default connected 2960x1050+0+0 0mm x 0mm
   2960x1050      66.0*

Everything works just fine, there is an additional plasma button on the second screen, I can add widgets / panels, maximise windows etc.

The rather interesting part comes after disabling the second monitor.
$ xrandr
Screen 0: minimum 1680 x 1050, current 1680 x 1050, maximum 2960 x 1050
default connected 1680x1050+0+0 0mm x 0mm
   2960x1050      66.0     50.0
   1680x1050      50.0*

Everything works fine, until trying to enter systemsettings -> display. At this point compositing crashes, and X starts eating 100% CPU. After managing to run an xrandr -s 0, CPU usage went down, but no compositing.
The "Desktop effects" checkbox in systemsettings was still checked. Uncheck/re-check/apply results in "Failed to activate desktop effects using the given configuration options. [...] Check your X configuration. " etc.

However, compiz --replace works fine, and doing kwin --replace afterwards allows compositing to be enabled again.
Comment 9 Ionut Ciocirlan 2009-01-13 15:36:47 UTC
*** This bug has been confirmed by popular vote. ***
Comment 10 FiNeX 2009-04-29 17:20:04 UTC
On current trunk (r961118) When I enable the second monitor (using nvidia settings, for example) the secondary monitor is enabled but desktop effects are disabled, I've to restart kwin for re-enable desktop effects.

Qt 4.5.0
Xorg 1.6.1
Nvidia 180.44
Comment 11 Jonas Vejlin 2009-05-01 07:38:43 UTC
This bug might be related to bug #156475
Comment 12 Kai Wb. 2009-05-26 18:47:28 UTC
Please not that the Debian bug 529487 [0] was forwarded to this bug report.

[0] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=529487
Comment 13 Jonas Vejlin 2009-05-26 20:12:25 UTC
This bug report have soon 1 year birthday. Is that a good thing?
Comment 14 Aaron J. Seigo 2009-05-26 20:40:20 UTC

*** This bug has been marked as a duplicate of bug 156475 ***