You are not logged in.
My monitor is reporting a wrong physical size leading to an incorrect DPI calculation.
I created a custom EDID; however no matter how I try to use it, xrandr always reports the wrong physical size as reported by the monitor.
I tried so far:
My custom edid file is located in /usr/lib/firmware/edid/lg.bin.
I tried to use it via a kernel option
options drm.edid_firmware=DP-4:edid/lg.bin
I tried to use it via xorg configuration in /etc/X11/xorg.conf.d/20-nvidia.conf
Section "Device"
#...
Option "ConnectedMonitor" "DP-4, HDMI-1"
Option "UseEDID" "true"
Option "CustomEDID" "DP-4:/usr/lib/firmware/edid/lg.bin"
I am using the nvidia drivers and have a multi screen setup (different monitors, different resolution, different physical sizes).
I am not even sure if I am using the port identifiers correctly. Am I supposed DP-4 or am I supposed DFP-6, or even GPU0.DFP-6 or even DP-3 (as reported by inxi:
Monitor-1: DP-3 mapped: DP-4 note: disabled pos: primary,left
model: LG (GoldStar) HDR 4K res: 3840x2160 dpi: 163 diag: 690mm (27.2")
Thanks in advance and happy to provide additional info.
(I could not find any related error messages in xorg.0.log or dmesg, though.)
Last edited by nuunamnir (2023-02-18 13:38:06)
Offline
The output name that "xrandr -q" reports is relevant for the kernel command line, the nvidia xorg config options wants to see the DFP-* value (GPU.0 is irrelevant if there's only one GPU)
For the kernel option to work you'll most likely have to add "nvidia-drm.modeset=1" to the kernel commandline as well.
Offline
Thanks for clarifying the naming convention and pointing out the nvidia-drm kernel option. However, making the changes accordingly did not fix the issue.
How can I even check if the edid got loaded correctly? (If I export the edid from nvidia-settings, it exports my custom edid - even though xrandr still uses the wrong one ...)
Offline
Please post your complete system journal for the boot:
sudo journalctl -b | curl -F 'file=@-' 0x0.st
Please post your Xorg log, https://wiki.archlinux.org/title/Xorg#General
Offline
Offline
There're no discernable errors.
Can you upload the generated edid?
However if your only problem is the montitor dimensions, there's a much more straight forward way:
https://man.archlinux.org/man/extra/xor … isplaySize
/etc/X11/xorg.conf.d/11-monitor.conf
Section "Monitor"
Identifier "HDMI-1"
Option "DisplaySize" <width in mm> <height in mm>
EndSection
You're sure about the wrong dimensions being the cause ?
Did you look at the edid (w/ edid-decode, https://aur.archlinux.org/packages/edid-decode-git )
Because on a multiscreen setup the DPI could be calculated from the wrong output.
You can enfore the DPI w/ the nvidia driver:
/etc/X11/xorg.conf.d/20-nvidia.conf
Section Device
Identifier "Default nvidia Device"
Driver "nvidia"
Option "DPI" "90x90" # fix the dpi here ;)
Option "UseEdidDpi" "False"
EndSection
Offline
The display size is already set in the xorg config - but xrandr still reports the wrong display sizes:
Section "Monitor"
Identifier "DFP-6"
ModelName "LG HDR 4K"
VendorName "GSM"
# Monitor Manufactured week 10 of 2020
# EDID version 1.4
# Digital Display
DisplaySize 940 520
Option "DPMS" "true"
Horizsync 30-135
VertRefresh 56-61
EndSection
This is the output of parse-edid for the original edid:
Section "Monitor"
Identifier "LG HDR 4K"
ModelName "LG HDR 4K"
VendorName "GSM"
# Monitor Manufactured week 10 of 2020
# EDID version 1.4
# Digital Display
DisplaySize 600 340
Gamma 2.20
Option "DPMS" "true"
Horizsync 30-135
VertRefresh 56-61
# Maximum pixel clock is 560MHz
#Not giving standard mode: 1152x864, 60Hz
#Not giving standard mode: 1280x1024, 60Hz
#Not giving standard mode: 1280x720, 60Hz
#Not giving standard mode: 1600x900, 60Hz
#Not giving standard mode: 1920x1080, 60Hz
#Not giving standard mode: 1280x800, 60Hz
#Extension block found. Parsing...
Modeline "Mode 6" +hsync +vsync
Modeline "Mode 0" +hsync -vsync
Modeline "Mode 1" +hsync -vsync
Modeline "Mode 2" 148.500 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
Modeline "Mode 3" 74.250 1280 1390 1420 1650 720 725 730 750 +hsync +vsync
Modeline "Mode 4" 27.027 720 736 798 858 480 489 495 525 -hsync -vsync
Modeline "Mode 5" 25.200 640 656 752 800 480 490 492 525 -hsync -vsync
Modeline "Mode 7" +hsync -vsync
Option "PreferredMode" "Mode 6"
EndSection
And this is the output of my custom edid:
Section "Monitor"
Identifier "LG HDR 4K"
ModelName "LG HDR 4K"
VendorName "GSM"
# Monitor Manufactured week 10 of 2020
# EDID version 1.4
# Digital Display
DisplaySize 940 540
Gamma 2.20
Option "DPMS" "true"
Horizsync 30-135
VertRefresh 56-61
# Maximum pixel clock is 560MHz
#Not giving standard mode: 1152x864, 60Hz
#Not giving standard mode: 1280x1024, 60Hz
#Not giving standard mode: 1280x720, 60Hz
#Not giving standard mode: 1600x900, 60Hz
#Not giving standard mode: 1920x1080, 60Hz
#Not giving standard mode: 1280x800, 60Hz
#Extension block found. Parsing...
Modeline "Mode 6" +hsync +vsync
Modeline "Mode 0" +hsync -vsync
Modeline "Mode 1" +hsync -vsync
Modeline "Mode 2" 148.500 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
Modeline "Mode 3" 74.250 1280 1390 1420 1650 720 725 730 750 +hsync +vsync
Modeline "Mode 4" 27.027 720 736 798 858 480 489 495 525 -hsync -vsync
Modeline "Mode 5" 25.200 640 656 752 800 480 490 492 525 -hsync -vsync
Modeline "Mode 7" +hsync -vsync
Option "PreferredMode" "Mode 6"
EndSection
The output of xrandr is; note the wrong size despite all the xorg.conf / kernel / edid settings:
DP-4 connected primary 3840x2160+0+0 (normal left inverted right x axis y axis) 600mm x 340mm
Right now I just want to know how I can change these 600mm x 340mm to the correct values 940mm x 540mm. (Other scripts depend on the xrandr output.)
Last edited by nuunamnir (2023-02-12 20:40:22)
Offline
Identifier "DFP-6"
this needs to match the output name (DP-4) to have any impact. DFP-6 is wrong in this context.
Offline
Identifier "DFP-6"
this needs to match the output name (DP-4) to have any impact. DFP-6 is wrong in this context.
Are you sure? Can't the identifier not be arbitrary as long as it is consistently used?
Anyway - I had it with DP-4 before, and I changed it backed to DP-4 now - it does not have an effect at all. Is there a way for me to diagnose this further? Can I activate some additional logging? How can I see if a configuration was successfully applied or the correct edid loaded.
(Thanks for the help so far.)
Offline
Can't the identifier not be arbitrary as long as it is consistently used?
Not if you want it to be automagically applied.
You'd have to write a static server or at least screen configuration and explicitly reference the output which is actively discouraged and a bad idea.
Please post your entire xorg configuration and an updated xorg log.
Offline
Offline
It doesn't reference any monitor by their identifier - or any monitor at all.
Also that's nvidia-settings generated cruft - half of it is nonsense.
Remove the xorg.conf and only use xorg.conf.d/11-monitor.conf
Section "Monitor"
Identifier "HDMI-1"
ModelName "S27B550"
VendorName "SAM"
DisplaySize 600 340
EndSection
Section "Monitor"
Identifier "DP-4"
ModelName "LG HDR 4K"
VendorName "GSM"
DisplaySize 940 520
EndSection
Offline
I do not understand, what is wrong with this part in my xorg conf?
Section "Monitor"
Identifier "HDMI-1"
ModelName "S27B550"
VendorName "SAM"
# Monitor Manufactured week 7 of 2012
# EDID version 1.3
# Digital Display
DisplaySize 600 340
Option "DPMS" "true"
Horizsync 30-81
VertRefresh 50-75
EndSection
Section "Monitor"
Identifier "DP-4"
ModelName "LG HDR 4K"
VendorName "GSM"
# Monitor Manufactured week 10 of 2020
# EDID version 1.4
# Digital Display
DisplaySize 940 520
Option "DPMS" "true"
Horizsync 30-135
VertRefresh 56-61
EndSection
Edit: only using the suggested 11-monitor.conf does not fix the problem. edid is still not used.
Last edited by nuunamnir (2023-02-14 17:34:44)
Offline
I'd not force Horizsync & VertRefresh and DPMS defaults to true anyway, but the problem was indeed rather everything else in the config.
Please post an updated xorg log.
edid is still not used.
Certainly not w/ that xorg conglet, the approach was to force the output dimensions.
Offline
edid is still not used.
Certainly not w/ that xorg conglet, the approach was to force the output dimensions.
What I meant was that unfortunately the screen dimension are still reported incorrectly by xrandr ... Here is the xorg log with only the minimal conf active. Thanks again for the help!
Offline
The option isn't reported. To make sure the config is parsed, add
Option "FooBar" "SNAFU"
which should get you an error in the xorg log.
Still, we went from
[ 15.372] (--) NVIDIA(0): DPI set to (81, 80); computed from "UseEdidDpi" X config
to
[ 43708.433] (--) NVIDIA(0): DPI set to (162, 161); computed from "UseEdidDpi" X config
The NVIDIA X driver reports the size of the X screen in pixels and in millimeters. On X.Org 6.9 or newer, when the XRandR extension resizes the X screen in pixels, the NVIDIA X driver computes a new size in millimeters for the X screen, to maintain a constant DPI (see the "Physical Size" column of the `xrandr -q` output as an example). This is done because a changing DPI can cause interaction problems for some applications. To disable this behavior, and instead keep the same millimeter size for the X screen (and therefore have a changing DPI), set the ConstantDPI option to FALSE.
…
The NVIDIA X driver performs several steps during X screen initialization to determine the DPI of each X screen:o If the display device provides an EDID, and the EDID contains information about the physical size of the display device, that is used to compute the DPI, along with the size in pixels of the first mode to be used on the display device.
Note that in some cases, the physical size information stored in a display device's EDID may be unreliable. This could result in a display device's DPI being computed incorrectly, potentially leading to undesired consequences such as fonts that are scaled larger or smaller than expected. These issues can be worked around by manually setting a DPI using the "DPI" X configuration option, or by disabling the use of the EDID's physical size information for computing DPI by setting the UseEdidDpi X configuration option to "FALSE"'.
If multiple display devices are used by this X screen, then the NVIDIA X screen will choose which display device to use. You can override this with the "UseEdidDpi" X configuration option: you can specify a particular display device to use; e.g.:
Option "UseEdidDpi" "DFP-1"
or disable EDID-computed DPI by setting this option to false:
Option "UseEdidDpi" "FALSE"
EDID-based DPI computation is enabled by default when an EDID is available.o If the "-dpi" commandline option to the X server is specified, that is used to set the DPI (see `X -h` for details). This will override the "UseEdidDpi" option.
o If the DPI X configuration option is specified, that will be used to set the DPI. This will override the "UseEdidDpi" option.
o If none of the above are available, then the "DisplaySize" X config file Monitor section information will be used to determine the DPI, if provided; see the xorg.conf or XF86Config man pages for details.
o If none of the above are available, the DPI defaults to 75x75.
So to have DisplaySize take an impact, you'll still require
Option "UseEdidDpi" "FALSE"
in the nvidia device section.
Option "ConstantDPI" "FALSE"
(same section) might be required to impact what xrandr reports and ultimately
Option "DPI" "96x96"
(device section still) will just enforce a DPI.
Last edited by seth (2023-02-15 07:44:14)
Offline
This is not working either.
My current configuration looks like this and the corresponding log; xrandr output; parsed edid from log.
As you can see, with this configuration it loads the monitor's wrong edid file (size is 600 340).
However, I want it to use the edid file that I specified as kernel parameter.
If I specify a CustomEDID in the configuration (log, parsed edid), it is used, but xrandr still reports the wrong monitor size.
Fun Fact: If I plug the monitor out and in (with the customedid specified in the config) - xrandr reports the correct monitor size as specified in my custom edid. (If I reboot, it is back to the wrong monitor size.)
Last edited by nuunamnir (2023-02-16 07:20:53)
Offline
[ 1572.835] (WW) NVIDIA(0): Option "FooBar" is not used
Config is parsed
[ 1572.501] (**) NVIDIA(0): Option "UseEdidDpi" "false"
[ 1572.501] (**) NVIDIA(0): Option "DPI" "96x96"
[ 1572.501] (**) NVIDIA(0): Option "ConstantDPI" "false"
[ 1572.679] (**) NVIDIA(0): DPI set to (96, 96); computed from "DPI" X config option
Custom DPI is applied (96 DPI, that was meant as an example value; You want maybe 144, between 104 and 162 of your physical resolutions)
=>
xdpyinfo | grep reso
Edit: since this is a hybrid setup w/ different physical resolutions and on top of that one of the outputs being rotated, this is likely what you want to do anyway.
xrandr still reports the wrong monitor size
#Option "ConstantDPI" "false"
the NVIDIA X driver computes a new size in millimeters for the X screen, to maintain a constant DPI (see the "Physical Size" column of the `xrandr -q` output as an example). This is done because a changing DPI can cause interaction problems for some applications. To disable this behavior, and instead keep the same millimeter size for the X screen (and therefore have a changing DPI), set the ConstantDPI option to FALSE.
Last edited by seth (2023-02-16 07:49:34)
Offline
Thanks so far! But I think we need to track back a bit. I am not so much concerned about getting the right DPI, but getting my custom EDID loaded at boot.
For this I have the kernel option
drm.edid_firmware=DP-4:edid/lg.bin
set.
lsinitcpio /boot/initramfs-linux.img | grep edid
usr/lib/firmware/edid/
usr/lib/firmware/edid/lg.bin
However, this seemingly does not have any effect. Why, and how can I change it?
Offline
First see whether it's truely not applied by checking
edid-decode /sys/class/drm/card0-DP-4/edid
For your attempts to load the EDID w/ Xorg:
[ 1988.254] (**) NVIDIA(0): Option "CustomEDID" "DFP-6:/usr/lib/firmware/edid/lg.bin"
…
[ 1988.302] (--) NVIDIA(GPU-0): --- EDID for LG Electronics LG HDR 4K (DP-4) ---
…
[ 1988.302] (--) NVIDIA(GPU-0): Maximum Image Size : 940 mm x 540 mm
They worked.
Offline
Yes, the edid is not applied.
ls /sys/class/drm/
card0 card0-DP-1 card0-DP-2 card0-DP-3 card0-HDMI-A-1 card0-HDMI-A-2 renderD128 version
As you can see, there is no DP-4 ...
... but on card-0-DP-3 I get the wrong edid:
parse-edid < /sys/class/drm/card0-DP-3/edid
Checksum Correct
Section "Monitor"
Identifier "LG HDR 4K"
ModelName "LG HDR 4K"
VendorName "GSM"
# Monitor Manufactured week 10 of 2020
# EDID version 1.4
# Digital Display
DisplaySize 600 340
Gamma 2.20
Option "DPMS" "true"
Horizsync 30-135
VertRefresh 56-61
# Maximum pixel clock is 560MHz
#Not giving standard mode: 1152x864, 60Hz
#Not giving standard mode: 1280x1024, 60Hz
#Not giving standard mode: 1280x720, 60Hz
#Not giving standard mode: 1600x900, 60Hz
#Not giving standard mode: 1920x1080, 60Hz
#Not giving standard mode: 1280x800, 60Hz
#Extension block found. Parsing...
Modeline "Mode 6" +hsync +vsync
Modeline "Mode 0" +hsync -vsync
Modeline "Mode 1" +hsync -vsync
Modeline "Mode 2" 148.500 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
Modeline "Mode 3" 74.250 1280 1390 1420 1650 720 725 730 750 +hsync +vsync
Modeline "Mode 4" 27.027 720 736 798 858 480 489 495 525 -hsync -vsync
Modeline "Mode 5" 25.200 640 656 752 800 480 490 492 525 -hsync -vsync
Modeline "Mode 7" +hsync -vsync
Option "PreferredMode" "Mode 6"
EndSection
So I wonder, why is my custom edid not applied?
Offline
Did you try "drm.edid_firmware=DP-0:edid/lg.bin"?
Offline
Now I tried it (why would I try DP-0?). No effect.
(Btw. forcing the mode as described here does not work either - I unplugged the monitor and put it back.)
I guess it is just broken, maybe related to this bug.
Giving up on the approach loading the EDID via kernel option ...
If I but the CustomEDID option in xorg, the custom edid is loaded when I unplug and replug the monitor. Any idea how I can achieve this in software?
Thanks!
Offline
You would not, but obviously DP-3, sorry.
I don't see why re-plugging should be required, unless the output changes its id (ehat indeed seems the case), so just add another section for DP-3 in the xorg config.
Offline
Ah okay, yes - I tried it with DP-3 as well. Does not work either.
I do not understand why replugging would be required, but this is the only way I can get CustomEDID option to be applied.
This is my xorg log. You can see around 9616.575 I unplug and replug the monitor. From that time on xrandr -q reads
DP-4 connected primary 3840x2160+0+0 (normal left inverted right x axis y axis) 940mm x 540mm
Before that it reads
DP-4 connected primary 3840x2160+0+0 (normal left inverted right x axis y axis) 600mm x 340mm
But the edid file that is printed in the log always specifies a screen size of 940x540 ...
If I could just simulate the replugging somehow ...
Last edited by nuunamnir (2023-02-17 18:18:22)
Offline