Alsa-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [alsa-devel] [PATCH] ASoC: msm8916-wcd-digital: Remove broken MIX2 DAPM routes
@ 2019-10-07 18:19 Stephan Gerhold
  2019-10-09  9:15 ` Srinivas Kandagatla
  0 siblings, 1 reply; 4+ messages in thread
From: Stephan Gerhold @ 2019-10-07 18:19 UTC (permalink / raw)
  To: Mark Brown
  Cc: alsa-devel, Stephan Gerhold, Takashi Iwai, Liam Girdwood,
	Srinivas Kandagatla

Since 5.3-rc1, the kernel (correctly) complains about missing
widgets when loading msm8916-wcd-digital:

	ASoC: no sink widget found for RX1 MIX2 INP1
	ASoC: Failed to add route IIR1 -> IIR1 -> RX1 MIX2 INP1
	ASoC: no sink widget found for RX2 MIX2 INP1
	ASoC: Failed to add route IIR1 -> IIR1 -> RX2 MIX2 INP1
	ASoC: no sink widget found for RX1 MIX2 INP1
	ASoC: Failed to add route IIR2 -> IIR2 -> RX1 MIX2 INP1
	ASoC: no sink widget found for RX2 MIX2 INP1
	ASoC: Failed to add route IIR2 -> IIR2 -> RX2 MIX2 INP1

This happens because RX1/2 MIX2 INP1 is not actually supported by
msm8916-wcd-digital for some reason. There were some traces of it
in the initial patch, but the last remnants were removed in
commit fecd5c09ddf8 ("ASoC: msm8916-wcd-digital: remove few unused variables").

On 5.3 everything seemingly worked even with that error, but on 5.4-rc1
the sound card is no longer successfully registered:

	qcom-apq8016-sbc 7702000.sound: ASoC: failed to instantiate card -19

This happens because a check for the return code of
snd_soc_dapm_add_routes() was added in
commit daa480bde6b3 ("ASoC: soc-core: tidyup for snd_soc_dapm_add_routes()").

Avoid the error by removing the routes that reference the missing widgets.

Fixes: ef8a4757a6db ("ASoC: msm8916-wcd-digital: Add sidetone support")
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
 sound/soc/codecs/msm8916-wcd-digital.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/sound/soc/codecs/msm8916-wcd-digital.c b/sound/soc/codecs/msm8916-wcd-digital.c
index 9fa5d44fdc79..36d8f619e298 100644
--- a/sound/soc/codecs/msm8916-wcd-digital.c
+++ b/sound/soc/codecs/msm8916-wcd-digital.c
@@ -1022,11 +1022,6 @@ static const struct snd_soc_dapm_route msm8916_wcd_digital_audio_map[] = {
 	{"RX3 MIX1 INP2", "IIR1", "IIR1"},
 	{"RX3 MIX1 INP2", "IIR2", "IIR2"},
 
-	{"RX1 MIX2 INP1", "IIR1", "IIR1"},
-	{"RX2 MIX2 INP1", "IIR1", "IIR1"},
-	{"RX1 MIX2 INP1", "IIR2", "IIR2"},
-	{"RX2 MIX2 INP1", "IIR2", "IIR2"},
-
 	{"IIR1", NULL, "IIR1 INP1 MUX"},
 	{"IIR1 INP1 MUX", "DEC1", "DEC1 MUX"},
 	{"IIR1 INP1 MUX", "DEC2", "DEC2 MUX"},
-- 
2.23.0

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [alsa-devel] [PATCH] ASoC: msm8916-wcd-digital: Remove broken MIX2 DAPM routes
  2019-10-07 18:19 [alsa-devel] [PATCH] ASoC: msm8916-wcd-digital: Remove broken MIX2 DAPM routes Stephan Gerhold
@ 2019-10-09  9:15 ` Srinivas Kandagatla
  2019-10-09 11:15   ` Stephan Gerhold
  0 siblings, 1 reply; 4+ messages in thread
From: Srinivas Kandagatla @ 2019-10-09  9:15 UTC (permalink / raw)
  To: Stephan Gerhold, Mark Brown; +Cc: alsa-devel, Takashi Iwai, Liam Girdwood

Hi Stephan,
Thanks for testing and reporting this!

On 07/10/2019 19:19, Stephan Gerhold wrote:
> Since 5.3-rc1, the kernel (correctly) complains about missing
> widgets when loading msm8916-wcd-digital:
> 
> 	ASoC: no sink widget found for RX1 MIX2 INP1
> 	ASoC: Failed to add route IIR1 -> IIR1 -> RX1 MIX2 INP1
> 	ASoC: no sink widget found for RX2 MIX2 INP1
> 	ASoC: Failed to add route IIR1 -> IIR1 -> RX2 MIX2 INP1
> 	ASoC: no sink widget found for RX1 MIX2 INP1
> 	ASoC: Failed to add route IIR2 -> IIR2 -> RX1 MIX2 INP1
> 	ASoC: no sink widget found for RX2 MIX2 INP1
> 	ASoC: Failed to add route IIR2 -> IIR2 -> RX2 MIX2 INP1
> 
> This happens because RX1/2 MIX2 INP1 is not actually supported by
> msm8916-wcd-digital for some reason. There were some traces of it

RX1/2 MIX2 path is supported by the codec with IIR1 and IIR2 inputs on INP1.

MIX2 path was not added when we added first codec support as there was 
no IIR support. I think I totally missed adding this while adding IIR 
support.
Better fix here would be to add that missing path.

Can you try this patch?

------------------------------------->cut<-----------------------------

 From c54cc63897794efdf3c9fa8886d8377f80c272f8 Mon Sep 17 00:00:00 2001
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Date: Wed, 9 Oct 2019 10:10:09 +0100
Subject: [PATCH] ASoC: msm8916-wcd-digital: add missing MIX2 path for RX1/2

This patch adds missing MIX2 path on RX1/2 which take IIR1 and
IIR2 as inputs.

Without this patch sound card fails to intialize with below warning:

  ASoC: no sink widget found for RX1 MIX2 INP1
  ASoC: Failed to add route IIR1 -> IIR1 -> RX1 MIX2 INP1
  ASoC: no sink widget found for RX2 MIX2 INP1
  ASoC: Failed to add route IIR1 -> IIR1 -> RX2 MIX2 INP1
  ASoC: no sink widget found for RX1 MIX2 INP1
  ASoC: Failed to add route IIR2 -> IIR2 -> RX1 MIX2 INP1
  ASoC: no sink widget found for RX2 MIX2 INP1
  ASoC: Failed to add route IIR2 -> IIR2 -> RX2 MIX2 INP1

Reported-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
  sound/soc/codecs/msm8916-wcd-digital.c | 22 ++++++++++++++++++++++
  1 file changed, 22 insertions(+)

diff --git a/sound/soc/codecs/msm8916-wcd-digital.c 
b/sound/soc/codecs/msm8916-wcd-digital.c
index 9fa5d44fdc79..58b2468fb2a7 100644
--- a/sound/soc/codecs/msm8916-wcd-digital.c
+++ b/sound/soc/codecs/msm8916-wcd-digital.c
@@ -243,6 +243,10 @@ static const char *const rx_mix1_text[] = {
  	"ZERO", "IIR1", "IIR2", "RX1", "RX2", "RX3"
  };

+static const char * const rx_mix2_text[] = {
+	"ZERO", "IIR1", "IIR2"
+};
+
  static const char *const dec_mux_text[] = {
  	"ZERO", "ADC1", "ADC2", "ADC3", "DMIC1", "DMIC2"
  };
@@ -270,6 +274,16 @@ static const struct soc_enum rx3_mix1_inp_enum[] = {
  	SOC_ENUM_SINGLE(LPASS_CDC_CONN_RX3_B2_CTL, 0, 6, rx_mix1_text),
  };

+/* RX1 MIX2 */
+static const struct soc_enum rx_mix2_inp1_chain_enum =
+	SOC_ENUM_SINGLE(LPASS_CDC_CONN_RX1_B3_CTL,
+		0, 3, rx_mix2_text);
+
+/* RX2 MIX2 */
+static const struct soc_enum rx2_mix2_inp1_chain_enum =
+	SOC_ENUM_SINGLE(LPASS_CDC_CONN_RX2_B3_CTL,
+		0, 3, rx_mix2_text);
+
  /* DEC */
  static const struct soc_enum dec1_mux_enum = SOC_ENUM_SINGLE(
  				LPASS_CDC_CONN_TX_B1_CTL, 0, 6, dec_mux_text);
@@ -309,6 +323,10 @@ static const struct snd_kcontrol_new 
rx3_mix1_inp2_mux = SOC_DAPM_ENUM(
  				"RX3 MIX1 INP2 Mux", rx3_mix1_inp_enum[1]);
  static const struct snd_kcontrol_new rx3_mix1_inp3_mux = SOC_DAPM_ENUM(
  				"RX3 MIX1 INP3 Mux", rx3_mix1_inp_enum[2]);
+static const struct snd_kcontrol_new rx1_mix2_inp1_mux = SOC_DAPM_ENUM(
+				"RX1 MIX2 INP1 Mux", rx_mix2_inp1_chain_enum);
+static const struct snd_kcontrol_new rx2_mix2_inp1_mux = SOC_DAPM_ENUM(
+				"RX2 MIX2 INP1 Mux", rx2_mix2_inp1_chain_enum);

  /* Digital Gain control -38.4 dB to +38.4 dB in 0.3 dB steps */
  static const DECLARE_TLV_DB_SCALE(digital_gain, -3840, 30, 0);
@@ -740,6 +758,10 @@ static const struct snd_soc_dapm_widget 
msm8916_wcd_digital_dapm_widgets[] = {
  			 &rx3_mix1_inp2_mux),
  	SND_SOC_DAPM_MUX("RX3 MIX1 INP3", SND_SOC_NOPM, 0, 0,
  			 &rx3_mix1_inp3_mux),
+	SND_SOC_DAPM_MUX("RX1 MIX2 INP1", SND_SOC_NOPM, 0, 0,
+			 &rx1_mix2_inp1_mux),
+	SND_SOC_DAPM_MUX("RX2 MIX2 INP1", SND_SOC_NOPM, 0, 0,
+			 &rx2_mix2_inp1_mux),

  	SND_SOC_DAPM_MUX("CIC1 MUX", SND_SOC_NOPM, 0, 0, &cic1_mux),
  	SND_SOC_DAPM_MUX("CIC2 MUX", SND_SOC_NOPM, 0, 0, &cic2_mux),
-- 
2.21.0

------------------------------------->cut<-----------------------------



> in the initial patch, but the last remnants were removed in
> commit fecd5c09ddf8 ("ASoC: msm8916-wcd-digital: remove few unused variables").
> 
> On 5.3 everything seemingly worked even with that error, but on 5.4-rc1
> the sound card is no longer successfully registered:
> 
> 	qcom-apq8016-sbc 7702000.sound: ASoC: failed to instantiate card -19
> 
> This happens because a check for the return code of
> snd_soc_dapm_add_routes() was added in
> commit daa480bde6b3 ("ASoC: soc-core: tidyup for snd_soc_dapm_add_routes()").
> 
> Avoid the error by removing the routes that reference the missing widgets.
> 
> Fixes: ef8a4757a6db ("ASoC: msm8916-wcd-digital: Add sidetone support")
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> ---
>   sound/soc/codecs/msm8916-wcd-digital.c | 5 -----
>   1 file changed, 5 deletions(-)
> 
> diff --git a/sound/soc/codecs/msm8916-wcd-digital.c b/sound/soc/codecs/msm8916-wcd-digital.c
> index 9fa5d44fdc79..36d8f619e298 100644
> --- a/sound/soc/codecs/msm8916-wcd-digital.c
> +++ b/sound/soc/codecs/msm8916-wcd-digital.c
> @@ -1022,11 +1022,6 @@ static const struct snd_soc_dapm_route msm8916_wcd_digital_audio_map[] = {
>   	{"RX3 MIX1 INP2", "IIR1", "IIR1"},
>   	{"RX3 MIX1 INP2", "IIR2", "IIR2"},
>   
> -	{"RX1 MIX2 INP1", "IIR1", "IIR1"},
> -	{"RX2 MIX2 INP1", "IIR1", "IIR1"},
> -	{"RX1 MIX2 INP1", "IIR2", "IIR2"},
> -	{"RX2 MIX2 INP1", "IIR2", "IIR2"},
> -
>   	{"IIR1", NULL, "IIR1 INP1 MUX"},
>   	{"IIR1 INP1 MUX", "DEC1", "DEC1 MUX"},
>   	{"IIR1 INP1 MUX", "DEC2", "DEC2 MUX"},
> 
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [alsa-devel] [PATCH] ASoC: msm8916-wcd-digital: Remove broken MIX2 DAPM routes
  2019-10-09  9:15 ` Srinivas Kandagatla
