aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordvdli <dvdli@google.com>2020-10-28 17:37:19 +0800
committerdvdli <dvdli@google.com>2020-10-28 17:37:19 +0800
commit1e75a165df625396afd68bbc68a59c517727c3e6 (patch)
tree3af9ed8f027f6a4b8a973560c6a281927d0542a5 /src
parent5688a7a7b125e9bd3e3f81f8a30f3425bf71d42d (diff)
AOSP CL "pcm: add support to set silence_size"
https://android.googlesource.com/platform/external/tinyalsa/+/e25fe0b50ea717a9f347dcb927d396e8772e6362 commit e25fe0b50ea717a9f347dcb927d396e8772e6362 author Maneet Singh <mmaneetsingh@nvidia.com> pcm: add support to set silence_size Tinyalsa always set silence_size to zero. Add support to set this pcm software parameter as required. Bug: 20226809 Bug: 20300203 Change-Id: I25de43623dc04bf5a3ad4c6573bc2b8dad1eec5e
Diffstat (limited to 'src')
-rw-r--r--src/pcm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pcm.c b/src/pcm.c
index 406ac8d..8da3241 100644
--- a/src/pcm.c
+++ b/src/pcm.c
@@ -438,6 +438,7 @@ int pcm_set_config(struct pcm *pcm, const struct pcm_config *config)
pcm->config.start_threshold = config->period_count * config->period_size;
pcm->config.stop_threshold = config->period_count * config->period_size;
pcm->config.silence_threshold = 0;
+ pcm->config.silence_size = 0;
} else
pcm->config = *config;
@@ -519,7 +520,7 @@ int pcm_set_config(struct pcm *pcm, const struct pcm_config *config)
sparams.stop_threshold = config->stop_threshold;
sparams.xfer_align = config->period_size / 2; /* needed for old kernels */
- sparams.silence_size = 0;
+ sparams.silence_size = config->silence_size;
sparams.silence_threshold = config->silence_threshold;
pcm->boundary = sparams.boundary = pcm->buffer_size;