mafredri / macos-display-overrides

Display overrides to make (my) monitors work better on macOS
MIT License
28 stars 7 forks source link

How do you go about patching the EDID? #1

Closed Phunky closed 3 years ago

Phunky commented 4 years ago

I have a 49" Phillips Monitor that is currently unsupported by macos at it's native resolution of 5120x1440, I believe it's due to the EDID not being read correctly by the OS but i'm unable to find anything in-depth about the override files.

It seems you've done some bits around this yourself with you override for DisplayProductID-c4d, could you point me in the right directions for doing similar for my monitor.

I have the EDID .bin and decoded output, but i've no idea where to start when it comes to editing it.

I've tried the macos pixel clock patch + switchresx but neither enable full native resolution, closes I can get is 4096x1440.

Sorry for bugging you, feels like my last choice :D

mafredri commented 4 years ago

No trouble, I'm glad you asked. The macOS display support is random at best and the overrides are like a form of archaic magic, so I'm happy to share whatever little knowledge I have 😄.

This might be a long shot considering you've already tried SwitchResX, but have you tried changing resolution with RDM (brew cask install avibrazil-rdm)?

Since that probably won't help, we need to figure out why macOS is detecting it incorrectly and if/how the EDID needs to be patched.

First, would you mind posting the output from System Information > Graphics/Displays > Active graphics card > Info about your display (feel free to censor the serial number).

Second, it would be helpful if you shared the EDID binary (or at least the decoded output), but keep in mind it contains the serial in one or two places, you could censor that e.g. by editing with Hex Fiend.

Phunky commented 4 years ago

This is the current output with my custom 4096x1440 resolution applied via SwitchResX

image

Output of edid-decode

EDID version: 1.4
Manufacturer: PHL Model 92a Serial Number 5388
Made in week 18 of 2019
Digital display
10 bits per primary color channel
DisplayPort interface
Maximum image size: 119 cm x 34 cm
Gamma: 2.20
DPMS levels: Off
Supported color formats: RGB 4:4:4
Default (sRGB) color space is primary color space
First detailed timing includes the native pixel format and preferred refresh rate
Display is continuous frequency
Display x,y Chromaticity:
  Red:   0.6748, 0.3134
  Green: 0.2802, 0.6445
  Blue:  0.1494, 0.0664
  White: 0.3125, 0.3291
Established timings supported:
  720x400@70Hz 9:5 HorFreq: 31469 Hz Clock: 28.320 MHz
  640x480@60Hz 4:3 HorFreq: 31469 Hz Clock: 25.175 MHz
  640x480@67Hz 4:3 HorFreq: 35000 Hz Clock: 30.240 MHz
  640x480@72Hz 4:3 HorFreq: 37900 Hz Clock: 31.500 MHz
  640x480@75Hz 4:3 HorFreq: 37500 Hz Clock: 31.500 MHz
  800x600@56Hz 4:3 HorFreq: 35200 Hz Clock: 36.000 MHz
  800x600@60Hz 4:3 HorFreq: 37900 Hz Clock: 40.000 MHz
  800x600@72Hz 4:3 HorFreq: 48100 Hz Clock: 50.000 MHz
  800x600@75Hz 4:3 HorFreq: 46900 Hz Clock: 49.500 MHz
  832x624@75Hz 4:3 HorFreq: 49726 Hz Clock: 57.284 MHz
  1024x768@60Hz 4:3 HorFreq: 48400 Hz Clock: 65.000 MHz
  1024x768@70Hz 4:3 HorFreq: 56500 Hz Clock: 75.000 MHz
  1024x768@75Hz 4:3 HorFreq: 60000 Hz Clock: 78.750 MHz
  1280x1024@75Hz 5:4 HorFreq: 80000 Hz Clock: 135.000 MHz
Standard timings supported:
  1920x1080@60Hz 16:9
  1280x1024@60Hz 5:4 HorFreq: 64000 Hz Clock: 108.000 MHz
Detailed mode: Clock 266.500 MHz, 1193 mm x 336 mm
               3840 3888 3920 4000 hborder 0
               1080 1083 1093 1111 vborder 0
               +hsync -vsync
               VertFreq: 59 Hz, HorFreq: 66625 Hz
Detailed mode: Clock 241.500 MHz, 1193 mm x 336 mm
               2560 2608 2640 2720 hborder 0
               1440 1443 1448 1481 vborder 0
               +hsync +vsync
               VertFreq: 59 Hz, HorFreq: 88786 Hz
Monitor name: PHL 499P9
Monitor ranges (bare limits): 48-75Hz V, 230-230kHz H, max dotclock 600MHz
Has 1 extension blocks
Checksum: 0xc2 (valid)

