You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The monotonic time does not advance while in suspend. So if we set an alarm in 10min, suspend the device for 5min and keep it awake after that, the alarm will go off after 15 wall clock minutes.
Programming the RTC is not sufficient, as fsotdld needs to notify who ever programmed the alarm after the system woke from suspend e.g. org.openmoko.projects.ffalarms.atd. This does not work, because fsotdld keeps waiting for the timer to run down (in monotonic time).
Here are some thoughts of how this could be fixed:
Finding a timer running on wall clock time would certainly help, though I have no clue how realistic that is. glib seeems not to provide such function.
Another approach that comes to mind would be to notify fsotdld of every system wakeup. Then let it check for an expired timer or reset it.
Note:
In the past the monotonic time must have advanced even in suspend (more likely on resume), because it used to work in SHR and uptime accumulated even time in suspend while now it does not.
fsotdld uses g_timeout_add_seconds() for fsotdld to wake up at the alarm
https://github.com/freesmartphone/cornucopia/blob/master/fsotdld/src/plugins/alarm/plugin.vala#L123
The interval given is in terms of monotonic time, not wall clock time. See g_get_monotonic_time().
https://developer.gnome.org/glib/2.36/glib-The-Main-Event-Loop.html#g-timeout-add-seconds
The monotonic time does not advance while in suspend. So if we set an alarm in 10min, suspend the device for 5min and keep it awake after that, the alarm will go off after 15 wall clock minutes.
This is with srv rev: 12843f0
Issue in SHR: http://shr-project.org/trac/ticket/1253
The text was updated successfully, but these errors were encountered: