[PATCH] ASoC: soc-pcm: only apply symmetry if more than one stream is active

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



ALSA documentation indicates that the hw_params() (and prepare())
callbacks can be made multiple times during the life of an individual
stream.  It is not specified whether hw_free() will be called, nor is
it specified whether the parameters will be the same as the last call.

Since symmetry is supposed to be applied between different streams,
apply symmetry only when we have more than one activation of the CPU
DAI.

Signed-off-by: Russell King <rmk+kernel@xxxxxxxxxxxxxxx>
---
Untested, depends on "ASoC: soc-pcm: make symmetry work again"

 sound/soc/soc-pcm.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 2a4246dbe55f..3c7c3f79742e 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -1010,9 +1010,11 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream,
 	}
 	component = NULL;
 
-	ret = soc_pcm_params_symmetry(substream, params);
-	if (ret)
-		goto component_err;
+	if (cpu_dai->active > 1) {
+		ret = soc_pcm_params_symmetry(substream, params);
+		if (ret)
+			goto component_err;
+	}
 
 	/* store the parameters for each DAIs */
 	cpu_dai->rate = params_rate(params);
-- 
2.7.4

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux