We have moved to a new Sailfish OS Forum. Please start new discussions there.

Light sensor stops responding (XA2)?

Tracked by Jolla

asked 2019-08-07 17:13:49 +0300

Filip K. gravatar image

updated 2019-08-07 17:14:20 +0300

Did anyone noticed that light sensor sometimes is stuck on XA2 with and also older versions? Similar as Proximity sensor did in the past. I confirmed with CSD which shows -1 value and it doesn't change with light.

It works properly afer I restart sensorfwd: $ devel-su systemctl restart sensorfwd

edit retag flag offensive close delete

1 Answer

Sort by » oldest newest most voted

answered 2019-08-08 10:03:24 +0300

spiiroin gravatar image

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:

  1. 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
  2. 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
  3. Flip mce setting off, wait few secs, and flip it back on (mcetool --set-als-mode=disabled --block=5 --set-als-mode=enabled)
  4. ... when done, restore normal display blanking behavior with: mcetool -Doff
edit flag offensive delete publish link more


Thanks spiiroin. Great guide which will help to debug also for many others. I'll try to catch it although it's a bit rare on occurrence.

Filip K. ( 2019-08-08 10:42:39 +0300 )edit
Login/Signup to Answer

Question tools



Asked: 2019-08-07 17:13:49 +0300

Seen: 164 times

Last updated: Aug 08 '19