DisplayID extension block
Extension version: 17
Length 56, version 17, extension count 0
Checksum: 0xb3 (valid)
Type 1 detailed timing: aspect: 1:1,
Detailed mode: Clock 438.230 MHz, 0 mm x 0 mm
               4095 4142 4173 4254
               1439 1441 1450 1469
               +hsync -vsync
Type 1 detailed timing: aspect: 1:1,
Detailed mode: Clock 233.000 MHz, 0 mm x 0 mm
               5119 5166 5197 5278
               1439 1441 1450 1469
               +hsync -vsync
GP ASCII string
Phunky commented 4 years ago

he macOS display support is random at best and the overrides are like a form of archaic magic, so I'm happy to share whatever little knowledge I have 😄.

This is so true, i've been trying to find anything that documents its abilities but can't find anything at all... it's total black magic!

mafredri commented 4 years ago

Hmm, I see macOS is detecting your display as a TV, this is really common (seriously...) among larger displays.

One thing you can try, and that could work is to just create a No-TV override for your display:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>DisplayProductName</key>
        <string>PHL 499P9 (NoTV override)</string>
        <key>DisplayVendorID</key>
        <integer>VENDOR_ID</integer>
        <key>DisplayProductID</key>
        <integer>PRODCT_ID</integer>
        <key>DisplayIsTV</key>
        <false/>
    </dict>
</plist>

Just like e.g. DisplayVendorID-10ac/DisplayProductID-a0f4.plist.

It's not guaranteed it will fix the resolution issue (it could) but you'll want to do it anyway. At least if you have a Touch Bar which displays "extend display" whenever you connect your monitor, this will fix that.

If that doesn't work, we'll need to apply a patch to the EDID (also via override so nothing permanent).

One idea I have is to either swap the position of these, or entirely blank out the definition for the 4096x1440 resolution:

Detailed mode: Clock 438.230 MHz, 0 mm x 0 mm
               4095 4142 4173 4254
               1439 1441 1450 1469
               +hsync -vsync
Type 1 detailed timing: aspect: 1:1,
Detailed mode: Clock 233.000 MHz, 0 mm x 0 mm
               5119 5166 5197 5278
               1439 1441 1450 1469
               +hsync -vsync

But I'm not sure where those are located (not very familiar with the EDID binary format), but I could probably figure out where those are if I looked at the binary.

Once we find those, we write down the start offset and sequence of bytes we want to replace it with, similar to DisplayVendorID-4c2d/DisplayProductID-c4d.plist.

Phunky commented 4 years ago

How do you produce that encoded value for the edid patch? I was thinking if we could override the native res of 3840x1080 that may also work.

I'll give the DisplayIsTV a try - awesome name for that value...

mafredri commented 4 years ago

You don't necessarily have to encode it, for the U28E590 it's just a sequence of hexadecimal characters (IIRC). If you want to encode it though you can use base64 encoding on the binary data.

For example:

$ echo -n "\0\0\0\0\0\0\0" | base64
AAAAAAAAAA==
Phunky commented 4 years ago

How does the patching work then?

Offset is obviously the starting point of where we want to patch, does it then just go off the length of the patch and replace the same amount or do we need to have everything after that offset included in the patch itself?

mafredri commented 4 years ago

It's the first option 😄. From the offset as starting point, we only need to include as much as we want to change, the patch will not touch anything else. For example, the base64 encoding I posted previously would zero out 7 bytes starting from whatever offset is specified.

Normally an EDID has a checksum as well, but using this method the checksum does not need to be updated.

Phunky commented 4 years ago

I'm trying to figure out the EDID binary format, but my google skills is failing me.

Also doesn't help that i've only got access to the monitor at work so only got short amount of testing time.

I've loaded the EDID .bin in Hex Fiend but it's not really helping. Need to read up on EDID binary format over the weekend.

Lot of people on the Apple support pages with this problem on other ultrawides too.

Phunky commented 4 years ago

Do you know much about mtdd overrides? I noticed they include some more specific timing details than other overrides.

image

Also found http://edid.tv/edid/514/ which can ready .bin and hex files.

mafredri commented 4 years ago

Do you know much about mtdd overrides? I noticed they include some more specific timing details than other overrides.

No, sorry. I've seen them but never looked into them.

Also found http://edid.tv/edid/514/ which can ready .bin and hex files.

Interesting, I downloaded the bin from there but it does not seem to contain the same data as yours (the extension block is missing).

Phunky commented 4 years ago

Those are the ones I uploaded, think it drops the extension block.

I've managed to find AWEDIDEditor but it complains about the byte size of the EDID for this monitor. It has a built in hex view and I can find the standard timings

image But can't find anything to do with the extended ones sadly :(

image

arnljot commented 4 years ago