@ 2019-10-09 11:15   ` Stephan Gerhold
  2019-10-09 11:18     ` Srinivas Kandagatla
  0 siblings, 1 reply; 4+ messages in thread
From: Stephan Gerhold @ 2019-10-09 11:15 UTC (permalink / raw)
  To: Srinivas Kandagatla; +Cc: Takashi Iwai, Mark Brown, Liam Girdwood, alsa-devel

On Wed, Oct 09, 2019 at 10:15:57AM +0100, Srinivas Kandagatla wrote:
> Hi Stephan,
> Thanks for testing and reporting this!
> 
> On 07/10/2019 19:19, Stephan Gerhold wrote:
> > Since 5.3-rc1, the kernel (correctly) complains about missing
> > widgets when loading msm8916-wcd-digital:
> > 
> > 	ASoC: no sink widget found for RX1 MIX2 INP1
> > 	ASoC: Failed to add route IIR1 -> IIR1 -> RX1 MIX2 INP1
> > 	ASoC: no sink widget found for RX2 MIX2 INP1
> > 	ASoC: Failed to add route IIR1 -> IIR1 -> RX2 MIX2 INP1
> > 	ASoC: no sink widget found for RX1 MIX2 INP1
> > 	ASoC: Failed to add route IIR2 -> IIR2 -> RX1 MIX2 INP1
> > 	ASoC: no sink widget found for RX2 MIX2 INP1
> > 	ASoC: Failed to add route IIR2 -> IIR2 -> RX2 MIX2 INP1
> > 
> > This happens because RX1/2 MIX2 INP1 is not actually supported by
> > msm8916-wcd-digital for some reason. There were some traces of it
> 
> RX1/2 MIX2 path is supported by the codec with IIR1 and IIR2 inputs on INP1.
> 
> MIX2 path was not added when we added first codec support as there was no
> IIR support. I think I totally missed adding this while adding IIR support.
> Better fix here would be to add that missing path.
> 

