Update to latest tinyalsa
3bb114a pcm: add control for ASLA thresholds to pcm_open
ee99f21 include: make it easier to use this header from C++
89b3128 Makefile: Don't error out of clean if already clean
a14dad9 tinymix: Say if we can't open the mixer
49900f0 Merge pull request #3 from broonie/noprelink
ea019ef Merge pull request #2 from broonie/add-include
Change-Id: I110de23af1f43d2cefb134204cb0439a7fd4c1d0
diff --git a/pcm.c b/pcm.c
index 341c214..300def5 100644
--- a/pcm.c
+++ b/pcm.c
@@ -427,11 +427,21 @@
sparams.tstamp_mode = SNDRV_PCM_TSTAMP_ENABLE;
sparams.period_step = 1;
sparams.avail_min = 1;
- sparams.start_threshold = config->period_count * config->period_size;
- sparams.stop_threshold = config->period_count * config->period_size;
+
+ if (!config->start_threshold)
+ sparams.start_threshold = config->period_count * config->period_size;
+ else
+ sparams.start_threshold = config->start_threshold;
+
+ if (!config->stop_threshold)
+ sparams.stop_threshold = config->period_count * config->period_size;
+ else
+ sparams.stop_threshold = config->stop_threshold;
+
sparams.xfer_align = config->period_size / 2; /* needed for old kernels */
sparams.silence_size = 0;
- sparams.silence_threshold = 0;
+ sparams.silence_threshold = config->silence_threshold;
+
if (ioctl(pcm->fd, SNDRV_PCM_IOCTL_SW_PARAMS, &sparams)) {
oops(pcm, errno, "cannot set sw params");