I have a custom i.MX6 board which has WM8985 audio codec. I have the codec driver wm8985 in sound/soc/codecs folder. I am developing the machine level driver sound/soc/fsl/imx-wm8985.c
I am taking the wm8962 code as reference. I am unable to understand the audio routing concept in linux audio subsystem.
I have modified the device tree to the following looking at wm8962 device tree.
sound { compatible = "fsl,imx6q-sabresd-wm8985", "fsl,imx-audio-wm8985"; model = "wm8985-audio"; cpu-dai = <&ssi2>; audio-codec = <&codec>; audio-routing = "Headphone Jack", "HPL", "Headphone Jack", "HPR", "Ext Spk", "SPKL", "Ext Spk", "SPKR", "Mic Bias", "AMIC", "RIN", "Mic Bias", "DMIC", "Mic Bias", "DMICDAT", "DMIC"; mux-int-port = <2>; mux-ext-port = <3>; hp-det-gpios = <&gpio7 8 1>; /* same as sabre */ /*mic-det-gpios = <&gpio1 23 1>;*/ /* move to enet_ref_clk */ };
Is this correct. Can you please help me to understanding what does the source and sink means in this. How to make a route..
Running aplay, i am getting Read/Write Error which happens due to incorrect routing..
Hi Jamal
for source and sink routing one can refer to documentation in
linux/Documentation/devicetree/bindings/sound/imx-audio-wm8962.txt
linux-imx.git - i.MX Linux Kernel
and Chapter 7 Audio attached Linux Manual, alsa project online documentation
ALSA Driver Documentation - AlsaProject
https://www.alsa-project.org/main/index.php/Tutorials_and_Presentations
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
I was able to write the driver. But when i am trying to play the audio it is failing : pcm write I/O Error . How to debug
please use driver sources in Linux Manual and AN4553 Using Open Source
Debugging Tools for Linux on i.MX Processors
https://www.nxp.com/docs/en/application-note/AN4553.pdf
for testing hardware may be useful baremetal sdk:
Github SDK
https://github.com/backenklee/swp-report/tree/master/iMX6_Platform_SDK
Best regards
igor