Join GitHub today
Avoid display brightness tuning due to shortlived ALS noise #241
Earlier, when fixed time ALS sampling was possible, mce used median filtering to prevent adjusting display brightness due to short lived sensor noise. The feature got removed while adapting to sensor drivers that report only changes that are significant enough. User timer based approach to resample waveform obtained by tracking changes reported by the ambient light sensor. Apply 9 slot moving window median filtering on top of that and feed the results in to brightness evaluation state machines. To avoid unnecessary processing, the timer is stopped when no ALS changes are noticed i.e. when all of the history data is the same. The median filter can be enabled via: mcetool --set-als-input-filter=<disabled|median> And the sample time can be adjusted via: mcetool --set-als-sample-time=<50...1000> [mce] Implement median filtering for ALS data
Combined effect of the directional nature of the ambient light sensor and mce reacting immediately to light level changes is that the display brightness can pump up and down very easily - especially in relatively dimly lit environments. Apply median filtering to ALS input data to eliminate effects of very short lived sensor level changes. Make the brightness tuning that happens after median filtering take a bit longer. This makes it more likely that longer, but still short living changes in ALS level get reversed before the brightness change gets finished. [mce] Avoid display brightness tuning due to shortlived ALS noise. Fixes JB#25463
To keep display state related brightness fade animations as uniform as possible, mce skips ALS tuning while those are running. The recent changes in startup and als filtering made it more likely that a timing glitch can occur and cause the "assumed light level before real sensor data is available" based brightness stays in effect after mce startup. Check if ALS tuning is needed after finishing brightness fade animations that could have blocked it while running.
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews.