Xrandr call makes it forget about secondary display

displaydisplay-settingsxrandr

In short

I have a laptop with an external DVI display which is hooked up to its Display Port (via adapter). When I rotate the internal screen using xrandr, it will forget about the secondary display. Calling xrandr multiple times does not have any effect. I have to power off the external display, wait for a while, call xrandr again and it finds the display.

The details

I use Kubuntu 13.10 with Awesome WM instead of the regular KWin Windows Manager. Therefore, there are already two systems which do stuff with displays.

The laptop is a ThinkPad X220 Tablet, which has a Display Port on the device itself, and another one on the UltraBase docking station, which I use currently. The display is a Samsung SyncMaster 2443BW with a DVI to Display Port adapter.

Then, I use my own think-rotate to rotate the internal (LVDS1) screen when I rotate the physical display (via ACPI hook). Said script uses xrandr to rotate the screen.

When I call think-rotate, it will glitch and give me the following xrandr output afterwards:

Screen 0: minimum 320 x 200, current 1366 x 768, maximum 32767 x 32767
LVDS1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 277mm x 156mm
   1366x768       60.0*+
   1360x768       59.8     60.0  
   1024x768       60.0  
   800x600        60.3     56.2  
   640x480        59.9  
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
DP1 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
HDMI3 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
DP3 disconnected (normal left inverted right x axis y axis)

You see, that the HDMI2 is completely missing. After letting all the power drain from the external display, calling xrandr again gave me the screen back and the following output:

Screen 0: minimum 320 x 200, current 1366 x 768, maximum 32767 x 32767
LVDS1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 277mm x 156mm
   1366x768       60.0*+
   1360x768       59.8     60.0  
   1024x768       60.0  
   800x600        60.3     56.2  
   640x480        59.9  
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
DP1 disconnected (normal left inverted right x axis y axis)
HDMI2 connected (normal left inverted right x axis y axis)
   1920x1200      60.0 +
   1600x1200      60.0  
   1280x1024      60.0  
   1280x960       60.0  
   1024x768       60.0  
   800x600        60.3     56.2  
   640x480        60.0  
HDMI3 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
DP3 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)

I looked into the /var/log/syslog and found the following within the debug output of the think-rotate script:

Jan  6 20:20:26 Martin-X220 colord: device removed: xrandr-Samsung Electric Company-SyncMaster-H9XS113172
Jan  6 20:20:26 Martin-X220 colord: Device added: xrandr-Samsung Electric Company-SyncMaster-H9XS113172

How can I triage this issue? I got other DVI and VGA displays around, I got another Display Port on the ThinkPad itself.

I assume that the problem is the interaction between something in KDE, Awesome WM (which reloads its config on every display change) and my xrandr calls.

Follow-up

Without Awesome WM, plain KDE with KWin

I just started KDE without Awesome WM. It did not only forget about the external display when I rotated, but it also caused severe compositing glitches. I found that think-rotate is called twice by the ACPI hook, so I am currently implementing a guard against that. Running it twice simultaneously might be the cause of the glitches. The forgetting about the display is caused when I call think-rotate manually, so that is not caused by running it twice.

Without KDE, plain Awesome WM

Now I am just with Awesome WM, no KDE started. There is no problem. I saw here that it is called twice and work on that guard. It is called twice, but runs only one now. Apparently, the issue does not persist here. Although I do not like to admit, but with the information I currently have, KDE seems to cause the issue.

Update 2014-01-06 21:37+0100

Well, it seems like rotation works without problems with plain Awesome WM. When I put it onto the docking station, it does not see the external display right away. I have to power it off and call xrandr manually to get it working.

Update 2014-01-21 21:53+0100

I tried another DVI display, and I did not have any problems with it. When I go back to my Samsung SyncMaster, I get the issue again. Awesome WM alone caused problems, KDE with Awesome WM causes problems as well. It is still broken!

Update 2014-03-10 18:17+0100

The issue persists. I used a VGA cable to test it, and that did not appear to have the issue. My current workaround is to switch off the display, call xrandr and then turn it on again. Maybe Ubuntu 14.04 will fix that issue.

Best Answer

The issue also persists when it is hooked up to different computers, also a Windows 7 machine. It is a hardware defect, I bought a new display a while ago.

Related Question