Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 1e43219c authored by Jeremy Wu's avatar Jeremy Wu
Browse files

Floss: address clock drift in asrc

Since ISO packets are sent out at fixed intervals, the |RepeatingTimer|
utility determines an important time domain.

By default, it uses NTP-adjusted clocks, the difference between the
timestamps of which is compatible with
|CLOCK_REALTIME/MONOTONIC/BOOTTIME| and such, aligning with Android's
audio server.

However, CrAS uses |CLOCK_MONOTONIC_RAW|, which is another time domain,
unaffected by NTP, and this can cause xruns when the clock drift
accumulates, which does relatively quickly.

This CL adds a parameter to |RepeatingTimer| to allow scheduling based
on |CLOCK_MONOTONIC_RAW|, where despite each |DelayedCallback| can still
drift (since libchrome schedulers use NTP-adjusted clocks), in the long
run they are aligned.

Bug: 333334341
Test: m Bluetooth
Flag: EXEMPT floss only changes

Change-Id: Ie90952138d53a67171f526db55edd604306a96f6
parent ba2e6728
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment