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

Avoid display brightness tuning due to shortlived ALS noise #241

merged 5 commits into from Jan 30, 2015


Copy link

commented Jan 29, 2015

No description provided.

spiiroin added 5 commits Jan 29, 2015
To match what the rest of the mce.h uses.
Similar to already existing inteher and string helpers.
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.
spiiroin added a commit that referenced this pull request Jan 30, 2015
Avoid display brightness tuning due to shortlived ALS noise
@spiiroin spiiroin merged commit 6bc55d8 into nemomobile:master Jan 30, 2015
@spiiroin spiiroin deleted the spiiroin:jb25463_median_filter branch Jan 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.