locked
how to read edid data direct from monitor (not registry) RRS feed

  • Question

  • Hi,

    the registry folder
       HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\DISPLAY\{Type}\{SWnummer}\ Device Parameters
    contains the EDID data.

    But for some reasons I can not use those data from the registry. Therefore I have to read the
    EDID data direct from the monitor. How can this be done?

    I have the following ideas  (but no complete solution for them):


    1. Using the VCP command 78h.
    ---------------------------------

    But in the Windows API there is just a SetVCPFeature but no GetVCPFeature. ==> So what does the Windows
    API offer, to send the VCP command 78h to the monitor and to retrieve herewith the EDID data?

    I searched the MSDN, but I did not found a Windows API function, with which I can do that.
    Does somebody know such a function?


    2. Function to read direct from the I2C bus
    ---------------------------------------------------------

    Wikipedia says here:
       http://en.wikipedia.org/wiki/EDID
    that the EDID data can be read from the I2C bus (starting at address 0x50).

    But unfortunately I only found the Kernel mode functions I2CRead, ReadDataLine, etc...
    But I did not found a user mode function, that  can be used to read the I2C bus.

    Does somebody know a user mode function, with which I can read the I2C bus?


    3. Some othe way(s) to read EDID data direct from the monitor
    ------------------------------------------------------------------

    Does somebody know another way, how I can read the EDID data directly from a monitor?

     


    Thanks in advance for your helpful answer(s).

    • Moved by Jesse Jiang Tuesday, April 17, 2012 2:37 AM (From:Visual C++ General)
    Monday, April 16, 2012 1:17 PM

Answers

  • ==> This meanas that Windows has such a functionnality but does not expose it. Right

    Correct. the method to read EDID is private to the display/monitor driver. it does not expose a public API for you to get at the EDID directly.  why cant you use the data in the device instance (what you refer to as HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\DISPLAY\{Type}\{SWnummer}\Device Parameters) ? is it because you can't construct this path in the registry ahead of time? that is by design.  you need to use SetupDiGetClassDevices(GUID_DEVINTERFACE_MONITOR)/SetupDiEnumDeviceInterfaces/SetupDiOpenDevRegKeyto get an HKEY to this path.

    in other words, the path is an abstraction that you should not parse, the system provides APIs for you to get to the Device Parameters key without knowing the path


    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, April 17, 2012 3:34 AM

