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
Loading
Please register or sign in to comment