Find the answer to your Linux question:
Results 1 to 8 of 8
Hello everyone! I am currently developing an small program in Python and at a certain point, I need to do some “stuff” depending on the monitors that are connected to ...
  1. #1
    Just Joined!
    Join Date
    Jul 2010
    Posts
    5

    Get model of monitors plugged to the computer

    Hello everyone!

    I am currently developing an small program in Python and at a certain point, I need to do some “stuff” depending on the monitors that are connected to the computer. I have an intel vga card with two outputs. I want to do “something” if one of the screens connected to the output is a “Dell”, another “something” if one of the monitors is a “Nec” and another “something” if both monitors are connected.

    So the question is: Is there any way to get the vendor/model of the monitors currently connected to the computer?

    I did a little bit testing. I plugged both screens to my vga card (the Nec to the HDMI output and the Dell to the DVI output), and the gnome-display-properties tool properly detected the model, size, resolution... of both screens connected. I would like to know if I can use a command on bash (or a library in python) to get the same information.

    The /var/log/Xorg.0.log also shows properly:

    (II) intel(0): EDID vendor "NEC", prod id 26345
    (II) intel(0): I2C device "HDMIDDC_C:E-EDID segment register" registered at address 0x60.
    (II) intel(0): I2C device "HDMIDDC_C:ddc2" registered at address 0xA0.
    (II) intel(0): EDID vendor "DEL", prod id 41027

    I could always parse that file, but it is not the best solution...

    I also tried the ddprobe command, but for some reason, it only detects one of the screens (the Dell, connected to a DVI cable)

    I am currently using Ubuntu 9.04 and Python2.4 (just in case it's relevant)

    Thank you very much in advance!

  2. #2
    Linux Newbie JosePF's Avatar
    Join Date
    Jun 2010
    Posts
    225
    Hi,
    You could try installing read-edid and run get-edid or get-edid | parse-edid.

    I hope this help you
    Regards

  3. #3
    Just Joined!
    Join Date
    Jul 2010
    Posts
    5
    Thank you for your reply.

    I tried that and it doesn't seem to recognize my second monitor (the NEC)...

    aer@aer-desktop:~$ sudo get-edid | parse-edid
    parse-edid: parse-edid version 1.4.1
    get-edid: get-edid version 1.4.1

    Performing real mode VBE call
    Interrupt 0x10 ax=0x4f00 bx=0x0 cx=0x0
    Function supported
    Call successful

    VBE version 300
    VBE string at 0x11110 "Intel(r)Eaglelake Graphics Chip Accelerated VGA BIOS"

    VBE/DDC service about to be called
    Report DDC capabilities

    Performing real mode VBE call
    Interrupt 0x10 ax=0x4f15 bx=0x0 cx=0x0
    Function supported
    Call successful

    Monitor and video card combination does not support DDC1 transfers
    Monitor and video card combination supports DDC2 transfers
    0 seconds per 128 byte EDID block transfer
    Screen is not blanked during DDC transfer

    Reading next EDID block

    VBE/DDC service about to be called
    Read EDID

    Performing real mode VBE call
    Interrupt 0x10 ax=0x4f15 bx=0x1 cx=0x0
    Function supported
    Call successful

    parse-edid: EDID checksum passed.

    # EDID version 1 revision 3
    Section "Monitor"
    # Block type: 2:0 3:ff
    # Block type: 2:0 3:fc
    Identifier "DELL S2209W"
    VendorName "DEL"
    ModelName "DELL S2209W"
    # Block type: 2:0 3:ff
    # Block type: 2:0 3:fc
    # Block type: 2:0 3:fd
    HorizSync 30-83
    VertRefresh 50-76
    # Max dot clock (video bandwidth) 170 MHz
    # DPMS capabilities: Active off:yes Suspend:yes Standby:yes

    Mode "1920x1080" # vfreq 60.000Hz, hfreq 67.500kHz
    DotClock 148.500000
    HTimings 1920 2008 2052 2200
    VTimings 1080 1084 1089 1125
    Flags "+HSync" "+VSync"
    EndMode
    # Block type: 2:0 3:ff
    # Block type: 2:0 3:fc
    # Block type: 2:0 3:fd
    EndSection


    I swear the NEC is "on" (I made sure it was being recognized by gnome-display-properties when I tried the read the edid)

  4. #4
    Just Joined!
    Join Date
    Jul 2010
    Posts
    5

    Re: Get model of monitors plugged to the computer

    I am going to reply to myself...

    The command xrandr seems to work fine and provides me the EDID of the screens


  5. #5
    Linux Newbie JosePF's Avatar
    Join Date
    Jun 2010
    Posts
    225
    hi,
    i used xrandr but it is not show model and vendor,
    what flags have to be used to show model and vendor?

  6. #6
    Just Joined!
    Join Date
    Jul 2010
    Posts
    5

    Wink Re: Get model of monitors plugged to the computer

    Well... I got it from the raw edid data...

    I got the format from the Wikipedia (look for "EDID", Extended_display_identification_data)

    If you execute:
    xrandr -q --verbose

    You will see among the output a block saying:
    Code:
    	EDID_DATA:
    		00ffffffffffff0010ac43a055465032
    		1413010380301b78eeee91a3544c9926
    		0f5054a54b00714f8180d1c001010101
    		010101010101023a801871382d40582c
    		4500dd0c1100001e000000ff004e3736
    		3448393547325046550a000000fc0044
    		454c4c205332323039570a20000000fd
    		00324c1e5311000a20202020202000ec

    The header is:
    00ffffffffffff00

    The information about the manufacturer comes right after that and is in:
    10ac
    and the information about the model comes in the following 2 bytes (4 chars)
    43a0

    For the manufacturer:
    10ac = 0001 0000 1010 1100
    Reorganizing: 0[00100 00101 01100]
    00100 = 4 (4th letter in the alphabet: D)
    00101 = 5 (5th letter in the alphabet: E)
    01100 = 12 (12th letter in the alphabet: L)
    DEL (my Dell monitor)

    For the model:
    Reorganize 43a0 => a043
    Make it decimal 41027
    That's the model that the Xorg.log is showing

    Code:
    cat /var/log/Xorg.0.log | grep EDID
    (II) intel(0): EDID vendor "DEL", prod id 41027
    Hope it helps

  7. #7
    Linux Newbie JosePF's Avatar
    Join Date
    Jun 2010
    Posts
    225
    Thank you very much for information
    it is very usefull for me.

    Regards

  8. #8
    Just Joined!
    Join Date
    Jul 2010
    Posts
    5
    Glad I helped

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...