• Adam Whiteside's avatar
    [Chromecast] Adjust cast_audio_output_stream mixer output buffer sizes. · cc885f25
    Adam Whiteside authored
    Currently audio output streams inside MixerInputConnection have a fixed
    maximum buffer size of 8192 frames. This means that the overall delay
    changes depending on sample rate (with lower sample rates accumulating
    substantial delay, 512ms at 16000Hz).
    
    The current 8192 frame buffer is equivalent to 170ms of audio at
    48000Hz, which is unnecessarily high. Set non-communications streams to
    70ms and communications streams to 50ms.
    
    confirmed both with logging and listening test that the latency is
    substantially reduced.
    
    Bug: internal 168254375
    Test: On device. Ran sample app at both 48000 and 16000 sample rates and
    Change-Id: I109df7dd10e3067f9cb4f9117c31e96cbdef581b
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2461218
    Commit-Queue: Adam Whiteside <awhiteside@google.com>
    Reviewed-by: default avatarKenneth MacKay <kmackay@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#815452}
    cc885f25
cast_audio_output_stream.cc 19.6 KB