Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Control Viotek GN34C #305

Closed
jarpoole opened this issue Apr 4, 2022 · 13 comments
Closed

Unable to Control Viotek GN34C #305

jarpoole opened this issue Apr 4, 2022 · 13 comments

Comments

@jarpoole
Copy link

jarpoole commented Apr 4, 2022

This app is so simple and slick but unfortunately I cannot control my primary monitor, a Viotek GN34C.
I have confirmed that DDC/CI is enabled and functioning correctly using ScreenBright which allows me to adjust the brightness but that tool is really not very user friendly.

I hope I included all the information required to get the discussion going at least. I initially struggled to get anything useful to print in the operation.log but I think now there is some info there.

Probe.log

[Date: 2022-04-04 2:19:22 PM Ver: 3.9.0.0]
{
  "System": "Manufacturer: System manufacturer, Model: System Product Name",
  "Device Context - DeviceItems": [
    {
      "DeviceInstanceId": "DISPLAY\\DELA0E7\\5&149822b7&0&UID37123",
      "Description": "Generic PnP Monitor",
      "DisplayIndex": 1,
      "MonitorIndex": 0
    },
    {
      "DeviceInstanceId": "DISPLAY\\SAM0A59\\5&149822b7&0&UID37126",
      "Description": "Generic PnP Monitor",
      "DisplayIndex": 2,
      "MonitorIndex": 0
    },
    {
      "DeviceInstanceId": "DISPLAY\\@@@0000\\5&149822b7&0&UID37121",
      "Description": "Generic PnP Monitor",
      "DisplayIndex": 3,
      "MonitorIndex": 0
    }
  ],
  "DisplayMonitor - DisplayItems": [
    {
      "DeviceInstanceId": "DISPLAY\\@@@0000\\5&149822b7&0&UID37121",
      "DisplayName": "GN34C",
      "IsInternal": false,
      "ConnectionDescription": "DisplayPort",
      "PhysicalSize": 34.00668
    },
    {
      "DeviceInstanceId": "DISPLAY\\SAM0A59\\5&149822b7&0&UID37126",
      "DisplayName": "S24C570",
      "IsInternal": false,
      "ConnectionDescription": "DVI",
      "PhysicalSize": 23.5329685
    },
    {
      "DeviceInstanceId": "DISPLAY\\DELA0E7\\5&149822b7&0&UID37123",
      "DisplayName": "Dell S2417DG",
      "IsInternal": false,
      "ConnectionDescription": "DisplayPort",
      "PhysicalSize": 23.7967625
    }
  ],
  "Display Config - DisplayItems": [
    {
      "DeviceInstanceId": "DISPLAY\\@@@0000\\5&149822b7&0&UID37121",
      "DisplayName": "GN34C",
      "IsInternal": false,
      "ConnectionDescription": "DisplayPort",
      "IsAvailable": true
    },
    {
      "DeviceInstanceId": "DISPLAY\\SAM0A59\\5&149822b7&0&UID37126",
      "DisplayName": "S24C570",
      "IsInternal": false,
      "ConnectionDescription": "DVI",
      "IsAvailable": true
    },
    {
      "DeviceInstanceId": "DISPLAY\\DELA0E7\\5&149822b7&0&UID37123",
      "DisplayName": "Dell S2417DG",
      "IsInternal": false,
      "ConnectionDescription": "DisplayPort",
      "IsAvailable": true
    }
  ],
  "Device Installation - InstalledItems": [
    {
      "DeviceInstanceId": "DISPLAY\\@@@0000\\5&149822B7&0&UID37121",
      "Description": "Generic PnP Monitor",
      "IsRemovable": true
    },
    {
      "DeviceInstanceId": "DISPLAY\\SAM0A59\\5&149822B7&0&UID37126",
      "Description": "Generic PnP Monitor",
      "IsRemovable": true
    },
    {
      "DeviceInstanceId": "DISPLAY\\DELA0E7\\5&149822B7&0&UID37123",
      "Description": "Generic PnP Monitor",
      "IsRemovable": true
    }
  ],
  "Monitor Configuration - PhysicalItems": [
    {
      "Key": {
        "DisplayIndex": 2,
        "MonitorRect": "Location:-1920,548, Size:1920,1080"
      },
      "Value": [
        {
          "Description": "Generic PnP Monitor",
          "MonitorIndex": 0,
          "Capability": {
            "IsHighLevelBrightnessSupported": true,
            "IsLowLevelBrightnessSupported": true,
            "IsContrastSupported": true,
            "IsPrecleared": false,
            "CapabilitiesString": "(prot(monitor)type(LCD)model(Plum)mccs_ver(2.0)vcp(04 05 08 10 12 14(03 04 02 07 08 0B) 16 18 1A 60(01 05) 87 B0(01 02) B6 C6 C8 C9 D6(01 04) DC(01 02 03 04 05 06 F0 F1 F2 F9 FA FB) DB(00 04 FD FE) DF EB(00 01 09 FD) F2 F3(00 01 02) F6 F7(00 02 03) )mswhql(1))",
            "CapabilitiesReport": "Luminance: True, Contrast: True, Speaker Volume: False, Power Mode: True",
            "CapabilitiesData": null
          },
          "GetBrightness": "Success: True, Valid: True (Minimum: 0, Current: 100, Maximum: 100)",
          "SetBrightness": "Success: True, Match: True (Expected: 90, Actual: 90)"
        }
      ]
    },
    {
      "Key": {
        "DisplayIndex": 1,
        "MonitorRect": "Location:3440,-452, Size:1440,2560"
      },
      "Value": [
        {
          "Description": "Generic PnP Monitor",
          "MonitorIndex": 0,
          "Capability": {
            "IsHighLevelBrightnessSupported": false,
            "IsLowLevelBrightnessSupported": true,
            "IsContrastSupported": true,
            "IsPrecleared": false,
            "CapabilitiesString": "(prot(monitor)type(lcd)model(Dell S2417DG)cmds(01 02 03 06 07 0C E3 F3)vcp(02 03(01) 04 05 08 10 12 14(03 05 09 0B) 16 18 1A 2E 52 59 5A 5B 5C 5D 5E 72(00 78 FF) 8A AC AE B6 C0 C8 C9 CA DF)mccs_ver(2.2)vcpname(10(Brightness))mswhql(1))",
            "CapabilitiesReport": "Luminance: True, Contrast: True, Speaker Volume: False, Power Mode: False",
            "CapabilitiesData": null
          },
          "GetBrightness": "Success: True, Valid: True (Minimum: 0, Current: 100, Maximum: 100)",
          "SetBrightness": "Success: True, Match: True (Expected: 94, Actual: 94)"
        }
      ]
    },
    {
      "Key": {
        "DisplayIndex": 3,
        "MonitorRect": "Location:0,0, Size:3440,1440"
      },
      "Value": [
        {
          "Description": "Generic PnP Monitor",
          "MonitorIndex": 0,
          "Capability": {
            "IsHighLevelBrightnessSupported": false,
            "IsLowLevelBrightnessSupported": false,
            "IsContrastSupported": false,
            "IsPrecleared": false,
            "CapabilitiesString": null,
            "CapabilitiesReport": null,
            "CapabilitiesData": null
          },
          "GetBrightness": "Success: True, Valid: True (Minimum: 0, Current: 100, Maximum: 100)",
          "SetBrightness": "Success: False"
        }
      ]
    }
  ],
  "MSMonitorClass - DesktopItems": [ ],
  "ElapsedTime": [
    "DeviceItems    -> 0.002",
    "DisplayMonitorItems -> 0.010",
    "DisplayConfigItems -> 0.008",
    "InstalledItems -> 0.009",
    "PhysicalItems  -> 5.028",
    "DesktopItems   -> 0.024"
  ]
}

