From 067f5e33aad8216201d6673793155f8768a778ff Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 6 Jan 2019 13:49:20 -0800 Subject: [PATCH] Increase audio buffer on Linux to 25 ms. Fixes #147. Fixes #157. --- app/streaming/audio/renderers/soundioaudiorenderer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/streaming/audio/renderers/soundioaudiorenderer.cpp b/app/streaming/audio/renderers/soundioaudiorenderer.cpp index dd88c5f3..5ed7d9e4 100644 --- a/app/streaming/audio/renderers/soundioaudiorenderer.cpp +++ b/app/streaming/audio/renderers/soundioaudiorenderer.cpp @@ -9,9 +9,11 @@ const double SoundIoAudioRenderer::k_RawSampleLengthSec = 0.005; #ifdef Q_OS_LINUX // PulseAudio and ALSA require more than just 5 ms samples -// for some reason, so write a minimum of 20 ms each time to +// for some reason, so write a minimum of 25 ms each time to // prevent underruns on Bluetooth. -const double SoundIoAudioRenderer::k_MinSampleLengthSec = 0.020; +// https://github.com/moonlight-stream/moonlight-qt/issues/147 +// https://github.com/moonlight-stream/moonlight-qt/issues/157 +const double SoundIoAudioRenderer::k_MinSampleLengthSec = 0.025; #else // This determines the size of the buffers we'll // get from CoreAudio. It is also the minimum