![通过 xrandr 在多显示器设置中添加新分辨率](https://linux22.com/image/97747/%E9%80%9A%E8%BF%87%20xrandr%20%E5%9C%A8%E5%A4%9A%E6%98%BE%E7%A4%BA%E5%99%A8%E8%AE%BE%E7%BD%AE%E4%B8%AD%E6%B7%BB%E5%8A%A0%E6%96%B0%E5%88%86%E8%BE%A8%E7%8E%87.png)
我有两个具有不同最大值的显示器。分辨率(2560x1440 和 1920x1080)。在 Windows 中,我可以为两台显示器配置最大分辨率,但在 Linux 中(manjaro、专有的 nvidia 驱动程序和 xrandr 1.5),较大显示器的分辨率仅限于 2048x1152。我读了几个问题/线程/文章如何通过 xrandr 添加自定义分辨率,但这些都不适合我。这是我的问题:
xrandr 的输出:
Screen 0: minimum 8 x 8, current 3968 x 1152, maximum 16384 x 16384
DVI-I-0 disconnected (normal left inverted right x axis y axis)
DVI-I-1 disconnected (normal left inverted right x axis y axis)
DVI-I-2 connected 1920x1080+2048+0 (normal left inverted right x axis y axis) 478mm x 269mm
1920x1080 60.00*+
... skipped few lines ....
640x480 75.00 72.81 59.94
HDMI-0 connected primary 2048x1152+0+0 (normal left inverted right x axis y axis) 553mm x 311mm
2048x1152 60.00*+
... skipped few lines ...
640x480 75.00 59.94 59.93
DVI-I-3 disconnected (normal left inverted right x axis y axis)
我使用 cvt 生成新的自定义分辨率:
$ cvt 2560 1440 60
# 2560x1440 59.96 Hz (CVT 3.69M9) hsync: 89.52 kHz; pclk: 312.25 MHz
Modeline "2560x1440_60.00" 312.25 2560 2752 3024 3488 1440 1443 1448 1493 -hsync +vsync
现在我想创建新的结果:
xrandr --newmode 2560x1440_60.00 312.25 2560 2752 3024 3488 1440 1443 1448 1493 -hsync +vsync
xrandr 的输出现在看起来像这样:
Screen 0: minimum 8 x 8, current 3968 x 1152, maximum 16384 x 16384
DVI-I-0 disconnected (normal left inverted right x axis y axis)
DVI-I-1 disconnected (normal left inverted right x axis y axis)
DVI-I-2 connected 1920x1080+2048+0 (normal left inverted right x axis y axis) 478mm x 269mm
1920x1080 60.00*+
... skipped few lines ...
640x480 75.00 72.81 59.94
HDMI-0 connected primary 2048x1152+0+0 (normal left inverted right x axis y axis) 553mm x 311mm
2048x1152 60.00*+
... skipped few lines ...
640x480 75.00 59.94 59.93
DVI-I-3 disconnected (normal left inverted right x axis y axis)
2560x1440_60.00 (0x313) 312.250MHz -HSync +VSync
h: width 2560 start 2752 end 3024 total 3488 skew 0 clock 89.52KHz
v: height 1440 start 1443 end 1448 total 1493 clock 59.96Hz
如果我现在想将此分辨率添加到输出 HDMI-0,我会收到以下错误:
$ xrandr --addmode HDMI-0 2560x1440_60.00
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: 33
Current serial number in output stream: 34
过去,我能够成功地使用此方法根据需要设置我的显示器,在不同的电脑(笔记本电脑+外接显示器,两者具有相同的分辨率)上没有任何问题。我真的很感激任何建议。
答案1
nVidia 驱动程序有严格的 EDID 政策,即使它们有问题。
它有一个 xorg 选项来忽略 EDID 并从图形适配器支持的所有分辨率中进行选择。使用以下之一:
Option "UseEDID" "boolean" Option "ModeValidation" "NoEdidModes"
可能会忽略部分功能:
Option "UseEDIDFreqs" "FALSE" Option "IgnoreEDIDChecksum" "<con-1>, <con-2>"
或者更高级的 EDID 验证调整,请参阅参考以获取支持的值:
Option "ModeValidation" "string"
它还可以选择注入 EDID 的更正/修改副本。警告:这很危险,并非所有显示器都坚固耐用。
Option "CustomEDID" "<con-1>:</pathto/edid1.bin>; <con-2>:</pathto/edid2.bin>"
参考:
笔记:
顺便说一句,验证它是否已检索 EDID 数据,使用:
xrandr --verbose