I tried to interface the Texas Instrument TLV320ADC6140 on JetsonNano to record a TDM stream of 4 channels (32 bits 48kHz).
The kernel driver of this ADC was developed under kernel > 5.X, so I modified the tlv320adcx140 driver to be compatible with jetson nano kernel. You will find the driver sources attached.
I recompiled the jetson kernel and I didn’t get any errors.
I also modified the device tree of the jetson nano to:
Configure the pin muxing
Enable I2S and I2C on jetson nano board
Attach audio codec to correct I2S and I2C ports
You will also find attached the device tree “tegra210-porg-p3448-common.dtsi” (please take a look to “tegra_sound” and “hdr40_i2c1” paragraphs).
Next, I reflash the jetson nano SD card and I can see with dmesg command that the codec is correctly registered and I2C communication with the ADC is working.
When I run alsamixer, I can see all the codec kcontrol parameters.
Then I tried to configure I2S using amixer by typing these commands : >amixer -c tegrasndt210ref cset name =”I2S4 Mux” “ADMAIF1” >amixer -c tegrasndt210ref cset name =”I2S4 fsync width” 0 >amixer -c tegrasndt210ref cset name =”I2S4 codec master mode” “cbs-cfs” >amixer -c tegrasndt210ref cset name =”I2S4 codec frame mode” “dsp-a”
When I run the command :>arecord -D hw:tegrasndt210ref,0 -r 48000 -c 4 -f S32_LE test.wav, I do not see any clock coming out of the jetson nano and I have the following error : arecord: pcm_read:2103: read error: Input/output error
I think it’s a routing problem but the configuration of ALSA in the Jetson nano environment is complicated and poorly documented.
Do you have an idea?
Thank you. tlv320adcx140.h (4.2 KB) tegra210-porg-p3448-common.dtsi (22.0 KB) tlv320adcx140.c (32.7 KB)
If the audio path is not configured correctly, then it is possible that the DAPM widget for the I2S will not be turned on and so you will not see the clocks running. I see ADMAIF Mux is not set correctly and also codec routing.
For capturing audio, map the I2S4 interface to the ADMAIF1 interface with below command.
But for the last register GPIO_CNF (0x6000d204), it keep always the value 0xF0 and we have to modify it manually.
We found a temporary solution by changing the U-Boot environment variable “bootcmd” :
setenv bootcmd 'mw 0x6000d204 0; run distro_bootcmd'
saveenv
This solution doesn’t seem very good for me.
Without recompiling the u-boot, is there another solution to change the register value? (Using device tree for example)
Thank you in advance.
Best regards,
Dorian LE RENARD.