waydabber / BetterDisplay

Unlock your displays on your Mac! Flexible HiDPI scaling, XDR/HDR extra brightness, virtual screens, DDC control, extra dimming, PIP/streaming, EDID override and lots more!
https://betterdisplay.pro
16.9k stars 313 forks source link

Value mismatch between BetterDisplay and MediaMate #3117

Closed sampotts closed 2 days ago

sampotts commented 1 week ago

Current Behaviour

The values for brightness shown in MediaMate don't match those in BetterDisplay.

When BetterDisplay shows 69% for both displays, MediaMate shows 68% for the Pro Display XDR and 62% for the Studio Display.

App Values
BetterDisplay 69% for both displays.
MediaMate 68% for the Pro Display XDR and 62% for the Studio Display.
image
App Values
BetterDisplay 75% for both displays.
MediaMate 75% for the Pro Display XDR and 68% for the Studio Display.
image
App Values
BetterDisplay 62% for the ProDisplay XDR and 63% for Studio Display.
MediaMate 62% for the Pro Display XDR and 56% for the Studio Display.
image

BetterDisplay Configuration

CleanShot 2024-06-24 at 10 03 43@2x

CleanShot 2024-06-24 at 10 03 14@2x

CleanShot 2024-06-24 at 10 03 21@2x

CleanShot 2024-06-24 at 10 04 10@2x

CleanShot 2024-06-24 at 10 04 21@2x

MediaMate Configuration

CleanShot 2024-06-24 at 10 05 02@2x

CleanShot 2024-06-24 at 10 05 13@2x

Expected Behaviour

The values match.

Versions

waydabber commented 1 week ago

Hi there,

please follow this procedure:

  1. Exit BetterDisplay
  2. Open Terminal
  3. Enter the following command (this launches the app with log output enabled):

/Applications/BetterDisplay.app/Contents/MacOS/BetterDisplay -v

  1. Make sure Dispatch OSD notifications is enabled under Settings/Application/Integration
Screenshot 2024-06-24 at 12 14 29
  1. Adjust the brightness using the keyboard and check the Terminal window's log output.

You should see items like this:

OSD notification sent: {"controlTarget":"combinedBrightness","displayID":4,"maxValue":64,"systemIconID":1,"value":44} 

Check if the value (44 in this example) corresponds properly to the expected OSD value for the brightness. Please note that the OSD uses 64 levels (16 chiclets with 4 substeps each). So 100% is value 64, 50% should be value 32.

If these match up properly, then BetterDisplay is sending the right values, maybe some kind of setting/configuration issue prevents MediaMate from showing the right percentages.

Let me know what are the results are so we can determine the best course of action.

Thanks!

sampotts commented 1 week ago

It looks to me like the numbers are right. The percentages are what MediaMate is displaying and they seem to match the API responses?

100%
[2024-06-24 20:29:33.779] OSD notification sent: {"controlTarget":"hardwareBrightness","displayID":4,"maxValue":64,"systemIconID":1,"value":64}
[2024-06-24 20:29:33.780] OSD notification sent: {"controlTarget":"hardwareBrightness","displayID":3,"maxValue":64,"systemIconID":1,"value":64}

93% / 87%
[2024-06-24 20:29:51.871] OSD notification sent: {"controlTarget":"hardwareBrightness","displayID":4,"maxValue":64,"systemIconID":1,"value":60}
[2024-06-24 20:29:51.872] OSD notification sent: {"controlTarget":"hardwareBrightness","displayID":3,"maxValue":64,"systemIconID":1,"value":56}

87% / 81%
[2024-06-24 20:30:05.300] OSD notification sent: {"controlTarget":"hardwareBrightness","displayID":4,"maxValue":64,"systemIconID":1,"value":56}
[2024-06-24 20:30:05.300] OSD notification sent: {"controlTarget":"hardwareBrightness","displayID":3,"maxValue":64,"systemIconID":1,"value":52}

81% / 75%
[2024-06-24 20:30:16.794] OSD notification sent: {"controlTarget":"hardwareBrightness","displayID":4,"maxValue":64,"systemIconID":1,"value":52}
[2024-06-24 20:30:16.795] OSD notification sent: {"controlTarget":"hardwareBrightness","displayID":3,"maxValue":64,"systemIconID":1,"value":48}

75% / 68% 
[2024-06-24 20:30:50.087] OSD notification sent: {"controlTarget":"hardwareBrightness","displayID":4,"maxValue":64,"systemIconID":1,"value":48}
[2024-06-24 20:30:50.088] OSD notification sent: {"controlTarget":"hardwareBrightness","displayID":3,"maxValue":64,"systemIconID":1,"value":44}

68% / 62%
[2024-06-24 20:31:06.825] OSD notification sent: {"controlTarget":"hardwareBrightness","displayID":4,"maxValue":64,"systemIconID":1,"value":44}
[2024-06-24 20:31:06.825] OSD notification sent: {"controlTarget":"hardwareBrightness","displayID":3,"maxValue":64,"systemIconID":1,"value":40}

