rpavlik / edid-json-tools

Convert between EDID binaries and editable JSON
BSD 3-Clause "New" or "Revised" License
11 stars 2 forks source link

Missing fields in JSON output #2

Open r-vdp opened 1 year ago

r-vdp commented 1 year ago

After a lot of searching for a tool to edit EDID data and save the result to a new binary file, I came across this repo.

However, it seems that not all data is included if I run edid2json on my monitor's EDID file. Notable, the actual higher resolution modelines are missing, there is no mention of 3840x2160 in the output of edid2json.

Do you have any idea why this is? Is it simply not implemented? It would be great if we could extend this tool to cover all this data too. I might be able to help out in doing that.

E.g., edid-decode gives me this:

edid-decode (hex):

00 ff ff ff ff ff ff 00 10 ac 05 d1 56 50 43 30
33 20 01 03 80 46 28 78 ea 3c 55 ad 4f 46 a8 27
11 50 54 a5 4b 00 a9 c0 b3 00 d1 00 71 4f a9 40
81 80 d1 c0 01 01 34 3c 80 a0 70 b0 23 40 30 20
36 00 ff ff 00 00 00 1e 00 00 00 ff 00 44 30 38
54 36 4e 33 0a 20 20 20 20 20 00 00 00 fc 00 44
45 4c 4c 20 53 33 32 32 31 51 53 41 00 00 00 fd
00 28 3c 1d 8c 21 00 0a 20 20 20 20 20 20 01 fb

02 03 40 f1 54 00 00 04 03 02 00 00 01 00 11 12
00 13 00 1f 10 5d 5e 5f 00 23 09 07 07 83 01 00
00 6d 03 0c 00 10 00 30 3c 20 00 60 01 02 03 67
00 00 00 00 00 00 00 68 1a 00 00 01 01 28 3c e6
56 5e 00 a0 a0 a0 29 50 30 20 35 00 b9 88 21 00
00 1a 02 3a 80 18 71 38 2d 40 58 2c 45 00 b9 88
21 00 00 1e 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3b

----------------

Block 0, Base EDID:
  EDID Structure Version & Revision: 1.3
  Vendor & Product Identification:
    Manufacturer: DEL
    Model: 53509
    Serial Number: 809717846
    Made in: week 51 of 2022
  Basic Display Parameters & Features:
    Digital display
    Maximum image size: 70 cm x 40 cm
    Gamma: 2.20
    DPMS levels: Standby Suspend Off
    RGB color display
    First detailed timing is the preferred timing
  Color Characteristics:
    Red  : 0.6757, 0.3115
    Green: 0.2763, 0.6562
    Blue : 0.1533, 0.0673
    White: 0.3134, 0.3291
  Established Timings I & II:
    IBM     :   720x400    70.081663 Hz   9:5     31.467 kHz     28.320000 MHz
    DMT 0x04:   640x480    59.940476 Hz   4:3     31.469 kHz     25.175000 MHz
    DMT 0x06:   640x480    75.000000 Hz   4:3     37.500 kHz     31.500000 MHz
    DMT 0x09:   800x600    60.316541 Hz   4:3     37.879 kHz     40.000000 MHz
    DMT 0x0b:   800x600    75.000000 Hz   4:3     46.875 kHz     49.500000 MHz
    DMT 0x10:  1024x768    60.003840 Hz   4:3     48.363 kHz     65.000000 MHz
    DMT 0x12:  1024x768    75.028582 Hz   4:3     60.023 kHz     78.750000 MHz
    DMT 0x24:  1280x1024   75.024675 Hz   5:4     79.976 kHz    135.000000 MHz
  Standard Timings:
    DMT 0x53:  1600x900    60.000000 Hz  16:9     60.000 kHz    108.000000 MHz (RB)
    DMT 0x3a:  1680x1050   59.954250 Hz  16:10    65.290 kHz    146.250000 MHz
    DMT 0x45:  1920x1200   59.884600 Hz  16:10    74.556 kHz    193.250000 MHz
    DMT 0x15:  1152x864    75.000000 Hz   4:3     67.500 kHz    108.000000 MHz
    DMT 0x33:  1600x1200   60.000000 Hz   4:3     75.000 kHz    162.000000 MHz
    DMT 0x23:  1280x1024   60.019740 Hz   5:4     63.981 kHz    108.000000 MHz
    DMT 0x52:  1920x1080   60.000000 Hz  16:9     67.500 kHz    148.500000 MHz
  Detailed Timing Descriptors:
    DTD 1:  1920x1200   59.996886 Hz  16:10    74.096 kHz    154.120000 MHz (255 mm x 255 mm)
                 Hfront   48 Hsync  32 Hback   80 Hpol P
                 Vfront    3 Vsync   6 Vback   26 Vpol P
    Display Product Serial Number: 'D08T6N3'
    Display Product Name: 'DELL S3221QSA'
    Display Range Limits:
      Monitor ranges (GTF): 40-60 Hz V, 29-140 kHz H, max dotclock 330 MHz
  Extension blocks: 1
