This is a cache of https://discuss.96boards.org/t/audio-does-not-load-the-configuration-if-i-enable-remoteproc-208000/9273. It is a snapshot of the page at 2024-11-01T12:49:57.269+0000.
Audio does not load the Configuration if i enable remoteproc@208000 - DragonBoard 820c - 96Boards Forum

Audio does not load the Configuration if i enable remoteproc@208000

we are using 407 release git qcom-4.14 , kernel commit id cfdd5dcc5327637e2979688c17e3d9bb93f8e5f2

if we enable the remotproc related to gps, Audio gets disabled, no soundcard get registered - dummy output. Please suggest

if we set status=“disabled” for remotproc, Audio gets enabled, soundcard will be available
root@linaro-alip:/home/linaro# cat /proc/asound/cards
0 [DB820c ]: DB820c - DB820c
DB820c

remoteproc@2080000 {
compatible = “qcom,msm8996-mss-pil”;
status = “okay”;
//status = “disabled”;

I’ve actually found that the sound card only registers intermittently. Initially, I thought that changes I was making were causing it to fail to register. Have you tried rebooting it several times with your changes to confirm that it isn’t just intermittent?

I thought audio got disabled because of remoteproc enable , later i observed 1 in 5
reboots sound cards does recognize.

I suspect this because of audio firmwares not loading properly

@srini can give good suggestion.

Is it possible to reload after boot the audio part.

Would you be able to find which part of the driver fail by enabling debugging or adding some traces

facing same issue, sound cards are not getting detected. using kernel-4.14.89
~# cat /proc/asound/cards
— no soundcards —
@srini

@srini

failures logs seen from aDSP
[ 21.782100] qcom-q6afe aprsvc:q6afe:4:4: cmd = 0x100e5 returned error = 0x9
[ 21.782151] qcom-q6afe aprsvc:q6afe:4:4: DSP returned error[9]
[ 21.788001] qcom-q6afe aprsvc:q6afe:4:4: AFE enable for port 0x4001 failed -22
[ 21.794262] wcd9335-codec wcd9335-codec.0: wcd9335_slimbus_irq: overflow error on TX port 0, value 1
[ 21.806608] q6afe-dai adsp-pil:smd-edge:apr:q6afe:dais: fail to start AFE port 3
[ 21.810272] q6afe-dai adsp-pil:smd-edge:apr:q6afe:dais: ASoC: cpu DAI prepare error: -22
[ 21.818588] SLIM Capture: ASoC: backend prepare failed -22
[ 21.839042] qcom-q6afe aprsvc:q6afe:4:4: cmd = 0x100e5 returned error = 0x9
[ 21.839097] qcom-q6afe aprsvc:q6afe:4:4: DSP returned error[9]
[ 21.845010] qcom-q6afe aprsvc:q6afe:4:4: AFE enable for port 0x4001 failed -22
[ 21.854653] q6afe-dai adsp-pil:smd-edge:apr:q6afe:dais: fail to start AFE port 3
[ 21.857922] q6afe-dai adsp-pil:smd-edge:apr:q6afe:dais: ASoC: cpu DAI prepare error: -22
[ 21.865539] SLIM Capture: ASoC: backend prepare failed -22
[ 21.889562] qcom-q6afe aprsvc:q6afe:4:4: cmd = 0x100e5 returned error = 0x9
[ 21.889615] qcom-q6afe aprsvc:q6afe:4:4: DSP returned error[9]
[ 21.895410] qcom-q6afe aprsvc:q6afe:4:4: AFE enable for port 0x4001 failed -22
[ 21.901279] q6afe-dai adsp-pil:smd-edge:apr:q6afe:dais: fail to start AFE port 3
[ 21.914595] q6afe-dai adsp-pil:smd-edge:apr:q6afe:dais: ASoC: cpu DAI prepare error: -22
[ 21.916009] SLIM Capture: ASoC: backend prepare failed -22
[ 21.933077] qcom-q6afe aprsvc:q6afe:4:4: cmd = 0x100e5 returned error = 0x9
[ 21.933141] qcom-q6afe aprsvc:q6afe:4:4: DSP returned error[9]
[ 21.938940] qcom-q6afe aprsvc:q6afe:4:4: AFE enable for port 0x4001 failed -22
[ 21.944795] q6afe-dai adsp-pil:smd-edge:apr:q6afe:dais: fail to start AFE port 3
[ 21.954588] q6afe-dai adsp-pil:smd-edge:apr:q6afe:dais: ASoC: cpu DAI prepare error: -22
[ 21.962611] SLIM Capture: ASoC: backend prepare failed -22
[ 21.978633] qcom-q6afe aprsvc:q6afe:4:4: cmd = 0x100e5 returned error = 0x9
[ 21.978730] qcom-q6afe aprsvc:q6afe:4:4: DSP returned error[9]
[ 21.984449] qcom-q6afe aprsvc:q6afe:4:4: AFE enable for port 0x4001 failed -22
[ 21.994637] q6afe-dai adsp-pil:smd-edge:apr:q6afe:dais: fail to start AFE port 3
[ 21.997516] q6afe-dai adsp-pil:smd-edge:apr:q6afe:dais: ASoC: cpu DAI prepare error: -22
[ 22.005174] SLIM Capture: ASoC: backend prepare failed -22
[ 22.034149] qcom-q6afe aprsvc:q6afe:4:4: cmd = 0x100e5 returned error = 0x9
[ 22.034205] qcom-q6afe aprsvc:q6afe:4:4: DSP returned error[9]
[ 22.040077] qcom-q6afe aprsvc:q6afe:4:4: AFE enable for port 0x4001 failed -22
[ 22.045867] q6afe-dai adsp-pil:smd-edge:apr:q6afe:dais: fail to start AFE port 3
[ 22.058638] q6afe-dai adsp-pil:smd-edge:apr:q6afe:dais: ASoC: cpu DAI prepare error: -22
[ 22.060570] SLIM Capture: ASoC: backend prepare failed -22
[ 22.082342] qcom-q6afe aprsvc:q6afe:4:4: cmd = 0x100e5 returned error = 0x9
[ 22.082432] qcom-q6afe aprsvc:q6afe:4:4: DSP returned error[9]
[ 22.089667] qcom-q6afe aprsvc:q6afe:4:4: AFE enable for port 0x4001 failed -22
[ 22.095295] q6afe-dai adsp-pil:smd-edge:apr:q6afe:dais: fail to start AFE port 3
[ 22.101556] q6afe-dai adsp-pil:smd-edge:apr:q6afe:dais: ASoC: cpu DAI prepare error: -22
[ 22.109542] SLIM Capture: ASoC: backend prepare failed -22
[ 22.139208] qcom-q6afe aprsvc:q6afe:4:4: cmd = 0x100e5 returned error = 0x9
[ 22.139262] qcom-q6afe aprsvc:q6afe:4:4: DSP returned error[9]
[ 22.145030] qcom-q6afe aprsvc:q6afe:4:4: AFE enable for port 0x4001 failed -22
[ 22.145038] q6afe-dai adsp-pil:smd-edge:apr:q6afe:dais: fail to start AFE port 3
[ 22.145046] q6afe-dai adsp-pil:smd-edge:apr:q6afe:dais: ASoC: cpu DAI prepare error: -22
[ 22.166207] SLIM Capture: ASoC: backend prepare failed -22
[ 22.194848] qcom-q6afe aprsvc:q6afe:4:4: cmd = 0x100e5 returned error = 0x9
[ 22.194896] qcom-q6afe aprsvc:q6afe:4:4: DSP returned error[9]
[ 22.200724] qcom-q6afe aprsvc:q6afe:4:4: AFE enable for port 0x4001 failed -22
[ 22.206575] q6afe-dai adsp-pil:smd-edge:apr:q6afe:dais: fail to start AFE port 3
[ 22.222602] q6afe-dai adsp-pil:smd-edge:apr:q6afe:dais: ASoC: cpu DAI prepare error: -22
[ 22.222635] SLIM Capture: ASoC: backend prepare failed -22
[ 22.233979] qcom-q6afe aprsvc:q6afe:4:4: cmd = 0x100e5 returned error = 0x9
[ 22.235093] qcom-q6afe aprsvc:q6afe:4:4: DSP returned error[9]
[ 22.242327] qcom-q6afe aprsvc:q6afe:4:4: AFE enable for port 0x4001 failed -22
[ 22.248799] q6afe-dai adsp-pil:smd-edge:apr:q6afe:dais: fail to start AFE port 3
[ 22.256176] q6afe-dai adsp-pil:smd-edge:apr:q6afe:dais: ASoC: cpu DAI prepare error: -22
[ 22.268989] SLIM Capture: ASoC: backend prepare failed -22

@vinaysimha @srini
seems issue with capture, DSP errors,
[ 22.268989] SLIM Capture: ASoC: backend prepare failed -22
I have commented SectionDevice.“Handset” in HiFi file then these errors are not seen and able to do only playback.

I have commented the SectionDevice.“Handset” in HiFi file, still soundcard is not detected for me. Is there any specific debian rootfs build version like 228,439 in which soundcard is always detected? @srini @vinaysimha

Thanks,
Sakthi

In 4.14.96 it randomly detects the wcd , In non-working case we do not even get the wcd9335-slim logs at all. please suggest

working case
[ 29.289818] wcd9335-slim 217:1a0:0:0: setting slimbus l-addr:ca, ea:217,1a0,0,0
[ 29.374580] wcd9335-slim 217:1a0:1:0: WCD9335 CODEC version is v2.0
[ 29.385759] wcd9335-slim 217:1a0:1:0: setting slimbus l-addr:cb, ea:217,1a0,1,0

regards,
vinaysimha

try this

https://git.linaro.org/people/srinivas.kandagatla/linux.git/commit/?h=release/qcomlt-5.4-db820c&id=2cea5b2d046c1ca944491663409d0462ed41fdfc

do not take the #if 0 endif , it is for HDMI.

Tried this. But still soundcard is not detected. Any another clues about debugging this issue?? @srini @vinaysimha @Loic @doitright

@srini

is there any reason why does wcd9335 will not load when sound cards not detected. sometimes soundcard will not detect on soft reboot, intermittent when we switch on the board.
In the lsmod snd_soc_wcd9335 will also not got loaded.
please suggest

[ 29.289818] wcd9335-slim 217:1a0:0:0: setting slimbus l-addr:ca, ea:217,1a0,0,0
[ 29.374580] wcd9335-slim 217:1a0:1:0: WCD9335 CODEC version is v2.0
[ 29.385759] wcd9335-slim 217:1a0:1:0: setting slimbus l-addr:cb, ea:217,1a0,1,0

regards,
vinaysimha

This is what I do to make the sound work;

Of course, there’s no use of the wcd9335/analog with that.

@vinaysimha : I haven’t any idea what makes the wcd9335 work or not work. In fact, it consistently does not work at all for me.

@srini : you mentioned in another thread that the analog sound was working for you on yours; srinivas.kandagatla/linux.git - srini kernel working tree

However, even incorporating the additions you made to qcomlt-5.4, I’m unable to get the wcd9335 working at all. I presume that I must be missing something in my config, but I have no idea what, since I’ve got all the slim and wcd related configs enabled.

https://gitlab.com/aosp-automotive/dragonboard-kernel-src/-/blob/5.4-wip/arch/arm64/configs/db820c_defconfig

CONFIG_SLIMBUS=y
CONFIG_SLIM_QCOM_CTRL=y
CONFIG_SLIM_QCOM_NGD_CTRL=y
CONFIG_SND_SOC_WCD9335=y

@vinaysimha: which board are you using and which rootfs are you on?
Its important to run “qrtr-cfg 1 && qrtr-ns” to be able to get SLIMbus QMI working.
here is my boot log: ubuntu Pastebin
I also pushed my working config to the same branch
Can you share you dmesg out put when you have the issue.
@doitright as i said above there is userspace dependency as well which is required. If you already have done this , may be you can share me dmesg output.

thanks,
srini

I’ll try it out.

Is this a new requirement now? The wcd9335 used to work in AOSP with kernel 4.14. There is nothing in the device path referring to qrtr at all, and in addition, with no change besides the kernel 4.14 vs 5.4, it still works in 4.14 and not 5.4.

Was this functionality previously implemented right in the kernel?

EDIT: That did the job!
I had to make some minor changes to the code to get it to build in current AOSP master, which I have here; AOSP-Automotive / qrtr · GitLab

Now I guess the question is… what can I do with a wcd9335? I vaguely understand that it can do some audio processing functionality, like echo and noise cancellation, hpf, lpf.

So routing call audio between PRI-PCM and QUAT-MI2S, would it be possible to do something like this? Especially echo cancellation.

Hi Srini,

I am using an SD820 based custom board with kernel version 4.14.96 and the rootfs build version 382. Attached bootlog here: https://pastebin.com/xHyTWZSD
I have searched for the qrtr services. Only qrtr-ns was listed, you can find that below.

root@Commando:~# ps -eaf | grep qrtr*
root 1830 1 0 06:43 ? 00:00:00 /usr/bin/qrtr-ns -f 1
root 2716 2401 0 06:48 ttyMSM0 00:00:00 grep qrtr*

The soundcards are not detected everytime.

root@Commando:~# cat /proc/asound/cards
— no soundcards —

Any suggestions about solving the issue? @srini

Thanks,
Sakthi

Hi Sakthi,
I definitely see that apr and wcd9335 are up. So its possible that some of the dais you have for SD820 board are not up yet. Can you cat /sys/kernel/debug/asoc/dais and check with your board dts sound card node if all the dai nodes that you are using in dts are up from sysfs entries.

Thanks,
srini

Hi Srini,

If I check /sys/kernel/debug/asoc/dais, I am getting the following dais:

QUINARY_TDM_TX_7
QUINARY_TDM_TX_6
QUINARY_TDM_TX_5
QUINARY_TDM_TX_4
QUINARY_TDM_TX_3
QUINARY_TDM_TX_2
QUINARY_TDM_TX_1
QUINARY_TDM_TX_0
QUINARY_TDM_RX_7
QUINARY_TDM_RX_6
QUINARY_TDM_RX_5
QUINARY_TDM_RX_4
QUINARY_TDM_RX_3
QUINARY_TDM_RX_2
QUINARY_TDM_RX_1
QUINARY_TDM_RX_0
QUATERNARY_TDM_TX_7
QUATERNARY_TDM_TX_6
QUATERNARY_TDM_TX_5
QUATERNARY_TDM_TX_4
QUATERNARY_TDM_TX_3
QUATERNARY_TDM_TX_2
QUATERNARY_TDM_TX_1
QUATERNARY_TDM_TX_0
QUATERNARY_TDM_RX_7
QUATERNARY_TDM_RX_6
QUATERNARY_TDM_RX_5
QUATERNARY_TDM_RX_4
QUATERNARY_TDM_RX_3
QUATERNARY_TDM_RX_2
QUATERNARY_TDM_RX_1
QUATERNARY_TDM_RX_0
TERTIARY_TDM_TX_7
TERTIARY_TDM_TX_6
TERTIARY_TDM_TX_5
TERTIAR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MultiMedia5
MultiMedia4
MultiMedia3
MultiMedia2
MultiMedia1
i2s-hifi
snd-soc-dummy-dai

But the following are not listed in the sysfs entries.

    hdmi-dai-link {
            link-name = "HDMI Playback";
            cpu {
                    sound-dai = <&q6afedai HDMI_RX>;
            };

            platform {
                    sound-dai = <&q6routing>;
            };

            codec {
                    sound-dai = <&hdmi 0>;
            };
    };

    slim-dai-link {
            link-name = "SLIM Playback";
            cpu {
                    sound-dai = <&q6afedai SLIMBUS_6_RX>;
            };

            platform {
                    sound-dai = <&q6routing>;
            };

            codec {
                    sound-dai = <&wcd9335 6>;
            };
    };

    slimcap-dai-link {
            link-name = "SLIM Capture";
            cpu {
                    sound-dai = <&q6afedai SLIMBUS_0_TX>;
            };

            platform {
                    sound-dai = <&q6routing>;
            };

            codec {
                    sound-dai = <&wcd9335 1>;
            };
    };

Can you give some suggestions for this? @srini

Thanks,
Sakthi

Its interesting! I don’t see any wcd9335 dais in the debugfs…
Is it possible to add some debug in wcd9335_slim_status(), wcd9335_irq_init() and wcd9335_probe() if they are returning any errors or failing and entry and exit.
Am assuming you are on the same code base as am testing too.

–srini