Operation.log

[Date: 2022-04-04 2:19:14 PM Ver: 3.9.0.0]
Enabled

[Date: 2022-04-04 2:22:50 PM Ver: 3.9.0.0]
ScanAsync [2022-04-04 2:22:45 PM]
{
  "Items": [
    {
      "Type": "DdcMonitorItem",
      "DeviceInstanceId": "DISPLAY\SAM0A59\5&149822b7&0&UID37126",
      "Description": "S24C570",
      "DisplayIndex": 2,
      "MonitorIndex": 0,
      "MonitorRect": -1920,548,1920,1080,
      "IsReachable": true,
      "IsBrightnessSupported": true,
      "IsContrastSupported": true,
      "IsPrecleared": false,
      "Brightness": -1,
      "BrightnessSystemAdjusted": -1,
      "Contrast": -1
    },
    {
      "Type": "DdcMonitorItem",
      "DeviceInstanceId": "DISPLAY\DELA0E7\5&149822b7&0&UID37123",
      "Description": "Dell S2417DG",
      "DisplayIndex": 1,
      "MonitorIndex": 0,
      "MonitorRect": 3440,-452,1440,2560,
      "IsReachable": true,
      "IsBrightnessSupported": true,
      "IsContrastSupported": true,
      "IsPrecleared": false,
      "Brightness": -1,
      "BrightnessSystemAdjusted": -1,
      "Contrast": -1
    },
    {
      "Type": "UnreachableMonitorItem",
      "DeviceInstanceId": "DISPLAY\@@@0000\5&149822b7&0&UID37121",
      "Description": "GN34C",
      "DisplayIndex": 3,
      "MonitorIndex": 0,
      "MonitorRect": Empty,
      "IsReachable": false,
      "IsBrightnessSupported": false,
      "IsContrastSupported": false,
      "IsPrecleared": false,
      "Brightness": -1,
      "BrightnessSystemAdjusted": -1,
      "Contrast": -1
    }
  ],
  "Monitors": [
    {
      "Item": {
        "Type": "DdcMonitorItem",
        "DeviceInstanceId": "DISPLAY\SAM0A59\5&149822b7&0&UID37126",
        "Description": "S24C570",
        "DisplayIndex": 2,
        "MonitorIndex": 0,
        "MonitorRect": -1920,548,1920,1080,
        "IsReachable": true,
        "IsBrightnessSupported": true,
        "IsContrastSupported": true,
        "IsPrecleared": false,
        "Brightness": 100,
        "BrightnessSystemAdjusted": -1,
        "Contrast": -1
      },
      "Name": "S24C570",
      "IsUnison": true,
      "IsControllable": true,
      "IsConfirmed": true,
      "ControllableCount": 5,
      "IsByKey": false,
      "IsSelected": true,
      "IsTarget": true
    },
    {
      "Item": {
        "Type": "DdcMonitorItem",
        "DeviceInstanceId": "DISPLAY\DELA0E7\5&149822b7&0&UID37123",
        "Description": "Dell S2417DG",
        "DisplayIndex": 1,
        "MonitorIndex": 0,
        "MonitorRect": 3440,-452,1440,2560,
        "IsReachable": true,
        "IsBrightnessSupported": true,
        "IsContrastSupported": true,
        "IsPrecleared": false,
        "Brightness": 100,
        "BrightnessSystemAdjusted": -1,
        "Contrast": -1
      },
      "Name": "Dell S2417DG",
      "IsUnison": false,
      "IsControllable": true,
      "IsConfirmed": true,
      "ControllableCount": 5,
      "IsByKey": false,
      "IsSelected": false,
      "IsTarget": true
    },
    {
      "Item": {
        "Type": "UnreachableMonitorItem",
        "DeviceInstanceId": "DISPLAY\@@@0000\5&149822b7&0&UID37121",
        "Description": "GN34C",
        "DisplayIndex": 3,
        "MonitorIndex": 0,
        "MonitorRect": Empty,
        "IsReachable": false,
        "IsBrightnessSupported": false,
        "IsContrastSupported": false,
        "IsPrecleared": false,
        "Brightness": -1,
        "BrightnessSystemAdjusted": -1,
        "Contrast": -1
      },
      "Name": "GN34C",
      "IsUnison": false,
      "IsControllable": false,
      "IsConfirmed": false,
      "ControllableCount": 3,
      "IsByKey": false,
      "IsSelected": false,
      "IsTarget": false
    }
  ]
}
@emoacht
Copy link
Owner