62% / 56%
[2024-06-24 20:31:24.200] OSD notification sent: {"controlTarget":"hardwareBrightness","displayID":4,"maxValue":64,"systemIconID":1,"value":40}
[2024-06-24 20:31:24.201] OSD notification sent: {"controlTarget":"hardwareBrightness","displayID":3,"maxValue":64,"systemIconID":1,"value":36}
waydabber commented 1 week ago

Hi @sampotts - BetterDisplay does not send percentages, only the maxValue (64) and the current value. This works like this (and uses 64 as maxValue) because the feature to send OSD data to MediaMate instead is implemented right where the app would normally use the native macOS OSD framework to produce the OSD. This way mediaMate gets the exact same data macOS would get to show the OSD.

Note: originally when the interface was developed I think MediaMate did not show percentages so the fact that it calculates percentage value is probably a new development. Since in some instances BetterDisplay does not use a 0-100% scale (for example when software HDR/XDR upscaling is used), this for sure causes discrepancies, but in your case as only hardware brightness is used, this should not be the case.

waydabber commented 1 week ago

Let's add @wouter01 to this issue, maybe he has some insights.

sampotts commented 6 days ago

BetterDisplay does not send percentages, only the maxValue (64) and the current value.

Oh yeah, I get that. When I say "It looks to me like the numbers are right." I mean I calculated what I'd expect to see from the API output based on the values displayed by MediaMate and they seemed right (rounded).

For example. MediaMate displays 62% and 56% when the API output was:

[2024-06-24 20:31:24.200] OSD notification sent: {"controlTarget":"hardwareBrightness","displayID":4,"maxValue":64,"systemIconID":1,"value":40}
[2024-06-24 20:31:24.201] OSD notification sent: {"controlTarget":"hardwareBrightness","displayID":3,"maxValue":64,"systemIconID":1,"value":36}

62% of 64 is 39.68 and the API output was 40 56% of 64 is 35.84 and the API output was 36.

Meanwhile with the above values, BetterDisplay shows 63% for both displays. So is there an issue with how I've configured BetterDisplay, or a bug in it's UI?

waydabber commented 6 days ago

Hmm. I am not sure. If the brightness percentage does not match the OSD, then something must be affecting it. If you change the brightness using the keyboard, do you see the slider value changing to the desired level? If so, what are the values as you progress from 0% to 100% with each keyboard press and do they remain at the set value or change slightly afterwards?

BetterDisplay continuously reads the brightness level of Apple displays and adjusts its sliders accordingly so it might be that even though after a keypress the brightness is set to a certain level but then the display or macOS compensates for whatever reasons (ambient light sensor, other processes interfering etc) and thus the slider value slightly changes - this won't be reflected in MediaMate's OSD as that reflects the OSD event only. You should have the app's menu open (and maybe System Setting's brightness slider) and see if the slider and brightness value in it changes in any direction by itself after the keypress.

Wouter01 commented 5 days ago

Hi, sorry for only having a look at this now. Is there something I can do about this?

sampotts commented 5 days ago

In macOS Settings, both displays have Automatically adjust brightness enabled and from what I can see, when I adjust the brightness, both values are in identical positions on the sliders. I

In BetterDisplay, when I adjust the brightness with the keyboard, both values are identical but I did notice the value flickering around at some levels:

https://github.com/waydabber/BetterDisplay/assets/719092/33e7dedd-59f8-42da-8918-a2e5197bbf06

waydabber commented 5 days ago

@Wouter01 - I don't think so - if I understand right the values are sent correctly and MediaMate calculates the percentages based on that right.

@sampotts - and are the levels correct then (I guess they show the same level because they are synced as a group or the keyboard is set to affect them all, right?) Does the flickering happen as well when the auto brightness is disabled?

waydabber commented 5 days ago

(note: I could add some logic to prevent the percentage value from flickering annoyingly when the brightness hovers around the threshold between two percentage numbers due to system brightness changing like that).

sampotts commented 3 days ago

There's something odd going on for sure, I can't seem to disable auto brightness adjustment. I can disable it but when I flick back and forth between the two displays, it will toggle itself back on. I guess this could be related. I also noticed that the brightness sliders are in sligthly different positions now.

https://github.com/waydabber/BetterDisplay/assets/719092/f6782634-bab9-4abc-b66f-eb9bae009b1f

waydabber commented 3 days ago

I am not sure what's wrong with auto brightness for the display - this might be some kind of macOS issue. The sliders being at different locations might be normal if one or both displays have auto brightness enabled, as the displays each have their sensors and they might drift.

You should be able to fully synchronize them by enabling auto brightness for one or the other display only and use BetterDisplay's Groups/Synchronization feature for brightness syncing make one display (the one with ambient sensor enabled) as sync source and the other a target + enable syncing external events for the sync config (so ambient light sensor induced changes are synced also).

Screenshot 2024-06-28 at 13 59 51