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

Skip to content
Commit a5df87bf authored by jiabin's avatar jiabin
Browse files

Use the timestamp reported by the HAL for aaudio.

Use the timestamp reported by the HAL if it is accurate.

For the audio HAL whose version is less than 7.0,
getPresentationPosition is an optional API. In that case, it may not
report the timestamp correctly. If the reported position is not
changed within the time of 5 burst size, the reported timestamp from
the HAL will not be used.

For the audio HAL whose version is 7.0 or later, the
getPresentationPosition API is mandatory. In that case, the reported
timestamp is expected to be a valid one. But in the real practice, the
HAL may not always report the timestamp correctly for MMAP case. To
avoid reporting wrong timestamp to apps, the timestamp from the HAL is
not trusted if
1) reported position is going backwards or
2) reported timestamp is going backwards or
3) timestamp or position is frozon for a certain time.

Bug: 158609200
Test: atest AAudioTests
Change-Id: Ib6a9825936f3db15b68d2c7af8c578182566f52a
parent 3e014877
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment