Qcom-5.4 audio adsp not working/loading

In qcom-5.4 kernel , adsp is not loading, sound card not detected.

[ 18.855623] remoteproc remoteproc0: adsp-pil is available
[ 18.856734] remoteproc remoteproc0: Direct firmware load for qcom/msm8996/adsp.mbn failed with error -2
[ 18.862808] remoteproc remoteproc0: Falling back to sysfs fallback for: qcom/msm8996/adsp.mbn
[ 19.045905] remoteproc remoteproc1: 2080000.remoteproc is available
[ 21.196398] remoteproc remoteproc0: powering up adsp-pil
[ 21.196817] remoteproc remoteproc0: Direct firmware load for qcom/msm8996/adsp.mbn failed with error -2
[ 21.202146] remoteproc remoteproc0: Falling back to sysfs fallback for: qcom/msm8996/adsp.mbn
[ 21.565507] remoteproc remoteproc0: request_firmware failed: -11
[ 24.577704] remoteproc remoteproc1: powering up 2080000.remoteproc

Eventhough adsp binaries are present in the /lib/firmware, adsp not able to load
root@linaro-alip:/lib/firmware# ls adsp*
adsp.b00 adsp.b02 adsp.b04 adsp.b06 adsp.b09 adspr.jsn
adsp.b01 adsp.b03 adsp.b05 adsp.b08 adsp.mdt adspua.jsn

Direct firmware load for qcom/msm8996/adsp.mbn

I wonder if the problem might be the path? Try copying them to /lib/firmware/qcom/msm8996/.

copying the adsp* to /lib/firmware/qcom/msm8996/* , did not work,
after commenting the firmware-name in dts, adsp loaded. But still the audio not working.

As stated in the other thread, please create a symlink of adsp.mbn to adsp.mdt and it should work better.

Regards,
Bjorn

bjorn, @srini

adsp is loading, but still the audio/sound cards not detected.

[ 15.782900] remoteproc remoteproc0: adsp-pil is available
[ 15.786040] remoteproc remoteproc0: powering up adsp-pil
[ 15.787430] remoteproc remoteproc0: Booting fw image adsp.mdt, size 7196
[ 15.943611] remoteproc remoteproc1: 2080000.remoteproc is available
[ 16.017338] remoteproc remoteproc0: remote processor adsp-pil is now up

root@linaro-alip:~# cat /proc/asound/cards
— no soundcards —

regards,
vinaysimha

The problem seems to be related to some kind of QMI magic.

[  295.008672] calling  adsp_pil_driver_init+0x0/0x1000 [qcom_q6v5_adsp] @ 1827
[  295.009014] initcall adsp_pil_driver_init+0x0/0x1000 [qcom_q6v5_adsp] returned 0 after 318 usecs
[  301.172967] calling  q6v5_driver_init+0x0/0x1000 [qcom_q6v5_mss] @ 1828
[  301.173539] qcom-q6v5-mss 2080000.remoteproc: Looking up pll-supply from device tree
[  301.174446] remoteproc remoteproc0: 2080000.remoteproc is available
[  301.174659] probe of 2080000.remoteproc returned 1 after 1457 usecs
[  301.174846] initcall q6v5_driver_init+0x0/0x1000 [qcom_q6v5_mss] returned 0 after 1815 usecs
[  306.963397] calling  q6v5_wcss_driver_init+0x0/0x1000 [qcom_q6v5_wcss] @ 1830
[  306.963783] initcall q6v5_wcss_driver_init+0x0/0x1000 [qcom_q6v5_wcss] returned 0 after 361 usecs
[  311.317907] calling  adsp_driver_init+0x0/0x1000 [qcom_q6v5_pas] @ 1831
[  311.318367] qcom_q6v5_pas adsp-pil: Looking up cx-supply from device tree
[  311.318387] qcom_q6v5_pas adsp-pil: Looking up cx-supply property in node /adsp-pil failed
[  311.318446] qcom_q6v5_pas adsp-pil: adsp-pil supply cx not found, using dummy regulator
[  311.318623] qcom_q6v5_pas adsp-pil: Looking up px-supply from device tree
[  311.318636] qcom_q6v5_pas adsp-pil: Looking up px-supply property in node /adsp-pil failed
[  311.318663] qcom_q6v5_pas adsp-pil: adsp-pil supply px not found, using dummy regulator
[  311.326017] remoteproc remoteproc1: adsp-pil is available
[  311.334065] probe of adsp-pil returned 1 after 15899 usecs
[  311.334634] remoteproc remoteproc1: powering up adsp-pil
[  311.338808] remoteproc remoteproc1: Booting fw image qcom/msm8996/adsp.mdt, size 7196
[  311.339095] initcall adsp_driver_init+0x0/0x1000 [qcom_q6v5_pas] returned 0 after 20637 usecs
[  311.407310] regulator-dummy: DRMS operation not allowed
[  311.523089] regulator-dummy: DRMS operation not allowed
[  311.524378] probe of remoteproc1:smd-edge.rpmsg_chrdev.0.0 returned 1 after 811 usecs
[  311.524399] remoteproc remoteproc1: remote processor adsp-pil is now up
[  311.525550] probe of remoteproc1:smd-edge.IPCRTR.-1.-1 returned 1 after 387 usecs
[  321.774309] timed out waiting for new server
[  321.774389] failed to send QMI message
[  321.777662] QMI send req failed, ret - -22
[  321.781461] qcom,apr remoteproc1:smd-edge.apr_audio_svc.-1.-1: rpmsg_dev_probe: failed: -22
[  321.785441] qcom,apr: probe of remoteproc1:smd-edge.apr_audio_svc.-1.-1 failed with error -22
[  321.793704] probe of remoteproc1:smd-edge.apr_audio_svc.-1.-1 returned 0 after 10260382 usecs

@srini @Loic @bamse – any hints about this?

For 820 the PD up notification will never come, so you need to ensure the code introduced by 08fc27e811c3 (“HACK: qcom: apr: Wait for PD up notification”) isn’t run for this target.

The same patches under review upstream has made this configurable, so given your interest in supporting db820c we should look at replacing the above hack with proper patches.

Regards,
Bjorn

Thank you @bamse , that seems to have gotten me past the first hurdle. I’m now at what looks like a slimbus/wcd9335 initialization problem;

[   16.399930] calling  qcom_slim_driver_init+0x0/0x20 @ 1
[   16.407994] initcall qcom_slim_driver_init+0x0/0x20 returned 0 after 337 usecs
[   16.412688] calling  qcom_slim_ngd_ctrl_driver_init+0x0/0x20 @ 1
[   16.425282] probe of qcom,slim-ngd.1 returned 1 after 4491 usecs
[   16.432160] probe of 91c0000.slim returned 1 after 12022 usecs
[   16.435138] initcall qcom_slim_ngd_ctrl_driver_init+0x0/0x20 returned 0 after 14807 usecs

This is causing a sound card probe error (the codec dai it is referring to is the wcd9335);

[   89.960379] msm-snd-apq8096 sound: SLIM Playback: codec dai not found
[   89.960384] msm-snd-apq8096 sound: Error parsing OF data

Commenting out the slim dai links from the sound card definition in DTS appears to allow the rest of the card to probe, but still no front ends appearing.

Edit: removing also the wcd-related audio routing seems to have the sound card probe successful. Just none of the analog audio features of the board will work, since those need the wcd.

Things remaining broken in my fork of kernel 5.4;

  1. Analog audio,
  2. USB Gadget,
    ** digital audio appears to be working, though I haven’t actually tested it yet.

https://gitlab.com/aosp-automotive/dragonboard-kernel-src/commits/wip/dragonboard-kernel-android-qcomlt-5.4

I have NOT experienced even a single lock up on boot since enabling the nvmem cpufreq driver.

EDIT: I have now tested digital audio, and it is working. Specifically, I have codecs hooked up to the i2s pins on the LS expansion header and am running i2s data to them. Currently I have confirmed output is functional on that port.

fyi,

reverting these two patches will resolve the rpmsg_dev_probe and smd-edge.apr_audio_svc.-1.- errors
e7054b5 - Bjorn Andersson, 5 months ago : soc: qcom: apr: Release the QMI handle on failure
08fc27e - Sibi Sankar, 8 months ago : HACK: qcom: apr: Wait for PD up notification

But still the sound card is not available in /proc/asound/cards

dmesg

hdmi audio is working

analog audio still not working

It would save you a lot of work if you would read the intermediary messages in the thread for the easy solution rather than reinventing the wheel.

I did not get you. Do you already has the solution of hdmi audio and analog audio working.

i do undertstand that you have i2s working on the expansion header.

HDMI is digital audio.

Any update on this? @vinaysimha @srini

currently only HDMI digital audio works.

You need to make the audio related changes in kernel which is shared earlier.

if we remove headphone microphone section in DB820c/HiFi and reboot the board, volume->configuration option shows both HDMI and HiFi Configuration. But still the audio does not works in analog audio.

currently the problem wrt analog audio is

23.468462] input: DB820c Headset Jack as /devices/platform/sound/sound/card0/input5
[ 24.101917] wcd9335-slim 217:1a0:1:0: Invalid HPH Mode, default to ClSH HiFi
[ 24.932038] wcd9335-slim 217:1a0:1:0: Invalid HPH Mode, default to ClSH HiFi
[ 25.340575] broken atomic modeset userspace detected, disabling atomic
[ 25.681355] wcd9335-slim 217:1a0:1:0: Invalid HPH Mode, default to ClSH HiFi

if we fix this analog audio may work.

regards,
vinaysimha

I am using 4.14 kernel version, so I can’t apply your audio related changes. Can you share any pointers about solving the sound card detection issue? @vinaysimha @bamse @doitright @Loic @srinI

Thanks,
Sakthi

try removing headphone microphone section in /usr/share/alsa/ucm/DB820c/HiFi

Hi Vinay,
Thanks for reporting this and testing it out.
To be Honest we have not been testing every thing on DB820c in recent days due to other priorities.
However today i started testing release/5.4 branch and found few fixes that are missing.
I did try it on my DB820c with headset and it works fine.
Can you try this branch: srinivas.kandagatla/linux.git - srini kernel working tree
All of these fixes will end up in release branch once we finish full testing

thanks,
srini

@srini:
There are a number of commits near the top of my fork starting from January 23 for cpufreq by Ilia Lin, this one by myself that enables it; 0b7f687f478d51e447b21cefac7f87fdf3a766e4, this one by @Loic that fixes the core voltage 7edf03b58160e1c60a648aad4eb09152dcab7ac0

https://gitlab.com/aosp-automotive/dragonboard-kernel-src/commits/wip/dragonboard-kernel-android-qcomlt-5.4

And there is also this one from @amit to fix USB gadget;
https://patchwork.kernel.org/patch/11279599/