Update to latest tinyalsa
authorEric Laurent <elaurent@google.com>
Mon, 30 Jan 2012 19:31:56 +0000 (11:31 -0800)
committerSimon Wilson <simonwilson@google.com>
Mon, 30 Jan 2012 20:01:24 +0000 (12:01 -0800)
3502113 pcm: fix pcm capture dropping samples

Change-Id: Icae0f32a39e58dda55a3b9a0094263ba781d65a7

pcm.c

diff --git a/pcm.c b/pcm.c
index 04d4396a1acfb5eda9bd32473a0db26ea3d1ae14..9324f384143a533a23cfca3898fc226973e73d82 100644 (file)
--- a/pcm.c
+++ b/pcm.c
@@ -551,9 +551,14 @@ struct pcm *pcm_open(unsigned int card, unsigned int device,
         sparams.start_threshold = config->start_threshold;
 
     /* pick a high stop threshold - todo: does this need further tuning */
-    if (!config->stop_threshold)
-        pcm->config.stop_threshold = sparams.stop_threshold =
-            config->period_count * config->period_size;
+    if (!config->stop_threshold) {
+        if (pcm->flags & PCM_IN)
+            pcm->config.stop_threshold = sparams.stop_threshold =
+                config->period_count * config->period_size * 10;
+        else
+            pcm->config.stop_threshold = sparams.stop_threshold =
+                config->period_count * config->period_size;
+    }
     else
         sparams.stop_threshold = config->stop_threshold;