Clight
Clight copied to clipboard
[BUG] Clight changes the backlight level twice every capture
Clight version the issue has been seen with: Clight 4.11-6a5ad96 / Clightd 5.9-7d447d0 / Fedora 39
Used distribution: Source build.
Describe the bug Clight changes the backlight level twice on every capture, one time with the calculated value and the second time with the other (wrong) value:
Sensor '/etc/clightd/sensors.d/als' is now available.
Resumed as a sensor is now available.
Emitting 'NextEvent' property
Emitting 'SensorAvail' property
Captured [1/1] from '/etc/clightd/sensors.d/als'. Ambient brightness: 0.488.
Ambient brightness: 0.488 -> Screen backlight: 0.698.
Set timeout of 10s 0ns on fd 42.
Emitting 'AmbientBr' property
Emitting 'BlPct' property
Backlight 'intel_backlight' level updated: 0.70.
Emitting 'BlPct' property
Backlight '/dev/i2c-13' level updated: 0.70.
Backlight 'intel_backlight' level updated: 0.65.
Emitting 'BlPct' property
Backlight '/dev/i2c-13' level updated: 0.65.
Captured [1/1] from '/etc/clightd/sensors.d/als'. Ambient brightness: 0.488.
Ambient brightness: 0.488 -> Screen backlight: 0.698.
Set timeout of 10s 0ns on fd 42.
Emitting 'AmbientBr' property
Emitting 'BlPct' property
Backlight 'intel_backlight' level updated: 0.70.
Emitting 'BlPct' property
Backlight '/dev/i2c-13' level updated: 0.70.
Backlight 'intel_backlight' level updated: 0.65.
Emitting 'BlPct' property
Backlight '/dev/i2c-13' level updated: 0.65.
Captured [1/1] from '/etc/clightd/sensors.d/als'. Ambient brightness: 0.488.
Ambient brightness: 0.488 -> Screen backlight: 0.698.
Set timeout of 10s 0ns on fd 42.
Emitting 'AmbientBr' property
Emitting 'BlPct' property
Backlight 'intel_backlight' level updated: 0.70.
Emitting 'BlPct' property
Backlight '/dev/i2c-13' level updated: 0.70.
Backlight 'intel_backlight' level updated: 0.65.
Emitting 'BlPct' property
Backlight '/dev/i2c-13' level updated: 0.65.
Expected behavior The backlight level should change once every capture.
To Reproduce
clight.conf
:
verbose = true;
backlight :
{
ac_timeouts = [ 10, 10, 10 ];
};
keyboard :
{
disabled = true;
};
sensor:
{
captures = [ 1, 1 ];
devname = "als";
};
$ cat /etc/clightd/sensors.d/als
2000
Did some investigation and it looks like it's not a Clight issue but Clightd. I bisected it and it seems that this bug was introduced by this commit.
Hi! Thanks for reporting this issue and thanks for the investigation! Are you willing to try to fix it? Otherwise I can dig it further and hopefully find a solution:)
Hi, I took a look into the Clightd code and the problem seems to be more complex. While ce65493 is the last correctly working code, commit b762958 is not the root of the issue, at least not the single root, because it was effectively reverted in commit 65bd59c. That's all I dug for now, I will report here if I find something more.