Hi Team,
We are working on PCM5242 Audio DAC with NXP processor in ANdorid11 code base.
I have integrated all the changes in DTSI and driver file.
After changes, DAC has been registered successfully.
I checked the all clocks like WCLK MCLK BCLK and DIN pin , We are getting all the clocks properly while playing audio file. But NO sound.
Error we are facing:
E audio_hw_primary: start_output_stream: Invalid PCM card id: -1
I audio_hw_primary: start_output_stream: primary: 1, out: 0xee944630, device: 131072, address: , mode: 0, flags 0x2
I audio_hw_primary: select_output_device(), headphone 0 ,headset 0 ,speaker 2
D audio_hw_primary: start_output_stream: pcm_open: card: -1, pcm_device_id: 0, rate: 48000, channel: 2, format: 0, period_size: 0xc0, flag: 9
Looks like no card present:
evk_8mm:/ # cat /proc/asound/card0/pcm0p/*
card: 0
device: 0
subdevice: 0
stream: PLAYBACK
id: 30050000.sai-pcm512x-hifi pcm512x-hifi-0
name: 30050000.sai-pcm512x-hifi pcm512x-hifi-0
subname: subdevice #0
class: 0
subclass: 0
subdevices_count: 1
subdevices_avail: 1
I2C dump:
1. When audio not playing:
2. When trying to play audio file
DTSI changes:
sound-pcm512x {
compatible = "simple-audio-card";
simple-audio-card,name = "pcm512x-audio";
simple-audio-card,format = "i2s";
simple-audio-card,bitclock-master = <&dailink0_master4>;
simple-audio-card,frame-master = <&dailink0_master4>;
simple-audio-card,widgets =
"Line", "Left Line Out Jack",
"Line", "Right Line Out Jack";
simple-audio-card,routing =
"Left Line Out Jack", "OUTL",
"Right Line Out Jack", "OUTR";
dailink0_master4: simple-audio-card,cpu {
sound-dai = <&sai5>;
};
simple-audio-card,codec {
sound-dai = <&pcm5242>;
clocks = <&clk IMX8MM_CLK_SAI5_ROOT>;
};
};
pcm5242: pcm5242@4c {
compatible = "ti,pcm5242";
#sound-dai-cells = <0>;
reg = <0x4c>;
AVDD-supply = <®_3v3_vext>;
DVDD-supply = <®_3v3_vext>;
CPVDD-supply = <®_3v3_vext>;
clocks = <&ext_osc_22m>, <&ext_osc_24m>;
clock-names = "sclk0", "sclk1";
};
&sai5 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai5>;
assigned-clocks = <&clk IMX8MM_CLK_SAI5>;
assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
assigned-clock-rates = <24576000>;
status = "okay";
};
pinctrl_sai5: sai5grp {
fsl,pins = <
MX8MM_IOMUXC_SAI5_MCLK_SAI5_MCLK 0xd6 /*MCLK*/
MX8MM_IOMUXC_SAI5_RXD2_SAI5_TX_BCLK 0xd6 /*BCLK*/
MX8MM_IOMUXC_SAI5_RXD3_SAI5_TX_DATA0 0xd6 /*DIN*/
MX8MM_IOMUXC_SAI5_RXD1_SAI5_TX_SYNC 0xd6 /*WCLK*/
>;
};
NOTE: WE dont have proper driver. We are using driver of different family which is pcm5142.
sound/soc/codecs/pcm512x-i2c.c
sound/soc/codecs/pcm512x.c
Need your urgent support
Thanks
Divyesh
Android layer changes are required related to "PCM5242 Audio DAC"
Hi @qwerty1 ,
Could you please specify the what changes required?
Please share any reference.
Thanks
Divyesh
Sorry, I don't have any reference.
First check in device/nxp folder [Files- audio_policy_configuartion and audio_effects.xml]. Then vendor folder[Audio HAL changes]
Please find below logs:
01-01 00:00:00.234 0 0 E imx-pcm512x sound-pcm512x: failed to find codec device
01-01 00:00:01.148 0 0 E pcm512x 3-004c: divyesh enter into CONFIG_OF func :pcm512x_probe
01-01 00:00:01.155 0 0 E pcm512x 3-004c: divyesh enter into CONFIG_OF and dev->of_node func :pcm512x_probe
FYI. Please read the Chapter 16 for audio codec porting.
https://www.nxp.com/docs/en/user-guide/IMX_PORTING_GUIDE.pdf