Update to latest tinyalsa
[android-sdk/platform-external-tinyalsa.git] / 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;