How do you produce that encoded value for the edid patch? I was thinking if we could override the native res of 3840x1080 that may also work.

I'll give the DisplayIsTV a try - awesome name for that value...

Did it work out for you?

I bought the 49" Samsung C49RG90 which has 5K resolution, and I´m using it through a Vega 64 eGpu. The Samsung is reporting 5K resoultion, but my scaling gives childishly huge text on the screen. I`m on Catalina 10.15.1.

When I select scaled and "more room" option it gives me smaller GUI elements, but it drops the resolution to 1080p, and not 1440p anymore. So it´s not a good solution. When I opt click on the scaled toggle in screen prefs to get Display settings to show me which resolutions it sees, then 3840x1080 is the largest it shows me.

When I used it with HDMI cable (USB-C to HDMI) then the Radeon 560 i have wasn`t able to drive it bigger I though, and also it just saw it as a TV and the output was Magenta. To combat that I used the Ruby patch method to create an override. To write it to the read only partition I used the csrutil disable, and umount -rw / fixes first.

So if someone has a good idea of what needs to be done to unlock my screen from being a toy display with the Macbook Pro I´d be grateful. Or I`d seriously consider calling it quits with Macs.

As it is now my mac says it`s using a 5120x1440 resolution which looks like 2560 x 720 @ 60 Hz. What a waste.

For now I run it in PbP mode as two discrete screens. But that means that I cannot split a window between them, because that`s not possible in OS X.

Phunky commented 4 years ago

