increase alsa rewind safeguard
authorJaska Uimonen <jaska.uimonen@intel.com>
Mon, 28 Apr 2014 08:26:15 +0000 (11:26 +0300)
committerIsmo Puustinen <ismo.puustinen@intel.com>
Wed, 28 May 2014 09:40:02 +0000 (12:40 +0300)
In some devices alsa drivers behaves badly
if pulseaudio rewind safeguard is too small.
This is not fixing the driver issues, but is
a workaround to give time (1.33ms->5ms) for
user space processing so that alsa is not
getting into this weird state. This could be
also helped by running pulseaudio in realtime.
This is of course increasing the volume setting
latency, but should leave it still quite
responsive.

Change-Id: Iecdf879bf8ba58e991808d2dc382def05de36ec9
Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
src/modules/alsa/alsa-sink.c

index ccf1137..5a41cf6 100644 (file)
 
 #define VOLUME_ACCURACY (PA_VOLUME_NORM/100)  /* don't require volume adjustments to be perfectly correct. don't necessarily extend granularity in software unless the differences get greater than this level */
 
+#if 0
 #define DEFAULT_REWIND_SAFEGUARD_BYTES (256U) /* 1.33ms @48kHz, we'll never rewind less than this */
 #define DEFAULT_REWIND_SAFEGUARD_USEC (1330) /* 1.33ms, depending on channels/rate/sample we may rewind more than 256 above */
+#endif
+
+#define DEFAULT_REWIND_SAFEGUARD_BYTES (1024U) /* increase safeguard 4x */
+#define DEFAULT_REWIND_SAFEGUARD_USEC (5000) /* increase safeguard ~4x */
 
 struct userdata {
     pa_core *core;