0

EDIT: added some stuff that solves the issue at the end of the question - it's based on what Robert Siemer suggested, so he's answer is marked as correct

When I cold-plug my Lenovo USB-C dock on my laptop I get my 2 additonal monitors working (3 total).

When hot-plugging the dock, though, I get the following error from arandr:

XRandR returned error code 1:
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 140 (RANDR)
Minor opcode of failed request: 21 (RRSetCrtcConfig)
Serial number of failed request: 44
Current serial number in output stream: 44
  1920x1080 (0x48) 142.600MHz -HSync -VSync *current +preferred
        h: width  1920 start 1936 end 1952 total 2080 skew    0 clock  68.56KHz
        v: height 1080 start 1083 end 1088 total 1142           clock  60.03Hz
  1920x1080 (0x56f) 138.500MHz +HSync -VSync
        h: width  1920 start 1968 end 2000 total 2080 skew    0 clock  66.59KHz
        v: height 1080 start 1083 end 1088 total 1111           clock  59.93Hz

Additionally, when working with all 3 monitors, often at some point the laptop screen will freeze applications randomly, so I often disable the laptop screen to avoid that.

My laptop is a Lenovo X1 carbon 8th gen. I'm on Manjaro Linux, fully updated, using i3 with X11, not Wayland.

What follows is the shortened output of xrandr --verbose

  1. when the monitors are not connected I get:
xrandr --verbose | grep -E '^[^[:space:]]|curr|pref' | sed -e 's/(norm.*)//' 

Screen 0: minimum 8 x 8, current 6535 x 2434, maximum 32767 x 32767
eDP1 connected primary 1920x1080+1256+1354 (0x48) normal  310mm x 170mm
  1920x1080 (0x48) 142.600MHz -HSync -VSync *current +preferred
DP1 disconnected 
DP1-1 connected 
  1440x900 (0x78b) 106.500MHz +HSync -VSync +preferred
DP1-2 connected 
  1920x1080 (0x56f) 138.500MHz +HSync -VSync +preferred
DP1-3 disconnected 
DP2 disconnected 
HDMI1 disconnected 
VIRTUAL1 disconnected

  1. with dock connected and restart (i.e. everything okay) I get:
Screen 0: minimum 8 x 8, current 4740 x 3600, maximum 32767 x 32767
eDP1 connected primary 1920x1080+2820+2520 (0x4b) normal  310mm x 170mm
  1920x1080 (0x4b) 142.600MHz -HSync -VSync *current +preferred
DP1 disconnected 
DP1-1 connected 900x1440+0+0 (0x4c) right  410mm x 260mm
  1440x900 (0x4c) 106.500MHz +HSync -VSync *current +preferred
DP1-2 connected 1920x1080+900+1440 (0x4d) normal  530mm x 300mm
  1920x1080 (0x4d) 138.500MHz +HSync -VSync *current +preferred
DP1-3 disconnected 
DP2 disconnected 
HDMI1 disconnected 
VIRTUAL1 disconnected

Answer:

Ok! so by avoiding arandr entirely and first using:


xrandr --output DP1-2 --auto 
xrandr --output DP1-1 --auto  

makes the two external monitors work when hot-plugging.

then I can use:



xrandr --output eDP1 --primary --mode 1920x1080 --pos 2820x2520 --rotate normal --output DP1 --off --output DP1-1 --mode 1440x900 --pos 0x0 --rotate right --output DP1-2 --mode 1920x1080 --pos 900x1440 --rotate normal 

to set up them up. Before, by just putting the above in a script did not work, but by inclued the --auto for the two screens in the script then it works also when hot-plugging:


xrandr --output DP1-2 --auto 
xrandr --output DP1-1 --auto  

xrandr --output eDP1 --primary --mode 1920x1080 --pos 2820x2520 --rotate normal --output DP1 --off --output DP1-1 --mode 1440x900 --pos 0x0 --rotate right --output DP1-2 --mode 1920x1080 --pos 900x1440 --rotate normal 

however, if I don't run the setup (each separately) with arandr --auto, they fail.

Nothing changes in dmesg when doing these steps, as far as I can tell.

0

2 Answers 2

1

The error message does not reveal which xrandr command arandr launched (and with what intentions).

I have to do some assumptions here. I encourage you to confirm/deny them with your input. So here is what I assume:

  • when booted with the dock, all monitors work
  • when the dock is hot-plugged, only the internal monitor continues displaying, the external monitors stay black/off
  • the wrapper you use is arandr (which I don’t know myself and is best left out of the picture while investigating the problem!)
  • you and arandr want to switch the external monitors on

I would launch:

xrandr --output DP1-1 --auto

and then

xrandr --output DP1-2 --auto

What happens?

I further guess that arandr is doing something similar and that these commands unfortunately do not work. You did not include new output of the kernel (revealed with two invocations of dmesg, before and after any xrandr command; only report new messages, if any).

If that does not work, start driving the monitors with lower resolutions, one by one. E.g.:

xrandr --output DP1-1 --mode 800x600

Works?

What I do know is:

  • it is not a pixel clock issue: cold-plugging the monitors works with all different modelines and frequencies; a pixel clock shortage would not support that
  • your output with the monitors connected looks more like “with the monitors switched off”, because they are reported as connected; was that the situation even without the dock? (Or with the dock, but the monitor cables removed?)
0

Are you saying that this command fails in the hot-plug case?

xrandr --output eDP1 --primary --mode 1920x1080 --pos 2820x2520 --rotate normal \
    --output DP1 --off \
    --output DP1-1 --mode 1440x900 --pos 0x0 --rotate right \
    --output DP1-2 --mode 1920x1080 --pos 900x1440 --rotate normal

That still leave the question open of why it does not work.

Could you hot-plug and execute these one by one and say which one fails?

xrandr --output eDP1 --primary --mode 1920x1080 --pos 2820x2520
xrandr --output DP1-1 --mode 1440x900 --pos 0x0 --rotate right
xrandr --output DP1-2 --mode 1920x1080 --pos 900x1440
xrandr --output DP1 --off

By the way, do I see it right that you have the three monitors diagonally touching each other on one corner only?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .