Xrandr --addmode throws BadMatch (invalid parameter attributes) adding 4k60 res

xrandr seems to always throw “BadMatch (invalid parameter attributes)” when using --addmode command to force 4K60 output.

Generate Modeline

$ cvt -r 3840 2160 60
# 3840x2160 59.97 Hz (CVT 8.29M9-R) hsync: 133.25 kHz; pclk: 533.00 MHz
Modeline "3840x2160R"  533.00  3840 3888 3920 4000  2160 2163 2168 2222 +hsync -vsync

Add and Configure Mode

$ xrandr --newmode "3840x2160R"  533.00  3840 3888 3920 4000  2160 2163 2168 2222 +hsync -vsync

$ xrandr --addmode DP-1 3840x2160R
X Error of failed request:  BadMatch (invalid parameter attributes)
Major opcode of failed request:  140 (RANDR)
Minor opcode of failed request:  18 (RRAddOutputMode)
Serial number of failed request:  41
Current serial number in output stream:  42

Try lower res

$ cvt 1920 1080 60
Modeline...
$ xrandr --newmode ...
$ xrandr --addmode DP-1 <mode_name>
# same error

Seem to be stuck with 4K30 using NVIDIA graphics while I can get 4K60 under Windows so hardware is not the limitation.

Using F33 Silverblue edition but /etc/ path should be writable for xorg.conf.

Maybe it doesn’t support the “59.97 Hz” refresh rate that you get with the reduced blanking (-r) parameter to cvt?

$ cvt 3840 2160 60.0
# 3840x2160 59.98 Hz (CVT 8.29M9) hsync: 134.18 kHz; pclk: 712.75 MHz
Modeline "3840x2160_60.00"  712.75  3840 4160 4576 5312  2160 2163 2168 2237 -hsync +vsync

Alternatively, you might try gtf:

$ gtf 3840 2160 60.0
# 3840x2160 @ 60.00 Hz (GTF) hsync: 134.10 kHz; pclk: 712.34 MHz
Modeline "3840x2160_60.00"  712.34  3840 4152 4576 5312  2160 2161 2164 2235  -HSync +Vsync

Not surprisingly throws the same error, could be specific to read-only rootfs in silverblue.

I’m not really familiar with the problem, but it appears that the firmware database for monitors under Linux is not as extensive as the one Microsoft has. If Linux doesn’t have a specific definition for a particular monitor, then it can fall back to querying the monitor. But it is apparently not uncommon for monitors to not report their full list of supported modes over this protocol.

It looks like it is possible to hand craft a definition for your monitor: Need help with enforcing custom monitor EDID from firmware! | Linux.org

You’ll just need to save your custom EDID under /usr/lib/firmware.

1 Like