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

org.cinnamon.SettingsDaemon.Power.Screen.SetPercentage sets wrong value #348

Open
navid-zamani opened this issue Oct 4, 2021 · 0 comments

Comments

@navid-zamani
Copy link

 * csd version:  5.0.4+uma
 * Distribution: Linux Mint 20.2 Uma
 * Graphics hardware *and* driver used: Intel(R) HD Graphics 3000 (SNB GT2), using i915 driver
 * 32 or 64 bit: 64 bit

Issue
It does not set the actual percentage that it is given. E.g. for pIn=33, SetPercentage reports (uint32 33,), but actually, as GetPercentage confirms, it is set to (uint32, 26,) for some reason! And 66 results in 60. For those two values, pIn=$(( pIn+1 )) is a hack to make it work. But values in-between, like from 67 to 72, can not be set at all! (Setting it to 74 lets you set it to 73 again.)

Steps to reproduce

read pIn
gdbus call --session --dest org.cinnamon.SettingsDaemon.Power.Screen --object-path /org/cinnamon/SettingsDaemon/Power --method org.cinnamon.SettingsDaemon.Power.Screen.SetPercentage $pIn
pOut=$( gdbus call --session --dest org.cinnamon.SettingsDaemon.Power.Screen --object-path /org/cinnamon/SettingsDaemon/Power --method org.cinnamon.SettingsDaemon.Power.Screen.GetPercentage )
[[ $pOut == $pIn ]] && echo "Worked as expected" || echo "Failed"

Expected behaviour
Outputs “Worked as expected”, for all pIn values from 0 to 100. Ideally when using floating point values too.

Other information
This granularity also exists for the UI controls (Fn-Brighter and Fn-Darker key combos).
But it does not exist for setting /sys/class/backlight/intel_backlight/brightness directly! There, any value between 0 and $(</sys/class/backlight/intel_backlight/max_brightness) is possible and works.
BUT: Cinnamon doesn't notice and e.g. after power save, resets the brightness to what it knows again.
Also, very weirdly, the mapping from Cinnamon's to the sysfs one is NOT linear. Which makes mattes even worse, since a script, like a hook for redshift, cannot properly set e.g. 50% brightness, and Cinnamon just plain doesn't “allow” it. And I can't find any settings to change the granularity or mapping function.

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

1 participant