Hello,
I am an embedded software engineer and recently working on a project bringing up a board based on the NXP i.MX8QM Arm processor with a TI TLV320AIC3204 Stereo Audio Codec running the Linux 5.4.47 Kernel. The Codec chip is connected via the SAI1 I2S bus. I am able to get the audio playing part working, however am currently facing some difficulties getting the recording function working and would appreciate your advice and help. Details are listed below.
My development is based on the following framework as shown in the figure. I am currently using the “Codec Driver” (tlv320aic32x4-i2c.c/ tlv320aic32x4.c) that comes with the Linux Kernel-5.4.47 and the “Platform Driver” file “simple-sound.c” (linux-imx/sound/soc/generic/simple-card.c) from the same kernel release. The device tree (DTS) is configured as an audio device using the following steps:
the Schematic diagram is as flow:
After a fresh reboot, I confirmed that the TLV320AIC3204 codec chip was detected in the Kernel
1) by using the “aplay -L” command to list the newly added audio device:
sysdefault:CARD=tlv320audio
tlv320-audio,
Default Audio Device
2) by testing the audio playback: the audio clip can be played using the following command
aplay -D sysdefault:CARD=tlv320audio -f dat 1.wav
However, the recording function does not work.
I tried to use the following command:
arecord -vv -D sysdefault:CARD=tlv320audio foo.wav
When executing the recording command, the followings were observed:
1) No change was observed on the MICBIAS signal,
2) The PIN1 MCLK outputs is OK
3) The Codec chip was not outputting PIN 2 BCLK and WCLK signals
After some preliminary debugging, I found that during the arecord call, the “dapm_power_widgets” function in sound/soc/soc-dapm.c was called. While going through each widget, all the capture widget’s “new_power” property had a “0” value and the “target_bias_level” remained at 0 (SND_SOC_BIAS_OFF). In turn, the recording failed.
I was wondering if anyone has experienced this issue before. Whether this is a DTS configuration issue or a kernel driver issue that requires a patch. Thanks in advance for your help!