aboutsummaryrefslogtreecommitdiff
path: root/pcm.c
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2012-01-30 11:31:56 -0800
committerSimon Wilson <simonwilson@google.com>2012-01-30 11:51:46 -0800
commit350211381a270fc6f5e02d3a75cbf6bf99152ec8 (patch)
treedbb633fd6ff7fdedeaf841cf6bf2aec9d02c6b81 /pcm.c
parent7db48587ba86708f4d1284014e07c88de044b2d4 (diff)
pcm: fix pcm capture dropping samples
Commit ee9ba87d modified the stop threshold for capture and playback and caused pcm samples to be dropped during capture. Restore initial stop threshold for capture and leave new value for playback.
Diffstat (limited to 'pcm.c')
-rw-r--r--pcm.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/pcm.c b/pcm.c
index 010d054..2ef7075 100644
--- a/pcm.c
+++ b/pcm.c
@@ -542,9 +542,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;