Screen auto brightness control and low ambient luminosity
Related Mobian issue: https://gitlab.com/mobian1/issues/-/issues/128 is tagged upstream, so reporting it here.
I am using PinePhone community edition with 2 GB RAM and 16 GB of storage and Mobian OS. The power saving option to use auto screen brightness works as expected for high ambient luminosity. The screen brightness automatically goes up when the ambient luminosity increases and goes down when ambient luminosity decreases.
However, if ambient luminosity is almost zero (night mode), the screen brightness also goes to 0. This behaviour is not expected. The screen brightness should remain on some minimal level so the phone can be used.
From Mobian's issue https://gitlab.com/mobian1/issues/-/issues/5 I found the following code is used to compute the brightness level (didn't check it muself):
manager->ambient_accumulator = (GSD_AMBIENT_SMOOTH * brightness) + (1.0 - GSD_AMBIENT_SMOOTH) * manager->ambient_accumulator;
Considering brightness = 0
, GSD_AMBIENT_SMOOTH = 0.3
, 1.0 - GSD_AMBIENT_SMOOTH = 0.7
, obtain:
manager->ambient_accumulator = 0.3 * 0 + 0.7 * manager->ambient_accumulator = 0.7 * manager->ambient_accumulator
, so the brightness really goes to 0.
I would be happy with some minimal brightness for zero ambient luminosity, something like manager->ambient_accumulator = (1 - p - q) + p * brightness + q * manager->ambient_accumulator;
where 0 < p,q < p + q < 1.