emoacht commented Apr 5, 2022

Thanks for the logs.
They iniducate that GN34C does not respond to the query via DDC/CI.
I don't know what ScreenBright does.

@jarpoole
Copy link
Author

jarpoole commented Apr 5, 2022

I attached an API debugger to ScreenBright filtered on only GDI32.dll and only on the APIs that start with DDCCI. I also have the Don't display if API was called by another API box checked.

image

When I drag the brightness slider a single step I get two API calls

image

The microsoft docs state that this is not meant to be called directly by applications but because of the checkbox mentioned above I'm pretty sure that ScreenBright is calling it directly.
https://docs.microsoft.com/en-us/windows/win32/monitor/ddccisetvcpfeature

I tried to capture any API call made to the normal SetVCPFeature function but no luck.
https://docs.microsoft.com/en-us/windows/win32/api/lowlevelmonitorconfigurationapi/nf-lowlevelmonitorconfigurationapi-setvcpfeature

I know absolutely zero C# but when I cloned the repo and searched I could only find reference to SetVCPFeature so I imagine this is the difference between Monitorian and ScreenBright. I also noticed that you had enumerated some error codes from winerror.h here.

This made me realize that the non-zero return value actually probably contained the full error. I used Microsoft's error lookup tool to get this:

image

I guess this makes sense because Wikipedia seems to indicate that DDC is just I2C in disguise?

