jc: Xrandr parser seems to be broken not extracting display EDID data

The latest changes, perhaps #455, on the xrandr parser may introduced a malfunction as now the parser seems to be unable to extract the EDID information per device when xrandr is called with the --props option.

Xrandr output xrandr --props

Screen 0: minimum 8 x 8, current 2560 x 1440, maximum 32767 x 32767
DVI-D-0 disconnected (normal left inverted right x axis y axis)
        CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
                0 1 
        CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0 
        BorderDimensions: 4 
                supported: 4
        Border: 0 0 0 0 
                range: (0, 65535)
        SignalFormat: TMDS 
                supported: TMDS
        ConnectorType: DVI-D 
        ConnectorNumber: 0 
        _ConnectorLocation: 0 
HDMI-0 disconnected (normal left inverted right x axis y axis)
        CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
                0 1 
        CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0 
        BorderDimensions: 4 
                supported: 4
        Border: 0 0 0 0 
                range: (0, 65535)
        SignalFormat: TMDS 
                supported: TMDS
        ConnectorType: HDMI 
        ConnectorNumber: 3 
        _ConnectorLocation: 3 
DP-0 disconnected (normal left inverted right x axis y axis)
        CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
                0 1 
        CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0 
        BorderDimensions: 4 
                supported: 4
        Border: 0 0 0 0 
                range: (0, 65535)
        SignalFormat: DisplayPort 
                supported: DisplayPort
        ConnectorType: DisplayPort 
        ConnectorNumber: 4 
        _ConnectorLocation: 4 
DP-1 disconnected (normal left inverted right x axis y axis)
        CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
                0 1 
        CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0 
        BorderDimensions: 4 
                supported: 4
        Border: 0 0 0 0 
                range: (0, 65535)
        SignalFormat: TMDS 
                supported: TMDS
        ConnectorType: DisplayPort 
        ConnectorNumber: 4 
        _ConnectorLocation: 4 
DP-2 disconnected (normal left inverted right x axis y axis)
        CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
                0 1 
        CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0 
        BorderDimensions: 4 
                supported: 4
        Border: 0 0 0 0 
                range: (0, 65535)
        SignalFormat: DisplayPort 
                supported: DisplayPort
        ConnectorType: DisplayPort 
        ConnectorNumber: 2 
        _ConnectorLocation: 2 
DP-3 disconnected (normal left inverted right x axis y axis)
        CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
                0 1 
        CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0 
        BorderDimensions: 4 
                supported: 4
        Border: 0 0 0 0 
                range: (0, 65535)
        SignalFormat: TMDS 
                supported: TMDS
        ConnectorType: DisplayPort 
        ConnectorNumber: 2 
        _ConnectorLocation: 2 
DP-4 connected primary 2560x1440+0+0 (normal left inverted right x axis y axis) 597mm x 336mm
        CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
                0 1 
        CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0 
        EDID: 
                00ffffffffffff0010ac33424c303541
                0f210104b53c22783eee95a3544c9926
                0f5054a54b00714f8180a9c0a940d1c0
                010101010101565e00a0a0a029503020
                350055502100001a000000ff00365339
                353350330a2020202020000000fc0044
                454c4c20553237323244450a000000fd
                00314c1e5a19010a2020202020200182
                020319f14c90040302011112131f2021
                2223097f0783010000023a801871382d
                40582c450055502100001e7e3900a080
                381f4030203a0055502100001a011d00
                7251d01e206e28550055502100001ebf
                1600a08038134030203a005550210000
                1a000000000000000000000000000000
                00000000000000000000000000000006
        BorderDimensions: 4 
                supported: 4
        Border: 0 0 0 0 
                range: (0, 65535)
        SignalFormat: DisplayPort 
                supported: DisplayPort
        ConnectorType: DisplayPort 
        ConnectorNumber: 1 
        _ConnectorLocation: 1 
   2560x1440     59.95*+
   2048x1080     60.00    24.00  
   1920x1080     60.00    59.94    50.00    29.97    25.00    23.98  
   1600x1200     60.00  
   1600x900      60.00  
   1280x1024     75.02    60.02  
   1280x720      60.00    59.94    50.00  
   1152x864      75.00  
   1024x768      75.03    60.00  
   800x600       75.00    60.32  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    59.94    59.93  
