[ltp] x hang switching screens using xrandr

Alex Deucher linux-thinkpad@linux-thinkpad.org
Tue, 13 Jan 2009 10:00:46 -0500


On Tue, Jan 13, 2009 at 5:41 AM, Phil Shotton <phil@stairbridge.org.uk> wrote:
> Replying to my own post...
>
> Phil Shotton wrote:
>>
>> I regularly switch my laptop between twin external monitors (work) and
>> single external with laptop LCD (home), and wrote two scripts to switch
>> between the two using xrandr (having suspended/resumed):
>>
>> home.sh
>> xrandr --output VGA-0 --auto
>> xrandr --output DVI-0 --off
>> xrandr --output LVDS --auto
>> xrandr --output VGA-0 --auto --right-of LVDS
>>
>> work.sh
>> xrandr --output DVI-0 --auto
>> xrandr --output VGA-0 --auto
>> xrandr --output LVDS --off
>> xrandr --output DVI-0 --auto
>> xrandr --output VGA-0 --auto --left-of DVI-0
>
> It's this line that causes the problem. Even if run on its own without any
> of the intervening lines. x-session-manager is then stuck with exactly the
> same trace as below. An interrupted system call failing to restart or
> deadlock in the bowels of X??
>
> This problem is happening regularly and is very annoying. It means closing
> all apps before screen switch just in case I have to restart X. Any ideas?

Can you get access to another box via ssh and attach to the xserver
with gdb?  Then run the problematic commands and get a backtrace.
Also, you might want to try explicitly selecting the crtcs in your
commands:

xrandr --output DVI-0 --crtc 1 --auto
xrandr --output LVDS --off
xrandr --output DVI-0 --crtc 0 --auto
xrandr --output VGA-0 --left-of DVI-0

Alex