AudioService: Fixes for loopback underruns/timing issues.
Fixes a "choppy audio" issue on platforms with certain audio timing parameters/scenarios. Investigation on crbug.com/934770 led to the realization that three related problems needed to be addressed: 1. Fix the "gap" detection in audio::SnooperNode to check in BOTH directions, not just one direction; and on both the input and output flows. This accounts for the case where a device-switch in audio::OutputController results in a sudden drastic shift in the delay timestamps. 2. Add automatically-increasing capture delay logic to audio::LoopbackStream to ensure the reads from all nodes' delay buffer will never result in underrun. 3. Increased the accuracy of media::FakeAudioWorker/OutputStream by: a) addressing a subtle source of error in task scheduling delay math due to integer truncation; b) exposing timestamps to worker callbacks that allow FakeAudioOutputStream to provide a |delay| and |delay_timestamp| that behaves just like a real AudioOutputStream. This "lessens the blow" of a device-switch to SnooperNode. Bug: 934770 Change-Id: Ia75f18b2be3ad905f27d6ad882df9632764bb81c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1504981 Commit-Queue: Yuri Wiitala <miu@chromium.org> Reviewed-by:Max Morin <maxmorin@chromium.org> Reviewed-by:
Oskar Sundbom <ossu@chromium.org> Reviewed-by:
Weiyong Yao <braveyao@chromium.org> Reviewed-by:
Dale Curtis <dalecurtis@chromium.org> Cr-Commit-Position: refs/heads/master@{#638427}
Showing
Please register or sign in to comment