You are not logged in.

#1 2020-06-26 10:52:32

spapanik21
Member
Registered: 2016-02-13
Posts: 6

xrandr not identifying the monitor size correctly

I have an external monitor (LG 24UD58-B) connected on my laptop (XPS 15 9570).

xrandr reports the wrong dimensions for my monitor:

~
********@******** $ xrandr --version
xrandr program version       1.5.1
Server reports RandR version 1.6
~
********@******** $ xrandr | grep -w connected
eDP1 connected primary 3840x2160+0+0 (normal left inverted right x axis y axis) 340mm x 190mm
DP1 connected 3840x2160+3840+0 (normal left inverted right x axis y axis) 600mm x 340mm

from the site of LG the pixel pitch of my external monitor is 0.1369x0.1369, which makes it a 526mm x 296mm monitor (which agrees to what I measure with a ruler).

Am I doing something wrong with xrandr, or is it broken?

Offline

#2 2020-06-26 11:18:11

Ropid
Member
Registered: 2015-03-09
Posts: 884

Re: xrandr not identifying the monitor size correctly

Those numbers are set up by the monitor's manufacturer. The monitor messages a block of data called "EDID" to the graphics card when the connection starts up. That's where details like monitor size come from.

If you are wondering if something is broken in Xorg or xrandr, or if the wrong data comes from your monitor, you could check the EDID of the monitor with a tool. I can do that here with open AMD drivers like this (is perhaps the same on Intel):

The kernel module for the GPU exposes details about the monitor connections as folders in /sys/class/drm/. I can find the folder with the correct monitor connection like this:

$ tail /sys/class/drm/card0-*/status
==> /sys/class/drm/card0-DP-1/status <==
connected

==> /sys/class/drm/card0-DP-2/status <==
disconnected

==> /sys/class/drm/card0-DVI-D-1/status <==
disconnected

==> /sys/class/drm/card0-HDMI-A-1/status <==
disconnected

==> /sys/class/drm/card0-HDMI-A-2/status <==
disconnected

This means my monitor data is in that "card0-DP-1" folder. There's an "edid" file in that folder that's binary data, and there's a tool "edid-decode" to decode it:

$ edid-decode /sys/class/drm/card0-DP-1/edid
...
  Detailed Timing Descriptors:
    DTD 1:  2560x1440   59.951 Hz  16:9    88.787 kHz 241.500 MHz (597 mm x 336 mm)
                 Hfront   48 Hsync  32 Hback  80 Hpol P
                 Vfront    3 Vsync   5 Vback  33 Vpol N
...

That edid-decode tool is in an AUR package named "edid-decode-git".

For me here the size numbers in the EDID is the same as what xrandr shows:

$ xrandr | grep mm
DisplayPort-0 connected primary 2560x1440+0+0 (normal left inverted right x axis y axis) 597mm x 336mm

Last edited by Ropid (2020-06-26 11:21:54)

Offline

#3 2020-06-26 14:32:11

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 8,380

Re: xrandr not identifying the monitor size correctly

X often doesn't use the screen size from the EDID, but tries to calculate it based on resolution and DPI  .

The DPI used tends to be incorrect a lot, see https://wiki.archlinux.org/index.php/Xo … ze_and_DPI .

Run

xdpyinfo | grep -B2 resolution

Incase the DPI shown doesn't match the value given by the manufacturer, you'll have to set it manually .

SideNote :
I use an etc/X11/xorg.conf.d/90-monitor.conf file AND a ~/.Xresources file to get correct DPI .

Last edited by Lone_Wolf (2020-06-26 14:32:37)


Multi-init booting with apg Openrc and systemd coexisting
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#4 2020-06-26 14:41:40

seth
Member
Registered: 2012-09-03
Posts: 16,266

Re: xrandr not identifying the monitor size correctly

The server side display size is different from the randr value, while the former is calculated out of dpi and root window size, the latter should™ always be correct and reflect the EDID reports.
@spapanik21 please post your xorg log.

Offline

Board footer

Powered by FluxBB