answered
2019-12-17 09:29:02 +0200
The algorithm has not changed in 3.2.1. In fact there are no significant changes since 1.1.x times.
What you are describing is basically: Highly directional sensor, observing in the opposite direction vs user, in dimly lit environment -> User can experience ambient lightning as stable, but light sources behind user easily cause major difference in amount of light perceived by the sensor -> Tilting device slightly causes display brightness fluctuation.
Due to hw constraints automatic brightness tuning is basically deciding much weight is given to display brightness stability vs reaction time to major lightning changes - some aspects of this are user configurable. For example:
Minimizing reaction time: Just use sensor output as-is without delay of any sort -> Lots of abrupt changes -> Unlikely that anybody would wish to use settings like this.
mcetool --set-als-input-filter=disabled --set-brightness-fade-als=0
Maximizing stabily: Use median filter with relatively long sampling frame time and perform display brightness changes slowly in fixed velocity (say, 5% / s) -> Lightning changes that last under 5 seconds or so end up getting ignored altogether and actual display brightness changes are so slow that it might go unnoticed -> Very stable, but ... flick lights on/off and nothing seems to happen for ages.
mcetool --set-als-input-filter=median --set-als-sample-time=1000 --set-brightness-fade-als=-5
The defaults are a compromise somewhere in between the above two cases: Use median filter with relatively short frame size and perform display brightness change in fixed time -> Short living changes are still ignored, small adjustments ought to be subtle enough while reacting to major changes finishes in couple of seconds, but ... there will be some amount of fluctuation especially in dimly light environment (in bus driving past streetlamps, walking in corridor with lamps overhead, etc).
mcetool --set-als-input-filter=median --set-als-sample-time=125 --set-brightness-fade-als=1000
If you often use your phone in dimly lit conditions, you could try whether tweaking these parameters produces more pleasant experience for you. For example using a bit longer filtering sample frame and slower brightness adjustments:
mcetool --set-als-input-filter=median --set-als-sample-time=500 --set-brightness-fade-als=1500
Or maybe additionally switching to fixed velocity (7% / second) rather than using fixed transition time:
mcetool --set-als-input-filter=median --set-als-sample-time=500 --set-brightness-fade-als=-7