I have no idea why the first write fails but the second write is successful. It also seems strange to even require two calls to increase the brightness by one step. Hopefully this sheds some light on the issue.

@jarpoole
Copy link
Author

jarpoole commented Apr 5, 2022

Perhaps this is related to #270

@emoacht
Copy link
Owner

emoacht commented Apr 5, 2022

Thanks for in-depth report.
It's quite interesting. It would be reasonable to guess if ScreenBright fails the first try of calling DDCCISetVCPFeature (return value is other than 0), it will do the second try. Does it do the same when calling DDCCIGetCapabilitiesStringLength and DDCCIGetCapabilitiesString as well as DDCCIGetVCPFeature?

@jarpoole
Copy link
Author

jarpoole commented Apr 5, 2022

After clicking on the refresh button I get the following low level API calls. This test was done identically to the one above.

image

image

I did however realize that I was being a bit silly and that there is actually a ton of higher level API calls happening which are probably of more interest. Scrolling down on the documentation page for SetVPCFeature it seems that this function and all related APIs are found in dxva2.dll which was not loaded by default by my tool so I didn't realize it existed. It's my first time doing any of this so my apologies.

Capturing with a filter of all dxva2.dll APIs selected I get the following when clicking refresh

image

Similarly, if I capture what happens when I adjust the brightness I get

image

The documentation states that these functions return only TRUE or FALSE so the behavior seems identical. Every function is called twice, the first time is unsuccessful and the second time works perfectly. I don't see any mention of GetCapabilitiesString and GetCapabilitiesStringLength though. Given I know for certain that I know that they are found in dxva2.dll and that I captured every api call to this lib, I think its fair to conclude that ScreenBright doesn't even check what capabilities are supported before sending its commands.

@emoacht
Copy link
Owner

emoacht commented Apr 6, 2022

Thanks again.
It's quite imformative. Then, I have two questions.

First, is it fair to say that a function (e.g. GetMonitorBrightness) of dxva2.dll internaly calls a function (e.g. DDCCIGetVCPFeature) of gdi32.dll? I just felt it contradicts the option Don't display if API was called by another API you touched on in previous comment.

Second, is it possible to get error code (not return value) when a function of dxva2.dll fails (returns 0)? I am wondeing DDCCIGetVCPFeature's error code in question, STATUS_GRAPHICS_I2C_ERROR_TRANSMITTING_DATA (0xC01E0582), might be internally translated to ERROR_GRAPHICS_I2C_ERROR_TRANSMITTING_DATA (0xC0262582) which is a error code of a function of dxva2.dll. It is because the description of the latter is "An error occurred while transmitting data to the device on the I2C bus" and these two codes could indicate the same error.

