All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: soc-pcm: only apply symmetry if more than one stream is active
@ 2019-03-07 15:45 Russell King
  0 siblings, 0 replies; only message in thread
From: Russell King @ 2019-03-07 15:45 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, Takashi Iwai, Liam Girdwood

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@armlinux.org.uk>
---
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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-03-07 15:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-07 15:45 [PATCH] ASoC: soc-pcm: only apply symmetry if more than one stream is active Russell King

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.