32

Pending an answer to xrandr detects amplifier as monitor a possible workaround is to blacklist devices with specific EDIDs. Unfortunately xrandr --verbose prints everything in a format which is cumbersome to parse and doesn't support querying single devices, and get-edid's output doesn't seem to be easy to map to xrandr's monitor IDs (for example DVI-1).

Is there some way to get an easily parseable EDID for a single monitor?

1
  • I'd go for xrandr parsing. It's cumbersome, but you just write your script once and for all, and then it'll work everywhere. Commented Feb 10, 2014 at 1:01

5 Answers 5

32

Lead #1: monitor-edid

I'm not that up on EDID and monitors but I did find this tool, monitor-edid which might be of use to you here as well.

Forgive me if it's off base, I'm trying to also learn more about this space, given the variety of questions you ask on the topic.

$ monitor-edid 
EISA ID: LEN4036
EDID version: 1.3
EDID extension blocks: 0
Screen size: 30.3 cm x 19.0 cm (14.08 inches, aspect ratio 16/10 = 1.59)
Gamma: 2.2
Digital signal

    # Monitor preferred modeline (60.0 Hz vsync, 55.8 kHz hsync, ratio 16/10, 120 dpi)
    ModeLine "1440x900" 114.06 1440 1488 1520 2044 900 903 909 930 -hsync -vsync

    # Monitor supported modeline (50.0 Hz vsync, 51.8 kHz hsync, ratio 16/10, 120 dpi)
    ModeLine "1440x900" 114.06 1440 1488 1520 2204 900 903 909 1035 -hsync -vsync

Lead #2: ddccontrol

There was another tool that I came across called ddccontrol, which might be helpful in getting the information you're after.

Lead #3: /sys

Finally in poking through /sys I noticed that there were leaf nodes hanging off of the various video interfaces.

$ sudo find /sys |grep -i edid
/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-HDMI-A-1/edid
/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-HDMI-A-2/edid
/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-HDMI-A-3/edid
/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-VGA-1/edid
/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/edid
/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-DP-1/edid
/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-DP-2/edid
/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-DP-3/edid
/sys/module/drm/parameters/edid_fixup
/sys/module/drm_kms_helper/parameters/edid_firmware

However on my Lenovo laptop these "files" were empty, perhaps they're different on your system. I found this forum thread that showed sample output from the VGA EDID.

$ lspci | grep VGA
01:00.0 VGA compatible controller: nVidia Corporation NV17 [GeForce4 440 Go 64M] (rev a3)
$ xxd  /sys/devices/pci0000:00/0000:00:0b.0/0000:01:00.0/drm/card0/card0-VGA-1/edid
0000000: 00ff ffff ffff ff00 5a63 0213 0101 0101  ........Zc......
0000010: 2b0a 0103 1c25 1bb0 eb00 b8a0 5749 9b26  +....%......WI.&
0000020: 1048 4cff ff80 8199 8159 714f 6159 4559  .HL......YqOaYEY
0000030: 3159 a94f 0101 863d 00c0 5100 3040 40a0  1Y.O...=..Q.0@@.
0000040: 1300 680e 1100 001e 0000 00ff 0033 3139  ..h..........319
0000050: 3030 3433 3030 3737 330a 0000 00fd 0032  004300773......2
0000060: a01e 6114 000a 2020 2020 2020 0000 00fc  ..a...      ....
0000070: 0047 3930 6d62 0a20 2020 2020 2020 00ba  .G90mb.       ..

Source: Extract Monitor Serial Number / Manufacture Date Using EDID?.

References

9
  • @l0b0 - has it only been 2? Seemed like more. I may be confusing the category of this Q w/ just you asking them. I will remove the offending bit 8-)
    – slm
    Commented Feb 10, 2014 at 12:54
  • 1
    #3 /sys/... works for me, I have Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09) with i915 driver, Kubuntu 15.04
    – user.dz
    Commented Sep 25, 2015 at 18:39
  • #3 /sys/... and xrandr --verbose both return EDID data for my HDMI monitor, but neither return EDID data for my DVI monitor.
    – noobninja
    Commented Jun 4, 2016 at 12:18
  • The monitor-edid link is dead and archive.org doesn't have any backups. Anyone know where I can get that tool?
    – emmalyx
    Commented Jul 3, 2016 at 22:50
  • @PeterW. - there's the alternative, thanks for bringing this to my attention. Also the tool is in most of the major repos. I found it in Fedora 24, for example and also CentOS. So you can install the tool as a binary which is probably a much easier option.
    – slm
    Commented Jul 4, 2016 at 2:35
25

The output of xrandr --props contains hex EDID strings for each connected display in a less verbose way. Here's a simple Python script exploiting this to grab an EDID for a specific connected monitor.

I haven't found any other distro-packaged CLI tools that work for EDID extraction on my NVidia-based system, but most tools for parsing a binary EDID seem to work fine.

1
  • xrandr --props worked for me, I then cut of the EDID found in the output and was able to use edid-decode (git.linuxtv.org/edid-decode.git) to get human-readable info from it. Commented Jan 26, 2021 at 23:34
19

In the binary form EDID is available at /sys/class/drm/card%d-%s/edid, where %d represents DRM device index (probably a GPU index) and %s is a connector ID that you see in xrandr output.

To list all available, run ls -1 /sys/class/drm/*/edid

If your GPU driver doesn't support DRM, you won't be able to get EDID this way.

To view in hex form, run hexdump on it.

If you want human-readable form, pass it to edid-decode, e.g.:

edid-decode < /sys/class/drm/card0-eDP-1/edid

(you might need to install it using your package manager, sudo apt install edid-decode for Ubuntu)

3
  • More accurately to get the hex form, you need to run the content of the edid file through hexdump -v -e '/1 "%02x"'
    – user48678
    Commented Nov 16, 2021 at 17:29
  • Your first point is not accurate on my system. xrandr gives me: eDP-1, DP-1, DP-2, DP-3, DP-4, DP-4-1, DP-4-2, DP-4-3, DP-3-1, DP-3-2, DP-3-3, but the /sys/devices/ outputs are eDP-1, DP-1, DP-2, DP-3, DP-4, DP-5, DP-6, DP-7 Commented Jun 10, 2022 at 9:46
  • The stdin redirection is not necessary: edid-decode can also take a file as argument: Usage: edid-decode <options> [in [out]] where [in] is the EDID file to parse. Read from standard input if none given or if the input filename is -.
    – Eric
    Commented Nov 27, 2022 at 11:38
13

If you happen to be using a x86 or powerpc arch, you could use read-edid. On debian this is available here.

Usage is simply (you need to be root):

$ sudo get-edid > /tmp/edid

and then parse the structure:

$ parse-edid < /tmp/edid
Checksum Correct

Section "Monitor"
    Identifier "HP v220"
    ModelName "HP v220"
    VendorName "HWP"
    # Monitor Manufactured week 13 of 2008
    # EDID version 1.3
    # Analog Display
    DisplaySize 470 300
    Gamma 2.20
    Option "DPMS" "true"
    Horizsync 30-81
    VertRefresh 56-76
    # Maximum pixel clock is 160MHz
    #Not giving standard mode: 1152x720, 60Hz
    #Not giving standard mode: 1280x960, 60Hz
    #Not giving standard mode: 1280x1024, 60Hz
    #Not giving standard mode: 1440x900, 60Hz
    #Not giving standard mode: 1600x1000, 60Hz
    #Not giving standard mode: 1680x1050, 60Hz
    Modeline    "Mode 0" -hsync +vsync 
EndSection

Often this is combined into:

$ sudo get-edid | parse-edid

See also here on how to pass this custom edid file to your graphic card using either:

  • CustomEDID or,
  • drm_kms_helper.edid_firmare
1
  • 3
    Just to clarify that get-edid did not work for me until I did "modprobe i2c-dev" . And the "parse-edid" produced Modeline was not accepted by Xorg. So I've used this in the device section: Option "CustomEDID" "CRT-0:/etc/X11/edid-StarLight-170418_gb-nv-gf-650-GTX-VGA.bin" I need to manually provide the EDID since it can not be correctly read over 10m long VGA cable. Setting the "DisplaySize" was also useful for me. Commented Apr 19, 2017 at 9:18
4

A recent version of a tool called edid-decode can parse EDID information, and it can read and write text and binary EDID files. It works well on the output of xrandr --verbose. For example, It can be used to save the EDID in a binary file:

xrandr --verbose | edid-decode - /file/to/save

The version of edid-decode that comes with Fedora 27 (package: xorg-x11-utils) is too old and it doesn't work perfectly. I used the most recent version.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .