24

I have extracted the shorthand version of the current monitor attached to the computer.
Here is an example: vendor "VSC", prod id "18500"

In Ubuntu's Monitor Preferences, it is identified as Viewsonic Corporation 16".

How can I extract this human readable form? ... and also, how can I determine if a monitor is a CRT or an LCD? (this is actually what got me started on this quest)

The EDID format can be found on Wikipedia: Extended display identification data
Here is the code used to get the EDID Vendor and Product id

edid=$(xrandr -q --verbose | 
         sed -n '/^[[:space:]]\+00ffffffffffff00/,/[^a-fA-F0-9[:space:]]/{
                                                  /[^a-fA-F0-9[:space:]]/d
                                                  s/[[:space:]]\+//g; p}')
nibble=({0..1}{0..1}{0..1}{0..1})
vend=$(for i in {16..19} ;do 
           printf "%s" ${nibble[$((16#${edid:$i:1}))]}
       done)
vend="$(for i in 1 6 11 ;do
            printf \\x$(printf %x $((2#${vend:$i:5} +64)))
        done)"
prod=$((16#${edid:22:2}${edid:20:2}))
printf "monitor: vendor \"%s\", prod id \"%s\"\n" "${vend}" "$prod"

Edit: Here are the leading lines of xrandr -q verbose outpt ... up to the end of the EDID hex dump

Screen 0: minimum 320 x 200, current 1280 x 960, maximum 8192 x 8192
VGA1 connected 1280x960+0+0 (0x47) normal (normal left inverted right x axis y axis) 320mm x 240mm
        Identifier: 0x41
        Timestamp:  26386
        Subpixel:   unknown
        Clones:    
        CRTC:       0
        CRTCs:      0 1
        Transform:  1.000000 0.000000 0.000000
                    0.000000 1.000000 0.000000
                    0.000000 0.000000 1.000000
                   filter: 
        EDID:
                00ffffffffffff005a63444809000000
                15090101682018b1e84f22a157479925
                0f484ffffe00315945596159714f8140
                818001010101000000ff004848393231
                30303030390a2020000000fd0032781e
                46ff000a202020202020000000fc0056
                696577536f6e696320453737000000fc
                00312d320a2020202020202020200084
  1280x1024 (0x46)  108.0MHz +HSync +VSync
        h: width  1280 start 1328 end 1440 total 1688 skew    0 clock   64.0KHz
        v: height 1024 start 1025 end 1028 total 1066           clock   60.0Hz
  1280x960 (0x47)  ....  
        ...
        ... etc
2
  • There is similar topic in stackoverflow.com.
    – pevik
    May 22, 2015 at 7:10
  • @peter-o probably you meant xrandr -q --verbose (typo in your command)
    – dovah
    Oct 6, 2016 at 0:22

6 Answers 6

14

In Ubuntu's Monitor Preferences, it is identified as Viewsonic Corporation 16". How can I extract this human readable form?

That human readable form ("Viewsonic Corporation") doesn't come directly from your EDID: Ubuntu uses gnome libraries underneath. libgnome-desktop decodes the edid and via pnp.ids converts the three-letter vendor ID ("VSC" in your particular case) into a "pretty name for the display.
On my system

grep VSC /usr/share/hwdata/pnp.ids

returns:

VSC    ViewSonic Corporation

That aside, additional information can be extracted from the EDID, namely from the descriptor blocks. From the same wikipedia link:

Descriptor blocks. Detailed timing descriptors, in decreasing preference order. After all detailed timing descriptors, additional descriptors are permitted:

  • Monitor range limits (required)
  • ASCII text (monitor name (required), monitor serial number or unstructured text)
  • 6 Additional standard timing information blocks
  • Colour point data

Currently defined descriptor types are:

  • 0xFF: Monitor serial number (text)
  • 0xFE: Unspecified text (text)
  • 0xFD: Monitor range limits. 6- or 13-byte binary descriptor.
  • 0xFC: Monitor name (text)
  • 0xFB: Additional white point data. 2× 5-byte descriptors, padded with 0A 20 20.
  • 0xFA: Additional standard timing identifiers. 6× 2-byte descriptors, padded with 0A.

In your EDID you have 0xFF (serial number) in descriptor 1 (bytes 54-71):

00 ff 00 48 48 39 32 31 30 30 30 30 39 0a 20 20 00 00

and you have 0xFC (monitor name) in descriptor 3 (bytes 90–107) and 4 (bytes 108–125):

  00 fc 00 56 69 65 77 53 6f 6e 69 63 20 45 37 37 00 00
  00 fc 00 31 2d 32 0a 20 20 20 20 20 20 20 20 20 00 84

so it's only a matter of extracting the information from there, e.g. descriptor 3:

56 69 65 77 53 6f 6e 69 63 20 45 37 37 >> Viewsonic E77


Finally, I have no idea how to determine (in linux) if a monitor is LCD or CRT. I don't know of any library that implements such function (like this one from MS).

1
  • That's a great answer. Thanks for the effort.
    – Peter.O
    Mar 18, 2013 at 1:24
6

Something like this should work better (all others answers didn't work 100% here):

for file in `ls -1 /sys/class/drm/*/edid`; do text=$(tr -d '\0' <"$file"); if [ -n "$text" ]; then edid-decode "$file" | grep -e Manufacturer: -e Product; sleep 0.0001; fi done

I tested here with 2 monitors. My primary is a builtin laptop monitor and the secondary is a DELL 25". This was the output:

Manufacturer: DELL Model 53359 Serial Number 809781068
Display Product Serial Number: YKFWP5790DGL
Display Product Name: DELL U2515H
Manufacturer: LGD Model 1133 Serial Number 0

You must have installed the edid-decode in your distro. My setup is DELL Latitude e5450 with Ubuntu 20.04.

1
  • Does not work if nvidia binary driver is in use, because there are no files /sys/class/drm/*/edid then. Related bug report
    – jarno
    Dec 25, 2020 at 21:54
2

The following tool can be helpful for decoding edid info: http://cgit.freedesktop.org/xorg/app/edid-decode

0

Some window managers provide commands for listing output details. This one works if you are running swaywm:

$ swaymsg -t get_outputs

It generates the following output

Output eDP-1 'Unknown 0x408D 0x00000000'
  Current mode: 1920x1080 @ 60.049000 Hz
  Position: 0,0
  Scale factor: 1.000000
  Scale filter: nearest
  Subpixel hinting: unknown
  Transform: normal
  Workspace: 10
  Max render time: off
  Adaptive sync: disabled
  Available modes:
    640x480 @ 60.049000 Hz
    800x600 @ 60.049000 Hz
    1024x768 @ 60.049000 Hz
    1280x720 @ 60.049000 Hz
    1280x800 @ 60.049000 Hz
    1440x900 @ 60.049000 Hz
    1280x1024 @ 60.049000 Hz
    1680x1050 @ 60.049000 Hz
    1920x1080 @ 60.049000 Hz

Output HDMI-A-1 'Samsung Electric Company C24F390 SRNABC123' (focused)
  Current mode: 1920x1080 @ 60.000000 Hz
  Position: 1920,0
  Scale factor: 1.000000
  Scale filter: nearest
  Subpixel hinting: unknown
  Transform: normal
  Workspace: 1
  Max render time: off
  Adaptive sync: disabled
  Available modes:
    720x400 @ 70.082001 Hz
    640x480 @ 59.939999 Hz
    640x480 @ 60.000000 Hz
    640x480 @ 66.667000 Hz
    640x480 @ 72.808998 Hz
    720x480 @ 59.939999 Hz
    720x480 @ 59.939999 Hz
    720x480 @ 60.000000 Hz
    720x480 @ 60.000000 Hz
    720x576 @ 50.000000 Hz
    720x576 @ 50.000000 Hz
    800x600 @ 56.250000 Hz
    800x600 @ 60.317001 Hz
    800x600 @ 72.188004 Hz
    1024x768 @ 60.004002 Hz
    1024x768 @ 70.069000 Hz
    1280x720 @ 50.000000 Hz
    1280x720 @ 50.000000 Hz
    1280x720 @ 59.939999 Hz
    1280x720 @ 60.000000 Hz
    1280x720 @ 60.000000 Hz
    1280x800 @ 59.910000 Hz
    1440x900 @ 59.901001 Hz
    1280x1024 @ 60.020000 Hz
    1600x900 @ 60.000000 Hz
    1680x1050 @ 59.882999 Hz
    1920x1080 @ 50.000000 Hz
    1920x1080 @ 59.939999 Hz
    1920x1080 @ 60.000000 Hz
    1920x1080 @ 60.000000 Hz
0

I've been trying to obtain the model number for some Dell flat panel displays that are connected to an older PC running Ubuntu 16.04 LTE. This is the method that finally worked for me.

  1. I installed the package edid-decode.
$ sudo apt update
$ sudo apt install -y edid-decode
  1. The edid-decode manual page states,
SYNOPSIS
    edid-decode [in] [out]

DESCRIPTION
    [...] With two arguments, normal output is suppressed, and
    the binary EDID blob is written to the file named by the
    second argument. [...]

NOTES
       Not all fields are decoded, or decoded completely.  Some
       fields' decoding may appear to corrupt the output….

The statement under the "NOTES" section about corrupted output was happening for me. Running edid-decode produced some garbled output (non-printing characters) prior to outputting some human-readable text.

Given the information in the manual page, I tried this command line:

$ edid-decode /sys/class/drm/card0/card0-VGA-1/edid vga.edid

Unfortunately, this did not produce the output file vga.edid. So, I manually created an empty file named vga.edid and then I reran the edid-decode command line:

$ touch vga.edid
$ edid-decode /sys/class/drm/card0/card0-VGA-1/edid vga.edid

This time, edid-decode dumped the EDID data into the output file vga.edid.

Next, I used the app xxd to produce a hex dump of the contents of file vga.edid. The last line of the hex dump output yielded the monitor's model number:

$ xxd vga.edid
[...other stuff...]
00000070: 0044 454c 2031 3930 3846 5042 4c4b 00ad  .DEL 1908FPBLK..

So, the monitor is a Dell 1908FP (black enclosure).

FWIW, the edid-decode command line shown above also displayed this information for the monitor's manufacturer:

Manufacturer: DEL Model 4047 Serial Number xxxxxxxxx

(NB: I obscured the serial number value.) I looked around a little, but I couldn't find online a lookup table that maps the integer value 4047 to a particular Dell monitor product.

I've tried this approach with two different Dell monitors, both are older models, and it yielded the correct Dell model number for both.

0

This worked for me on Kali GNU/Linux Rolling; Linux 6.1.0-kali9-amd64 for an external monitor connected via HDMI;

grep -i "monitor name" /var/log/syslog

You must log in to answer this question.

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