answered
2019-08-08 10:03:24 +0200
Normally in sfos:
- Proximity sensor is kept always powered on
- Light sensor is powered on/off along with the display
The p-sensor problem in XA2 was: After the sensor has been powered on for "longish" period, it ceases to react to changes.
As a workaround for p-sensor problems one could do things like:
- restart sensorfwd - the big stick, all sensor stuff gets re-initialized
- restart mce - (as mce is the only p-sensor user) sensorfwd ends up power cycling just p-sensor, but mce state is lost
- toggle mce's "use proximity sensor" setting off and back on - p-sensor is power cycled without restarting any services
And the fix was to induce the same effect as the last of the above mentioned workarounds by making p-sensor utilization be more like how light sensor is used i.e. keep it powered off until needed (and introduce sensor power up wait states to everything that depends on p-sensor state).
Now with that in mind, it would be helpful to know when light sensor gets stuck:
- Has the display been on for lengthy periods of time (e.g. watching videos or something that might match the "longish" period causing problems with p-sensor)?
- Does the problem persist over display power cycling? (light sensor ought to get power cycled - which was enough to restore p-sensor functionality)
- Is restarting sensorfwd required, or would restarting mce / flipping mce settings suffice?
For that last item workflow would be something like:
- Close any apps that might utilize light sensor (e.g. that csd test app) so that mce is left as the only process using light sensor
- Ensure display is on and stays on (
mcetool -Don
) - slightly different from what happens during display power cycling, where light sensor power states are flipped while display is powered off - just in case it makes any difference from underlying sensor sw stack point of view - Flip mce setting off, wait few secs, and flip it back on (
mcetool --set-als-mode=disabled --block=5 --set-als-mode=enabled
) - ... when done, restore normal display blanking behavior with:
mcetool -Doff