From 591a4987250ec8de37a38410b28a991ce4fa0e4e Mon Sep 17 00:00:00 2001 From: Mark Hills Date: Fri, 21 Mar 2014 18:43:05 +0000 Subject: [PATCH] Be more specific when setting buffer time We don't want the max buffer time, but we want the nearest buffer time that is below the value provided by the user. --- device.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/device.c b/device.c index 0b19224..00e3a29 100644 --- a/device.c +++ b/device.c @@ -62,9 +62,9 @@ int set_alsa_hw(snd_pcm_t *pcm, r = snd_pcm_hw_params_set_channels(pcm, hw, channels); CHK("snd_pcm_hw_params_set_channels", r); - dir = 0; - r = snd_pcm_hw_params_set_buffer_time_max(pcm, hw, &buffer, &dir); - CHK("snd_pcm_hw_params_set_buffer_time_max", r); + dir = -1; + r = snd_pcm_hw_params_set_buffer_time_near(pcm, hw, &buffer, &dir); + CHK("snd_pcm_hw_params_set_buffer_time_near", r); r = snd_pcm_hw_params(pcm, hw); CHK("hw_params", r);