@emoacht
Copy link
Owner

emoacht commented Apr 6, 2022

I found that you can get the error code by current version of this app.

  1. Set preclear option for the monitor in question. Remedy for faulty monitor which fails to respond its capabilities #270 (comment)
  2. Enable to make operation log.
  3. After several scans, error messages including the error code will be hopefuly recorded in oparation.log.

@jarpoole
Copy link
Author

jarpoole commented Apr 6, 2022

To address your first comment

  1. The tool I'm currently using for API monitoring (APIMonitor) is not freeware so I don't have all the features enabled. I'm not sure if it is impacting my ability to use the Don't display if API was called by another API option but it seems that I can't actually turn it off. When I attempt to launch ScreenBright with the option off nothing happens. Regardless, my thought is that if the filters are configured such that both the parent API call and client API call are monitored then the client API will not be displayed. However if only the client is monitored then the tool will display it because it has no idea where the call came from. This would explain why in the very first example I sent I captured the lowlevel DDCCISetVCPFeature calls but when I also capture the higher level SetVPCFeature in dxva2.dll I don't see it anymore.
  2. Similar story to 1. For whatever reason, checking the box for Show GetLastError stops everything from working and ScreenBright won't open.

To address these I am experimenting with WinApiOverride but its quite a bit more complicated and I haven't yet figured out how to use it. The good part is that its freeware so if I can get it working we will have far more information for debugging.

To address your second comment

Interesting troubleshooting steps! I did manage to set the preclear option but for anyone else attempting this, note that I had to get the Device Instance ID from operation.log. It seems that probe.log prints the id with escaped backslashes in JSON which don't work in the command line box but the output from operation.log contains no such backslash escapes.

Regardless after applying this change (and restarting the app!), the monitor does indeed show up and can be controlled however it is extremely buggy. It only seems to work correctly when I adjust the brightness twice in quite succession which is consistent with the observation above that the second write in quite succession from ScreenBright succeeds always succeeds.

ezgif-2-d21c7bf151

I did get an output in operation.log after doing this. It was extremely long so I've extracted the important bits out here I think

[Date: 2022-04-06 12:47:26 PM Ver: 3.9.0.0]
OnMonitorsChangeFound

[Date: 2022-04-06 12:47:27 PM Ver: 3.9.0.0]
OnMonitorsChangeInferred (DisplayWatcher)