All replies

  • Unfortunately, drivers are your only option to interface with the hardware in the way you want to.

    What is in the registry is what is read from the monitor, so is there any real reason why you can't touch that or believe it?


    This is a signature

    Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.

    Do you want Visual Studio 11 Express to be freely installable on Windows 7 and able to write regular C++ applications? Please vote for this.

    Monday, April 16, 2012 1:59 PM
  • Thanks, for that super fast answer !


    This sounds not good. The thing I wonder about is. How can Windows read those EDID data from the
    monitor and write to the registry, without having a function that reads those data?

    ==> This meanas that Windows has such a functionnality but does not expose it. Right?

    Are you really sure that there is no way, to read these EDID data from the monitor, without writing a
    own driver?

    Thanks in advance for your helpfull answer.


    Monday, April 16, 2012 2:44 PM
  • Hmm, well I know that Windows gets the monitor information from either the display driver or the monitor driver. So the functionality to actually read the monitor information exists.

    But this may be a case of me just not knowing some parts of Windows well enough.

    From the monitor configuration function reference, there is the CapabilitiesRequestAndCapabilitiesReply function. The output format of this does state that it conforms to the DDC/CI standard. So this may get you the EDID. The function also mentions that it usually returns quickly but sometimes can take a while. So I would also guess from that statement that it also gets the value from the monitor.

    I would say that this is your best bet for user mode to get the information you want from the monitor.


    This is a signature

    Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.

    Do you want Visual Studio 11 Express to be freely installable on Windows 7 and able to write regular C++ applications? Please vote for this.

    Monday, April 16, 2012 3:40 PM
  • Hello,

    I think your issue should be raised in the Windows WDK and Driver Development Forum. I believe they will know more information of this issue than us, and I will move this one to that forum.

    Thanks for your understanding,

    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, April 17, 2012 2:36 AM
  • ==> This meanas that Windows has such a functionnality but does not expose it. Right

    Correct. the method to read EDID is private to the display/monitor driver. it does not expose a public API for you to get at the EDID directly.  why cant you use the data in the device instance (what you refer to as HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\DISPLAY\{Type}\{SWnummer}\Device Parameters) ? is it because you can't construct this path in the registry ahead of time? that is by design.  you need to use SetupDiGetClassDevices(GUID_DEVINTERFACE_MONITOR)/SetupDiEnumDeviceInterfaces/SetupDiOpenDevRegKeyto get an HKEY to this path.

    in other words, the path is an abstraction that you should not parse, the system provides APIs for you to get to the Device Parameters key without knowing the path


    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, April 17, 2012 3:34 AM
  • ThePerfectWave wrote:
    >
    >This sounds not good. The thing I wonder about is. How can Windows read
    >those EDID data from the monitor and write to the registry, without
    >having a function that reads those data?
     
    Of course there is a function.  It's just not available to you.  Windows
    asks the display driver for that information.  The display driver knows how
    to talk to the EDID interface.  It owns that interface, and other drivers
    are not allowed to steal it.
     
    >Are you really sure that there is no way, to read these EDID data from
    >the monitor, without writing a own driver?
     
    Even if you write a driver, the EDID resource does not belong to you.  It
    belongs to the display driver.
    --
    Tim Roberts, timr@probo.com
    Providenza & Boekelheide, Inc.
     

    Tim Roberts, VC++ MVP Providenza & Boekelheide, Inc.
    Tuesday, April 17, 2012 6:51 AM

  • Thanks for your helpfull answers here!

    Now I have a further question concerning the EDID data:
       http://social.msdn.microsoft.com/Forums/pl-PL/vcgeneral/thread/efc46c70-7479-4d59-822b-600cb4852c4b

    Maybe you can also answer this question.

    That would be great.

    Friday, May 4, 2012 9:54 AM
  •  why cant you use the data in the device instance (what you refer to as HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\DISPLAY\{Type}\{SWnummer}\Device Parameters) ? is it because you can't construct this path in the registry ahead of time? that is by design.  you need to use SetupDiGetClassDevices(GUID_DEVINTERFACE_MONITOR)/SetupDiEnumDeviceInterfaces/SetupDiOpenDevRegKeyto get an HKEY to this path.


    Doron,

    Does windows cache the entire E-EDID in the registry or just the first segment (assuming that multiple segments exist on the monitor)?  Or does it perhaps depend on the display driver?

    Regards,

    George.

    Monday, May 20, 2013 8:53 PM
  • So, according to the following reference, Windows does cache extended E-EDID in memory: 

    http://msdn.microsoft.com/en-us/library/windows/hardware/ff565471%28v=vs.85%29.aspx.

    Hope that the reference will be useful to someone.

    Monday, June 24, 2013 4:37 PM
  • What if the cache of the EDID is corrupt?
    Tuesday, July 22, 2014 9:10 PM
  • Rossetoecioccolato wrote:

    So, according to the following reference, Windows does cache extended E-EDID in memory: 

    http://msdn.microsoft.com/en-us/library/windows/hardware/ff565471%28v=vs.85%29.aspx.

    Hope that the reference will be useful to someone.

    It's too late for the OP but in Win10 1709 only the first part (128 bytes) is cached in the registry, even if the monitor has more.

    Neither the referenced MSDN page (updated 04/20/2017) says that whole E-EDID info is cached somewhere.

    The extended info blocks cannot be read from the registry.

    > What if the cache of the EDID is corrupt?

    Cached data can be deleted by removing the monitor device in Device Manager. Next time when the monitor is plugged in, the cache will be created again.

    -- pa




    • Edited by Pavel A Monday, December 18, 2017 8:24 PM
    Monday, December 18, 2017 8:20 PM