You are not logged in.

#1 2016-10-05 17:51:14

qplakak
Member
Registered: 2016-10-05
Posts: 6

xrandr error when switching displays

Hi,

I have a weird problem that happens from time to time.
When I'm using

 xrandr --output "eDP1" --off --output "HDMI" --auto 

and other way around to switch between my internal screen and HDMI output occasionally I get a black rectangle in the middle of the screen, mouse is bound to it and I can't do anything other than move the mouse inside of it. It's like a small screen is created inside my normal screen. Only reset helps. (keys also don't work or at least I cannot see any effect on screen)

I've noticed that it might have something to do with a fact that I'm connecting to an external display with higher than mine native resolution. If I'm connecting through display port to an external display that has the same resolution as internal one - the problem doesn't occurs.

Here is the log - maybe someone will be able to say something based on that.

[  5137.254] (II) intel(0): EDID vendor "DEL", prod id 41082
[  5137.254] (II) intel(0): Using hsync ranges from config file
[  5137.254] (II) intel(0): Using vrefresh ranges from config file
[  5137.254] (II) intel(0): Printing DDC gathered Modelines:
[  5137.254] (II) intel(0): Modeline "1920x1200"x0.0  154.00  1920 1968 2000 2080  1200 1203 1209 1235 +hsync -vsync (74.0 kHz eP)
[  5137.254] (II) intel(0): Modeline "800x600"x0.0   40.00  800 840 968 1056  600 601 605 628 +hsync +vsync (37.9 kHz e)
[  5137.254] (II) intel(0): Modeline "640x480"x0.0   25.18  640 656 752 800  480 490 492 525 -hsync -vsync (31.5 kHz e)
[  5137.254] (II) intel(0): Modeline "720x400"x0.0   28.32  720 738 846 900  400 412 414 449 -hsync +vsync (31.5 kHz e)
[  5137.254] (II) intel(0): Modeline "1024x768"x0.0   65.00  1024 1048 1184 1344  768 771 777 806 -hsync -vsync (48.4 kHz e)
[  5137.254] (II) intel(0): Modeline "1280x960"x0.0  108.00  1280 1376 1488 1800  960 961 964 1000 +hsync +vsync (60.0 kHz e)
[  5137.254] (II) intel(0): Modeline "1280x1024"x0.0  108.00  1280 1328 1440 1688  1024 1025 1028 1066 +hsync +vsync (64.0 kHz e)
[  5137.254] (II) intel(0): Modeline "1600x1200"x0.0  162.00  1600 1664 1856 2160  1200 1201 1204 1250 +hsync +vsync (75.0 kHz e)
[  5137.254] (II) intel(0): Modeline "1680x1050"x0.0  119.00  1680 1728 1760 1840  1050 1053 1059 1080 +hsync -vsync (64.7 kHz e)
[  5137.254] (II) intel(0): Modeline "1920x1080"x60.0  172.80  1920 2040 2248 2576  1080 1081 1084 1118 -hsync +vsync (67.1 kHz e)
[  5137.686] (II) intel(0): resizing framebuffer to 1920x1200
[  5137.692] (II) intel(0): switch to mode 1920x1200@60.0 on HDMI1 using pipe 1, position (0, 0), rotation normal, reflection none
[  5154.546] (II) intel(0): resizing framebuffer to 1920x1080
[  5154.549] (II) intel(0): switch to mode 1920x1080@59.9 on eDP1 using pipe 0, position (0, 0), rotation normal, reflection none
[  5210.297] (II) intel(0): resizing framebuffer to 1920x1200
[  5210.302] (II) intel(0): switch to mode 1920x1200@60.0 on HDMI1 using pipe 1, position (0, 0), rotation normal, reflection none
[  5228.746] (II) intel(0): switch to mode 1920x1200@60.0 on HDMI1 using pipe 1, position (0, 0), rotation normal, reflection none
[  5228.795] (EE) intel(0): sna_mode_shutdown_crtc: invalid state found on pipe 0, disabling CRTC:26
[  5238.810] (II) intel(0): switch to mode 1920x1200@60.0 on HDMI1 using pipe 1, position (0, 0), rotation normal, reflection none
[  5238.859] (EE) intel(0): sna_mode_shutdown_crtc: invalid state found on pipe 0, disabling CRTC:26
[  5262.682] (II) intel(0): switch to mode 1920x1200@60.0 on HDMI1 using pipe 1, position (0, 0), rotation normal, reflection none
[  5262.739] (EE) intel(0): sna_mode_shutdown_crtc: invalid state found on pipe 0, disabling CRTC:26
[  5301.728] (II) intel(0): resizing framebuffer to 1920x1080
[  5301.734] (II) intel(0): switch to mode 1920x1080@59.9 on eDP1 using pipe 0, position (0, 0), rotation normal, reflection none

It's DELL XPS 15 9550. Any help appreciated.

Offline

#2 2016-10-05 19:55:48

AlexIL
Member
From: Israel
Registered: 2016-01-02
Posts: 45
Website

Re: xrandr error when switching displays

Try using the --primary or --noprimary options.

Offline

#3 2016-10-10 08:13:45

qplakak
Member
Registered: 2016-10-05
Posts: 6

Re: xrandr error when switching displays

Thank you but unfortunately this did not help.
Here is how the issue looks like:
https://dl.dropboxusercontent.com/u/45771515/issue.jpg
It shows up sometimes after disconnecting or connecting external screen. Can move mouse only in that black box - nothing else works...

Mod note: replaced oversized image with url. Please see the Code of Conduct regarding acceptable image sizes. -- WorMzy

Last edited by WorMzy (2017-01-07 11:08:58)

Offline

#4 2016-10-10 08:48:58

PhilippD
Member
Registered: 2015-02-06
Posts: 40

Re: xrandr error when switching displays

I have the same problem since quite some time and unfortunately do not have an answer either.
Do you have the same window manager as me? I have i3.

What I noticed is that a delay between enabling one monitor and disabling the other lets this phenomenon appear less frequent but it is still annoying.

Offline

#5 2016-10-10 09:37:24

qplakak
Member
Registered: 2016-10-05
Posts: 6

Re: xrandr error when switching displays

Yes, it's i3. And I did noticed that if I add sleep 2s or similar it occurs less often. But that's really annoying. I have to remember to unplug my external screen a minute or so earlier before I go to a meeting to make sure that if everything crashes I have time to reset WM and restart all applications I had running... Awful.

Offline

#6 2016-10-10 20:02:43

PhilippD
Member
Registered: 2015-02-06
Posts: 40

Re: xrandr error when switching displays

I assume it is a bug in i3, then. Have you enabled the i3 logging?
http://i3wm.org/docs/debugging.html

I did that right now and wait for the next time this occurs.

Offline

#7 2016-10-15 13:54:32

PhilippD
Member
Registered: 2015-02-06
Posts: 40

Re: xrandr error when switching displays

It happened a few days ago and now I had time to go through the logs. For completeness I describe my situation in detail.

- I have a systemd unit that is called whenever I suspend or hibernate and it calls a script that switches off the external monitor and switches on the laptop monitor. This is because I do not want the X server to crash when I unplug the external monitor before resuming.

- So it usually executes these lines:

xrandr --output LVDS1 --auto --output VGA1 --off
killall i3lock
killall spotify
killall Clementine
killall -9 vlc
i3lock

Sometimes, exactly what OP posted happens. I already notice the black rectangle while it is hibernating, it starts right when my laptop screen is activated and before the machine shuts down.

The only interesting line in the journal before the hibernation is:

Oct 13 22:41:51 t400 hibernate.sh[23626]: i3lock: Cannot grab pointer/keyboard

However this line is there if the problem happens or not.

Therefore, the journal during resume should be more interesting:

Oct 13 22:42:53 t400 resume.sh[23735]: xrandr: Configure crtc 1 failed
Oct 13 22:42:53 t400 resume.sh[23735]: xrandr: Configure crtc 0 failed
Oct 13 22:42:53 t400 systemd[1]: resume@philipp.service: Control process exited, code=exited status=1
Oct 13 22:42:53 t400 systemd[1]: Failed to start User resume actions.
Oct 13 22:42:53 t400 systemd[1]: resume@philipp.service: Unit entered failed state.
Oct 13 22:42:53 t400 systemd[1]: resume@philipp.service: Failed with result 'exit-code'.

Here the reverse xrandr command fails with this error message on crtc 0 and crtc 1.
The xorg log says:

[ 12515.389] (II) systemd-logind: got resume for 13:77
[ 12515.402] (II) systemd-logind: got resume for 13:75
[ 12515.415] (II) systemd-logind: got resume for 13:76
[ 12515.415] (II) systemd-logind: got resume for 226:0
[ 12515.415] (II) AIGLX: Resuming AIGLX clients after VT switch
[ 12515.416] (II) intel(0): switch to mode 1280x800@60.0 on LVDS1 using pipe 0, position (0, 0), rotation normal, reflection none
[ 12515.432] (EE) intel(0): sna_mode_shutdown_crtc: invalid state found on pipe 1, disabling CRTC:29

There is nothing in the i3 log.
I did not find much in the net for this error message. sad
Maybe there is someone with expertise on randr errors, but I am stuck here.

Last edited by PhilippD (2016-10-15 13:55:08)

Offline

#8 2016-10-25 09:51:01

petelewis
Package Maintainer (PM)
From: Birmingham, UK
Registered: 2008-08-14
Posts: 128
Website

Re: xrandr error when switching displays

Hi, I'm suffering from this too -- it's a major annoyance.

Has anyone reported it upstream to i3? I couldn't find anything by searching.

Thanks.


"Cared thou not, thou would have abstained." - Xyne

Offline

#9 2016-10-26 06:29:55

qplakak
Member
Registered: 2016-10-05
Posts: 6

Re: xrandr error when switching displays

I didn't do that, wasn't sure if it's only my problem or something wider. I guess now we should report it.

Offline

#10 2016-10-26 08:38:19

PhilippD
Member
Registered: 2015-02-06
Posts: 40

Re: xrandr error when switching displays

I have found a silly workaround - at least for the last 2 times this has happened.
When I had the black rectangle, I used the shortcut for the dmenu (I didn't see it of course) then pressed a random key - one that would write something to the dmenu prompt.
For magical reasons, the rectangle disappeared and I didn't have to kill i3.

Offline

#11 2016-10-26 13:05:48

qplakak
Member
Registered: 2016-10-05
Posts: 6

Re: xrandr error when switching displays

Amazing trick! Thanks!

(does not solve the problem but makes it somehow bearable)

Offline

#12 2016-10-26 18:50:05

seth
Member
Registered: 2012-09-03
Posts: 50,957

Re: xrandr error when switching displays

Install xdotool
Cause this, move to VT1, export DISPLAY=:0
run

xdotool key "XF86LogGrabInfo"
sleep 10; xwininfo > weird_window.info; xprop > weird_window.props

Head abck to VT2 (X11), when the pointer turns into a "+" (should happen twice) click (into the black rectangle) - if the pointer doesn't change, there's propably a pending mousegrab (have a look on VT1 to be sure)
Look at and/or post Xorg.0.log (tail, look out for *active* grabs) and the two generated files. "The dmenu shortcut" as a common sense sounds suspicious and dmenu grabs input (and has a 2nd window to dim the screen when composited)

@qplakak, wallpaper please ;-)

Offline

#13 2016-10-27 10:04:10

qplakak
Member
Registered: 2016-10-05
Posts: 6

Re: xrandr error when switching displays

I'll try that this weekend and post results.Thanks.

Wallpaper: http://satya164.deviantart.com/art/Numi … -392842843 smile

Offline

#14 2016-10-27 18:57:19

PhilippD
Member
Registered: 2015-02-06
Posts: 40

Re: xrandr error when switching displays

I ran this when it just happened again:

export DISPLAY=:0
xdotool key "XF86LogGrabInfo"
sleep 10; xwininfo > weird_window.info; xprop > weird_window.props
i3-dump-log > weird_window.dump

The output was :

xwininfo: error: Can't grab the mouse
xprop: error: Can't grab the mouse

Afterwards, a "sleep 3s ; dmenu_run" gave me "cannot grab keyboard"
I have the i3 dump this time and could file a bug report this week-end.

Offline

#15 2016-10-27 21:37:21

seth
Member
Registered: 2012-09-03
Posts: 50,957

Re: xrandr error when switching displays

Most likely means the pointer (and keyboard) is actively grabbed at the time and th Xorg log should hold that information (incl. which client is to blame here) for the xdotool keypress.

@qplakak, thanks a bunch big_smile

Offline

#16 2016-10-31 20:49:31

PhilippD
Member
Registered: 2015-02-06
Posts: 40

Re: xrandr error when switching displays

Finally the bug report: https://github.com/i3/i3/issues/2525

Thank you for the ideas, seth. Unfortunately I don't have the time right now to dig further.
I am also annoyed by the time stamps in the xorg log and could not find an explanation how they can be related to proper time.

Offline

Board footer

Powered by FluxBB