DP-5 disconnected (normal left inverted right x axis y axis)
        CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
                0 1 
        CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0 
        BorderDimensions: 4 
                supported: 4
        Border: 0 0 0 0 
                range: (0, 65535)
        SignalFormat: TMDS 
                supported: TMDS
        ConnectorType: DisplayPort 
        ConnectorNumber: 1 
        _ConnectorLocation: 1

JC parser output

{
  "screens": [
    {
      "devices": [
        {
          "modes": [],
          "is_connected": false,
          "is_primary": false,
          "device_name": "DVI-D-0",
          "rotation": "normal",
          "reflection": "normal"
        },
        {
          "modes": [],
          "is_connected": false,
          "is_primary": false,
          "device_name": "HDMI-0",
          "rotation": "normal",
          "reflection": "normal"
        },
        {
          "modes": [],
          "is_connected": false,
          "is_primary": false,
          "device_name": "DP-0",
          "rotation": "normal",
          "reflection": "normal"
        },
        {
          "modes": [],
          "is_connected": false,
          "is_primary": false,
          "device_name": "DP-1",
          "rotation": "normal",
          "reflection": "normal"
        },
        {
          "modes": [],
          "is_connected": false,
          "is_primary": false,
          "device_name": "DP-2",
          "rotation": "normal",
          "reflection": "normal"
        },
        {
          "modes": [],
          "is_connected": false,
          "is_primary": false,
          "device_name": "DP-3",
          "rotation": "normal",
          "reflection": "normal"
        },
        {
          "modes": [
            {
              "resolution_width": 2560,
              "resolution_height": 1440,
              "is_high_resolution": false,
              "frequencies": [
                {
                  "frequency": 59.95,
                  "is_current": true,
                  "is_preferred": true
                }
              ]
            },
            {
              "resolution_width": 2048,
              "resolution_height": 1080,
              "is_high_resolution": false,
              "frequencies": [
                {
                  "frequency": 60,
                  "is_current": false,
                  "is_preferred": false
                },
                {
                  "frequency": 24,
                  "is_current": false,
                  "is_preferred": false
                }
              ]
            },
            {
              "resolution_width": 1920,
              "resolution_height": 1080,
              "is_high_resolution": false,
              "frequencies": [
                {
                  "frequency": 60,
                  "is_current": false,
                  "is_preferred": false
                },
                {
                  "frequency": 59.94,
                  "is_current": false,
                  "is_preferred": false
                },
                {
                  "frequency": 50,
                  "is_current": false,
                  "is_preferred": false
                },
                {
                  "frequency": 29.97,
                  "is_current": false,
                  "is_preferred": false
                },
                {
                  "frequency": 25,
                  "is_current": false,
                  "is_preferred": false
                },
                {
                  "frequency": 23.98,
                  "is_current": false,
                  "is_preferred": false
                }
              ]
            },
            {
              "resolution_width": 1600,
              "resolution_height": 1200,
              "is_high_resolution": false,
              "frequencies": [
                {
                  "frequency": 60,
                  "is_current": false,
                  "is_preferred": false
                }
              ]
            },
            {
              "resolution_width": 1600,
              "resolution_height": 900,
              "is_high_resolution": false,
              "frequencies": [
                {
                  "frequency": 60,
                  "is_current": false,
                  "is_preferred": false
                }
              ]
            },
            {
              "resolution_width": 1280,
              "resolution_height": 1024,
              "is_high_resolution": false,
              "frequencies": [
                {
                  "frequency": 75.02,
                  "is_current": false,
                  "is_preferred": false
                },
                {
                  "frequency": 60.02,
                  "is_current": false,
                  "is_preferred": false
                }
              ]
            },
            {
              "resolution_width": 1280,
              "resolution_height": 720,
              "is_high_resolution": false,
              "frequencies": [
                {
                  "frequency": 60,
                  "is_current": false,
                  "is_preferred": false
                },
                {
                  "frequency": 59.94,
                  "is_current": false,
                  "is_preferred": false
                },
                {
                  "frequency": 50,
                  "is_current": false,
                  "is_preferred": false
                }
              ]
            },
            {
              "resolution_width": 1152,
              "resolution_height": 864,
              "is_high_resolution": false,
              "frequencies": [
                {
                  "frequency": 75,
                  "is_current": false,
                  "is_preferred": false
                }
              ]
            },
            {
              "resolution_width": 1024,
              "resolution_height": 768,
              "is_high_resolution": false,
              "frequencies": [
                {
                  "frequency": 75.03,
                  "is_current": false,
                  "is_preferred": false
                },
                {
                  "frequency": 60,
                  "is_current": false,
                  "is_preferred": false
                }
              ]
            },
            {
              "resolution_width": 800,
              "resolution_height": 600,
              "is_high_resolution": false,
              "frequencies": [
                {
                  "frequency": 75,
                  "is_current": false,
                  "is_preferred": false
                },
                {
                  "frequency": 60.32,
                  "is_current": false,
                  "is_preferred": false
                }
              ]
            },
            {
              "resolution_width": 720,
              "resolution_height": 576,
              "is_high_resolution": false,
              "frequencies": [
                {
                  "frequency": 50,
                  "is_current": false,
                  "is_preferred": false
                }
              ]
            },
            {
              "resolution_width": 720,
              "resolution_height": 480,
              "is_high_resolution": false,
              "frequencies": [
                {
                  "frequency": 59.94,
                  "is_current": false,
                  "is_preferred": false
                }
              ]
            },
            {
              "resolution_width": 640,
              "resolution_height": 480,
              "is_high_resolution": false,
              "frequencies": [
                {
                  "frequency": 75,
                  "is_current": false,
                  "is_preferred": false
                },
                {
                  "frequency": 59.94,
                  "is_current": false,
                  "is_preferred": false
                },
                {
                  "frequency": 59.93,
                  "is_current": false,
                  "is_preferred": false
                }
              ]
            }
          ],
          "is_connected": true,
          "is_primary": true,
          "device_name": "DP-4",
          "rotation": "normal",
          "reflection": "normal",
          "resolution_width": 2560,
          "resolution_height": 1440,
          "offset_width": 0,
          "offset_height": 0,
          "dimension_width": 597,
          "dimension_height": 336
        },
        {
          "modes": [],
          "is_connected": false,
          "is_primary": false,
          "device_name": "DP-5",
          "rotation": "normal",
          "reflection": "normal"
        }
      ],
      "screen_number": 0,
      "minimum_width": 8,
      "minimum_height": 8,
      "current_width": 2560,
      "current_height": 1440,
      "maximum_width": 32767,
      "maximum_height": 32767
    }
  ]
}

The device DP-4 supposed to have the following properties model_name, product_id and serial_number.

About this issue

  • Original URL
  • State: closed
  • Created 5 months ago
  • Comments: 15 (15 by maintainers)

Commits related to this issue

Most upvoted comments

@kellyjonbrazil I see the schema has been chaged a bit, now having all props under a separated field with the corresponding key name. Not a big deal, I need though to update my code to comply with the new schema!

@lyterk thanks for your time, both guys!

Thanks for providing that, similar enough to my system.

regular expressions should be this way as tabs are just blank spaces after all.

I was hoping I would be able to do that, but unfortunately that didn’t work out for me. On my systems, it obligatorily has e.g. 3 spaces in front of the resolution modes (1680x1050 59.95 59.88), and some number of tabs before props (EDID etc). So there’s no good way to resolve the indirection without at least considering tabs vs spaces, instead of just generic whitespace.

I’m using that along with my regexes to pre-identify lines before populating them into our structures. I should have a commit for tomorrow.