Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
share|improve this question

1 Answer 1

up vote 1 down vote accepted

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") does not 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.

gnome-pnp-ids.c, line 51:

* Note: we now prefer to use data coming from hwdata (and shipped with gnome-desktop)*

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

There are some linux tools out there that parse EDIDs... I use monitor-edid. Here is the output in Perl dumper format on my machine:

(
+{
          'EISA_ID' => 'CMO1574',
          'checksum' => 25,
          'detailed_timings' => [
                                  {
                                    'ModeLine' => '"1600x900" 97.75 1600 1648 1680 1760 900 903 908 926 -hsync -vsync',
                                    'ModeLine_comment' => '# Monitor preferred modeline (60.0 Hz vsync, 55.5 kHz hsync, ratio 16/9, 118 dpi)',
                                    'digital_composite' => 3,
                                    'horizontal_active' => 1600,
                                    'horizontal_blanking' => 160,
                                    'horizontal_border' => 0,
                                    'horizontal_dpi' => '118.139534883721',
                                    'horizontal_image_size' => 344,
                                    'horizontal_sync_offset' => 48,
                                    'horizontal_sync_positive' => 0,
                                    'horizontal_sync_pulse_width' => 32,
                                    'interlaced' => 0,
                                    'pixel_clock' => '97.75',
                                    'preferred' => 1,
                                    'stereo' => 0,
                                    'vertical_active' => 900,
                                    'vertical_blanking' => 26,
                                    'vertical_border' => 0,
                                    'vertical_dpi' => '118.445595854922',
                                    'vertical_image_size' => 193,
                                    'vertical_sync_offset' => 3,
                                    'vertical_sync_positive' => 0,
                                    'vertical_sync_pulse_width' => 5
                                  }
                                ],
          'diagonal_size' => '15.5292379824145',
          'edid_revision' => 3,
          'edid_version' => 1,
          'established_timings' => [],
          'extension_flag' => 0,
          'feature_support' => {
                                 'DPMS_active_off' => 0,
                                 'DPMS_standby' => 0,
                                 'DPMS_suspend' => 0,
                                 'GTF_compliance' => 0,
                                 'has_preferred_timing' => 1,
                                 'rgb' => 0,
                                 'sRGB_compliance' => 0
                               },
          'file' => '/sys/class/drm/card0-LVDS-1/edid',
          'gamma' => 120,
          'manufacturer_name' => 'CMO',
          'max_size_horizontal' => '34.4',
          'max_size_precision' => 'mm',
          'max_size_vertical' => '19.3',
          'monitor_details' => '',
          'monitor_text' => [
                              'N156O6-L01',
                              'CMO',
                              'N156O6-L01'
                            ],
          'product_code' => 5492,
          'ratio' => '1.78238341968912',
          'ratio_name' => '16/9',
          'ratio_precision' => 'mm',
          'serial_number' => 0,
          'standard_timings' => [],
          'video_input_definition' => {
                                        'composite_sync' => 0,
                                        'digital' => 1,
                                        'separate_sync' => 0,
                                        'sync_on_green' => 0,
                                        'voltage_level' => 0
                                      },
          'week' => 41,
          'year' => 2008
        }
,
)

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).

share|improve this answer
    
That's a great answer. Thanks for the effort. –  Peter.O Mar 18 '13 at 1:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.