From 7cb56487f88a0cafe307d1456528a39714494862 Mon Sep 17 00:00:00 2001 From: Kamal Mostafa Date: Wed, 8 Aug 2012 18:53:24 -0700 Subject: [PATCH] simpleaudio-alsa: do not fiddle with sw params at all --- src/simpleaudio-alsa.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/simpleaudio-alsa.c b/src/simpleaudio-alsa.c index b698bfc..3dbec78 100644 --- a/src/simpleaudio-alsa.c +++ b/src/simpleaudio-alsa.c @@ -137,7 +137,7 @@ simpleaudio_open_stream_alsa( return NULL; } - /* set ALSA's "stop threshold" to 0.1 sec (rate/10) to avoid underruns */ +#if 0 snd_pcm_sw_params_t *swparams; snd_pcm_sw_params_alloca(&swparams); error = snd_pcm_sw_params_current(pcm, swparams); @@ -146,13 +146,16 @@ simpleaudio_open_stream_alsa( snd_pcm_close(pcm); return NULL; } - snd_pcm_sw_params_set_stop_threshold(pcm, swparams, rate/10); + snd_pcm_sw_params_set_start_threshold(pcm, swparams, NFRAMES_VAL); + snd_pcm_sw_params_set_stop_threshold(pcm, swparams, NFRAMES_VAL); + snd_pcm_sw_params_set_silence_threshold(pcm, swparams, NFRAMES_VAL); error = snd_pcm_sw_params(pcm, swparams); if (error) { fprintf(stderr, "E: %s\n", snd_strerror(error)); snd_pcm_close(pcm); return NULL; } +#endif simpleaudio *sa = malloc(sizeof(simpleaudio)); if ( !sa ) {