Checksum: 0xfb

----------------

Block 1, CTA-861 Extension Block:
  Revision: 3
  Underscans IT Video Formats by default
  Basic audio support
  Supports YCbCr 4:4:4
  Supports YCbCr 4:2:2
  Native detailed modes: 1
  Video Data Block:
    VIC   4:  1280x720    60.000000 Hz  16:9     45.000 kHz     74.250000 MHz
    VIC   3:   720x480    59.940060 Hz  16:9     31.469 kHz     27.000000 MHz
    VIC   2:   720x480    59.940060 Hz   4:3     31.469 kHz     27.000000 MHz
    VIC   1:   640x480    59.940476 Hz   4:3     31.469 kHz     25.175000 MHz
    VIC  17:   720x576    50.000000 Hz   4:3     31.250 kHz     27.000000 MHz
    VIC  18:   720x576    50.000000 Hz  16:9     31.250 kHz     27.000000 MHz
    VIC  19:  1280x720    50.000000 Hz  16:9     37.500 kHz     74.250000 MHz
    VIC  31:  1920x1080   50.000000 Hz  16:9     56.250 kHz    148.500000 MHz
    VIC  16:  1920x1080   60.000000 Hz  16:9     67.500 kHz    148.500000 MHz
    VIC  93:  3840x2160   24.000000 Hz  16:9     54.000 kHz    297.000000 MHz
    VIC  94:  3840x2160   25.000000 Hz  16:9     56.250 kHz    297.000000 MHz
    VIC  95:  3840x2160   30.000000 Hz  16:9     67.500 kHz    297.000000 MHz
  Audio Data Block:
    Linear PCM:
      Max channels: 2
      Supported sample rates (kHz): 48 44.1 32
      Supported sample sizes (bits): 24 20 16
  Speaker Allocation Data Block:
    FL/FR - Front Left/Right
  Vendor-Specific Data Block (HDMI), OUI 00-0C-03:
    Source physical address: 1.0.0.0
    DC_36bit
    DC_30bit
    Maximum TMDS clock: 300 MHz
    Extended HDMI video details:
      HDMI VICs:
        HDMI VIC 1:  3840x2160   30.000000 Hz  16:9     67.500 kHz    297.000000 MHz
        HDMI VIC 2:  3840x2160   25.000000 Hz  16:9     56.250 kHz    297.000000 MHz
        HDMI VIC 3:  3840x2160   24.000000 Hz  16:9     54.000 kHz    297.000000 MHz
  Vendor-Specific Data Block, OUI 00-00-00:
    00 00 00 00                                     '....'
  Vendor-Specific Data Block (AMD), OUI 00-00-1A:
    Version: 1.1
    Minimum Refresh Rate: 40 Hz
    Maximum Refresh Rate: 60 Hz
    Flags 1.x: 0xe6 (MCCS)
  Detailed Timing Descriptors:
    DTD 2:  2560x1440   59.950550 Hz  16:9     88.787 kHz    241.500000 MHz (697 mm x 392 mm)
                 Hfront   48 Hsync  32 Hback   80 Hpol P
                 Vfront    3 Vsync   5 Vback   33 Vpol N
    DTD 3:  1920x1080   60.000000 Hz  16:9     67.500 kHz    148.500000 MHz (697 mm x 392 mm)
                 Hfront   88 Hsync  44 Hback  148 Hpol P
                 Vfront    4 Vsync   5 Vback   36 Vpol P
Checksum: 0x3b  Unused space in Extension Block: 27 bytes

Whereas edid2json on the same EDID file gives me this:

{
    "Base": {
        "Basic Display": {
            "Aspect ratio (landscape)": null,
            "Aspect ratio (portrait)": null,
            "Color Bit Depth": null,
            "Continuous frequency supported": false,
            "DPM active-off supported": true,
            "DPM standby supported": true,
            "DPM suspend supported": true,
            "Digital Video Interface Standard Support": null,
            "Display color type": "RGB 4:4:4 + YCrCb 4:4:4",
            "Display gamma": 2.2,
            "Maximum dimensions (cm)": {
                "x": 70,
                "y": 40
            },
            "Preferred timing includes native timing pixel format and refresh rate": true,
            "Video input type": "Digital",
            "sRGB Standard is default colour space": false
        },
        "Chromaticity": {
            "Blue": {
                "x": 157,
                "y": 69
            },
            "Green": {
                "x": 283,
                "y": 672
            },
            "Red": {
                "x": 692,
                "y": 319
            },
            "White": {
                "x": 321,
                "y": 337
            }
        },
        "Descriptors": [
            {
                "Addressable": {
                    "x": 1920,
                    "y": 1200
                },
                "Blanking": {
                    "x": 160,
                    "y": 35
                },
                "Border": {
                    "x": 0,
                    "y": 0
                },
                "Front porch": {
                    "x": 48,
                    "y": 3
                },
                "Image size (mm)": {
                    "x": 255,
                    "y": 255
                },
                "Interlace": false,
                "Pixel clock (MHz)": 154.12,
                "Stereo viewing": "No stereo",
                "Sync pulse": {
                    "x": 32,
                    "y": 6
                },
                "Sync type": {
                    "Horizontal sync (outside of V-sync)": "Positive",
                    "Type": "Digital Separate Sync",
                    "Vertical sync": "Positive"
                },
                "Type": "Detailed Timing Descriptor"
            },
            {
                "Data string": "D08T6N3",
                "Type": "Display Product Serial Number"
            },
            {
                "Data string": "DELL S3221QSA",
                "Type": "Display Product Name"
            },
            {
                "Horizontal rate (kHz)": {
                    "Maximum": 140,
                    "Minimum": 29
                },
                "Pixel clock (MHz)": 330,
                "Subtype": "Default GTF supported",
                "Type": "Display Range Limits Descriptor",
                "Vertical rate (Hz)": {
                    "Maximum": 60,
                    "Minimum": 40
                }
            }
        ],
        "Established Timing": {
            "1024x768 @ 60 Hz": true,
            "1024x768 @ 72 Hz": false,
            "1024x768 @ 75 Hz": true,
            "1024x768 @ 87 Hz, interlaced (1024x768i)": false,
            "1152x870 @ 75 Hz (Apple Macintosh II)": false,
            "1280x1024 @ 75 Hz": true,
            "640x480 @ 60 Hz": true,
            "640x480 @ 67 Hz": false,
            "640x480 @ 72 Hz": false,
            "640x480 @ 75 Hz": true,
            "720x400 @ 70 Hz": true,
            "720x400 @ 88 Hz": false,
            "800x600 @ 56 Hz": false,
            "800x600 @ 60 Hz": true,
            "800x600 @ 72 Hz": false,
            "800x600 @ 75 Hz": true,
            "832x624 @ 75 Hz": false,
            "Manufacturer specific display mode 1": false,
            "Manufacturer specific display mode 2": false,
            "Manufacturer specific display mode 3": false,
            "Manufacturer specific display mode 4": false,
            "Manufacturer specific display mode 5": false,
            "Manufacturer specific display mode 6": false,
            "Manufacturer specific display mode 7": false
        },
        "Manufacturer Info": {
            "ID Product Code": 53509,
            "Manufacturer ID": "DEL",
            "Model year": null,
            "Serial number": 809717846,
            "Week of manufacture": 51,
            "Year of manufacture": 2022
        },
        "Standard Timing": [
            {
                "Frequency": 60,
                "Ratio": "16:9",
                "X resolution": 1600
            },
            {
                "Frequency": 60,
                "Ratio": "16:10",
                "X resolution": 1680
            },
            {
                "Frequency": 60,
                "Ratio": "16:10",
                "X resolution": 1920
            },
            {
                "Frequency": 75,
                "Ratio": "4:3",
                "X resolution": 1152
            },
            {
                "Frequency": 60,
                "Ratio": "4:3",
                "X resolution": 1600
            },
            {
                "Frequency": 60,
                "Ratio": "5:4",
                "X resolution": 1280
            },
            {
                "Frequency": 60,
                "Ratio": "16:9",
                "X resolution": 1920
            }
        ]
    },
    "Extensions": [
        {
            "Basic audio": true,
            "Data blocks": [
                {
                    "Short video descriptors": [
                        {
                            "Nativity": "Unspecified",
                            "VIC": 0
                        },
                        {
                            "Nativity": "Unspecified",
                            "VIC": 0
                        },
                        {
                            "Nativity": "Non-native",
                            "VIC": 4
                        },
                        {
                            "Nativity": "Non-native",
                            "VIC": 3
                        },
                        {
                            "Nativity": "Non-native",
                            "VIC": 2
                        },
                        {
                            "Nativity": "Unspecified",
                            "VIC": 0
                        },
                        {
                            "Nativity": "Unspecified",
                            "VIC": 0
                        },
                        {
                            "Nativity": "Non-native",
                            "VIC": 1
                        },
                        {
                            "Nativity": "Unspecified",
                            "VIC": 0
                        },
                        {
                            "Nativity": "Non-native",
                            "VIC": 17
                        },
                        {
                            "Nativity": "Non-native",
                            "VIC": 18
                        },
                        {
                            "Nativity": "Unspecified",
                            "VIC": 0
                        },
                        {
                            "Nativity": "Non-native",
                            "VIC": 19
                        },
                        {
                            "Nativity": "Unspecified",
                            "VIC": 0
                        },
                        {
                            "Nativity": "Non-native",
                            "VIC": 31
                        },
                        {
                            "Nativity": "Non-native",
                            "VIC": 16
                        },
                        {
                            "Nativity": "Unspecified",
                            "VIC": 93
                        },
                        {
                            "Nativity": "Unspecified",
                            "VIC": 94
                        },
                        {
                            "Nativity": "Unspecified",
                            "VIC": 95
                        },
                        {
                            "Nativity": "Unspecified",
                            "VIC": 0
                        }
                    ],
                    "Type": "Video Data Block"
                },
                {
                    "Short audio descriptors": [
                        {
                            "Bit depth": {
                                "16 bit": true,
                                "20 bit": true,
                                "24 bit": true
                            },
                            "Max channel count": 2,
                            "Supported sampling": {
                                "176.4kHz": false,
                                "192kHz": false,
                                "32kHz": true,
                                "44.1kHz": true,
                                "48kHz": true,
                                "88.2kHz": false,
                                "96kHz": false
                            },
                            "Type": "Linear Pulse Code Modulation (LPCM)"
                        }
                    ],
                    "Type": "Audio Data Block"
                },
                {
                    "Speaker allocation": {
                        "Front Center": false,
                        "Front Center High": false,
                        "Front Left / Front Right": true,
                        "Front Left Center / Front Right Center": false,
                        "Front Left High / Front Right High": false,
                        "Front Left Wide / Front Right Wide": false,
                        "LFE": false,
                        "Rear Center": false,
                        "Rear Left / Rear Right": false,
                        "Rear Left Center / Rear Right Center": false,
                        "Top Center": false
                    },
                    "Type": "Speaker Allocation Block"
                },
                {
                    "Data payload": [
                        16,
                        0,
                        48,
                        60,
                        32,
                        0,
                        96,
                        1,
                        2,
                        3
                    ],
                    "IEEE OUI": "00-0c-03",
                    "Type": "Vendor-Specific Data Block"
                },
                {
                    "Data payload": [
                        0,
                        0,
                        0,
                        0
                    ],
                    "IEEE OUI": "00-00-00",
                    "Type": "Vendor-Specific Data Block"
                },
                {
                    "Data payload": [
                        1,
                        1,
                        40,
                        60,
                        230
                    ],
                    "IEEE OUI": "00-00-1a",
                    "Type": "Vendor-Specific Data Block"
                }
            ],
            "Descriptors": [
                {
                    "Addressable": {
                        "x": 2560,
                        "y": 1440
                    },
                    "Blanking": {
                        "x": 160,
                        "y": 41
                    },
                    "Border": {
                        "x": 0,
                        "y": 0
                    },
                    "Front porch": {
                        "x": 48,
                        "y": 3
                    },
                    "Image size (mm)": {
                        "x": 697,
                        "y": 392
                    },
                    "Interlace": false,
                    "Pixel clock (MHz)": 241.5,
                    "Stereo viewing": "No stereo",
                    "Sync pulse": {
                        "x": 32,
                        "y": 5
                    },
                    "Sync type": {
                        "Horizontal sync (outside of V-sync)": "Positive",
                        "Type": "Digital Separate Sync",
                        "Vertical sync": "Negative"
                    },
                    "Type": "Detailed Timing Descriptor"
                },
                {
                    "Addressable": {
                        "x": 1920,
                        "y": 1080
                    },
                    "Blanking": {
                        "x": 280,
                        "y": 45
                    },
                    "Border": {
                        "x": 0,
                        "y": 0
                    },
                    "Front porch": {
                        "x": 88,
                        "y": 4
                    },
                    "Image size (mm)": {
                        "x": 697,
                        "y": 392
                    },
                    "Interlace": false,
                    "Pixel clock (MHz)": 148.5,
                    "Stereo viewing": "No stereo",
                    "Sync pulse": {
                        "x": 44,
                        "y": 5
                    },
                    "Sync type": {
                        "Horizontal sync (outside of V-sync)": "Positive",
                        "Type": "Digital Separate Sync",
                        "Vertical sync": "Positive"
                    },
                    "Type": "Detailed Timing Descriptor"
                }
            ],
            "Native DTD count": 1,
            "Type": "CEA-861 Series Timing Extension",
            "Underscan": true,
            "Version": 3,
            "YCbCr 4:2:2": true,
            "YCbCr 4:4:4": true
        }
    ],
    "Version": "1.3"
}
rpavlik commented 1 year ago

Yeah, it's not intentionally excluded. Happy to accept contributions if you can add that.

Trying to figure out where that extra timing is: looks like just a detailed timing descriptor block inside the CTA extension block? That should be supported, there must be a bug or something, because I'm pretty sure I remember seeing something in an equivalent place when I was making the JSON schema for this.

rpavlik commented 1 year ago

Oh nvm the 3840 resolutions are in:

So yeah, missing features. Contributions welcome.

Joel-Valenciano commented 1 month ago

The short video descriptors look like they're parsed correctly for the most part. According to this wikipedia page, those are one byte each, pointing into a lookup table of resolutions.

The three before the last one, the ones with VICs 93, 94, and 95, are the 3840x2160 modes for 24, 25, and 30 fps, it just needs a way to map VICs to resolutions; the very last one might be a bug though.

It looks like the vendor specific blocks are parsed correctly, just not interpreted.