off-by-one with xrandr in screen size from a two display setup with nvidia drivers
Today, I debugged a strange x11vnc issue, that results in a strange effect: when enabling the on-screen-keyboard on my tablet, it paints most areas black. After messing with a bunch of x11vnc options, I noticed:
Jun 24 12:19:42 desktop bash[3778]: 24/06/2024 12:19:42 Sending rfbEncodingExtDesktopSize for size (5119x1600)
Jun 24 12:19:42 desktop bash[3778]: 24/06/2024 12:19:42 Client requested resolution change to (2560x1600)
Jun 24 12:19:43 desktop bash[3778]: 24/06/2024 12:19:43 Sending rfbEncodingExtDesktopSize for size (5119x1600) resize prohibited
Digging deeper on this issue:
$ xrandr
Screen 0: minimum 8 x 8, current 5119 x 1600, maximum 32767 x 32767
DP-2.8 connected 2560x1600+2559+0 (normal left inverted right x axis y axis) 641mm x 401mm
2560x1600 59.97*+
1920x1200 59.88
1920x1080 60.00 59.94 50.00 23.98
1680x1050 59.95
1600x1200 60.00
1280x1024 75.02 60.02
1280x800 59.81
1280x720 60.00 59.94 50.00
1152x864 75.00
1024x768 75.03 60.00
800x600 75.00 60.32
720x576 50.00
720x480 60.01 59.94
640x480 75.00 59.94 59.93
HDMI-0 disconnected (normal left inverted right x axis y axis)
DP-0 connected primary 2560x1600+0+0 (normal left inverted right x axis y axis) 641mm x 401mm
2560x1600 59.97*+
1920x1200 59.88
1920x1080 60.00 59.94 50.00 23.98
1680x1050 59.95
1600x1200 60.00
1280x1024 75.02 60.02
1280x800 59.81
1280x720 60.00 59.94 50.00
1152x864 75.00
1024x768 75.03 60.00
800x600 75.00 60.32
720x576 50.00
720x480 60.01 59.94
640x480 75.00 59.94 59.93
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
DP-4 disconnected (normal left inverted right x axis y axis)
DP-5 disconnected (normal left inverted right x axis y axis)
If I add the horizontal sizes of the two monitors, that makes 5120 pixels, not 5119.
This is a classical off-by-one, but who's to blame here?
Operating System: openSUSE Tumbleweed 20240621
KDE Plasma Version: 6.0.5
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.1
Kernel Version: 6.9.5-6-preempt (64-bit)
Graphics Platform: X11
Processors: 24 × AMD Ryzen 9 3900X 12-Core Processor
Memory: 62.4 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 3060/PCIe/SSE2
Manufacturer: ASUS
Specific package versions:
$ rpmg 'xorg|xrandr'
xorg-x11-Xvnc-1.13.1-6.2.x86_64
xorg-x11-Xvnc-module-1.13.1-6.2.x86_64
xorg-x11-driver-video-7.6_1-19.12.x86_64
xorg-x11-essentials-7.6_1-16.20.noarch
xorg-x11-fonts-7.6-46.2.noarch
xorg-x11-fonts-converted-7.6-46.2.noarch
xorg-x11-fonts-core-7.6-46.2.noarch
xorg-x11-fonts-legacy-7.6-46.2.noarch
xorg-x11-libX11-ccache-7.6-22.9.x86_64
xorg-x11-server-21.1.12-3.1.x86_64
xorg-x11-server-Xvfb-21.1.12-3.1.x86_64
xorg-x11-server-extra-21.1.12-3.1.x86_64
xorgproto-devel-2024.1-1.2.noarch
xorgxrdp-0.9.19-1.5.x86_64
xrandr-1.5.2-38.1.x86_64
I would blame the NVIDIA 550.90.07 driver for this, but at least, it shows the correct values:
[ 59.660] (II) NVIDIA(0): Virtual screen size determined to be 5120 x 1600
[ 69.878] (II) NVIDIA(0): Setting mode "DP-0: nvidia-auto-select @2560x1600 +0+0 {ViewPortIn=2560x1600, ViewPortOut=2560x1600+0+0}, DP-2.8: nvidia-auto-select @2560x1600 +2559+0 {ViewPortIn=2560x1600, ViewPortOut=2560x1600+0+0}"
Therefore, I suspect this problem in this project, or perhaps in xrandr for now.
Unfortunately, X11 will only come up with the propietary driver on this system.
Here the relevant verbose xrandr output:
Screen 0: minimum 8 x 8, current 5119 x 1600, maximum 32767 x 32767
DP-2.8 connected 2560x1600+2559+0 (0x1bd) normal (normal left inverted right x axis y axis) 641mm x 401mm
Identifier: 0x1bc
Timestamp: 69869
Subpixel: unknown
Gamma: 1.0:1.0:1.0
Brightness: 1.0
Clones:
CRTC: 1
CRTCs: 0 1 2 3
Transform: 1.000000 0.000000 0.000000
0.000000 1.000000 0.000000
0.000000 0.000000 1.000000
filter:
_KDE_SCREEN_INDEX: 2
CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0
0 1
CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0
GUID: {10DE9070-0000-0000-0033-0B6A000000CF}
EDID:
00ffffffffffff0010ac81404c343330
10190104b54028783a1df5ae4f35b325
0d5054a54b008100b300d100714fa940
8180d1c00101e26800a0a0402e603020
360081912100001a000000ff00503156
364e3534483033344c0a000000fc0044
454c4c2055333031340a2020000000fd
0031561d711c010a20202020202001e9
02031df1509005040302071601061112
1513141f2023091f0783010000023a80
1871382d40582c450081912100001e01
1d8018711c1620582c25008191210000
9e011d007251d01e206e285500819121
00001e8f0ad08a20e02d10103e960081
91210000180000000000000000000000
000000000000000000000000000000e6
BorderDimensions: 4
supported: 4
Border: 0 0 0 0
range: (0, 65535)
SignalFormat: DisplayPort
supported: DisplayPort
ConnectorType: DisplayPort
ConnectorNumber: 1
_ConnectorLocation: 1
non-desktop: 0
supported: 0, 1
2560x1600 (0x1bd) 268.500MHz +HSync -VSync *current +preferred
h: width 2560 start 2608 end 2640 total 2720 skew 0 clock 98.71KHz
v: height 1600 start 1603 end 1609 total 1646 clock 59.97Hz
1920x1200 (0x1be) 193.250MHz -HSync +VSync
h: width 1920 start 2056 end 2256 total 2592 skew 0 clock 74.56KHz
v: height 1200 start 1203 end 1209 total 1245 clock 59.88Hz
1920x1080 (0x1bf) 148.500MHz +HSync +VSync
h: width 1920 start 2008 end 2052 total 2200 skew 0 clock 67.50KHz
v: height 1080 start 1084 end 1089 total 1125 clock 60.00Hz
1920x1080 (0x1c0) 148.350MHz +HSync +VSync
h: width 1920 start 2008 end 2052 total 2200 skew 0 clock 67.43KHz
v: height 1080 start 1084 end 1089 total 1125 clock 59.94Hz
1920x1080 (0x1c1) 148.500MHz +HSync +VSync
h: width 1920 start 2448 end 2492 total 2640 skew 0 clock 56.25KHz
v: height 1080 start 1084 end 1089 total 1125 clock 50.00Hz
1920x1080 (0x1c2) 74.180MHz +HSync +VSync
h: width 1920 start 2558 end 2602 total 2750 skew 0 clock 26.97KHz
v: height 1080 start 1084 end 1089 total 1125 clock 23.98Hz
1680x1050 (0x1c3) 146.250MHz -HSync +VSync
h: width 1680 start 1784 end 1960 total 2240 skew 0 clock 65.29KHz
v: height 1050 start 1053 end 1059 total 1089 clock 59.95Hz
1600x1200 (0x1c4) 162.000MHz +HSync +VSync
h: width 1600 start 1664 end 1856 total 2160 skew 0 clock 75.00KHz
v: height 1200 start 1201 end 1204 total 1250 clock 60.00Hz
1280x1024 (0x1c5) 135.000MHz +HSync +VSync
h: width 1280 start 1296 end 1440 total 1688 skew 0 clock 79.98KHz
v: height 1024 start 1025 end 1028 total 1066 clock 75.02Hz
1280x1024 (0x1c6) 108.000MHz +HSync +VSync
h: width 1280 start 1328 end 1440 total 1688 skew 0 clock 63.98KHz
v: height 1024 start 1025 end 1028 total 1066 clock 60.02Hz
1280x800 (0x1c7) 83.500MHz -HSync +VSync
h: width 1280 start 1352 end 1480 total 1680 skew 0 clock 49.70KHz
v: height 800 start 803 end 809 total 831 clock 59.81Hz
1280x720 (0x1c8) 74.250MHz +HSync +VSync
h: width 1280 start 1390 end 1430 total 1650 skew 0 clock 45.00KHz
v: height 720 start 725 end 730 total 750 clock 60.00Hz
1280x720 (0x1c9) 74.180MHz +HSync +VSync
h: width 1280 start 1390 end 1430 total 1650 skew 0 clock 44.96KHz
v: height 720 start 725 end 730 total 750 clock 59.94Hz
1280x720 (0x1ca) 74.250MHz +HSync +VSync
h: width 1280 start 1720 end 1760 total 1980 skew 0 clock 37.50KHz
v: height 720 start 725 end 730 total 750 clock 50.00Hz
1152x864 (0x1cb) 108.000MHz +HSync +VSync
h: width 1152 start 1216 end 1344 total 1600 skew 0 clock 67.50KHz
v: height 864 start 865 end 868 total 900 clock 75.00Hz
1024x768 (0x1cc) 78.750MHz +HSync +VSync
h: width 1024 start 1040 end 1136 total 1312 skew 0 clock 60.02KHz
v: height 768 start 769 end 772 total 800 clock 75.03Hz
1024x768 (0x1cd) 65.000MHz -HSync -VSync
h: width 1024 start 1048 end 1184 total 1344 skew 0 clock 48.36KHz
v: height 768 start 771 end 777 total 806 clock 60.00Hz
800x600 (0x1ce) 49.500MHz +HSync +VSync
h: width 800 start 816 end 896 total 1056 skew 0 clock 46.88KHz
v: height 600 start 601 end 604 total 625 clock 75.00Hz
800x600 (0x1cf) 40.000MHz +HSync +VSync
h: width 800 start 840 end 968 total 1056 skew 0 clock 37.88KHz
v: height 600 start 601 end 605 total 628 clock 60.32Hz
720x576 (0x1d0) 27.000MHz -HSync -VSync
h: width 720 start 732 end 796 total 864 skew 0 clock 31.25KHz
v: height 576 start 581 end 586 total 625 clock 50.00Hz
720x480 (0x1d1) 27.030MHz -HSync -VSync
h: width 720 start 736 end 798 total 858 skew 0 clock 31.50KHz
v: height 480 start 489 end 495 total 525 clock 60.01Hz
720x480 (0x1d2) 27.000MHz -HSync -VSync
h: width 720 start 736 end 798 total 858 skew 0 clock 31.47KHz
v: height 480 start 489 end 495 total 525 clock 59.94Hz
640x480 (0x1d3) 31.500MHz -HSync -VSync
h: width 640 start 656 end 720 total 840 skew 0 clock 37.50KHz
v: height 480 start 481 end 484 total 500 clock 75.00Hz
640x480 (0x1d4) 25.175MHz -HSync -VSync
h: width 640 start 656 end 752 total 800 skew 0 clock 31.47KHz
v: height 480 start 490 end 492 total 525 clock 59.94Hz
640x480 (0x1d5) 25.170MHz -HSync -VSync
h: width 640 start 656 end 752 total 800 skew 0 clock 31.46KHz
v: height 480 start 490 end 492 total 525 clock 59.93Hz
[...]
DP-0 connected primary 2560x1600+0+0 (0x1bd) normal (normal left inverted right x axis y axis) 641mm x 401mm
Identifier: 0x1d7
Timestamp: 69869
Subpixel: unknown
Gamma: 1.0:1.0:1.0
Brightness: 1.0
Clones:
CRTC: 0
CRTCs: 0 1 2 3
Transform: 1.000000 0.000000 0.000000
0.000000 1.000000 0.000000
0.000000 0.000000 1.000000
filter:
_KDE_SCREEN_INDEX: 1
CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0
0 1
CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0
EDID:
00ffffffffffff0010ac81404c313731
1f180104b54028783a1df5ae4f35b325
0d5054a54b008100b300d100714fa940
8180d1c00101e26800a0a0402e603020
360081912100001a000000ff00503156
364e3437553137314c0a000000fc0044
454c4c2055333031340a2020000000fd
0031561d711c010a20202020202001c8
02031df1509005040302071601061112
1513141f2023091f0783010000023a80
1871382d40582c450081912100001e01
1d8018711c1620582c25008191210000
9e011d007251d01e206e285500819121
00001e8f0ad08a20e02d10103e960081
91210000180000000000000000000000
000000000000000000000000000000e6
BorderDimensions: 4
supported: 4
Border: 0 0 0 0
range: (0, 65535)
SignalFormat: DisplayPort
supported: DisplayPort
ConnectorType: DisplayPort
ConnectorNumber: 2
_ConnectorLocation: 2
non-desktop: 0
supported: 0, 1
2560x1600 (0x1bd) 268.500MHz +HSync -VSync *current +preferred
h: width 2560 start 2608 end 2640 total 2720 skew 0 clock 98.71KHz
v: height 1600 start 1603 end 1609 total 1646 clock 59.97Hz
1920x1200 (0x1be) 193.250MHz -HSync +VSync
h: width 1920 start 2056 end 2256 total 2592 skew 0 clock 74.56KHz
v: height 1200 start 1203 end 1209 total 1245 clock 59.88Hz
1920x1080 (0x1bf) 148.500MHz +HSync +VSync
h: width 1920 start 2008 end 2052 total 2200 skew 0 clock 67.50KHz
v: height 1080 start 1084 end 1089 total 1125 clock 60.00Hz
1920x1080 (0x1c0) 148.350MHz +HSync +VSync
h: width 1920 start 2008 end 2052 total 2200 skew 0 clock 67.43KHz
v: height 1080 start 1084 end 1089 total 1125 clock 59.94Hz
1920x1080 (0x1c1) 148.500MHz +HSync +VSync
h: width 1920 start 2448 end 2492 total 2640 skew 0 clock 56.25KHz
v: height 1080 start 1084 end 1089 total 1125 clock 50.00Hz
1920x1080 (0x1c2) 74.180MHz +HSync +VSync
h: width 1920 start 2558 end 2602 total 2750 skew 0 clock 26.97KHz
v: height 1080 start 1084 end 1089 total 1125 clock 23.98Hz
1680x1050 (0x1c3) 146.250MHz -HSync +VSync
h: width 1680 start 1784 end 1960 total 2240 skew 0 clock 65.29KHz
v: height 1050 start 1053 end 1059 total 1089 clock 59.95Hz
1600x1200 (0x1c4) 162.000MHz +HSync +VSync
h: width 1600 start 1664 end 1856 total 2160 skew 0 clock 75.00KHz
v: height 1200 start 1201 end 1204 total 1250 clock 60.00Hz
1280x1024 (0x1c5) 135.000MHz +HSync +VSync
h: width 1280 start 1296 end 1440 total 1688 skew 0 clock 79.98KHz
v: height 1024 start 1025 end 1028 total 1066 clock 75.02Hz
1280x1024 (0x1c6) 108.000MHz +HSync +VSync
h: width 1280 start 1328 end 1440 total 1688 skew 0 clock 63.98KHz
v: height 1024 start 1025 end 1028 total 1066 clock 60.02Hz
1280x800 (0x1c7) 83.500MHz -HSync +VSync
h: width 1280 start 1352 end 1480 total 1680 skew 0 clock 49.70KHz
v: height 800 start 803 end 809 total 831 clock 59.81Hz
1280x720 (0x1c8) 74.250MHz +HSync +VSync
h: width 1280 start 1390 end 1430 total 1650 skew 0 clock 45.00KHz
v: height 720 start 725 end 730 total 750 clock 60.00Hz
1280x720 (0x1c9) 74.180MHz +HSync +VSync
h: width 1280 start 1390 end 1430 total 1650 skew 0 clock 44.96KHz
v: height 720 start 725 end 730 total 750 clock 59.94Hz
1280x720 (0x1ca) 74.250MHz +HSync +VSync
h: width 1280 start 1720 end 1760 total 1980 skew 0 clock 37.50KHz
v: height 720 start 725 end 730 total 750 clock 50.00Hz
1152x864 (0x1cb) 108.000MHz +HSync +VSync
h: width 1152 start 1216 end 1344 total 1600 skew 0 clock 67.50KHz
v: height 864 start 865 end 868 total 900 clock 75.00Hz
1024x768 (0x1cc) 78.750MHz +HSync +VSync
h: width 1024 start 1040 end 1136 total 1312 skew 0 clock 60.02KHz
v: height 768 start 769 end 772 total 800 clock 75.03Hz
1024x768 (0x1cd) 65.000MHz -HSync -VSync
h: width 1024 start 1048 end 1184 total 1344 skew 0 clock 48.36KHz
v: height 768 start 771 end 777 total 806 clock 60.00Hz
800x600 (0x1ce) 49.500MHz +HSync +VSync
h: width 800 start 816 end 896 total 1056 skew 0 clock 46.88KHz
v: height 600 start 601 end 604 total 625 clock 75.00Hz
800x600 (0x1cf) 40.000MHz +HSync +VSync
h: width 800 start 840 end 968 total 1056 skew 0 clock 37.88KHz
v: height 600 start 601 end 605 total 628 clock 60.32Hz
720x576 (0x1d0) 27.000MHz -HSync -VSync
h: width 720 start 732 end 796 total 864 skew 0 clock 31.25KHz
v: height 576 start 581 end 586 total 625 clock 50.00Hz
720x480 (0x1d1) 27.030MHz -HSync -VSync
h: width 720 start 736 end 798 total 858 skew 0 clock 31.50KHz
v: height 480 start 489 end 495 total 525 clock 60.01Hz
720x480 (0x1d2) 27.000MHz -HSync -VSync
h: width 720 start 736 end 798 total 858 skew 0 clock 31.47KHz
v: height 480 start 489 end 495 total 525 clock 59.94Hz
640x480 (0x1d3) 31.500MHz -HSync -VSync
h: width 640 start 656 end 720 total 840 skew 0 clock 37.50KHz
v: height 480 start 481 end 484 total 500 clock 75.00Hz
640x480 (0x1d4) 25.175MHz -HSync -VSync
h: width 640 start 656 end 752 total 800 skew 0 clock 31.47KHz
v: height 480 start 490 end 492 total 525 clock 59.94Hz
640x480 (0x1d5) 25.170MHz -HSync -VSync
h: width 640 start 656 end 752 total 800 skew 0 clock 31.46KHz
v: height 480 start 490 end 492 total 525 clock 59.93Hz