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 gradual transition #49

Closed
wants to merge 2 commits into from
Closed

Add gradual transition #49

wants to merge 2 commits into from

Conversation

Anarky
Copy link

@Anarky Anarky commented Apr 20, 2020

Hello, this PR add an optional number to parse, and use it as a number of steps to gradually change the brightness.

I just saw the issue #26; in your anim branch it seems you implement a time-based solution.
I would say it's easier to use, but they are not mutually exclusive?

@Hummer12007
Copy link
Owner

Hi, does writing to the device in a lot of steps without any delay actually make any difference in comparison to just writing it once?

@Anarky
Copy link
Author

Anarky commented Apr 20, 2020

I just did more tests, it seems to only create a transition if ENABLE_SYSTEMD is set.
With this option, writing with 100 steps takes ~200ms.
Without it, it takes 10k steps (x100) for the same time, and I'm not sure to see a transition.

I would guess systemd apply each and every value, so sometimes repeating them creates a delay, but without it the values are batched and some are skipped?

@Hummer12007
Copy link
Owner

The reason it works with systemd is that each device write with systemd incurs the overhead of a DBus call, if I remember correctly, which is rather slow, so it introduces delay. While writes to sysfs are fast, so they happen almost immediately.

@xdbob
Copy link
Contributor

xdbob commented Apr 26, 2020

Indeed, talking to logind will cause a lot of overhead compared to directly writing to the device file. IMHO only a time-base solution is viable, taking advantage of the overhead of some call is a bad idea and may break for almost any reason at any point.

@Anarky
Copy link
Author

Anarky commented Apr 28, 2020

You're right, feel free to close this PR if you don't need it :)

@Hummer12007 Hummer12007 closed this Sep 6, 2021
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.

3 participants