Author: titmuss
Date: Thu Dec 11 09:16:17 2008
New Revision: 3495

URL: http://svn.slimdevices.com?rev=3495&root=Jive&view=rev
Log:
Bug: N/A
Description:
Make the alsa audio buffer 30ms for all bitrates.


Modified:
    7.4/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_alsa.c

Modified: 7.4/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_alsa.c
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_alsa.c?rev=3495&root=Jive&r1=3494&r2=3495&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_alsa.c 
(original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_alsa.c Thu 
Dec 11 09:16:17 2008
@@ -175,8 +175,9 @@
 static int pcm_open(u32_t sample_rate) {
        int err, dir;
        snd_pcm_uframes_t size;
-#define BUFFER_SIZE 8192 /*(8291 / 4)*/
-#define PERIOD_SIZE (BUFFER_SIZE / 4) /*(BUFFER_SIZE / 8)*/
+       unsigned int val;
+#define BUFFER_TIME 30000
+#define PERIOD_COUNT 3
 
        if (handle && sample_rate == pcm_sample_rate) {
                return 0;
@@ -243,14 +244,14 @@
        }
 
        /* set buffer and period times */
-       size = BUFFER_SIZE;
-       if ((err = snd_pcm_hw_params_set_buffer_size_near(handle, hwparams, 
&size)) < 0) {
-               DEBUG_ERROR("Unable to set  buffer size %s", snd_strerror(err));
-               return err;
-       }
-
-       size = PERIOD_SIZE;
-       if ((err = snd_pcm_hw_params_set_period_size_near(handle, hwparams, 
&size, &dir)) < 0) {
+       val = BUFFER_TIME;
+       if ((err = snd_pcm_hw_params_set_buffer_time_near(handle, hwparams, 
&val, &dir)) < 0) {
+               DEBUG_ERROR("Unable to set  buffer time %s", snd_strerror(err));
+               return err;
+       }
+
+       val = PERIOD_COUNT;
+       if ((err = snd_pcm_hw_params_set_periods_near(handle, hwparams, &val, 
&dir)) < 0) {
                DEBUG_ERROR("Unable to set period size %s", snd_strerror(err));
                return err;
        }

_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins

Reply via email to