From 350211381a270fc6f5e02d3a75cbf6bf99152ec8 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Mon, 30 Jan 2012 11:31:56 -0800 Subject: 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. --- pcm.c | 11 ++++++++--- 1 file 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; -- cgit v1.2.3