[Date: 2022-04-06 12:47:31 PM Ver: 3.9.0.0]
ScanAsync [2022-04-06 12:47:26 PM]
{
  "Items": [
    {
      "Type": "DdcMonitorItem",
      "DeviceInstanceId": "DISPLAY\SAM0A59\5&149822b7&0&UID37126",
      "Description": "S24C570",
      "DisplayIndex": 2,
      "MonitorIndex": 0,
      "MonitorRect": -1920,548,1920,1080,
      "IsReachable": true,
      "IsBrightnessSupported": true,
      "IsContrastSupported": true,
      "IsPrecleared": false,
      "Brightness": -1,
      "BrightnessSystemAdjusted": -1,
      "Contrast": -1
    },
    {
      "Type": "DdcMonitorItem",
      "DeviceInstanceId": "DISPLAY\DELA0E7\5&149822b7&0&UID37123",
      "Description": "Dell S2417DG",
      "DisplayIndex": 3,
      "MonitorIndex": 0,
      "MonitorRect": 3440,-452,1440,2560,
      "IsReachable": true,
      "IsBrightnessSupported": true,
      "IsContrastSupported": true,
      "IsPrecleared": false,
      "Brightness": -1,
      "BrightnessSystemAdjusted": -1,
      "Contrast": -1
    },
    {
      "Type": "DdcMonitorItem",
      "DeviceInstanceId": "DISPLAY\@@@0000\5&149822b7&0&UID37121",
      "Description": "GN34C",
      "DisplayIndex": 1,
      "MonitorIndex": 0,
      "MonitorRect": 0,0,3440,1440,
      "IsReachable": true,
      "IsBrightnessSupported": true,
      "IsContrastSupported": true,
      "IsPrecleared": true,
      "Brightness": -1,
      "BrightnessSystemAdjusted": -1,
      "Contrast": -1
    }
  ],
  "Monitors": [
    {
      "Item": {
        "Type": "DdcMonitorItem",
        "DeviceInstanceId": "DISPLAY\SAM0A59\5&149822b7&0&UID37126",
        "Description": "S24C570",
        "DisplayIndex": 2,
        "MonitorIndex": 0,
        "MonitorRect": -1920,548,1920,1080,
        "IsReachable": true,
        "IsBrightnessSupported": true,
        "IsContrastSupported": true,
        "IsPrecleared": false,
        "Brightness": 53,
        "BrightnessSystemAdjusted": -1,
        "Contrast": -1
      },
      "Name": "S24C570",
      "IsUnison": false,
      "IsControllable": true,
      "IsConfirmed": true,
      "ControllableCount": 5,
      "IsByKey": false,
      "IsSelected": false,
      "IsTarget": true
    },
    {
      "Item": {
        "Type": "DdcMonitorItem",
        "DeviceInstanceId": "DISPLAY\DELA0E7\5&149822b7&0&UID37123",
        "Description": "Dell S2417DG",
        "DisplayIndex": 3,
        "MonitorIndex": 0,
        "MonitorRect": 3440,-452,1440,2560,
        "IsReachable": true,
        "IsBrightnessSupported": true,
        "IsContrastSupported": true,
        "IsPrecleared": false,
        "Brightness": 58,
        "BrightnessSystemAdjusted": -1,
        "Contrast": -1
      },
      "Name": "Dell S2417DG",
      "IsUnison": false,
      "IsControllable": true,
      "IsConfirmed": true,
      "ControllableCount": 5,
      "IsByKey": false,
      "IsSelected": false,
      "IsTarget": true
    },
    {
      "Item": {
        "Type": "DdcMonitorItem",
        "DeviceInstanceId": "DISPLAY\@@@0000\5&149822b7&0&UID37121",
        "Description": "GN34C",
        "DisplayIndex": 1,
        "MonitorIndex": 0,
        "MonitorRect": 0,0,3440,1440,
        "IsReachable": true,
        "IsBrightnessSupported": true,
        "IsContrastSupported": true,
        "IsPrecleared": true,
        "Brightness": 45,
        "BrightnessSystemAdjusted": -1,
        "Contrast": -1
      },
      "Name": "GN34C",
      "IsUnison": false,
      "IsControllable": true,
      "IsConfirmed": true,
      "ControllableCount": 5,
      "IsByKey": false,
      "IsSelected": true,
      "IsTarget": true
    }
  ]
}

[Date: 2022-04-06 12:47:31 PM Ver: 3.9.0.0]
OnMonitorsChangeInferred (DisplayWatcher)

[Date: 2022-04-06 12:47:36 PM Ver: 3.9.0.0]
OnMonitorAccessFailed
Status: TransmissionFailed
Message: Low level, Code: -1071241854, Message: An error occurred while transmitting data to the device on the I2C bus.

The error code corresponds to 0xC0262582 in hex. Converting using the error util above:
image

Not sure what the difference between ERROR_GRAPHICS_I2C_ERROR_TRANSMITTING_DATA and STATUS_GRAPHICS_I2C_ERROR_TRANSMITTING_DATA from before is but apparently there is one!

@emoacht
Copy link
Owner

emoacht commented Apr 6, 2022

Thanks again.
It is quite helpful. The message below is exactly what I wanted to confirm.

[Date: 2022-04-06 12:47:36 PM Ver: 3.9.0.0]
OnMonitorAccessFailed
Status: TransmissionFailed
Message: Low level, Code: -1071241854, Message: An error occurred while transmitting data to the device on the I2C bus.

Just a sidenote on preclear option. It will replace // in DeviceInstanceId with / so that it can work with JSON format string. It means DISPLAY\\@@@0000\\5&149822b7&0&UID37121 will be read as DISPLAY\@@@0000\5&149822b7&0&UID37121. Strange.

@emoacht
Copy link
Owner

emoacht commented Apr 7, 2022

Could you try the attached and post probe.log?
Monitorian392.zip

@jarpoole
Copy link
Author

jarpoole commented Apr 7, 2022

Closing the normal version and running the build you attached above I get the following probe.log

[Date: 2022-04-07 8:14:48 AM Ver: 3.9.2.0]
{
  "System": "Manufacturer: System manufacturer, Model: System Product Name",
  "Device Context - DeviceItems": [
    {
      "DeviceInstanceId": "DISPLAY\\DELA0E7\\5&149822b7&0&UID37123",
      "Description": "Generic PnP Monitor",
      "DisplayIndex": 1,
      "MonitorIndex": 0
    },
    {
      "DeviceInstanceId": "DISPLAY\\SAM0A59\\5&149822b7&0&UID37126",
      "Description": "Generic PnP Monitor",
      "DisplayIndex": 2,
      "MonitorIndex": 0
    },
    {
      "DeviceInstanceId": "DISPLAY\\@@@0000\\5&149822b7&0&UID37121",
      "Description": "Generic PnP Monitor",
      "DisplayIndex": 3,
      "MonitorIndex": 0
    }
  ],
  "DisplayMonitor - DisplayItems": [
    {
      "DeviceInstanceId": "DISPLAY\\@@@0000\\5&149822b7&0&UID37121",
      "DisplayName": "GN34C",
      "IsInternal": false,
      "ConnectionDescription": "DisplayPort",
      "PhysicalSize": 34.00668
    },
    {
      "DeviceInstanceId": "DISPLAY\\SAM0A59\\5&149822b7&0&UID37126",
      "DisplayName": "S24C570",
      "IsInternal": false,
      "ConnectionDescription": "DVI",
      "PhysicalSize": 23.5329685
    },
    {
      "DeviceInstanceId": "DISPLAY\\DELA0E7\\5&149822b7&0&UID37123",
      "DisplayName": "Dell S2417DG",
      "IsInternal": false,
      "ConnectionDescription": "DisplayPort",
      "PhysicalSize": 23.7967625
    }
  ],
  "Display Config - DisplayItems": [
    {
      "DeviceInstanceId": "DISPLAY\\@@@0000\\5&149822b7&0&UID37121",
      "DisplayName": "GN34C",
      "IsInternal": false,
      "ConnectionDescription": "DisplayPort",
      "IsAvailable": true
    },
    {
      "DeviceInstanceId": "DISPLAY\\SAM0A59\\5&149822b7&0&UID37126",
      "DisplayName": "S24C570",
      "IsInternal": false,
      "ConnectionDescription": "DVI",
      "IsAvailable": true
    },
    {
      "DeviceInstanceId": "DISPLAY\\DELA0E7\\5&149822b7&0&UID37123",
      "DisplayName": "Dell S2417DG",
      "IsInternal": false,
      "ConnectionDescription": "DisplayPort",
      "IsAvailable": true
    }
  ],
  "Device Installation - InstalledItems": [
    {
      "DeviceInstanceId": "DISPLAY\\@@@0000\\5&149822B7&0&UID37121",
      "Description": "Generic PnP Monitor",
      "IsRemovable": true
    },
    {
      "DeviceInstanceId": "DISPLAY\\SAM0A59\\5&149822B7&0&UID37126",
      "Description": "Generic PnP Monitor",
      "IsRemovable": true
    },
    {
      "DeviceInstanceId": "DISPLAY\\DELA0E7\\5&149822B7&0&UID37123",
      "Description": "Generic PnP Monitor",
      "IsRemovable": true
    }
  ],
  "Monitor Configuration - PhysicalItems": [
    {
      "Key": {
        "DisplayIndex": 2,
        "MonitorRect": "Location:-1920,548, Size:1920,1080"
      },
      "Value": [
        {
          "Description": "Generic PnP Monitor",
          "MonitorIndex": 0,
          "Capability": {
            "IsHighLevelBrightnessSupported": true,
            "IsLowLevelBrightnessSupported": true,
            "IsContrastSupported": true,
            "IsPrecleared": false,
            "CapabilitiesString": "(prot(monitor)type(LCD)model(Plum)mccs_ver(2.0)vcp(04 05 08 10 12 14(03 04 02 07 08 0B) 16 18 1A 60(01 05) 87 B0(01 02) B6 C6 C8 C9 D6(01 04) DC(01 02 03 04 05 06 F0 F1 F2 F9 FA FB) DB(00 04 FD FE) DF EB(00 01 09 FD) F2 F3(00 01 02) F6 F7(00 02 03) )mswhql(1))",
            "CapabilitiesReport": "Luminance: True, Contrast: True, Speaker Volume: False, Power Mode: True",
            "CapabilitiesData": null
          },
          "GetBrightness": "Success: True, Valid: True (Minimum: 0, Current: 30, Maximum: 100)",
          "SetBrightness": "Success: True, Match: True (Expected: 36, Actual: 36)"
        }
      ]
    },
    {
      "Key": {
        "DisplayIndex": 1,
        "MonitorRect": "Location:3440,-452, Size:1440,2560"
      },
      "Value": [
        {
          "Description": "Generic PnP Monitor",
          "MonitorIndex": 0,
          "Capability": {
            "IsHighLevelBrightnessSupported": false,
            "IsLowLevelBrightnessSupported": true,
            "IsContrastSupported": true,
            "IsPrecleared": false,
            "CapabilitiesString": "(prot(monitor)type(lcd)model(Dell S2417DG)cmds(01 02 03 06 07 0C E3 F3)vcp(02 03(01) 04 05 08 10 12 14(03 05 09 0B) 16 18 1A 2E 52 59 5A 5B 5C 5D 5E 72(00 78 FF) 8A AC AE B6 C0 C8 C9 CA DF)mccs_ver(2.2)vcpname(10(Brightness))mswhql(1))",
            "CapabilitiesReport": "Luminance: True, Contrast: True, Speaker Volume: False, Power Mode: False",
            "CapabilitiesData": null
          },
          "GetBrightness": "Success: True, Valid: True (Minimum: 0, Current: 7, Maximum: 100)",
          "SetBrightness": "Success: True, Match: True (Expected: 14, Actual: 14)"
        }
      ]
    },
    {
      "Key": {
        "DisplayIndex": 3,
        "MonitorRect": "Location:0,0, Size:3440,1440"
      },
      "Value": [
        {
          "Description": "Generic PnP Monitor",
          "MonitorIndex": 0,
          "Capability": {
            "IsHighLevelBrightnessSupported": false,
            "IsLowLevelBrightnessSupported": false,
            "IsContrastSupported": false,
            "IsPrecleared": false,
            "CapabilitiesString": null,
            "CapabilitiesReport": null,
            "CapabilitiesData": null
          },
          "GetBrightness": "Success: True, Valid: True (Minimum: 0, Current: 10, Maximum: 100)",
          "SetBrightness": "Success: True, Match: True (Expected: 15, Actual: 15)"
        }
      ]
    }
  ],
  "MSMonitorClass - DesktopItems": [ ],
  "ElapsedTime": [
    "DeviceItems    -> 0.002",
    "DisplayMonitorItems -> 0.010",
    "DisplayConfigItems -> 0.008",
    "InstalledItems -> 0.010",
    "PhysicalItems  -> 5.377",
    "DesktopItems   -> 0.024"
  ]
}

Seems that GetBrightness and SetBrightness both succeed now!

I combined this with the /preclear command line option because it didn't detect automatically and it works beautifully! I quickly tested contrast also and this appears to be working perfectly as well.

@emoacht
Copy link
Owner

emoacht commented Apr 7, 2022

Thanks for testing.
I thought this change might enable this app to get the response to the query for capabilities from the monitor in question but it was not the case. It cannot be helped. So this change will be meaningful only in combination with preclear option as you did.

This change is applied by 00073b0 and will be included in next minor update.

@jarpoole
Copy link
Author

jarpoole commented Apr 8, 2022

Awesome! Thank you so much for the support. I'm glad we could figure this out and maybe this one will help others debug their issues also!

I will make sure to close this issue when I do a final test with the next minor update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants