Code Monkey home page Code Monkey logo

macos-edid-modification's Introduction

macOS-edid-modification

macOS sometimes has problems with using the obtained EDID from the display, especially for TVs. Even so the macOS Tools are able to obtain the proper EDID it is not used for the device. Leading to suboptimal resolution and refresh rate Settings.

How to obtain the EDID of your Displays

ioreg full info

This outputs the Display info. Important are the keys IODisplayPrefsKey and IODisplayEDID. Former is your identifier, used later to override your EDID, the later is the actual EDID data in hex encoding. Example output is ioreg-full-info.txt.

ioreg -l | grep -5 IODisplayEDID

ioreg short info

The same as above but only outputs the EDID. Example output is ioreg-short-info.txt.

ioreg -l | grep IODisplayEDID

How to convert the hex encoded EDID to binary Data

Copy the hex encoded EDID from IODisplayEDID key into its own file. Example edid-hex-dell.txt of my DELL monitor and edid-hex-lg-tv.txt of my LG OLED TV.

To convert this hex string now we can do the following.

cat edid-hex-dell.txt | xxd -r -p

Example output edid-bin-dell.bin and edid-bin-lg-tv.bin.

Read the EDID binary files

Informations from those binary files can be read with edid-decode.

edid-decode did-bin-dell.bin

Example output edid-decode-dell.txt and edid-decode-lg-tv.txt.

EDID Editor

You can also use an editor to view the info and modify it, like AW EDID Editor.

Modifying the binary files

There are various reasons why to modify the EDID file. For example macOS might force you to use a limited range (YCrCb) signal instead of a full range RBG one. If that happens one needs to remove all the mentions of YCrCb 4:4:4 and 4:2:2 support from the EDID. That way macOS is forced to use an RGB full range signal.

As an example I modified my LG TVs EDID, see edid-bin-lg-tv-mod.bin. Additionally to the above mentioned changes i also had to remove some vendor specific stuff to make it properly working. Keep in mind to leave the Detailed Timing info in.

How to override your EDID

Navigate to the /System⁩/⁨Library⁩/⁨Displays⁩/Contents⁩/⁨Resources⁩/⁨Overrides⁩ directory. Within this folder are all the Display specific properties and settings. The name is a bit cryptic but here our IODisplayPrefsKey key comes into play.

Exemplary the following is the value of that key on my System. The crucial part is are the two last hex digits, 1e6d (DisplayVendorID) and 1 (DisplayProductID). The first part is part of the folder name we need to look into (DisplayVendorID-1e6d) and the second part is part of the file we need to modify (DisplayProductID-1).

/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/PEG0@1/IOPP/PEGP@0/IOPP/pci-bridge@0/IOPP/GFX0@0/ATY,AMD,RadeonFramebuffer@3/AMDFramebufferVega10/display0/AppleDisplay-1e6d-1

Just open the file with any Text Editor and you should see something like. See the matching DisplayProductName.

<?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>DisplayProductID</key>
	<integer>1</integer>
	<key>DisplayProductName</key>
	<string>LG TV</string>
	<key>DisplayVendorID</key>
	<integer>7789</integer>
</dict>
</plist>

To override our EDID now we need to add another key/value entry into our plist file. Specifically the IODisplayEDID key with a data value encoded in base64. It will look like this.

<?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>DisplayProductID</key>
	<integer>1</integer>
	<key>DisplayProductName</key>
	<string>LG TV</string>
	<key>DisplayVendorID</key>
	<integer>7789</integer>
	<key>IODisplayEDID</key>
	<data>BASE64EncodedEDIDHere</data>
</dict>
</plist>

How to convert the binary EDID into a Base64 encoded string

First we need to convert our binary file back to a hex string. Example output edid-hex-lg-tv-mod.txt.

xxd -ps edid-bin-lg-tv-mod.bin

With following command you can convert the hex string file to a base64 encoded string, or use an online Tool like this.

cat edid-hex-lg-tv-mod.txt | xxd -r -p | base64

The resulting string can be copied into our plist file. You can also rename the display by changing the DisplayProductName key.

<?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>DisplayProductID</key>
	<integer>1</integer>
	<key>DisplayProductName</key>
	<string>LG OLED 55C7</string>
	<key>DisplayVendorID</key>
	<integer>7789</integer>
	<key>IODisplayEDID</key>
	<data>AP///////wAebQEAAQEBAQEbAQSzoFp4Au6Ro1RMmSYPUFShCAAxQEVAYUBxQIGAAQEBAQEBCOgAMPJwWoCwWIoAQIRjAAAeAjqAGHE4LUBYLEUAQIRjAAAeAAAA/QA6eR6IPAAAAAAAAAAAAAAA/ABMRyBPTEVEIDU1QzcKAWMCAzPBWmFgEB9mZQQTBRQDAhggISIbAV1eX2JjZD9ALwlXBxUHUFcHAT0GwGcEA+MFgAANAeIPM+sBRtAAJgoJdYBbbGYhULBRABswQHA2AECEYwAAHgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsw==</data>
</dict>
</plist>

All that is left is saving the file and restarting your Computer. In my case my TV was locked at 60Hz and limited range, after i manually added the read EDID i was able to set refresh rates between 24 to 120Hz depending on the resolution. It also made the 4k 50Hz RGB 10bit (or 4:4:4 full chroma) mode available. The 50Hz mode is advantageous, since on 60Hz only 4k 10bit 4:2:2 at max is support with HDMI 2.0a–2.0b and 50Hz is a closer multiple of our most common ~24fps video material.

If macOS is not able to read a proper EDID you have to obtain your EDID data with Linux or Windows.

macos-edid-modification's People

Contributors

akemi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

macos-edid-modification's Issues

No support for ARM

Apple has disabled EDID fetch using ioreg on the new ARM Macs.

You might want to add this in the info page. IF you know of any other way, kindly let me know.

Is it possible to add 120hz option?

Hi - thank you for this EDID edit. I just used yours (with a few minor description changes in AW EDID Editor), and it works just great at 4k RGB 10bit, but only at 60hz. When I spam the green button on my LG 42 C2, it says RGB 10b 4L12, so it should be able to achieve all this at 120hz?.

I have attached my "modified" EDID, in hope you can shed some light :-)

Thanks again for your contribution.

edid test.bin.zip

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.