Browse Source

pulseaudio: Request more recording data per-fragment.

This seems to help some devices that can't keep up with smaller fragment sizes
for whatever reason.

Fixes #13110.

(cherry picked from commit 14a4ae521acb784705e637854c368cceac80039a)
Ryan C. Gordon 2 months ago
parent
commit
0638fd58ce
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/audio/pulseaudio/SDL_pulseaudio.c

+ 2 - 1
src/audio/pulseaudio/SDL_pulseaudio.c

@@ -672,7 +672,8 @@ static bool PULSEAUDIO_OpenDevice(SDL_AudioDevice *device)
     paspec.rate = device->spec.freq;
 
     // Reduced prebuffering compared to the defaults.
-    paattr.fragsize = device->buffer_size;   // despite the name, this is only used for recording devices, according to PulseAudio docs!
+
+    paattr.fragsize = device->buffer_size * 2;   // despite the name, this is only used for recording devices, according to PulseAudio docs!  (times 2 because we want _more_ than our buffer size sent from the server at a time, which helps some drivers).
     paattr.tlength = device->buffer_size;
     paattr.prebuf = -1;
     paattr.maxlength = -1;