ASoC: msm8916-wcd-digital: Remove broken MIX2 DAPM routes
Subsystems (3)
PATCH 1/1 ASoC: msm8916-wcd-digital: Remove broken MIX2 DAPM routes
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.
--- sound/soc/codecs/msm8916-wcd-digital.c | 5 ----- 1 file changed, 5 deletions(-)
sound/soc/codecs/msm8916-wcd-digital.c +0 -5
@@ -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"},
Signature · 6 lines
2.23.0 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Hi Stephan,
Thanks for testing and reporting this!
Quoted 12 lines · Stephan Gerhold
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
Quoted 2 lines
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 <[email protected]>
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
--- sound/soc/codecs/msm8916-wcd-digital.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
sound/soc/codecs/msm8916-wcd-digital.c +22 -0
@@ -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),
Signature · 3 lines
2.21.0 ------------------------------------->cut<-----------------------------
Quoted 27 lines
in the initial patch, but the last remnants were removed in
commitfecd5c09ddf8("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 -19This happens because a check for the return code of
snd_soc_dapm_add_routes()was added in
commitdaa480bde6b3("ASoC: soc-core: tidyup forsnd_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 <[email protected]>--- sound/soc/codecs/msm8916-wcd-digital.c | 5 ----- 1 file changed, 5 deletions(-)sound/soc/codecs/msm8916-wcd-digital.c +0
-0@@ -1022,11 +1022,6 @@ static const struct snd_soc_dapm_route msm8916_wcd_digital_audio_map[] = { {"RX3 MIX1 INP2", "IIR1", "IIR1"},
sound/soc/codecs/msm8916-wcd-digital.c static const struct snd_soc_dapm_route msm8916_wcd_digital_audio_map[] = { · line 1027
Quoted 10 lines
sound/soc/codecs/msm8916-wcd-digital.c +0
-5{"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
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Stephan Gerhold
Tested-byQuoted 16 lines · Srinivas Kandagatla
Hi Stephan,
Thanks for testing and reporting this!Quoted 12 lines · Stephan Gerhold
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
Quoted 9 lines
Quoted 2 lines
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 :)
Quoted 85 lines
Can you try this patch?
------------------------------------->cut<-----------------------------
From
c54cc63897794efdf3c9fa8886d8377f80c272f8Mon Sep 17 00:00:00 2001
From: Srinivas Kandagatla <[email protected]>
Date: Wed, 9 Oct 2019 10:10:09 +0100
Subject: [PATCH] ASoC: msm8916-wcd-digital: add missing MIX2 path for RX1/2This 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 INP1Reported-by Stephan Gerhold <[email protected]>Signed-off-by Srinivas Kandagatla <[email protected]>--- sound/soc/codecs/msm8916-wcd-digital.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)sound/soc/codecs/msm8916-wcd-digital.c +14
-0@@ -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(
sound/soc/codecs/msm8916-wcd-digital.c +8
-0"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),
Quoted 6 lines
SND_SOC_DAPM_MUX("CIC2 MUX", SND_SOC_NOPM, 0, 0, &cic2_mux),Signature · 3 lines
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:
Thanks,
Stephan
_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Quoted 6 lines · Stephan Gerhold
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<[email protected]>
Thanks for testing!
--srini
_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel