Ticket #1961 (closed defect: fixed)

Opened 22 months ago

Last modified 20 months ago

Timer not fired due to timestamp clock issue in Android

Reported by: nanang Owned by: bennylp
Priority: normal Milestone: release-2.6
Component: pjlib Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported: no


Currently PJLIB timer heap uses CLOCK_MONOTONIC for timestamp clock on some platforms including Android, unfortunately it will stop when CPU goes deep sleep, so certain event may not fire at the scheduled time.

Thank you Itay Bianco for the report.

Change History

comment:1 Changed 22 months ago by nanang

  • Status changed from new to closed
  • Resolution set to fixed

In 5447:

Fix #1961: Updated Android timestamp to use CLOCK_BOOTTIME (or ANDROID_ALARM_ELAPSED_REALTIME for older NDK version), to avoid suspended clock when CPU is in deep sleep.

comment:2 Changed 22 months ago by nanang

In 5457:

Re #1961: Updated Android pj_gettimestamp() implementation to use ANDROID_ALARM_ELAPSED_REALTIME.

comment:3 Changed 20 months ago by ming

In 5482:

Re #1961: Fallback to CLOCK_MONOTONIC if /dev/alarm is not found, or getting ANDROID_ALARM_ELAPSED_REALTIME fails.

Note: See TracTickets for help on using tickets.