aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Laurent2012-08-22 18:18:14 -0500
committerEric Laurent2012-08-22 18:18:14 -0500
commitff2e54293f32b5bb5ff75b4cb25babb00f429ca4 (patch)
tree568558c37c8aa12b39f8b12c03f906d3262bbe00
parent85dc38f5bee79c184260e8c665cc34143be12bd4 (diff)
downloadplatform-external-tinyalsa-ff2e54293f32b5bb5ff75b4cb25babb00f429ca4.tar.gz
platform-external-tinyalsa-ff2e54293f32b5bb5ff75b4cb25babb00f429ca4.tar.xz
platform-external-tinyalsa-ff2e54293f32b5bb5ff75b4cb25babb00f429ca4.zip
pcm: fix default capture start threshold
Default start threshold was set to the same value (half of the buffer size) for playback and capture in pcm_open(). The normal default value for capture should be 1 frame. Change-Id: I05afd51ada3d915a6dde7c97846e1693f7c575f4
-rw-r--r--pcm.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/pcm.c b/pcm.c
index 4e9133a..284a7ac 100644
--- a/pcm.c
+++ b/pcm.c
@@ -547,10 +547,13 @@ struct pcm *pcm_open(unsigned int card, unsigned int device,
547 sparams.tstamp_mode = SNDRV_PCM_TSTAMP_ENABLE; 547 sparams.tstamp_mode = SNDRV_PCM_TSTAMP_ENABLE;
548 sparams.period_step = 1; 548 sparams.period_step = 1;
549 549
550 if (!config->start_threshold) 550 if (!config->start_threshold) {
551 pcm->config.start_threshold = sparams.start_threshold = 551 if (pcm->flags & PCM_IN)
552 config->period_count * config->period_size / 2; 552 pcm->config.start_threshold = sparams.start_threshold = 1;
553 else 553 else
554 pcm->config.start_threshold = sparams.start_threshold =
555 config->period_count * config->period_size / 2;
556 } else
554 sparams.start_threshold = config->start_threshold; 557 sparams.start_threshold = config->start_threshold;
555 558
556 /* pick a high stop threshold - todo: does this need further tuning */ 559 /* pick a high stop threshold - todo: does this need further tuning */