I've still not been able to get it running and Catalina didn't help :(

Currently I have a custom resolution of 4096x1440@70 with I set with SwitchResX but anything above that doesn't work (which is the EDID limit!).

If your running in PBP you can have a window in them middle, but you need to untick "Displays have separate spaces" in Mission Control.

You'll also see screen tear with PBP due to it being driven by two separate graphic buffers, even tho it's one device :D

ximbal commented 4 years ago

Still haven't found a solution? I just got myself the Samsung 49 inch RG90 Monitor and I'm flabbergasted to discover the sad limitations on Mac OS....I'll keep poking at EDID.

ximbal commented 4 years ago

Extracted this from SwitchResX if it might help.

EDID report generated by SwitchResX Version 4.9.1 for display C49RG9x


------------------- RAW DATA ------------------------

 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F

0 | 00 FF FF FF FF FF FF 00 4C 2D 9C 0F 00 00 00 00 1 | 2B 1C 01 04 B5 77 22 78 3A A2 A1 AD 4F 46 A7 24 2 | 0E 50 54 BF EF 80 71 4F 81 00 81 C0 81 80 A9 C0 3 | B3 00 95 00 D1 C0 74 D6 00 A0 F0 38 40 40 30 20 4 | 3A 00 A9 50 41 00 00 1A 00 00 00 FD 00 32 78 1E 5 | BE 61 00 0A 20 20 20 20 20 20 00 00 00 FC 00 43 6 | 34 39 52 47 39 78 0A 20 20 20 20 20 00 00 00 FF 7 | 00 48 31 41 4B 35 30 30 30 30 30 0A 20 20 02 6E


 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F

0 | 02 03 1E F0 46 10 5A 40 5B 3F 5C 23 09 07 07 83 1 | 01 00 00 E3 05 C0 00 E6 06 05 01 8B 73 12 56 5E 2 | 00 A0 A0 A0 29 50 30 20 35 00 A9 50 41 00 00 1A 3 | 58 4D 00 B8 A1 38 14 40 F8 2C 45 00 A9 50 41 00 4 | 00 1E 1A 68 00 A0 F0 38 1F 40 30 20 3A 00 A9 50 5 | 41 00 00 1A F4 B0 00 A0 F0 38 35 40 30 20 3A 00 6 | A9 50 41 00 00 1A 00 00 00 00 00 00 00 00 00 00 7 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 28


 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F

0 | 70 12 79 00 00 03 01 3C 57 79 01 88 FF 13 9F 00 1 | 2F 80 1F 00 9F 05 54 00 02 00 09 00 6C 37 01 08 2 | FF 13 9F 00 2F 80 1F 00 9F 05 45 00 02 00 09 00 3 | 33 B7 00 08 FF 13 9F 00 2F 80 1F 00 9F 05 28 00 4 | 02 00 09 00 00 00 00 00 00 00 00 00 00 00 00 00 5 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 6 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 7 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 F3 90


< 00FFFFFF FFFFFF00 4C2D9C0F 00000000 2B1C0104 B5772278 3AA2A1AD 4F46A724 0E5054BF EF80714F 810081C0 8180A9C0 B3009500 D1C074D6 00A0F038 40403020 3A00A950 4100001A 000000FD 0032781E BE61000A 20202020 20200000 00FC0043 34395247 39780A20 20202020 000000FF 00483141 4B353030 3030300A 2020026E 02031EF0 46105A40 5B3F5C23 09070783 010000E3 05C000E6 0605018B 7312565E 00A0A0A0 29503020 3500A950 4100001A 584D00B8 A1381440 F82C4500 A9504100 001E1A68 00A0F038 1F403020 3A00A950 4100001A F4B000A0 F0383540 30203A00 A9504100 001A0000 00000000 00000000 00000000 00000000 00000000 00000028 70127900 0003013C 57790188 FF139F00 2F801F00 9F055400 02000900 6C370108 FF139F00 2F801F00 9F054500 02000900 33B70008 FF139F00 2F801F00 9F052800 02000900 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 0000F390 >


{ 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x4C, 0x2D, 0x9C, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x1C, 0x01, 0x04, 0xB5, 0x77, 0x22, 0x78, 0x3A, 0xA2, 0xA1, 0xAD, 0x4F, 0x46, 0xA7, 0x24, 0x0E, 0x50, 0x54, 0xBF, 0xEF, 0x80, 0x71, 0x4F, 0x81, 0x00, 0x81, 0xC0, 0x81, 0x80, 0xA9, 0xC0, 0xB3, 0x00, 0x95, 0x00, 0xD1, 0xC0, 0x74, 0xD6, 0x00, 0xA0, 0xF0, 0x38, 0x40, 0x40, 0x30, 0x20, 0x3A, 0x00, 0xA9, 0x50, 0x41, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0xFD, 0x00, 0x32, 0x78, 0x1E, 0xBE, 0x61, 0x00, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x43, 0x34, 0x39, 0x52, 0x47, 0x39, 0x78, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x48, 0x31, 0x41, 0x4B, 0x35, 0x30, 0x30, 0x30, 0x30, 0x30, 0x0A, 0x20, 0x20, 0x02, 0x6E, 0x02, 0x03, 0x1E, 0xF0, 0x46, 0x10, 0x5A, 0x40, 0x5B, 0x3F, 0x5C, 0x23, 0x09, 0x07, 0x07, 0x83, 0x01, 0x00, 0x00, 0xE3, 0x05, 0xC0, 0x00, 0xE6, 0x06, 0x05, 0x01, 0x8B, 0x73, 0x12, 0x56, 0x5E, 0x00, 0xA0, 0xA0, 0xA0, 0x29, 0x50, 0x30, 0x20, 0x35, 0x00, 0xA9, 0x50, 0x41, 0x00, 0x00, 0x1A, 0x58, 0x4D, 0x00, 0xB8, 0xA1, 0x38, 0x14, 0x40, 0xF8, 0x2C, 0x45, 0x00, 0xA9, 0x50, 0x41, 0x00, 0x00, 0x1E, 0x1A, 0x68, 0x00, 0xA0, 0xF0, 0x38, 0x1F, 0x40, 0x30, 0x20, 0x3A, 0x00, 0xA9, 0x50, 0x41, 0x00, 0x00, 0x1A, 0xF4, 0xB0, 0x00, 0xA0, 0xF0, 0x38, 0x35, 0x40, 0x30, 0x20, 0x3A, 0x00, 0xA9, 0x50, 0x41, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x70, 0x12, 0x79, 0x00, 0x00, 0x03, 0x01, 0x3C, 0x57, 0x79, 0x01, 0x88, 0xFF, 0x13, 0x9F, 0x00, 0x2F, 0x80, 0x1F, 0x00, 0x9F, 0x05, 0x54, 0x00, 0x02, 0x00, 0x09, 0x00, 0x6C, 0x37, 0x01, 0x08, 0xFF, 0x13, 0x9F, 0x00, 0x2F, 0x80, 0x1F, 0x00, 0x9F, 0x05, 0x45, 0x00, 0x02, 0x00, 0x09, 0x00, 0x33, 0xB7, 0x00, 0x08, 0xFF, 0x13, 0x9F, 0x00, 0x2F, 0x80, 0x1F, 0x00, 0x9F, 0x05, 0x28, 0x00, 0x02, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF3, 0x90 }


Valid EDID block #0: checksum ok Valid EDID block #1: checksum ok Valid EDID block #2: checksum ok


------------------- MAIN EDID BLOCK -----------------

EDID Version........1.4 Manufacturer........SAM (4C2D) Product ID..........3996 (0F9C) Serial Number.......00000000

Manufactured........Week 43 of year 2018 Max H Size..........119 cm Max V Size..........34 cm Gamma...............2.20

Display Supported Features:

Power Management: Active off

Display type:

RGB 4:4:4 & YCrCb 4:4:4 & YCrCb 4:2:2 Color Encoding Formats Display is non continuous frequency Default color space is not sRGB standard First detailed Timing includes native Pixel Format and preferred Refresh Rate

Input signal & sync:

Digital Input 10 Bits per Primary Color DisplayPort interface

Color info:

Red x = 0.678 Green x = 0.273 Blue x = 0.143 White x = 0.312 Red y = 0.311 Green y = 0.654 Blue y = 0.057 White y = 0.329

Established Timings supported:

0: 720 × 400 @ 70Hz

1: 640 × 480 @ 60Hz

2: 640 × 480 @ 67Hz

3: 640 × 480 @ 72Hz

4: 640 × 480 @ 75Hz

5: 800 × 600 @ 56Hz

6: 800 × 600 @ 60Hz

7: 800 × 600 @ 72Hz

8: 800 × 600 @ 75Hz

9: 832 × 624 @ 75Hz

10: 1024 × 768 @ 60Hz

11: 1024 × 768 @ 70Hz

12: 1024 × 768 @ 75Hz

13: 1280 × 1024 @ 75Hz

14: 1152 × 870 @ 75Hz

Standard Timing supported:

0: 1152 × 864 @ 75Hz (714F)

1: 1280 × 800 @ 60Hz (8100)

2: 1280 × 720 @ 60Hz (81C0)

3: 1280 × 1024 @ 60Hz (8180)

4: 1600 × 900 @ 60Hz (A9C0)

5: 1680 × 1050 @ 60Hz (B300)

6: 1440 × 900 @ 60Hz (9500)

7: 1920 × 1080 @ 60Hz (D1C0)

Monitor Description blocks:

Descriptor #0 - Timing definition: Mode = 3840 × 1080 @ 119.974Hz Pixel Clock............. 549.00 MHz Non-Interlaced

                          Horizontal      Vertical
  Active.................. 3840 pixels        1080 lines
  Front Porch.............   48 pixels           3 lines
  Sync Width..............   32 pixels          10 lines
  Back Porch..............   80 pixels          51 lines
  Blanking................  160 pixels          64 lines
  Total................... 4000 pixels        1144 lines
  Scan Rate............... 137.250 kHz        119.974 Hz

  Image Size.............. 1193 mm         336 mm
  Border..................    0 pixels           0 lines

      Sync: Digital separate with
          * Negative vertical polarity
          * Positive horizontal polarity

Descriptor #1 - Monitor range: Horizontal frequency range.......30-190 kHz Vertical frequency range.........50-120 Hz Maximum bandwidth range..........970 MHz GTF supported

Descriptor #2 - Monitor name: C49RG9x

Descriptor #3 - Serial number: H1AK500000


------------ EXTENSION EDID BLOCK 1 ---------------

CTA-EXT: CTA 861 Series Extension:

Revision:...........................3 First DTD block at offset...........26 Display Supports: Underscan on PC modes Basic audio YCbCr 4:4:4 YCbCr 4:2:2

Data Block #1 Video Type: standard CTA Timings VIC 0): ( 16) 1920 × 1080 @ 60Hz - 16:9 VIC 1): ( 90) 2560 × 1080 @ 60Hz - 64:27 VIC 2): ( 64) 1920 × 1080 @ 100Hz - 16:9 VIC 3): ( 91) 2560 × 1080 @ 100Hz - 64:27 VIC 4): ( 63) 1920 × 1080 @ 120Hz - 16:9 VIC 5): ( 92) 2560 × 1080 @ 120Hz - 64:27

Data Block #2 Audio Data Block Supported format: Linear PCM, on 2 channels Supported sample rates (kHz): 32kHz, 44.1kHz, 48kHz Supported sample sizes (bits): 16 bit, 20 bit, 24 bit

Data Block #3 Speaker allocation data block Speaker map: FL/FR - Front Left/Right

Data Block #4 Extended Data Block: Colorimetry Data Block BT2020YCC BT2020RGB

Data Block #5 Extended Data Block: HDR static metadata data block Electro optical transfer functions: Traditional gamma - SDR luminance range SMPTE ST2084 Supported static metadata descriptors: Static metadata type 1 Desired content max luminance: 139 (1015.241 cd/m^2) Desired content max frame-average luminance: 115 (603.666 cd/m^2) Desired content min luminance: 18 (0.051 cd/m^2)

Detailed Timing Blocks - 0 is native Detailed Timing Block #1 - Timing definition: Mode = 2560 × 1440 @ 59.951Hz Pixel Clock............. 241.50 MHz Non-Interlaced

                          Horizontal      Vertical
  Active.................. 2560 pixels        1440 lines
  Front Porch.............   48 pixels           3 lines
  Sync Width..............   32 pixels           5 lines
  Back Porch..............   80 pixels          33 lines
  Blanking................  160 pixels          41 lines
  Total................... 2720 pixels        1481 lines
  Scan Rate...............  88.787 kHz         59.951 Hz

  Image Size.............. 1193 mm         336 mm
  Border..................    0 pixels           0 lines

      Sync: Digital separate with
          * Negative vertical polarity
          * Positive horizontal polarity

Detailed Timing Block #2 - Timing definition: Mode = 2560 × 1080 @ 60.000Hz Pixel Clock............. 198.00 MHz Non-Interlaced

                          Horizontal      Vertical
  Active.................. 2560 pixels        1080 lines
  Front Porch.............  248 pixels           4 lines
  Sync Width..............   44 pixels           5 lines
  Back Porch..............  148 pixels          11 lines
  Blanking................  440 pixels          20 lines
  Total................... 3000 pixels        1100 lines
  Scan Rate...............  66.000 kHz         60.000 Hz

  Image Size.............. 1193 mm         336 mm
  Border..................    0 pixels           0 lines

      Sync: Digital separate with
          * Positive vertical polarity
          * Positive horizontal polarity

Detailed Timing Block #3 - Timing definition: Mode = 3840 × 1080 @ 59.968Hz Pixel Clock............. 266.50 MHz Non-Interlaced

                          Horizontal      Vertical
  Active.................. 3840 pixels        1080 lines
  Front Porch.............   48 pixels           3 lines
  Sync Width..............   32 pixels          10 lines
  Back Porch..............   80 pixels          18 lines
  Blanking................  160 pixels          31 lines
  Total................... 4000 pixels        1111 lines
  Scan Rate...............  66.625 kHz         59.968 Hz

  Image Size.............. 1193 mm         336 mm
  Border..................    0 pixels           0 lines

      Sync: Digital separate with
          * Negative vertical polarity
          * Positive horizontal polarity

Detailed Timing Block #4 - Timing definition: Mode = 3840 × 1080 @ 99.956Hz Pixel Clock............. 453.00 MHz Non-Interlaced

                          Horizontal      Vertical
  Active.................. 3840 pixels        1080 lines
  Front Porch.............   48 pixels           3 lines
  Sync Width..............   32 pixels          10 lines
  Back Porch..............   80 pixels          40 lines
  Blanking................  160 pixels          53 lines
  Total................... 4000 pixels        1133 lines
  Scan Rate............... 113.250 kHz         99.956 Hz

  Image Size.............. 1193 mm         336 mm
  Border..................    0 pixels           0 lines

      Sync: Digital separate with
          * Negative vertical polarity
          * Positive horizontal polarity

------------ EXTENSION EDID BLOCK 2 ---------------

DID-EXT: Display ID Extension:

(only partly interpreted) DisplayID version........1.2

DisplayID Block Type = Detailed Timing Block type 1: Detailed Timing #1 in Block Mode = 5120 × 1440 @ 119.970Hz Pixel Clock............. 966.00 MHz Non-Interlaced

                          Horizontal      Vertical
  Active.................. 5120 pixels        1440 lines
  Front Porch.............   48 pixels           3 lines
  Sync Width..............   32 pixels          10 lines
  Back Porch..............   80 pixels          72 lines
  Blanking................  160 pixels          85 lines
  Total................... 5280 pixels        1525 lines
  Scan Rate............... 182.955 kHz        119.970 Hz

      Is default Mode
      Sync: Digital separate with
          * Negative vertical polarity
          * Positive horizontal polarity

Detailed Timing #2 in Block Mode = 5120 × 1440 @ 99.996Hz Pixel Clock............. 797.25 MHz Non-Interlaced

                          Horizontal      Vertical
  Active.................. 5120 pixels        1440 lines
  Front Porch.............   48 pixels           3 lines
  Sync Width..............   32 pixels          10 lines
  Back Porch..............   80 pixels          57 lines
  Blanking................  160 pixels          70 lines
  Total................... 5280 pixels        1510 lines
  Scan Rate............... 150.994 kHz         99.996 Hz

      Is non-default Mode
      Sync: Digital separate with
          * Negative vertical polarity
          * Positive horizontal polarity

Detailed Timing #3 in Block Mode = 5120 × 1440 @ 59.977Hz Pixel Clock............. 469.00 MHz Non-Interlaced

                          Horizontal      Vertical
  Active.................. 5120 pixels        1440 lines
  Front Porch.............   48 pixels           3 lines
  Sync Width..............   32 pixels          10 lines
  Back Porch..............   80 pixels          28 lines
  Blanking................  160 pixels          41 lines
  Total................... 5280 pixels        1481 lines
  Scan Rate...............  88.826 kHz         59.977 Hz

      Is non-default Mode
      Sync: Digital separate with
          * Negative vertical polarity
          * Positive horizontal polarity
lsca94 commented 4 years ago

Hello guys, just wanted to ask if somebody got a solution for this problem? Just got a Dell U4919DW and I have the same problem. I found somethings on the web but none helped so far. I want to get the 5120 x 1440 resolution.

I have a MacBook Pro 13" 2019, and officially it supports one monitor with 5120 x 2880 pixels (specs, look at the Video Support section), which is double the pixels. But the EDID of the monitor seems to be wrong. The officially supported monitor seems to be the LG UltraFine 5K Display.

My Setup

MacBook Pro 13" 2019 Dell U4919DW Currently I am working with PBP, connected with USB-C and HDMI

What I have tried so far

Goal

Connect the monitor with USB-C only and get the full 5120 x 1440 because from a hardware standpoint it seems to support it.

Helpfull links

https://www.apple.com/macbook-pro-13/specs/ https://apple.stackexchange.com/questions/221239/my-external-monitor-doesnt-work-at-full-resolution-with-my-macbook https://gist.github.com/joevt/32e5efffe3459958759fb702579b9529

buckles1138 commented 4 years ago

You seem to be on the right track for editing the EDID (patch). If you want to make it permanent on boot, you will need to edit the actual EDID in the EEPROM chip on the display. You can do this through the i2c protocol, but only way I know how is through ubuntu or windows boot. I dont recommend this until you can properly test your EDID patch file. I trust SwitchResX will do the job if you understand your hardware better.

The real problem I see in all the posts so far is perhaps just a discrepancy of hardware capability. Just because you plug in a 5k monitor doesnt make it so. You have to use a GPU and medium that supports the bandwidth. (And trying to drive at 120 Hz will cut your frame pixels by at least half the standard). Only the last post mentions what the actual machine (the GPU really) is capable of. But HDMI and display port were attempted which is likely substandard.

https://en.m.wikipedia.org/wiki/DisplayPort

5K (5120x2880) at 60 Hz, 24 bit color requires (at least) 22.2 Gbit/s data transfer, which is typically accomplished with 8 data lanes (two-channels of 4 lanes). You see this accomplished with dual displayport cables, although Displayport 2.0 with usb-c or Thunderport 3.0 can now accommodate that in a single cable...

In the not so distant past, quad HD (2560x1440) was new and was accomplished by two DVI cables which later became “dual link” DVI in one cable, and then Displayport 1.2 This requires 5.63 Gbit/s. But it just so happens the 4 lanes are a bit overkill and tops out at 8.6 Gbit/s which can drive 4k (3840x2160) at 30 frames per second.... That is where some confusion has crept in.

If you're trying to drive 4K at 60 Hz, it takes a more capable GPU, that can transmit at least 12.54 Gbit/s.

So, be especially careful of the GPU specs and the cable media you're trying to use. Adapters to HDMI or DP may be a lower revision spec than you require, and will limit your resolutions.

Trust what is happening in the afforded resolutions with SwitchResX. Double check your hardware. If trying to overclock or do some other customizations, perform a bit rate calculation (including frame overhead) and see if you have the bandwidth. Try to stick with 60 Hz until you fix the resolution problems. Also be careful of “10 bit” color. Not sure if that is 30 real color bits or just the usual 24-bit color with 6 bits of encoding. TV’s aren't meant for computers... See if it can transmit raw color.

It is possible to edit the display eeprom through the computer. But it is unforgiving of mistakes. There are youtube videos online that can guide you through it. In powerPC days I used DisplayConfigX. It may still work...

Phunky commented 4 years ago

@buckles1138 in most cases the same hardware can drive the monitor in Windows or Linux.

I'm currently running a customer resolution to drive the monitor at 4096x1440@70 in MacOS with a single display port cable, but can boot into windows and run it at full resolution off the bat.

buckles1138 commented 4 years ago

Ok, there are a couple issues that will shed some light on your problem.

Hardware: Your macbook has TWO GPUs. The Iris Pro is integrated on the logic board and is used for mild video needs. The Nvidia card is used for beastly graphics needs. Go to energy saver and dial it for performance and then check your About this Mac... You should notice that it has selected the faster card. I doubt the Iris Pro is capable of driving the 5120x1440. I believe Windows just plays dumb and grabs whatever card is set in the bios, and you have it set for Nvidia. It might not even detect the Iris Pro.

Software: To add some clarity to your EDID info, this is not a “standard” monitor aspect ratio. It is 32:9, twice as wide as a 16:9 monitor. So, the first 128 bytes are almost pointless for your purpose. There is no standard set of pixel ratios described in a VESA byte code for your monitor. (This is not a Mac thing. It is the VESA standard.) So nothing you do in this space will produce your desired pixel timing format.

You have a TV, not a monitor. So, the second section of 128 bytes is called the CEA-861-E extension to the EDID which describes just about any format like for a digital TV. There is a header and (up to) four blocks of 18 bytes called a Detailed Timing Description with your timing and pixels, following a VESA Generalized Timing Formula. The first block is your preferred timing while the rest are optional. You dont have much in this section. It starts near the bottom, at “DisplayID extension block”.

With a bit of study you can interpret the “decoded” text to the binary file using a hex editor. I use hex fiend. The file specification is broadly available, but Wikipedia has a good page:

https://en.m.wikipedia.org/wiki/Extended_Display_Identification_Data

For the format of those extended 128 bytes, look at the table called CEA Timing Extension Data format - version 3.

For the format of the 18 byte generalized timing, see the table EDID Display Range Limits Descriptor.

The GUI takes care of some messy accounting, but I think you can trim your clock slightly in .01 increments to hit your integer pixel counts that are realizable. They are organized in four sets of min/max pairs for both horizontal and vertical resolutions. The GPU will do its best to hit the range.

So, try the hardware selection to force the NVidia card, and I think you will start to make some headway.

buckles1138 commented 4 years ago

The IrisPro specs do indeed show an allowance for 4k, but only on the mini Displayport at 60 Hz and 24 bit color. The size they note is the 16:9 ratio 3840x2160, or 8,294,400 pixels, but with the standard Hsync and Vsync for 60 Hz, it is 9,900,000 pixels (14.256 Gb/s for 24 bit color). Ultimately, that is your speed limit, and it should work. (The reason why you are stuck at 4096 x 1440 is that 4096 is the largest integer that can be expressed with the 18-byte Detailed Timing Descriptors in byte 2.) The EIA/CEA update to the EDID spec expanded the range of standard screen sizes and ratios as a simple IDs such as 126 for 5120x2160 @ 60 Hz, and even larger UHD sizes. But 5120x1440 (a 4:1 ratio) is not one of the updated standard sizes. Perhaps future updates will do so. So, you cant use any of the “usual” standard methods. However the very latest update, CTA-861-G included in the EDID 1.4 standard in 2017 allows for ultrawide displays. Here is a good example of setting up such a custom screen with SwitchResX:

http://www.datapath.us/How%20to%20send%20a%20signal%20to%20FX4%20larger%20than%204096%20pixels.pdf

The timings can be worked out from the other standard definitions listed in the EIA-EDID spec. Your 5120 x 1440 monitor should be setup with the Hsync pixels of a 5120 x 2880 screen, which is 1480 including front porch, sync pulse, plus back porch. Net pixels are 6600. In switchresX, you set active, front porch, sync pulse, and net total, which calculates the back porch on its own. The Vsync should be set for the case of a 2560 x 1440 screen which is 60, for a total of 1500. Thats 9,900,000 pixels and has a pixel rate of precisely 594 MHz, a standard clock used for 3840x2160. All the 16:9 HD/FullHD timings scale linearly along with the sizes in 2x increments.

You should vary the front porch and sync pulse as needed, while keeping total pixels. Once you are able to drive your display and wish to go faster, you can experiment with the Hsync which is pretty long. (The HD multiples of 720 have a very long Hsync compared to Full HD multiple of 1080, and much of it is wasted, only serving to get 60 Hz with a standard clock.) Try shortening the Hsync and up the refresh rate. But you will have to hit a clock frequency at precisely 10 kHz intervals (digital) which can be synthesized by the GPU while producing integer pixels... This simple formula may work to find an integer Hsync for any allowed pixel frequency, fpx (in Hz):

HSync = fpx/(framerate25rows/24) - cols

The number rows/24 is the Vsync amount for any HD/FHD format (but only tested for 60 Hz). The number 25 is just 24+1 as the total number of such macro rows in a frame cycle. Rows and cols are just the active ones.

Btw, since your mac predates the 2017 update, I would expect the OSX system or Win10 driver updates would have applied a firmware update to read new monitors... But worth noting. Perhaps with High Sierra...

DarkSideOf5G commented 3 years ago

"Since macOS Mojave we no longer seem to need RGB edid overrides, they are ineffective" does this mean we are screwed?

mafredri commented 3 years ago

"Since macOS Mojave we no longer seem to need RGB edid overrides, they are ineffective" does this mean we are screwed?

@MoshePupkin not at all. We can use the DisplayIsTV override instead which is more robust. What the RGB EDID override basically did was prevent macOS from interpreting the screen as a TV.

https://github.com/mafredri/macos-display-overrides/blob/0a2175eae66e151eebeab4894df01a2280c70acf/DisplayVendorID-10ac/DisplayProductID-d065.plist#L19-L20

PS. I would appreciate it if you opened up a new issue in future as you question is unrelated to this issue.