diff options
author | Eric Laurent <elaurent@google.com> | 2012-08-22 16:18:14 -0700 |
---|---|---|
committer | Simon Wilson <simonwilson@google.com> | 2012-09-18 14:52:30 -0700 |
commit | 93e7b67301f9c5af3c5f92287c237a50dd607b95 (patch) | |
tree | 760281882bd5b5a68d03eda30ef1bc204abccf32 | |
parent | 80d8254df0294dcb97053c7b42e818595f4792cf (diff) |
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.
-rw-r--r-- | pcm.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -538,10 +538,13 @@ struct pcm *pcm_open(unsigned int card, unsigned int device, sparams.period_step = 1; sparams.avail_min = 1; - if (!config->start_threshold) - pcm->config.start_threshold = sparams.start_threshold = - config->period_count * config->period_size / 2; - else + if (!config->start_threshold) { + if (pcm->flags & PCM_IN) + pcm->config.start_threshold = sparams.start_threshold = 1; + else + pcm->config.start_threshold = sparams.start_threshold = + config->period_count * config->period_size / 2; + } else sparams.start_threshold = config->start_threshold; /* pick a high stop threshold - todo: does this need further tuning */ |