Hi all,
I am not sure how to specify audio-routing for AC97 codec. If I use the similar setting as the UDOO board (which was the only board that uses AC97 codec I could find) I get warnings during booting:
[ 3.261369] fsl-asoc-card sound: ac97-hifi <-> 202c000.ssi mapping ok [ 3.267917] fsl-asoc-card sound: ASoC: no sink widget found for Playback [ 3.274642] fsl-asoc-card sound: ASoC: Failed to add route AC97 Playback -> direct -> Playback [ 3.283309] fsl-asoc-card sound: ASoC: no source widget found for Capture [ 3.290141] fsl-asoc-card sound: ASoC: Failed to add route Capture -> direct -> AC97 Capture
This was tested on kernel Linux version 4.14.134.
However, the card is detected:
[ 4.041646] ALSA device list: [ 4.044628] #0: ac97-audio
and I can use it for playback normally, but the capture is "slow" as described in my previous e-mail.
Then I tried to build and boot the latest kernel from GIT (Linux version 5.4.0-rc4) using the same DTS, I get additional warnings from the kernel:
[ 2.639878] fsl-asoc-card sound: ac97-hifi <-> 202c000.ssi mapping ok [ 2.651321] fsl-asoc-card sound: ASoC: source widget AC97 Playback overwritten [ 2.658595] fsl-asoc-card sound: ASoC: no sink widget found for Playback [ 2.665317] fsl-asoc-card sound: ASoC: Failed to add route AC97 Playback -> direct -> Playback [ 2.673974] fsl-asoc-card sound: ASoC: sink widget AC97 Capture overwritten [ 2.680986] fsl-asoc-card sound: ASoC: no source widget found for Capture [ 2.687822] fsl-asoc-card sound: ASoC: Failed to add route Capture -> direct -> AC97 Capture [ 2.718636] fsl-asoc-card sound: snd_soc_register_card failed (-19)
and the card is not detected:
[ 3.285543] ALSA device list: [ 3.288518] No soundcards found.
As you can see, there are additional warnings about widget overwrite, because this check was added to the latest kernel, as seen from the kernel source code.
This is the setting from my DTS file:
sound { compatible = "fsl,imx-audio-ac97"; model = "fsl,imx6q-ac97"; audio-cpu = <&ssi2>; audio-routing = "RX", "Mic Jack", "Headphone Jack", "TX";
mux-int-port = <2>; mux-ext-port = <5>; };
As you can see, I do not even specify any routing about AC97 Playback/Capture and I still get those warnings.
For the test, I commented out the code in sound/soc/soc-core.c in function snd_soc_instantiate_card, to ignore the return values from the call to snd_soc_dapm_add_routes and then I can use the card for playback, but the recording has the issues again.
What seems to be wrong with this AC97 audio routing? Any suggestions?
I am willing to test this on the latest kernel, or from some other GIT repo if needed.
Thanks and BR, Matej