Hello,
I am working with an ADAU7118 PDM-to-I2S converter on a Verdin AM62D board. I have connected a single IM72D128V01 microphone to the ADAU7118 on channel 0, with clock-0.
Here are the relevant changes made in the device tree:
&main_i2c3 {
status = "okay";
#sound-dai-cells = <0>;
#address-cells = <1>;
status = "okay";
adau7118_codec: adau7118-codec@17 {
compatible = "adi,adau7118";
#sound-dai-cells = <0>;
reg = <0x17>;
status = "okay";
adi,pdm-clk-map = <0 0 0 0>;
adi,decimation-ratio = <16>;
};
sound {
compatible = "simple-audio-card";
simple-audio-card,bitclock-slave = <&codec_dai>;
simple-audio-card,format = "i2s";
simple-audio-card,frame-slave = <&codec_dai>;
simple-audio-card,mclk-fs = <256>;
simple-audio-card,name = "adau7118";
simple-audio-card,widgets = "Microphone", "Microphone Jack";
simple-audio-card,routing = "PDM_DAT0", "Microphone Jack";
codec_dai: simple-audio-card,codec {
sound-dai = <&adau7118_codec>;
};
simple-audio-card,cpu {
dai-tdm-slot-num = <2>; // Number of TDM slots
dai-tdm-slot-width = <32>; // Width of each TDM slot
sound-dai = <&mcasp0>;
}
I am using the following command to capture audio:
arecord -D hw:0,0 -V mono -c 1 -f S16_LE -r 8000 -v -t wav mic.wav
For a 10-second recording, I am getting a .wav file with around 50-60 seconds of audio when I play it back.
Could you please suggest:
How to properly configure the ADAU7118 for recording from a single microphone.
Any changes needed in the device tree.
If there is something wrong with the decimation ratio or PDM clock settings that might cause this issue.
Thank you for your help!