ASoc: soc-pcm: Open/close share channel once if it is used by two streams
- During voice and normal recording concurrency case, both voice
and recording streams share the same tx channel. If one stream
already opens the tx channel, another stream will get error when
trying to open the same channel again. If one stream ends and closes
the channel, but another stream will lose the sound if it's still using
it.
- To prevent the above issues, only send SND_SOC_DAPM_STREAM_START event
when capture active count is one. And send SND_SOC_DAPM_STREAM_STOP event
when capture active count is zero.
Change-Id: Ic6dcd5d8d1949c2b96d46915a4399a454075fbb7
CRs-Fixed: 357022
Signed-off-by: Helen Zeng <xiaoyunz@codeaurora.org>
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index 4676a02..17fef15 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -241,7 +241,7 @@
struct snd_soc_dai_driver *driver;
/* DAI runtime info */
- unsigned int capture_active:1; /* stream is in use */
+ unsigned int capture_active; /* stream is in use */
unsigned int playback_active:1; /* stream is in use */
unsigned int symmetric_rates:1;
struct snd_pcm_runtime *runtime;