TLDR
How can I understand and overcome xrandr
errors such as
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 140 (RANDR)
Minor opcode of failed request: 7 (RRSetScreenSize)
Serial number of failed request: 39
Current serial number in output stream: 40
?
How I got there
I'm trying to use a television as an external monitor. Yesterday, when I first connected the TV and tried to use arandr
to place it logically to the right of my laptop screen with resolution 3840x2160
, an error occurred. But I noticed that a resolution of 4096x2160
was available, so I tried that, it worked, and I got on with my life.
The next time I tried to use it, after turning the TV on, it was not detecting any signal on the HDMI1 input that I had used before, so I tried to elicit some reaction by changing a setting in arandr
: I switched to the 3840x2160
resolution (which did not work earlier), and this time it worked.
The next time I came back, once again no input detected on HDMI1, but this time both the 3840x2160
and 4096x2160
modes gave errors in arandr
. However, after plugging the cable into HDMI2
, the 3840x2160
mode worked.
This time, rather than getting on with my life, I tried to understand what was going on so I did some experiments, and am now completely unable to add the TV as a second monitor with both
- high resolution
- no overlap between laptop screen and TV
The current state of play
Using xrandr
rather than arandr
, variations on the theme of both high resolution and non-overlapping screen:
xrandr --output DP-4 --primary --mode 2560x1440 --pos 0x0 --output HDMI-0 --mode 3840x2160 --pos 2560x0
always fail (on any of the three physical HDMI sockets the TV has), with the error message shown at the top of this post.
OTOH variations on the them of hi-res + overlap:
xrandr --output DP-4 --primary --mode 2560x1440 --pos 0x0 --output HDMI-0 --mode 3840x2160 --pos 0x0
work fine, as do variations on the theme of lo-res + non-overlap:
xrandr --output DP-4 --primary --mode 2560x1440 --pos 0x0 --output HDMI-0 --mode 1920x1080 --pos 2560x0
For example, the same error occurs when using --right-of
instead of --pos 2560x0
.
Can xrandr be reset without restarting X?
It seems that some state has accumulated somewhere, as things which definitely worked earlier, have ceased to work.
I'm reluctant to try experiments which require restarting the X server, as I have many virtual screens with a large number of active tasks, which I really don't want to have to set up again.
I have reset the TV to factory settings, and it doesn't appear to have changed anything.