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

Skip to content
Commit ec8ca529 authored by Phil Burk's avatar Phil Burk
Browse files

aaudio: fix race at start of stream

When an MMAP stream is started, it is possible for the
beginning of the sound to be lost. One reason is because
the written data is placed right in front of the DSP read position.
But the DSP position is not well known when the stream is starting
because we only have a few timestamps.
If the DSP advances before the data is written then the first burst
might be skipped

This CL places the initial write one burst ahead of the estimated DSP
position.

The same code is used to synchronize the read/write counters
when a flush() occurs. In that case the serverMargin is zero.

Bug: 156313728
Bug: 157510931
Bug: 158547650
Test: atest CtsNativeMediaAAudioTestCases
Test: see bugs for other test cases
Change-Id: I96170a924c69eee080a497b52cc6c1f3498c5455
parent 18125ce8
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