* [PATCH v1] ASoC: soc-pcm: Fix mute and unmute control for non-dynamic DAI links
@ 2025-10-07 2:33 Mohammad Rafi Shaik
2025-10-08 13:46 ` Srinivas Kandagatla
0 siblings, 1 reply; 4+ messages in thread
From: Mohammad Rafi Shaik @ 2025-10-07 2:33 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Srinivas Kandagatla
Cc: linux-sound, linux-kernel, kernel, prasad.kumpatla, ajay.nandam,
stable
In setups where the same codec DAI is reused across multiple DAI
links, mute controls via `snd_soc_dai_digital_mute()` is skipped for
non-dynamic links. The trigger operations are not invoked when
`dai_link->dynamic == 0`, and mute controls is currently conditioned
only on `snd_soc_dai_mute_is_ctrled_at_trigger()`. This patch ensures
that mute and unmute is applied explicitly for non-dynamic links.
Fixes: f0220575e65a ("ASoC: soc-dai: add flag to mute and unmute stream during trigger")
Cc: stable@vger.kernel.org
Signed-off-by: Mohammad Rafi Shaik <mohammad.rafi.shaik@oss.qualcomm.com>
---
sound/soc/soc-pcm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 2c21fd528afd..4ed829b49bc2 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -949,7 +949,7 @@ static int __soc_pcm_prepare(struct snd_soc_pcm_runtime *rtd,
SND_SOC_DAPM_STREAM_START);
for_each_rtd_dais(rtd, i, dai) {
- if (!snd_soc_dai_mute_is_ctrled_at_trigger(dai))
+ if (!snd_soc_dai_mute_is_ctrled_at_trigger(dai) || !rtd->dai_link->dynamic)
snd_soc_dai_digital_mute(dai, 0, substream->stream);
}
@@ -1007,7 +1007,7 @@ static int soc_pcm_hw_clean(struct snd_soc_pcm_runtime *rtd,
soc_pcm_set_dai_params(dai, NULL);
if (snd_soc_dai_stream_active(dai, substream->stream) == 1) {
- if (!snd_soc_dai_mute_is_ctrled_at_trigger(dai))
+ if (!snd_soc_dai_mute_is_ctrled_at_trigger(dai) || !rtd->dai_link->dynamic)
snd_soc_dai_digital_mute(dai, 1, substream->stream);
}
}
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH v1] ASoC: soc-pcm: Fix mute and unmute control for non-dynamic DAI links 2025-10-07 2:33 [PATCH v1] ASoC: soc-pcm: Fix mute and unmute control for non-dynamic DAI links Mohammad Rafi Shaik @ 2025-10-08 13:46 ` Srinivas Kandagatla 2025-10-08 16:08 ` Mohammad Rafi Shaik 0 siblings, 1 reply; 4+ messages in thread From: Srinivas Kandagatla @ 2025-10-08 13:46 UTC (permalink / raw) To: Mohammad Rafi Shaik, Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai, Srinivas Kandagatla Cc: linux-sound, linux-kernel, kernel, prasad.kumpatla, ajay.nandam, stable On 10/7/25 3:33 AM, Mohammad Rafi Shaik wrote: > In setups where the same codec DAI is reused across multiple DAI > links, mute controls via `snd_soc_dai_digital_mute()` is skipped for Please explain the problem. > non-dynamic links. The trigger operations are not invoked when > `dai_link->dynamic == 0`, and mute controls is currently conditioned I dont think any of the Qualcomm upstream platforms use this flag. > only on `snd_soc_dai_mute_is_ctrled_at_trigger()`. This patch ensures > that mute and unmute is applied explicitly for non-dynamic links. How is this resolving the issue, mute on these codecs happens at trigger level instead of prepare. --srini > > Fixes: f0220575e65a ("ASoC: soc-dai: add flag to mute and unmute stream during trigger") > Cc: stable@vger.kernel.org > Signed-off-by: Mohammad Rafi Shaik <mohammad.rafi.shaik@oss.qualcomm.com> > --- > sound/soc/soc-pcm.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c > index 2c21fd528afd..4ed829b49bc2 100644 > --- a/sound/soc/soc-pcm.c > +++ b/sound/soc/soc-pcm.c > @@ -949,7 +949,7 @@ static int __soc_pcm_prepare(struct snd_soc_pcm_runtime *rtd, > SND_SOC_DAPM_STREAM_START); > > for_each_rtd_dais(rtd, i, dai) { > - if (!snd_soc_dai_mute_is_ctrled_at_trigger(dai)) > + if (!snd_soc_dai_mute_is_ctrled_at_trigger(dai) || !rtd->dai_link->dynamic) > snd_soc_dai_digital_mute(dai, 0, substream->stream); > } > > @@ -1007,7 +1007,7 @@ static int soc_pcm_hw_clean(struct snd_soc_pcm_runtime *rtd, > soc_pcm_set_dai_params(dai, NULL); > > if (snd_soc_dai_stream_active(dai, substream->stream) == 1) { > - if (!snd_soc_dai_mute_is_ctrled_at_trigger(dai)) > + if (!snd_soc_dai_mute_is_ctrled_at_trigger(dai) || !rtd->dai_link->dynamic) > snd_soc_dai_digital_mute(dai, 1, substream->stream); > } > } ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1] ASoC: soc-pcm: Fix mute and unmute control for non-dynamic DAI links 2025-10-08 13:46 ` Srinivas Kandagatla @ 2025-10-08 16:08 ` Mohammad Rafi Shaik 2025-10-08 16:12 ` Srinivas Kandagatla 0 siblings, 1 reply; 4+ messages in thread From: Mohammad Rafi Shaik @ 2025-10-08 16:08 UTC (permalink / raw) To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai Cc: linux-sound, linux-kernel, kernel, prasad.kumpatla, ajay.nandam, stable On 10/8/2025 7:16 PM, Srinivas Kandagatla wrote: > > > On 10/7/25 3:33 AM, Mohammad Rafi Shaik wrote: >> In setups where the same codec DAI is reused across multiple DAI >> links, mute controls via `snd_soc_dai_digital_mute()` is skipped for > > Please explain the problem. > In Qualcomm audioreach setup, if platform dai not specified in DT, then cpu dai using as platform and initialize as static dai-link and created pcm device and link-dynamic == false by default. In existing setup if dynamic==false, it's skipping trigger snd-ops and the codec is always on mute state. >> non-dynamic links. The trigger operations are not invoked when >> `dai_link->dynamic == 0`, and mute controls is currently conditioned > > I dont think any of the Qualcomm upstream platforms use this flag. > Yes, we are using dynamic flag and it's set to true in Qualcomm platforms. Please check: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/tree/sound/soc/qcom/qdsp6/topology.c#n1093 >> only on `snd_soc_dai_mute_is_ctrled_at_trigger()`. This patch ensures >> that mute and unmute is applied explicitly for non-dynamic links. > How is this resolving the issue, mute on these codecs happens at trigger > level instead of prepare. > yes agree, but if link->dynamic==false the trigger ops not getting called, which leading to codec always on mute state. Thanks & Regards, Rafi. > --srini >> >> Fixes: f0220575e65a ("ASoC: soc-dai: add flag to mute and unmute stream during trigger") >> Cc: stable@vger.kernel.org >> Signed-off-by: Mohammad Rafi Shaik <mohammad.rafi.shaik@oss.qualcomm.com> >> --- >> sound/soc/soc-pcm.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c >> index 2c21fd528afd..4ed829b49bc2 100644 >> --- a/sound/soc/soc-pcm.c >> +++ b/sound/soc/soc-pcm.c >> @@ -949,7 +949,7 @@ static int __soc_pcm_prepare(struct snd_soc_pcm_runtime *rtd, >> SND_SOC_DAPM_STREAM_START); >> >> for_each_rtd_dais(rtd, i, dai) { >> - if (!snd_soc_dai_mute_is_ctrled_at_trigger(dai)) >> + if (!snd_soc_dai_mute_is_ctrled_at_trigger(dai) || !rtd->dai_link->dynamic) >> snd_soc_dai_digital_mute(dai, 0, substream->stream); >> } >> >> @@ -1007,7 +1007,7 @@ static int soc_pcm_hw_clean(struct snd_soc_pcm_runtime *rtd, >> soc_pcm_set_dai_params(dai, NULL); >> >> if (snd_soc_dai_stream_active(dai, substream->stream) == 1) { >> - if (!snd_soc_dai_mute_is_ctrled_at_trigger(dai)) >> + if (!snd_soc_dai_mute_is_ctrled_at_trigger(dai) || !rtd->dai_link->dynamic) >> snd_soc_dai_digital_mute(dai, 1, substream->stream); >> } >> } > ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1] ASoC: soc-pcm: Fix mute and unmute control for non-dynamic DAI links 2025-10-08 16:08 ` Mohammad Rafi Shaik @ 2025-10-08 16:12 ` Srinivas Kandagatla 0 siblings, 0 replies; 4+ messages in thread From: Srinivas Kandagatla @ 2025-10-08 16:12 UTC (permalink / raw) To: Mohammad Rafi Shaik, Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai Cc: linux-sound, linux-kernel, kernel, prasad.kumpatla, ajay.nandam, stable On 10/8/25 5:08 PM, Mohammad Rafi Shaik wrote: > > > On 10/8/2025 7:16 PM, Srinivas Kandagatla wrote: >> >> >> On 10/7/25 3:33 AM, Mohammad Rafi Shaik wrote: >>> In setups where the same codec DAI is reused across multiple DAI >>> links, mute controls via `snd_soc_dai_digital_mute()` is skipped for >> >> Please explain the problem. >> > In Qualcomm audioreach setup, if platform dai not specified in DT, then > cpu dai using as platform and initialize as static dai-link and created > pcm device and link-dynamic == false by default. > > In existing setup if dynamic==false, it's skipping trigger snd-ops and > the codec is always on mute state. > >>> non-dynamic links. The trigger operations are not invoked when >>> `dai_link->dynamic == 0`, and mute controls is currently conditioned >> >> I dont think any of the Qualcomm upstream platforms use this flag. >> > > Yes, we are using dynamic flag and it's set to true in Qualcomm platforms. > > Please check: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/ > sound.git/tree/sound/soc/qcom/qdsp6/topology.c#n1093 > >>> only on `snd_soc_dai_mute_is_ctrled_at_trigger()`. This patch ensures >>> that mute and unmute is applied explicitly for non-dynamic links. >> How is this resolving the issue, mute on these codecs happens at trigger >> level instead of prepare. >> > yes agree, but if link->dynamic==false the trigger ops not getting > called, which leading to codec always on mute state. This is because you are using something very different solution to what ASoC kernel provides. I dont think this is a problem with as long as you use kernel ABI.. This patch looks totally a hack from something that does not belong to kernel, so is NAK from my side on this. --srini > > Thanks & Regards, > Rafi. > >> --srini >>> >>> Fixes: f0220575e65a ("ASoC: soc-dai: add flag to mute and unmute >>> stream during trigger") >>> Cc: stable@vger.kernel.org >>> Signed-off-by: Mohammad Rafi Shaik >>> <mohammad.rafi.shaik@oss.qualcomm.com> >>> --- >>> sound/soc/soc-pcm.c | 4 ++-- >>> 1 file changed, 2 insertions(+), 2 deletions(-) >>> >>> diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c >>> index 2c21fd528afd..4ed829b49bc2 100644 >>> --- a/sound/soc/soc-pcm.c >>> +++ b/sound/soc/soc-pcm.c >>> @@ -949,7 +949,7 @@ static int __soc_pcm_prepare(struct >>> snd_soc_pcm_runtime *rtd, >>> SND_SOC_DAPM_STREAM_START); >>> for_each_rtd_dais(rtd, i, dai) { >>> - if (!snd_soc_dai_mute_is_ctrled_at_trigger(dai)) >>> + if (!snd_soc_dai_mute_is_ctrled_at_trigger(dai) || !rtd- >>> >dai_link->dynamic) >>> snd_soc_dai_digital_mute(dai, 0, substream->stream); >>> } >>> @@ -1007,7 +1007,7 @@ static int soc_pcm_hw_clean(struct >>> snd_soc_pcm_runtime *rtd, >>> soc_pcm_set_dai_params(dai, NULL); >>> if (snd_soc_dai_stream_active(dai, substream->stream) == >>> 1) { >>> - if (!snd_soc_dai_mute_is_ctrled_at_trigger(dai)) >>> + if (!snd_soc_dai_mute_is_ctrled_at_trigger(dai) || !rtd- >>> >dai_link->dynamic) >>> snd_soc_dai_digital_mute(dai, 1, substream->stream); >>> } >>> } >> > ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-10-08 16:12 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-10-07 2:33 [PATCH v1] ASoC: soc-pcm: Fix mute and unmute control for non-dynamic DAI links Mohammad Rafi Shaik 2025-10-08 13:46 ` Srinivas Kandagatla 2025-10-08 16:08 ` Mohammad Rafi Shaik 2025-10-08 16:12 ` Srinivas Kandagatla
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox