From 56a4b30a421ffd7c452650da4adcf1a3886fa599 Mon Sep 17 00:00:00 2001
From: Yamit Mehta <ymehta@codeaurora.org>
Date: Mon, 7 Nov 2016 16:30:09 +0530
Subject: [PATCH] pcm: add support to set silence_size

Tinyalsa always set silence_size to zero. Add support to set this
pcm software parameter as required.
---
 git/include/tinyalsa/pcm.h | 1 +
 git/src/pcm.c              | 1 +
 2 files changed, 2 insertions(+)

diff --git a/tinyalsa-git/include/tinyalsa/pcm.h b/tinyalsa-git/include/tinyalsa/pcm.h
index 58a7f56..74a871b 100644
--- a/tinyalsa-git/include/tinyalsa/pcm.h
+++ b/tinyalsa-git/include/tinyalsa/pcm.h
@@ -182,6 +182,7 @@ struct pcm_config {
     unsigned int stop_threshold;
     /** The minimum number of frames to silence the PCM */
     unsigned int silence_threshold;
+    unsigned int silence_size;
     int avail_min;
 };
 
diff --git a/tinyalsa-git/src/pcm.c b/tinyalsa-git/src/pcm.c
index 75fc85c..1051a3b 100644
--- a/tinyalsa-git/src/pcm.c
+++ b/tinyalsa-git/src/pcm.c
@@ -1039,6 +1039,7 @@ struct pcm *pcm_open(unsigned int card, unsigned int device,
     sparams.xfer_align = config->period_size / 2; /* needed for old kernels */
     sparams.silence_size = 0;
     sparams.silence_threshold = config->silence_threshold;
+    sparams.silence_size = config->silence_size;
     pcm->boundary = sparams.boundary = pcm->buffer_size;
 
     while (pcm->boundary * 2 <= INT_MAX - pcm->buffer_size)
-- 
1.9.1

