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 support for CameraShutter #3358

Merged
merged 1 commit into from
Nov 10, 2024
Merged

Add support for CameraShutter #3358

merged 1 commit into from
Nov 10, 2024

Conversation

yinyue200
Copy link
Contributor

Add support for CameraShutter on UX5401 and UX5406 to resolve the issue of the LED light not responding on the corresponding button.

See also: https://github.com/Kuchteq/asus-shutter-linux

@seerge
Copy link
Owner

seerge commented Nov 10, 2024

@yinyue200 hello,

Interesting, thanks for a contribution and a good find. I was looking for an endpoint for camera by myself, but other owners of laptops that have this hotkey were not really helpful :)

Do I understand correctly that Program.acpi.DeviceGet(AsusACPI.CameraShutter) on the device always returns correct shutter status ? (i.e. 0 or 1)

Cause if so, just checking for a value being >=0 (i.e. if endpoint exists in general) would be enough instead of hardcoding models list under AppConfig.IsCameraShutter() :)

@seerge seerge merged commit 000162b into seerge:main Nov 10, 2024
@seerge
Copy link
Owner

seerge commented Nov 10, 2024

@yinyue200 I have replaced IsCameraShutter() with just direct endpoint value check based on this assumption.

As for you it seem to always return a value, and on the device that does not support it (like mine) endpoint doesn't exist at all. This is how most of the endpoints work on Asus devices and how G-Helper usually hides unsupported features from UI :)

c6ea0b0

@yinyue200
Copy link
Contributor Author

Yes, on my device, the return value is always 0 or 1. If this endpoint returns a negative value on devices that do not support CameraShutter, then there should be no problem. Thank you for your fix!

@yinyue200 yinyue200 deleted the CameraShutter branch November 10, 2024 18:57
@seerge
Copy link
Owner

seerge commented Nov 10, 2024

@yinyue200 yes, all endpoints that DSTS (DeviceGet) command returns contain a "presence" bit, that's why to get actual value I deduct it from result (i.e. deduct 65536 from int value)

public int DeviceGet(uint DeviceID)

And then, if result is < 0 it means endpoint doesn't exist at all.

Pro-tip: You can add "debug": 1, to config.json in the app, and then under Extra section you will see a zoom-glass button that runs a scan over all endpoints on your device. May be you will find something interesting there :)

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

Successfully merging this pull request may close these issues.

2 participants