Either way is fine for me, as long as it gets fixed for 5.4 :)

> Can you try this patch?
> 
> ------------------------------------->cut<-----------------------------
> 
> From c54cc63897794efdf3c9fa8886d8377f80c272f8 Mon Sep 17 00:00:00 2001
> From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> Date: Wed, 9 Oct 2019 10:10:09 +0100
> Subject: [PATCH] ASoC: msm8916-wcd-digital: add missing MIX2 path for RX1/2
> 
> This patch adds missing MIX2 path on RX1/2 which take IIR1 and
> IIR2 as inputs.
> 
> Without this patch sound card fails to intialize with below warning:
> 
>  ASoC: no sink widget found for RX1 MIX2 INP1
>  ASoC: Failed to add route IIR1 -> IIR1 -> RX1 MIX2 INP1
>  ASoC: no sink widget found for RX2 MIX2 INP1
>  ASoC: Failed to add route IIR1 -> IIR1 -> RX2 MIX2 INP1
>  ASoC: no sink widget found for RX1 MIX2 INP1
>  ASoC: Failed to add route IIR2 -> IIR2 -> RX1 MIX2 INP1
>  ASoC: no sink widget found for RX2 MIX2 INP1
>  ASoC: Failed to add route IIR2 -> IIR2 -> RX2 MIX2 INP1
> 
> Reported-by: Stephan Gerhold <stephan@gerhold.net>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
>  sound/soc/codecs/msm8916-wcd-digital.c | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/sound/soc/codecs/msm8916-wcd-digital.c
> b/sound/soc/codecs/msm8916-wcd-digital.c
> index 9fa5d44fdc79..58b2468fb2a7 100644
> --- a/sound/soc/codecs/msm8916-wcd-digital.c
> +++ b/sound/soc/codecs/msm8916-wcd-digital.c
> @@ -243,6 +243,10 @@ static const char *const rx_mix1_text[] = {
>  	"ZERO", "IIR1", "IIR2", "RX1", "RX2", "RX3"
>  };
> 
> +static const char * const rx_mix2_text[] = {
> +	"ZERO", "IIR1", "IIR2"
> +};
> +
>  static const char *const dec_mux_text[] = {
>  	"ZERO", "ADC1", "ADC2", "ADC3", "DMIC1", "DMIC2"
>  };
> @@ -270,6 +274,16 @@ static const struct soc_enum rx3_mix1_inp_enum[] = {
>  	SOC_ENUM_SINGLE(LPASS_CDC_CONN_RX3_B2_CTL, 0, 6, rx_mix1_text),
>  };
> 
> +/* RX1 MIX2 */
> +static const struct soc_enum rx_mix2_inp1_chain_enum =
> +	SOC_ENUM_SINGLE(LPASS_CDC_CONN_RX1_B3_CTL,
> +		0, 3, rx_mix2_text);
> +
> +/* RX2 MIX2 */
> +static const struct soc_enum rx2_mix2_inp1_chain_enum =
> +	SOC_ENUM_SINGLE(LPASS_CDC_CONN_RX2_B3_CTL,
> +		0, 3, rx_mix2_text);
> +
>  /* DEC */
>  static const struct soc_enum dec1_mux_enum = SOC_ENUM_SINGLE(
>  				LPASS_CDC_CONN_TX_B1_CTL, 0, 6, dec_mux_text);
> @@ -309,6 +323,10 @@ static const struct snd_kcontrol_new rx3_mix1_inp2_mux
> = SOC_DAPM_ENUM(
>  				"RX3 MIX1 INP2 Mux", rx3_mix1_inp_enum[1]);
>  static const struct snd_kcontrol_new rx3_mix1_inp3_mux = SOC_DAPM_ENUM(
>  				"RX3 MIX1 INP3 Mux", rx3_mix1_inp_enum[2]);
> +static const struct snd_kcontrol_new rx1_mix2_inp1_mux = SOC_DAPM_ENUM(
> +				"RX1 MIX2 INP1 Mux", rx_mix2_inp1_chain_enum);
> +static const struct snd_kcontrol_new rx2_mix2_inp1_mux = SOC_DAPM_ENUM(
> +				"RX2 MIX2 INP1 Mux", rx2_mix2_inp1_chain_enum);
> 
>  /* Digital Gain control -38.4 dB to +38.4 dB in 0.3 dB steps */
>  static const DECLARE_TLV_DB_SCALE(digital_gain, -3840, 30, 0);
> @@ -740,6 +758,10 @@ static const struct snd_soc_dapm_widget
> msm8916_wcd_digital_dapm_widgets[] = {
>  			 &rx3_mix1_inp2_mux),
>  	SND_SOC_DAPM_MUX("RX3 MIX1 INP3", SND_SOC_NOPM, 0, 0,
>  			 &rx3_mix1_inp3_mux),
> +	SND_SOC_DAPM_MUX("RX1 MIX2 INP1", SND_SOC_NOPM, 0, 0,
> +			 &rx1_mix2_inp1_mux),
> +	SND_SOC_DAPM_MUX("RX2 MIX2 INP1", SND_SOC_NOPM, 0, 0,
> +			 &rx2_mix2_inp1_mux),
> 
>  	SND_SOC_DAPM_MUX("CIC1 MUX", SND_SOC_NOPM, 0, 0, &cic1_mux),
>  	SND_SOC_DAPM_MUX("CIC2 MUX", SND_SOC_NOPM, 0, 0, &cic2_mux),
> -- 
> 2.21.0
> 
> ------------------------------------->cut<-----------------------------
> 

Thanks for the patch!

I think your mail client messed it up, but I managed to apply it with
some manual fixes. It seems to work fine too:

Tested-by: Stephan Gerhold <stephan@gerhold.net>

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [alsa-devel] [PATCH] ASoC: msm8916-wcd-digital: Remove broken MIX2 DAPM routes
  2019-10-09 11:15   ` Stephan Gerhold
@ 2019-10-09 11:18     ` Srinivas Kandagatla
  0 siblings, 0 replies; 4+ messages in thread
From: Srinivas Kandagatla @ 2019-10-09 11:18 UTC (permalink / raw)
  To: Stephan Gerhold; +Cc: alsa-devel, Mark Brown, Takashi Iwai, Liam Girdwood



On 09/10/2019 12:15, Stephan Gerhold wrote:
> Thanks for the patch!
> 
> I think your mail client messed it up, but I managed to apply it with
> some manual fixes. It seems to work fine too:
> 
> Tested-by: Stephan Gerhold<stephan@gerhold.net>
Thanks for testing!

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-07 18:19 [alsa-devel] [PATCH] ASoC: msm8916-wcd-digital: Remove broken MIX2 DAPM routes Stephan Gerhold
2019-10-09  9:15 ` Srinivas Kandagatla
2019-10-09 11:15   ` Stephan Gerhold
2019-10-09 11:18     ` Srinivas Kandagatla

Alsa-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/alsa-devel/0 alsa-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 alsa-devel alsa-devel/ https://lore.kernel.org/alsa-devel \
		alsa-devel@alsa-project.org alsa-devel@archiver.kernel.org
	public-inbox-index alsa-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.alsa-project.alsa-devel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox