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

Add option to read and update current DDC value periodically #1967

Closed
joevt opened this issue Jul 9, 2023 · 20 comments
Closed

Add option to read and update current DDC value periodically #1967

joevt opened this issue Jul 9, 2023 · 20 comments
Assignees
Labels
DDC DDC related issue done All tasks are completed enhancement New feature or request released Released
Milestone

Comments

@joevt
Copy link

joevt commented Jul 9, 2023

If I change the volume using the display, it does not update what BetterDisplay thinks is the current volume for the display.

I think that before BetterDisplay changes or displays a value (increment or decrement) it should read the current value from the display. I believe BetterDisplay currently only has an option to read the current value only when the app starts?

Maybe this can be set so that it doesn't read the value if it was read or written in the last second. In the case of changing volume or brightness, maybe it can read the value only when the onscreen volume or brightness indicator overlay appears in macOS.

@waydabber waydabber added the enhancement New feature or request label Jul 9, 2023
@waydabber
Copy link
Owner

waydabber commented Jul 9, 2023

I'll add an option to read volume/brightness periodically (to update slider values) or on first keypress (and then a cool-off period when the app won't read again for a while). Currently the app is not reading anything by default even on startup (although you can set it to read on startup) as reading can be somewhat unreliable with some hardware.

Btw - generally improving DDC read, auto-configuring stuff by taking into account reported VCP capabilities and min/max ranges for various control codes is also on my todo list, this aspect of the app is somewhat half-baked now. - #1168

@joevt - your contribution to the community is highly appreciated, let me know if you want a free coupon code for the Pro version of the app!

@vjraitila
Copy link

Just to verify, should reading the current volume level from the monitor work upon startup in the current version?

It does not work for me, although my unit does return the current value in VCP code 0x62 (Audio speaker volume). Is there a way to troubleshoot why it does not work?

@waydabber
Copy link
Owner

waydabber commented May 20, 2024

It won't read the display value by default on startup as reading is somewhat unreliable. You can change this under DDC communication settings for the display under Settings (set it to Read values from display).

@vjraitila
Copy link

Yeah. I did enable the setting, but the value is still not restored.

@waydabber
Copy link
Owner

You can try m1ddc and see if the read succeeds.

@vjraitila
Copy link

Reading the value with m1ddc works as expected.

Screenshot 2024-05-21 at 18 50 46

@waydabber
Copy link
Owner

BetterDisplay will read the settings only on startup and from that time on assume you are not changing it externally. So it does not re-read the values periodically or on wake (this issue when implemented is to change that). So the issue is that on app startup the right value is not read? If so, I can reproduce and fix that as that is then a bug. :)

@vjraitila
Copy link

Yes. The value is not read on startup no matter how many times I quit and (re)start the app.

Whereas m1ddc consistently returns the correct value.

@waydabber
Copy link
Owner

All right, thank you, that might be an issue then. Honestly it's a time since I tested this feature as I don't actually use it myself (leave it default), so it might indeed be broken!

@waydabber waydabber changed the title Add option to read current value Add option to read and update current DDC value periodically May 21, 2024
@waydabber
Copy link
Owner

Added an issue about it! #2990

@waydabber
Copy link
Owner

Hi @vjraitila

It seems to me that DDC reading works in general (at least with the display I am testing), for image adjustments. Sadly none of my currently used displays actually support DDC volume control anymore (the one I used for testing that is broken), so this still might be a specific issue with volume control which I can't test right now. Can you confirm whether reading on startup works for Contrast for example but specifically it does not work for Volume?

Thank you!

@waydabber
Copy link
Owner

Ok, I tested it with a display that tends to reply random wrong values for DDC reads and based on that volume read does work (in the sense that it gets the random wrong value and sets it on startup). I am not entirely sure what could be the problem, might be display specific. You can maybe try tweaking the DDC communication settings a bit @vjraitila. Still it would be educational to know whether reading any other setting works or not.

@vjraitila
Copy link

The contrast is not read either upon startup in BetterDisplay. Whereas m1ddc consistently returns the correct value for both volume and contrast.

Anything particular in the DCC communication settings I could try? I played around with the delays a bit and the only thing it did was to slow down the application starting. BetterDisplay always shows the last values (for both volume and contrast) I had set using the app, not the ones read from the device.

@waydabber
Copy link
Owner

Honestly, not sure. Did you try reading via betterdisplaycli? Does that work?

Here is how to read the brightness for example:

betterdisplaycli get --namelike=wqhd --ddc --vcp=luminance

This should set brightness directly to 30:

betterdisplaycli set --namelike=wqhd --ddc=30 --vcp=luminance

@waydabber
Copy link
Owner

@vjraitila
Copy link

vjraitila commented May 25, 2024

betterdisplaycli get --namelike=wqhd --ddc --vcp=luminance returns Failed.

betterdisplaycli set --namelike=wqhd --ddc=30 --vcp=luminance succeeds.

m1ddc display 2 get luminance also works and returns the correct value.

@waydabber
Copy link
Owner

All right. The difference between the two apps is that BetterDisplay actually checks the checksum value sent by the display while m1ddc dos not so it accepts the result even if by spec the result should be considered wrong. It seems like the checksum is incorrectly calculated by the display while the return value is actually fine. I could maybe add an option not to check the checksum during read.

@waydabber
Copy link
Owner

#2990

@waydabber waydabber added the done All tasks are completed label Jun 18, 2024
@waydabber
Copy link
Owner

This can be enabled in a per display per DDC feature level. Disabled by default. Frequency can be anything between 0.5 and 3600 seconds.

Screenshot 2024-06-18 at 19 49 12

@waydabber
Copy link
Owner

Note: updated to work with synchronization when syncing of externally induced changes is enabled (originally for Apple screens).

@waydabber waydabber added the unreleased Not released yet in beta form label Jun 18, 2024
@waydabber waydabber self-assigned this Jun 18, 2024
@waydabber waydabber added this to the v2.3.8 milestone Jun 18, 2024
@waydabber waydabber added the released Released label Jun 28, 2024
@waydabber waydabber removed the unreleased Not released yet in beta form label Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DDC DDC related issue done All tasks are completed enhancement New feature or request released Released
Projects
None yet
Development

No branches or pull requests

3 participants