Adding TI PCMD3140/TLV320ADCx140 to Jetson Xavier AGX Industrial via I2S

Hello NVIDIA Community,

I need assistance in integrating a Texas Instruments 4-channel audio device (PCMD3140/TLV320ADCx140) to my Jetson Xavier AGX Industrial via the I2S pins on the 40-pin header.

Steps Taken:

  1. Downloaded the kernel source from NVIDIA Developer Guide.
  2. Added CONFIG_SND_SOC_TLV320ADCX140=m in menuconfig, compiled the kernel, and flashed the Jetson.
  3. Configured the I2S pins using the jetson-io script in /opt/nvidia/jetson-io, which added another device tree to the system.
  4. Confirmed the device communication on the I2C bus at address 0x4e using i2cdetect -r 1. Verified default register values with i2cget -f 1 0x4e 0xXX.

Issue: Followed a guide from TI E2E Forum to make changes in the device tree but encountered difficulties in configuring them correctly. Our current approach involves decompiling the dtb from /boot/extlinux, modifying specific parts, but it isn’t working.
dmesg | grep tlv is empty meaning that the driver didn’t came up, after i entered the driver using modprobe the lsmod | grep tlv outputs me snd_soc_tlv320adcx140 57344 0.

Questions:

  1. Should we modify the .dtsi files in the kernel source, recompile the whole kernel, and flash it again?
  2. What specific changes should we make to the .dtsi files to correctly configure the device?

Current de-compiled Device Tree: kernel_tegra194-p2888-0001-p2822-0000-user-custom.txt (486.0 KB)

How the ti i2c supposed to look: tlv320adcx140_edited.txt (430 Bytes)
Any guidance or suggestions would be greatly appreciated.

Thanks!

Hi ahepner,
Greetings! Am happy to help here.

To answer your questions. Yes, we need to modify the .dtsi files in the kernel source, recompile and flash to support new codec which in your case TLV320ADCx140

Sharing the reference documentation that could help

  1. Codec integration guide at Audio Setup and Development — NVIDIA Jetson Linux Developer Guide 1 documentation
  2. TroubleShooting at Audio Setup and Development — NVIDIA Jetson Linux Developer Guide 1 documentation
  3. Examples at Audio Setup and Development — NVIDIA Jetson Linux Developer Guide 1 documentation

Also below are some of related forum queries for your reference
Arecord fails with pcm_read error - Jetson & Embedded Systems / Jetson AGX Xavier - NVIDIA Developer Forums

Please follow the above references and perform the dtsi changes for your codec. If still the issues exists, provide the below info

  1. Jetpack version used
  2. Attach the files (DT and driver) changed to support TLV320ADC
  3. Kernel log
  4. cat /sys/kernel/debug/asoc/components
  5. zcat /proc/config.gz | grep tlv
  6. cat /proc/asound/cards

Hi mkumard,

Thank you for the prompt response!

Here is the additional information you requested:

  1. Jetpack Version: 5.1.1
  2. device tree:
    tegra194-p2888-0001-p2822-0000.txt (3.0 KB)
    some parts commented out that didn’t compile for us and we don’t know why.

we didnt changed the driver for the codec at all, only talk the one that is built in the kernel tlv320adcx140.c « codecs « soc « sound - kernel/git/stable/linux.git - Linux kernel stable tree
3. sudo dmesg | grep tlv [ 0.415606] OF: /sound/tlvcodec@4e: could not get #clock-cells for /aconnect@2a41000/ahub/i2s@2901100
4. cat /sys/kernel/debug/asoc/components
asoc_components.txt (906 Bytes)

  1. zcat /proc/config.gz | grep tlv empty
  2. cat /proc/asound/cards 0 [HDA ]: tegra-hda - NVIDIA Jetson AGX Xavier HDA NVIDIA Jetson AGX Xavier HDA at 0x3518000 irq 53

In order to copmile the DTS we entered the kernel output and compiled only the DTS with the following command:

make ARCH=arm64 LOCALVERSION="-tegra" CROSS_COMPILE="/home/user/Downloads/ti/aarch64--glibc--stable-final/bin/aarch64-buildroot-linux-gnu-" --output-sync=target dtbs

We modified the base device tree file tegra194-p2888-0001-p2822-0000 and then took the resulting .dtb file, updating our device boot configuration in extlinux.conf. After that, we opened the I2S ports using jetson-io because we couldn’t quite figure out how to make that change in the original DTS.

Thanks for your time!!

Hi ahepner,
Thanks! for your logs. My suggestion would be, not to update the base DT file as there is audio specific DT file @

hardware/nvidia/platform/t19x/galen/kernel-dts/common/tegra194-audio-p2822-0000.dtsi

As base DT got modified, it broken the APE sound card registration for the existing codec on board. This resulted in no APE sound card .

Please try the attached patch file, build and flash dtb.
tlv320.txt (2.6 KB)

Also, revert all the audio DT changes made on the base DT file.

Provide below info

  1. cat /proc/asound/cards
  2. kernel log

Hi mkumard,
Thanks for your replay

  1. cat /proc/asound/cards proc_asound_cards.txt (134 Bytes)
  2. kernel_log_tlv320.txt (72.7 KB)

and this is the audio device tree after your patch:
tegra194-audio-p2822-0000.txt (10.9 KB)

From the log, I see below error.

[ 13.425000] OF: /sound/nvidia-audio-card,dai-link@77/codec: could not get #sound-dai-cells for /i2c@c240000/tlvcodec@4e
[ 13.426363] tegra-asoc:: probe of sound failed with error -22

Can you cross check the codec i2c dt node entries.

As far as i can see this is it address.

type or paste code here

current.zip (143.7 KB)

We see that the driver is trying to upload the device but it get stuck for some reson as you can see in the files above, and in this dmesg.

dmesg | grep tlv
[   14.549660] tlv320adcx140-codec 1-004e: ASoC: error at snd_soc_component_probe on tlv320adcx140-codec.1-004e: -121
[   14.550879] tlv320adcx140-codec 1-004e: ASoC: failed to probe component -121

Hi ahepner,
Thanks for the update. Please check the adcx140_codec_probe() function in codec driver to understand the failing path.

As this issue is related to Codec driver, can you get in touch with codec vendor to rectify.

We made some changes in the device tree and it seems like the device is going up, but we were unable to find him in the arecored -l , do you know why?
tegra194-audio-p2822-0000.txt (11.4 KB)

cat /proc/asound/cards
 0 [HDA            ]: tegra-hda - NVIDIA Jetson AGX Xavier HDA
                      NVIDIA Jetson AGX Xavier HDA at 0x3518000 irq 53
 1 [APE            ]: tegra-ape - NVIDIA Jetson AGX Xavier APE
                      Unknown-Jetson_AGX-NotSpecified

dmesg
dmesg.txt (72.4 KB)

cat /sys/kernel/debug/asoc/components
[sudo] password for nvidia: 
2901500.i2s
2901400.i2s
2901300.i2s
2904300.dmic
2904200.dmic
2901200.i2s
2905100.dspk
2904100.dmic
2901100.i2s
2905000.dspk
2904000.dmic
2901000.i2s
290e000.iqc
290a200.mvc
2910000.asrc
290a000.mvc
2908000.ope
290e400.arad
2903300.amx
2903200.amx
2903100.amx
290bb00.amixer
2907500.afc
2907400.afc
2907300.afc
2902600.sfc
2907200.afc
2902400.sfc
2903b00.adx
2907100.afc
2907000.afc
2903a00.adx
2902200.sfc
290f000.admaif
2903900.adx
2902000.sfc
2903800.adx
2903000.amx
rt5659.7-001a
spdif_dit:spdif-dit.13@d
spdif_dit:spdif-dit.12@c
spdif_dit:spdif-dit.11@b
spdif_dit:spdif-dit.10@a
spdif_dit:spdif-dit.9@9
spdif_dit:spdif-dit.8@8
spdif_dit:spdif-dit.7@7
spdif_dit:spdif-dit.6@6
spdif_dit:spdif-dit.5@5
spdif_dit:spdif-dit.4@4
spdif_dit:spdif-dit.3@3
spdif_dit:spdif-dit.2@2
spdif_dit:spdif-dit.1@1
spdif_dit:spdif-dit.0@0
tegra210-adsp
2900800.ahub
tlv320adcx140-codec.1-004e
snd-soc-dummy
snd-soc-dummy

arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: APE [NVIDIA Jetson AGX Xavier APE], device 0: tegra-dlink-0 XBAR-ADMAIF1-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: APE [NVIDIA Jetson AGX Xavier APE], device 1: tegra-dlink-1 XBAR-ADMAIF2-1 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: APE [NVIDIA Jetson AGX Xavier APE], device 2: tegra-dlink-2 XBAR-ADMAIF3-2 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: APE [NVIDIA Jetson AGX Xavier APE], device 3: tegra-dlink-3 XBAR-ADMAIF4-3 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: APE [NVIDIA Jetson AGX Xavier APE], device 4: tegra-dlink-4 XBAR-ADMAIF5-4 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: APE [NVIDIA Jetson AGX Xavier APE], device 5: tegra-dlink-5 XBAR-ADMAIF6-5 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: APE [NVIDIA Jetson AGX Xavier APE], device 6: tegra-dlink-6 XBAR-ADMAIF7-6 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: APE [NVIDIA Jetson AGX Xavier APE], device 7: tegra-dlink-7 XBAR-ADMAIF8-7 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: APE [NVIDIA Jetson AGX Xavier APE], device 8: tegra-dlink-8 XBAR-ADMAIF9-8 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: APE [NVIDIA Jetson AGX Xavier APE], device 9: tegra-dlink-9 XBAR-ADMAIF10-9 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: APE [NVIDIA Jetson AGX Xavier APE], device 10: tegra-dlink-10 XBAR-ADMAIF11-10 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: APE [NVIDIA Jetson AGX Xavier APE], device 11: tegra-dlink-11 XBAR-ADMAIF12-11 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: APE [NVIDIA Jetson AGX Xavier APE], device 12: tegra-dlink-12 XBAR-ADMAIF13-12 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: APE [NVIDIA Jetson AGX Xavier APE], device 13: tegra-dlink-13 XBAR-ADMAIF14-13 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: APE [NVIDIA Jetson AGX Xavier APE], device 14: tegra-dlink-14 XBAR-ADMAIF15-14 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: APE [NVIDIA Jetson AGX Xavier APE], device 15: tegra-dlink-15 XBAR-ADMAIF16-15 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: APE [NVIDIA Jetson AGX Xavier APE], device 16: tegra-dlink-16 XBAR-ADMAIF17-16 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: APE [NVIDIA Jetson AGX Xavier APE], device 17: tegra-dlink-17 XBAR-ADMAIF18-17 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: APE [NVIDIA Jetson AGX Xavier APE], device 18: tegra-dlink-18 XBAR-ADMAIF19-18 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: APE [NVIDIA Jetson AGX Xavier APE], device 19: tegra-dlink-19 XBAR-ADMAIF20-19 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: APE [NVIDIA Jetson AGX Xavier APE], device 20: tegra-dlink-20 ADSP-FE1-20 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: APE [NVIDIA Jetson AGX Xavier APE], device 21: tegra-dlink-21 ADSP-FE2-21 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
arecord -L
null
    Discard all samples (playback) or generate zero samples (capture)
samplerate
    Rate Converter Plugin Using Samplerate Library
speexrate
    Rate Converter Plugin Using Speex Resampler
jack
    JACK Audio Connection Kit
oss
    Open Sound System
pulse
    PulseAudio Sound Server
upmix
    Plugin for channel upmix (4,6,8)
vdownmix
    Plugin for channel downmix (stereo) with a simple spacialization
default
    Tegra APE Soundcard
demixer
usbstream:CARD=HDA
    NVIDIA Jetson AGX Xavier HDA
    USB Stream Output
sysdefault:CARD=APE
    NVIDIA Jetson AGX Xavier APE, 
    Default Audio Device
front:CARD=APE,DEV=0
    NVIDIA Jetson AGX Xavier APE, 
    Front speakers
dmix:CARD=APE,DEV=0
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample mixing device
dmix:CARD=APE,DEV=1
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample mixing device
dmix:CARD=APE,DEV=2
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample mixing device
dmix:CARD=APE,DEV=3
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample mixing device
dmix:CARD=APE,DEV=4
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample mixing device
dmix:CARD=APE,DEV=5
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample mixing device
dmix:CARD=APE,DEV=6
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample mixing device
dmix:CARD=APE,DEV=7
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample mixing device
dmix:CARD=APE,DEV=8
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample mixing device
dmix:CARD=APE,DEV=9
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample mixing device
dmix:CARD=APE,DEV=10
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample mixing device
dmix:CARD=APE,DEV=11
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample mixing device
dmix:CARD=APE,DEV=12
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample mixing device
dmix:CARD=APE,DEV=13
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample mixing device
dmix:CARD=APE,DEV=14
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample mixing device
dmix:CARD=APE,DEV=15
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample mixing device
dmix:CARD=APE,DEV=16
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample mixing device
dmix:CARD=APE,DEV=17
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample mixing device
dmix:CARD=APE,DEV=18
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample mixing device
dmix:CARD=APE,DEV=19
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample mixing device
dmix:CARD=APE,DEV=20
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample mixing device
dmix:CARD=APE,DEV=21
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample mixing device
dsnoop:CARD=APE,DEV=0
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample snooping device
dsnoop:CARD=APE,DEV=1
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample snooping device
dsnoop:CARD=APE,DEV=2
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample snooping device
dsnoop:CARD=APE,DEV=3
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample snooping device
dsnoop:CARD=APE,DEV=4
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample snooping device
dsnoop:CARD=APE,DEV=5
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample snooping device
dsnoop:CARD=APE,DEV=6
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample snooping device
dsnoop:CARD=APE,DEV=7
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample snooping device
dsnoop:CARD=APE,DEV=8
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample snooping device
dsnoop:CARD=APE,DEV=9
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample snooping device
dsnoop:CARD=APE,DEV=10
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample snooping device
dsnoop:CARD=APE,DEV=11
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample snooping device
dsnoop:CARD=APE,DEV=12
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample snooping device
dsnoop:CARD=APE,DEV=13
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample snooping device
dsnoop:CARD=APE,DEV=14
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample snooping device
dsnoop:CARD=APE,DEV=15
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample snooping device
dsnoop:CARD=APE,DEV=16
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample snooping device
dsnoop:CARD=APE,DEV=17
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample snooping device
dsnoop:CARD=APE,DEV=18
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample snooping device
dsnoop:CARD=APE,DEV=19
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample snooping device
dsnoop:CARD=APE,DEV=20
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample snooping device
dsnoop:CARD=APE,DEV=21
    NVIDIA Jetson AGX Xavier APE, 
    Direct sample snooping device
hw:CARD=APE,DEV=0
    NVIDIA Jetson AGX Xavier APE, 
    Direct hardware device without any conversions
hw:CARD=APE,DEV=1
    NVIDIA Jetson AGX Xavier APE, 
    Direct hardware device without any conversions
hw:CARD=APE,DEV=2
    NVIDIA Jetson AGX Xavier APE, 
    Direct hardware device without any conversions
hw:CARD=APE,DEV=3
    NVIDIA Jetson AGX Xavier APE, 
    Direct hardware device without any conversions
hw:CARD=APE,DEV=4
    NVIDIA Jetson AGX Xavier APE, 
    Direct hardware device without any conversions
hw:CARD=APE,DEV=5
    NVIDIA Jetson AGX Xavier APE, 
    Direct hardware device without any conversions
hw:CARD=APE,DEV=6
    NVIDIA Jetson AGX Xavier APE, 
    Direct hardware device without any conversions
hw:CARD=APE,DEV=7
    NVIDIA Jetson AGX Xavier APE, 
    Direct hardware device without any conversions
hw:CARD=APE,DEV=8
    NVIDIA Jetson AGX Xavier APE, 
    Direct hardware device without any conversions
hw:CARD=APE,DEV=9
    NVIDIA Jetson AGX Xavier APE, 
    Direct hardware device without any conversions
hw:CARD=APE,DEV=10
    NVIDIA Jetson AGX Xavier APE, 
    Direct hardware device without any conversions
hw:CARD=APE,DEV=11
    NVIDIA Jetson AGX Xavier APE, 
    Direct hardware device without any conversions
hw:CARD=APE,DEV=12
    NVIDIA Jetson AGX Xavier APE, 
    Direct hardware device without any conversions
hw:CARD=APE,DEV=13
    NVIDIA Jetson AGX Xavier APE, 
    Direct hardware device without any conversions
hw:CARD=APE,DEV=14
    NVIDIA Jetson AGX Xavier APE, 
    Direct hardware device without any conversions
hw:CARD=APE,DEV=15
    NVIDIA Jetson AGX Xavier APE, 
    Direct hardware device without any conversions
hw:CARD=APE,DEV=16
    NVIDIA Jetson AGX Xavier APE, 
    Direct hardware device without any conversions
hw:CARD=APE,DEV=17
    NVIDIA Jetson AGX Xavier APE, 
    Direct hardware device without any conversions
hw:CARD=APE,DEV=18
    NVIDIA Jetson AGX Xavier APE, 
    Direct hardware device without any conversions
hw:CARD=APE,DEV=19
    NVIDIA Jetson AGX Xavier APE, 
    Direct hardware device without any conversions
hw:CARD=APE,DEV=20
    NVIDIA Jetson AGX Xavier APE, 
    Direct hardware device without any conversions
hw:CARD=APE,DEV=21
    NVIDIA Jetson AGX Xavier APE, 
    Direct hardware device without any conversions
plughw:CARD=APE,DEV=0
    NVIDIA Jetson AGX Xavier APE, 
    Hardware device with all software conversions
plughw:CARD=APE,DEV=1
    NVIDIA Jetson AGX Xavier APE, 
    Hardware device with all software conversions
plughw:CARD=APE,DEV=2
    NVIDIA Jetson AGX Xavier APE, 
    Hardware device with all software conversions
plughw:CARD=APE,DEV=3
    NVIDIA Jetson AGX Xavier APE, 
    Hardware device with all software conversions
plughw:CARD=APE,DEV=4
    NVIDIA Jetson AGX Xavier APE, 
    Hardware device with all software conversions
plughw:CARD=APE,DEV=5
    NVIDIA Jetson AGX Xavier APE, 
    Hardware device with all software conversions
plughw:CARD=APE,DEV=6
    NVIDIA Jetson AGX Xavier APE, 
    Hardware device with all software conversions
plughw:CARD=APE,DEV=7
    NVIDIA Jetson AGX Xavier APE, 
    Hardware device with all software conversions
plughw:CARD=APE,DEV=8
    NVIDIA Jetson AGX Xavier APE, 
    Hardware device with all software conversions
plughw:CARD=APE,DEV=9
    NVIDIA Jetson AGX Xavier APE, 
    Hardware device with all software conversions
plughw:CARD=APE,DEV=10
    NVIDIA Jetson AGX Xavier APE, 
    Hardware device with all software conversions
plughw:CARD=APE,DEV=11
    NVIDIA Jetson AGX Xavier APE, 
    Hardware device with all software conversions
plughw:CARD=APE,DEV=12
    NVIDIA Jetson AGX Xavier APE, 
    Hardware device with all software conversions
plughw:CARD=APE,DEV=13
    NVIDIA Jetson AGX Xavier APE, 
    Hardware device with all software conversions
plughw:CARD=APE,DEV=14
    NVIDIA Jetson AGX Xavier APE, 
    Hardware device with all software conversions
plughw:CARD=APE,DEV=15
    NVIDIA Jetson AGX Xavier APE, 
    Hardware device with all software conversions
plughw:CARD=APE,DEV=16
    NVIDIA Jetson AGX Xavier APE, 
    Hardware device with all software conversions
plughw:CARD=APE,DEV=17
    NVIDIA Jetson AGX Xavier APE, 
    Hardware device with all software conversions
plughw:CARD=APE,DEV=18
    NVIDIA Jetson AGX Xavier APE, 
    Hardware device with all software conversions
plughw:CARD=APE,DEV=19
    NVIDIA Jetson AGX Xavier APE, 
    Hardware device with all software conversions
plughw:CARD=APE,DEV=20
    NVIDIA Jetson AGX Xavier APE, 
    Hardware device with all software conversions
plughw:CARD=APE,DEV=21
    NVIDIA Jetson AGX Xavier APE, 
    Hardware device with all software conversions
usbstream:CARD=APE
    NVIDIA Jetson AGX Xavier APE
    USB Stream Output

Hi,
From the log, APE Sound card got registered successfully. This is good news.

You can cross check the list of TAS codec mixer controls with command

amixer -c APE controls

I believe you should be able to run audio usecase if above command shows H40-TLV controls.

Thanks, it does

amixer -c APE controls | grep TLV
numid=470,iface=MIXER,name='H40-TLV AGC Max Gain'
numid=469,iface=MIXER,name='H40-TLV AGC Threshold'
numid=463,iface=MIXER,name='H40-TLV Analog CH1 Mic Gain Volume'
numid=464,iface=MIXER,name='H40-TLV Analog CH2 Mic Gain Volume'
numid=465,iface=MIXER,name='H40-TLV Analog CH3 Mic Gain Volume'
numid=466,iface=MIXER,name='H40-TLV Analog CH4 Mic Gain Volume'
numid=1665,iface=MIXER,name='H40-TLV CH1_ASI_EN Switch'
numid=1674,iface=MIXER,name='H40-TLV CH1_DRE_EN Switch'
numid=1666,iface=MIXER,name='H40-TLV CH2_ASI_EN Switch'
numid=1675,iface=MIXER,name='H40-TLV CH2_DRE_EN Switch'
numid=1667,iface=MIXER,name='H40-TLV CH3_ASI_EN Switch'
numid=1676,iface=MIXER,name='H40-TLV CH3_DRE_EN Switch'
numid=1668,iface=MIXER,name='H40-TLV CH4_ASI_EN Switch'
numid=1677,iface=MIXER,name='H40-TLV CH4_DRE_EN Switch'
numid=1669,iface=MIXER,name='H40-TLV CH5_ASI_EN Switch'
numid=1670,iface=MIXER,name='H40-TLV CH6_ASI_EN Switch'
numid=1671,iface=MIXER,name='H40-TLV CH7_ASI_EN Switch'
numid=1672,iface=MIXER,name='H40-TLV CH8_ASI_EN Switch'
numid=468,iface=MIXER,name='H40-TLV DRE Max Gain'
numid=467,iface=MIXER,name='H40-TLV DRE Threshold'
numid=1673,iface=MIXER,name='H40-TLV DRE_ENABLE Switch'
numid=1683,iface=MIXER,name='H40-TLV Decimation Filter'
numid=471,iface=MIXER,name='H40-TLV Digital CH1 Out Volume'
numid=472,iface=MIXER,name='H40-TLV Digital CH2 Out Volume'
numid=473,iface=MIXER,name='H40-TLV Digital CH3 Out Volume'
numid=474,iface=MIXER,name='H40-TLV Digital CH4 Out Volume'
numid=475,iface=MIXER,name='H40-TLV Digital CH5 Out Volume'
numid=476,iface=MIXER,name='H40-TLV Digital CH6 Out Volume'
numid=477,iface=MIXER,name='H40-TLV Digital CH7 Out Volume'
numid=478,iface=MIXER,name='H40-TLV Digital CH8 Out Volume'
numid=1678,iface=MIXER,name='H40-TLV IN1 Analog Mic Resistor'
numid=1679,iface=MIXER,name='H40-TLV IN2 Analog Mic Resistor'
numid=1680,iface=MIXER,name='H40-TLV IN3 Analog Mic Resistor'
numid=1681,iface=MIXER,name='H40-TLV IN4 Analog Mic Resistor'
numid=1657,iface=MIXER,name='H40-TLV MIC1 Analog Mux'
numid=1661,iface=MIXER,name='H40-TLV MIC1M Input Mux'
numid=1653,iface=MIXER,name='H40-TLV MIC1P Input Mux'
numid=1658,iface=MIXER,name='H40-TLV MIC2 Analog Mux'
numid=1662,iface=MIXER,name='H40-TLV MIC2M Input Mux'
numid=1654,iface=MIXER,name='H40-TLV MIC2P Input Mux'
numid=1659,iface=MIXER,name='H40-TLV MIC3 Analog Mux'
numid=1663,iface=MIXER,name='H40-TLV MIC3M Input Mux'
numid=1655,iface=MIXER,name='H40-TLV MIC3P Input Mux'
numid=1660,iface=MIXER,name='H40-TLV MIC4 Analog Mux'
numid=1664,iface=MIXER,name='H40-TLV MIC4M Input Mux'
numid=1656,iface=MIXER,name='H40-TLV MIC4P Input Mux'
numid=1682,iface=MIXER,name='H40-TLV PDM Clk Div Select'

but i was unable to set with this controls

amixer -c APE set 'H40-TLV Analog CH1 Mic Gain Volume' 100%
amixer: Unable to find simple control 'H40-TLV Analog CH1 Mic Gain Volume',0

Try below command

amixer -c APE cset name=“H40-TLV Analog CH1 Mic Gain Volume” volume_level

note, above quote is double quote

amixer -c APE cset name=“H40-TLV Analog CH1 Mic Gain Volume” 100%
amixer: Cannot find the given element from control hw:1

Ideally it should work, please cross check on the double quote used for the control names. Use other controls to cross check the command format works for other controls.

Ok this has worked!!

amixer -c APE cset name='H40-TLV Analog CH1 Mic Gain Volume' 100
numid=463,iface=MIXER,name='H40-TLV Analog CH1 Mic Gain Volume'
  ; type=INTEGER,access=rw---R--,values=1,min=0,max=42,step=0
  : values=42
  | dBscale-min=0.00dB,step=1.00dB,mute=0

But now when i trying to record it doesn’t seem to record anything, or at list i don’t now how to play it as a .wav file

arecord -D hw:1,0 -f cd -t wav -d 10 -c 4 test.wav
Recording WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Channels 4

test.zip (420.2 KB)

Please check the usecase examples section in the bsp document reference shared in my early comment.

Connect TLV codec I2Sx to ADMAIF2 and use hw:APE,1 . Also set all required controls for the TLV codec for the playback and capture before starting the usecase.

We are encountering issues while trying to configure the Jetson Xavier to push clocks to our component.


We connected the I2C channels directly to the Xavier 40-pin header. Additionally, we connected the I2S pins (SDOUT, BCLK, FSYNC) from the PCMD3140 directly to the 40-pin header on the Xavier, where they correspond to I2S2 as per the pin-gpio-expansion-header specification.
The goal is to configure the Xavier as the master device and have it push the clock to the BCLK pin.

We tried the following device tree configuration to enable the setup:

// SPDX-License-Identifier: GPL-2.0-only
/*
 * T194 p2822-0000 audio common DTSI file.
 *
 * Copyright (c) 2017-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 *
 */

#include <audio/tegra-platforms-audio-dai-links.dtsi>
#include <audio/tegra186-audio-dai-links.dtsi>
#include <audio/tegra186-audio-graph.dtsi>
#include <dt-bindings/gpio/tegra194-gpio.h>
#include <dt-bindings/audio/tegra194-audio.h>
#include <audio/tegra-platforms-audio-dmic3-5-switch.dtsi>
#include <dt-bindings/gpio/gpio.h>
/ {

	aconnect@2a41000 {
		status = "okay";

		agic-controller@2a41000 {
			status = "okay";
		};

		adsp@2993000 {
			status = "okay";
		};
	};

	i2c@c250000 {
		rt5658: rt5659.7-001a@1a {
			compatible = "realtek,rt5658";
			reg = <0x1a>;

			/* refer include/sound/rt5659.h for the values to be used */
			realtek,jd-src = <2>; /* RT5659_JD_HDA_HEADER */
			realtek,dmic1-data-pin = <0>; /* RT5659_DMIC1_NULL */
			realtek,dmic2-data-pin = <0>; /* RT5659_DMIC2_NULL */

			/* Codec IRQ output */
			interrupt-parent = <&tegra_main_gpio>;
			interrupts = <TEGRA194_MAIN_GPIO(S, 5) GPIO_ACTIVE_HIGH>;

			clocks = <&bpmp TEGRA194_CLK_AUD_MCLK>;
			clock-names = "mclk";

			#sound-dai-cells = <1>;

			sound-name-prefix = "CVB-RT";

			status = "okay";

			port {
				rt5658_ep: endpoint {
					remote-endpoint = <&i2s1_dap_ep>;
					mclk-fs = <256>;
					link-name = "rt565x-playback";
				};
			};
		};
	};

	// our Sound settings
	
	i2c@c240000 {
        #address-cells = <1>;
        #size-cells = <0>;
        status = "okay";

        tlvcodec: tlvcodec@4e {
            compatible = "ti,tlv320adc3140";
            reg = <0x4e>;
            #sound-dai-cells = <1>;

            ti,mic-bias-source = <0>;
            ti,vref-source = <0>;
            //ti,pdm-edge-select = <0 1 0 0>;
            
            ti,gpi-config = <4 5 0 0>;
            ti,gpio-config = <0 0>;
            ti,gpo-config-1 = <4 1>;
            
            //reset-gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>;
            
            	status = "okay";
            	sound-name-prefix = "H40-TLV";
            	
            	port {
			tlv_ep: endpoint {
				remote-endpoint = <&hdr40_snd_i2s_dap_ep>;
				link-name = "tlv-4-mic-array";
			};
		};
            	
        };
    };
i2s@2901000 {
    status = "okay";
};
	/* Default for all I2S is long fsync width(31) */
	aconnect@2a41000 {
		ahub {
			/* I2S4 in Short frame sync for BT SCO */
			i2s@2901300 {
				bclk-ratio = <4>;
			};
		};
	};

	tegra_acsl_audio: acsl_audio {
		status = "okay";
	};

	hda@3510000 {
		status = "okay";

		nvidia,model = "NVIDIA Jetson AGX Xavier HDA";
	};

	tegra_sound: sound {
		status = "okay";
		compatible = "nvidia,tegra186-ape";
		nvidia-audio-card,name = "NVIDIA Jetson AGX Xavier APE";
		clocks = <&bpmp_clks TEGRA194_CLK_PLLA>,
			 <&bpmp_clks TEGRA194_CLK_PLLA_OUT0>,
			 <&bpmp_clks TEGRA194_CLK_AUD_MCLK>;
		clock-names = "pll_a", "pll_a_out0", "extern1";
		assigned-clocks = <&bpmp_clks TEGRA194_CLK_AUD_MCLK>;
		assigned-clock-parents = <&bpmp_clks TEGRA194_CLK_PLLA_OUT0>;

		nvidia-audio-card,widgets =
			"Headphone",	"CVB-RT Headphone Jack",
			"Microphone",	"CVB-RT Mic Jack",
			"Speaker",	"CVB-RT Int Spk",
			"Microphone",	"CVB-RT Int Mic",
			"Microphone",	"H40-TLV Int Mic1",
			"Microphone",	"H40-TLV Int Mic2",
			"Microphone",	"H40-TLV Int Mic3",
			"Microphone",	"H40-TLV Int Mic4";
			"Speaker",	"H40-TLV Int Spk"; //?

		nvidia-audio-card,routing =
			"CVB-RT Headphone Jack",     "CVB-RT HPO L Playback",
			"CVB-RT Headphone Jack",     "CVB-RT HPO R Playback",
			"CVB-RT IN1P",               "CVB-RT Mic Jack",
			"CVB-RT IN2P",               "CVB-RT Mic Jack",
			"CVB-RT Int Spk",            "CVB-RT SPO Playback",
			"CVB-RT DMIC L1",            "CVB-RT Int Mic",
			"CVB-RT DMIC L2",            "CVB-RT Int Mic",
			"CVB-RT DMIC R1",            "CVB-RT Int Mic",
			"CVB-RT DMIC R2",            "CVB-RT Int Mic",
			"H40-TLV MIC1P",             "H40-TLV Int Mic1",
			"H40-TLV MIC1M",             "H40-TLV Int Mic1",
			"H40-TLV MIC2P",             "H40-TLV Int Mic2",
			"H40-TLV MIC2M",             "H40-TLV Int Mic2",
			"H40-TLV MIC3P",             "H40-TLV Int Mic3",
			"H40-TLV MIC3M",             "H40-TLV Int Mic3",
			"H40-TLV MIC4P",             "H40-TLV Int Mic4",
			"H40-TLV MIC4M",             "H40-TLV Int Mic4",
			"H40-TLV Int Spk",            "H40-TLV CH1_OUT",
			"H40-TLV Int Spk",            "H40-TLV CH2_OUT",
			"H40-TLV Int Spk",            "H40-TLV CH3_OUT",
			"H40-TLV Int Spk",            "H40-TLV CH4_OUT",
			"H40-TLV Int Spk",            "H40-TLV CH5_OUT",
			"H40-TLV Int Spk",            "H40-TLV CH6_OUT",
			"H40-TLV Int Spk",            "H40-TLV CH7_OUT",
			"H40-TLV Int Spk",            "H40-TLV CH8_OUT"; 

		nvidia-audio-card,mclk-fs = <256>;
	};

	tegra_sound_graph: sound_graph {
		compatible = "nvidia,tegra186-audio-graph-card";

		/*
		 * Tegra audio graph card is based on uptream generic audio
		 * graph sound card. In future there is plan to use this
		 * as default sound card.
		 */
		status = "disabled";

		dais = /* ADMAIF (FE) Ports */
		       <&admaif1_port>, <&admaif2_port>, <&admaif3_port>,
		       <&admaif4_port>, <&admaif5_port>, <&admaif6_port>,
		       <&admaif7_port>, <&admaif8_port>, <&admaif9_port>,
		       <&admaif10_port>, <&admaif11_port>, <&admaif12_port>,
		       <&admaif13_port>, <&admaif14_port>, <&admaif15_port>,
		       <&admaif16_port>, <&admaif17_port>, <&admaif18_port>,
		       <&admaif19_port>, <&admaif20_port>,

		       /* ADSP (FE) Ports */
		       <&adsp_pcm1_port>, <&adsp_pcm2_port>,
		       <&adsp_compr1_port>, <&adsp_compr2_port>,

		       /* XBAR I/O ports */
		       <&xbar_i2s1_port>, <&xbar_i2s2_port>, <&xbar_i2s3_port>,
		       <&xbar_i2s4_port>, <&xbar_i2s5_port>, <&xbar_i2s6_port>,

		       <&xbar_dmic1_port>, <&xbar_dmic2_port>,
		       <&xbar_dmic3_port>, <&xbar_dmic4_port>,

		       <&xbar_dspk1_port>, <&xbar_dspk2_port>,

		       /* XBAR HW accelerator ports */
		       <&xbar_sfc1_in_port>, <&xbar_sfc2_in_port>,
		       <&xbar_sfc3_in_port>, <&xbar_sfc4_in_port>,

		       <&xbar_mvc1_in_port>, <&xbar_mvc2_in_port>,

		       <&xbar_afc1_in_port>, <&xbar_afc2_in_port>,
		       <&xbar_afc3_in_port>, <&xbar_afc4_in_port>,
		       <&xbar_afc5_in_port>, <&xbar_afc6_in_port>,

		       <&xbar_asrc_in1_port>, <&xbar_asrc_in2_port>,
		       <&xbar_asrc_in3_port>, <&xbar_asrc_in4_port>,
		       <&xbar_asrc_in5_port>, <&xbar_asrc_in6_port>,
		       <&xbar_asrc_in7_port>, <&xbar_arad_port>,

		       <&xbar_mixer_in1_port>, <&xbar_mixer_in2_port>,
		       <&xbar_mixer_in3_port>, <&xbar_mixer_in4_port>,
		       <&xbar_mixer_in5_port>, <&xbar_mixer_in6_port>,
		       <&xbar_mixer_in7_port>, <&xbar_mixer_in8_port>,
		       <&xbar_mixer_in9_port>, <&xbar_mixer_in10_port>,

		       <&xbar_ope1_in_port>,

		       <&xbar_amx1_in1_port>, <&xbar_amx1_in2_port>,
		       <&xbar_amx1_in3_port>, <&xbar_amx1_in4_port>,
		       <&xbar_amx2_in1_port>, <&xbar_amx2_in2_port>,
		       <&xbar_amx2_in3_port>, <&xbar_amx2_in4_port>,
		       <&xbar_amx3_in1_port>, <&xbar_amx3_in2_port>,
		       <&xbar_amx3_in3_port>, <&xbar_amx3_in4_port>,
		       <&xbar_amx4_in1_port>, <&xbar_amx4_in2_port>,
		       <&xbar_amx4_in3_port>, <&xbar_amx4_in4_port>,

		       <&xbar_adx1_in_port>, <&xbar_adx2_in_port>,
		       <&xbar_adx3_in_port>, <&xbar_adx4_in_port>,

		       /* BE I/O Ports */
		       <&i2s1_port>, <&i2s2_port>, <&i2s3_port>,
		       <&i2s4_port>, <&i2s5_port>, <&i2s6_port>,

		       <&dmic1_port>, <&dmic2_port>, <&dmic3_port>,
		       <&dmic4_port>,

		       <&dspk1_port>, <&dspk2_port>,

		       /* BE HW accelerator ports */
		       <&sfc1_out_port>, <&sfc2_out_port>,
		       <&sfc3_out_port>, <&sfc4_out_port>,

		       <&mvc1_out_port>, <&mvc2_out_port>,

		       <&afc1_out_port>, <&afc2_out_port>,
		       <&afc3_out_port>, <&afc4_out_port>,
		       <&afc5_out_port>, <&afc6_out_port>,

		       <&asrc_out1_port>, <&asrc_out2_port>,
		       <&asrc_out3_port>, <&asrc_out4_port>,
		       <&asrc_out5_port>, <&asrc_out6_port>,

		       <&mixer_out1_port>, <&mixer_out2_port>,
		       <&mixer_out3_port>, <&mixer_out4_port>,
		       <&mixer_out5_port>,

		       <&ope1_out_port>,

		       <&amx1_out_port>, <&amx2_out_port>,
		       <&amx3_out_port>, <&amx4_out_port>,

		       <&adx1_out1_port>, <&adx1_out2_port>,
		       <&adx1_out3_port>, <&adx1_out4_port>,
		       <&adx2_out1_port>, <&adx2_out2_port>,
		       <&adx2_out3_port>, <&adx2_out4_port>,
		       <&adx3_out1_port>, <&adx3_out2_port>,
		       <&adx3_out3_port>, <&adx3_out4_port>,
		       <&adx4_out1_port>, <&adx4_out2_port>,
		       <&adx4_out3_port>, <&adx4_out4_port>,

		       /* ADSP related ports */
		       <&adsp_admaif1_port>, <&adsp_admaif2_port>,
		       <&adsp_admaif3_port>, <&adsp_admaif4_port>,
		       <&adsp_admaif5_port>, <&adsp_admaif6_port>,
		       <&adsp_admaif7_port>, <&adsp_admaif8_port>,
		       <&adsp_admaif9_port>, <&adsp_admaif10_port>,
		       <&adsp_admaif11_port>, <&adsp_admaif12_port>,
		       <&adsp_admaif13_port>, <&adsp_admaif14_port>,
		       <&adsp_admaif15_port>, <&adsp_admaif16_port>,
		       <&adsp_admaif17_port>, <&adsp_admaif18_port>,
		       <&adsp_admaif19_port>, <&adsp_admaif20_port>,

		       <&admaif1_codec_port>, <&admaif2_codec_port>,
		       <&admaif3_codec_port>, <&admaif4_codec_port>,
		       <&admaif5_codec_port>, <&admaif6_codec_port>,
		       <&admaif7_codec_port>, <&admaif8_codec_port>,
		       <&admaif9_codec_port>, <&admaif10_codec_port>,
		       <&admaif11_codec_port>, <&admaif12_codec_port>,
		       <&admaif13_codec_port>, <&admaif14_codec_port>,
		       <&admaif15_codec_port>, <&admaif16_codec_port>,
		       <&admaif17_codec_port>, <&admaif18_codec_port>,
		       <&admaif19_codec_port>, <&admaif20_codec_port>;

		label = "NVIDIA Jetson AGX Xavier APE";

		clocks = <&bpmp_clks TEGRA194_CLK_PLLA>,
			 <&bpmp_clks TEGRA194_CLK_PLLA_OUT0>;
		clock-names = "pll_a", "plla_out0";
		assigned-clocks = <&bpmp_clks TEGRA194_CLK_AUD_MCLK>;
		assigned-clock-parents = <&bpmp_clks TEGRA194_CLK_PLLA_OUT0>;

		widgets = "Headphone",	"CVB-RT Headphone Jack",
			  "Microphone", "CVB-RT Mic Jack",
			  "Speaker",	"CVB-RT Int Spk",
			  "Microphone", "CVB-RT Int Mic";

		routing = "CVB-RT Headphone Jack", "CVB-RT HPO L Playback",
			  "CVB-RT Headphone Jack", "CVB-RT HPO R Playback",
			  "CVB-RT IN1P",	   "CVB-RT Mic Jack",
			  "CVB-RT IN2P",	   "CVB-RT Mic Jack",
			  "CVB-RT Int Spk",	   "CVB-RT SPO Playback",
			  "CVB-RT DMIC L1",	   "CVB-RT Int Mic",
			  "CVB-RT DMIC L2",	   "CVB-RT Int Mic",
			  "CVB-RT DMIC R1",	   "CVB-RT Int Mic",
			  "CVB-RT DMIC R2",	   "CVB-RT Int Mic";

		/*
		 * For codec2codec based DAI link design this is required.
		 * For DPCM based design, this is optional and instead
		 * it will be picked from codec port node.
		 */
		mclk-fs = <256>;
	};
};

/*
 * Default config for all I2S dai links are
 * format = "i2s", bitclock-slave, frame-slave,
 * bitclock-noninversion, frame-noninversion,
 * Any change from default needs override on
 * platform specific files.
 */

/* Override with Codec entries */
&i2s1_to_codec {
	link-name = "rt565x-playback";
	codec {
		sound-dai = <&rt5658 0>;
		prefix = "CVB-RT";
	};
};


hdr40_snd_link_i2s: &i2s2_to_codec {
	link-name = "tlv-4-mic-array";
	/*
		format = "dsp_a";
	*/
		//bitclock-master;
		//frame-master;
	
	codec {
		sound-dai = <&tlvcodec 0>;
		prefix = "H40-TLV";
		clock-frequency = <44100>;
	};
 };

/* Override with BT SCO entries */
&i2s4_to_codec {
	format = "dsp_a";
	bitclock-inversion;
};

/* Audio graph related bindings */
&i2s1_dap_ep {
	remote-endpoint = <&rt5658_ep>;
};

&i2s4_dap_ep {
	dai-format = "dsp_a";
	bitclock-inversion;
};

hdr40_snd_i2s_dap_ep: &i2s2_dap_ep { 
	remote-endpoint = <&tlv_ep>; 
			//bitclock-master;
			//frame-master;

};

We also entered the following command into amixer as described in the examples-i2s documentation:

amixer -c APE cset name='ADMAIF2 Mux' 'I2S2'
numid=1308,iface=MIXER,name='ADMAIF2 Mux'
  ; type=ENUMERATED,access=rw------,values=1,items=81
  ; Item #0 'None'
  ; Item #1 'ADMAIF1'
  ; Item #2 'ADMAIF2'
  ; Item #3 'ADMAIF3'
  ; Item #4 'ADMAIF4'
  ; Item #5 'ADMAIF5'
  ; Item #6 'ADMAIF6'
  ; Item #7 'ADMAIF7'
  ; Item #8 'ADMAIF8'
  ; Item #9 'ADMAIF9'
  ; Item #10 'ADMAIF10'
  ; Item #11 'ADMAIF11'
  ; Item #12 'ADMAIF12'
  ; Item #13 'ADMAIF13'
  ; Item #14 'ADMAIF14'
  ; Item #15 'ADMAIF15'
  ; Item #16 'ADMAIF16'
  ; Item #17 'I2S1'
  ; Item #18 'I2S2'
  ; Item #19 'I2S3'
  ; Item #20 'I2S4'
  ; Item #21 'I2S5'
  ; Item #22 'I2S6'
  ; Item #23 'SFC1'
  ; Item #24 'SFC2'
  ; Item #25 'SFC3'
  ; Item #26 'SFC4'
  ; Item #27 'MIXER1 TX1'
  ; Item #28 'MIXER1 TX2'
  ; Item #29 'MIXER1 TX3'
  ; Item #30 'MIXER1 TX4'
  ; Item #31 'MIXER1 TX5'
  ; Item #32 'AMX1'
  ; Item #33 'AMX2'
  ; Item #34 'AMX3'
  ; Item #35 'AMX4'
  ; Item #36 'ARAD1'
  ; Item #37 'AFC1'
  ; Item #38 'AFC2'
  ; Item #39 'AFC3'
  ; Item #40 'AFC4'
  ; Item #41 'AFC5'
  ; Item #42 'AFC6'
  ; Item #43 'OPE1'
  ; Item #44 'SPKPROT1'
  ; Item #45 'MVC1'
  ; Item #46 'MVC2'
  ; Item #47 'IQC1-1'
  ; Item #48 'IQC1-2'
  ; Item #49 'IQC2-1'
  ; Item #50 'IQC2-2'
  ; Item #51 'DMIC1'
  ; Item #52 'DMIC2'
  ; Item #53 'DMIC3'
  ; Item #54 'DMIC4'
  ; Item #55 'ADX1 TX1'
  ; Item #56 'ADX1 TX2'
  ; Item #57 'ADX1 TX3'
  ; Item #58 'ADX1 TX4'
  ; Item #59 'ADX2 TX1'
  ; Item #60 'ADX2 TX2'
  ; Item #61 'ADX2 TX3'
  ; Item #62 'ADX2 TX4'
  ; Item #63 'ADX3 TX1'
  ; Item #64 'ADX3 TX2'
  ; Item #65 'ADX3 TX3'
  ; Item #66 'ADX3 TX4'
  ; Item #67 'ADX4 TX1'
  ; Item #68 'ADX4 TX2'
  ; Item #69 'ADX4 TX3'
  ; Item #70 'ADX4 TX4'
  ; Item #71 'ADMAIF17'
  ; Item #72 'ADMAIF18'
  ; Item #73 'ADMAIF19'
  ; Item #74 'ADMAIF20'
  ; Item #75 'ASRC1 TX1'
  ; Item #76 'ASRC1 TX2'
  ; Item #77 'ASRC1 TX3'
  ; Item #78 'ASRC1 TX4'
  ; Item #79 'ASRC1 TX5'
  ; Item #80 'ASRC1 TX6'
  : values=18

Next, we attempted to record audio using the following command:

arecord -D hw:APE,1 -f cd -t wav -d 5 -c 2 test.wav
Recording WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Channels 4

Despite the correct configuration and command, the oscilloscope showed no clock signal on either the BCLK or PDMCLK pins. However, the I2C pin showed activity, indicating that communication was happening.

Additionally, when attempting to record using a single channel:

arecord -D hw:APE,1 -f cd -t wav -d 5 -c 1 test.wav
Recording WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
arecord: pcm_read:2178: read error: Input/output error

We tried configuring the device tree based on your suggestions from this arecord-fails-with-pcm-read-error thread, but we are still facing issues.

We need further guidance on how to properly configure the Jetson Xavier to act as the master and provide the BCLK signal.

We’ve also been reviewing the TI driver and forum posts. Some of the widgets defined in the driver (line 352) seem relevant, but we are unsure if the routing to the Xavier parts is correct.

/* Output Mixer */
static const struct snd_kcontrol_new adcx140_output_mixer_controls[] = {
	SOC_DAPM_SINGLE("Digital CH1 Switch", 0, 0, 0, 0),
	SOC_DAPM_SINGLE("Digital CH2 Switch", 0, 0, 0, 0),
	SOC_DAPM_SINGLE("Digital CH3 Switch", 0, 0, 0, 0),
	SOC_DAPM_SINGLE("Digital CH4 Switch", 0, 0, 0, 0),
};

static const struct snd_soc_dapm_widget adcx140_dapm_widgets[] = {
	/* Analog Differential Inputs */
	SND_SOC_DAPM_INPUT("MIC1P"),
	SND_SOC_DAPM_INPUT("MIC1M"),
	SND_SOC_DAPM_INPUT("MIC2P"),
	SND_SOC_DAPM_INPUT("MIC2M"),
	SND_SOC_DAPM_INPUT("MIC3P"),
	SND_SOC_DAPM_INPUT("MIC3M"),
	SND_SOC_DAPM_INPUT("MIC4P"),
	SND_SOC_DAPM_INPUT("MIC4M"),

	SND_SOC_DAPM_OUTPUT("CH1_OUT"),
	SND_SOC_DAPM_OUTPUT("CH2_OUT"),
	SND_SOC_DAPM_OUTPUT("CH3_OUT"),
	SND_SOC_DAPM_OUTPUT("CH4_OUT"),
	SND_SOC_DAPM_OUTPUT("CH5_OUT"),
	SND_SOC_DAPM_OUTPUT("CH6_OUT"),
	SND_SOC_DAPM_OUTPUT("CH7_OUT"),
	SND_SOC_DAPM_OUTPUT("CH8_OUT"),

	SND_SOC_DAPM_MIXER("Output Mixer", SND_SOC_NOPM, 0, 0,
		&adcx140_output_mixer_controls[0],
		ARRAY_SIZE(adcx140_output_mixer_controls)),

	/* Input Selection to MIC_PGA */
	SND_SOC_DAPM_MUX("MIC1P Input Mux", SND_SOC_NOPM, 0, 0,
			 &adcx140_dapm_mic1p_control),
	SND_SOC_DAPM_MUX("MIC2P Input Mux", SND_SOC_NOPM, 0, 0,
			 &adcx140_dapm_mic2p_control),
	SND_SOC_DAPM_MUX("MIC3P Input Mux", SND_SOC_NOPM, 0, 0,
			 &adcx140_dapm_mic3p_control),
	SND_SOC_DAPM_MUX("MIC4P Input Mux", SND_SOC_NOPM, 0, 0,
			 &adcx140_dapm_mic4p_control),

	/* Input Selection to MIC_PGA */
	SND_SOC_DAPM_MUX("MIC1 Analog Mux", SND_SOC_NOPM, 0, 0,
			 &adcx140_dapm_mic1_analog_control),
	SND_SOC_DAPM_MUX("MIC2 Analog Mux", SND_SOC_NOPM, 0, 0,
			 &adcx140_dapm_mic2_analog_control),
	SND_SOC_DAPM_MUX("MIC3 Analog Mux", SND_SOC_NOPM, 0, 0,
			 &adcx140_dapm_mic3_analog_control),
	SND_SOC_DAPM_MUX("MIC4 Analog Mux", SND_SOC_NOPM, 0, 0,
			 &adcx140_dapm_mic4_analog_control),

	SND_SOC_DAPM_MUX("MIC1M Input Mux", SND_SOC_NOPM, 0, 0,
			 &adcx140_dapm_mic1m_control),
	SND_SOC_DAPM_MUX("MIC2M Input Mux", SND_SOC_NOPM, 0, 0,
			 &adcx140_dapm_mic2m_control),
	SND_SOC_DAPM_MUX("MIC3M Input Mux", SND_SOC_NOPM, 0, 0,
			 &adcx140_dapm_mic3m_control),
	SND_SOC_DAPM_MUX("MIC4M Input Mux", SND_SOC_NOPM, 0, 0,
			 &adcx140_dapm_mic4m_control),

	SND_SOC_DAPM_PGA("MIC_GAIN_CTL_CH1", SND_SOC_NOPM, 0, 0, NULL, 0),
	SND_SOC_DAPM_PGA("MIC_GAIN_CTL_CH2", SND_SOC_NOPM, 0, 0, NULL, 0),
	SND_SOC_DAPM_PGA("MIC_GAIN_CTL_CH3", SND_SOC_NOPM, 0, 0, NULL, 0),
	SND_SOC_DAPM_PGA("MIC_GAIN_CTL_CH4", SND_SOC_NOPM, 0, 0, NULL, 0),

	SND_SOC_DAPM_ADC("CH1_ADC", "CH1 Capture", ADCX140_IN_CH_EN, 7, 0),
	SND_SOC_DAPM_ADC("CH2_ADC", "CH2 Capture", ADCX140_IN_CH_EN, 6, 0),
	SND_SOC_DAPM_ADC("CH3_ADC", "CH3 Capture", ADCX140_IN_CH_EN, 5, 0),
	SND_SOC_DAPM_ADC("CH4_ADC", "CH4 Capture", ADCX140_IN_CH_EN, 4, 0),

	SND_SOC_DAPM_ADC("CH1_DIG", "CH1 Capture", ADCX140_IN_CH_EN, 7, 0),
	SND_SOC_DAPM_ADC("CH2_DIG", "CH2 Capture", ADCX140_IN_CH_EN, 6, 0),
	SND_SOC_DAPM_ADC("CH3_DIG", "CH3 Capture", ADCX140_IN_CH_EN, 5, 0),
	SND_SOC_DAPM_ADC("CH4_DIG", "CH4 Capture", ADCX140_IN_CH_EN, 4, 0),
	SND_SOC_DAPM_ADC("CH5_DIG", "CH5 Capture", ADCX140_IN_CH_EN, 3, 0),
	SND_SOC_DAPM_ADC("CH6_DIG", "CH6 Capture", ADCX140_IN_CH_EN, 2, 0),
	SND_SOC_DAPM_ADC("CH7_DIG", "CH7 Capture", ADCX140_IN_CH_EN, 1, 0),
	SND_SOC_DAPM_ADC("CH8_DIG", "CH8 Capture", ADCX140_IN_CH_EN, 0, 0),

We previously posted a question in the TI forum, where the advice was to reach out here for further help.
We would appreciate your help and guidance in properly configuring the Xavier as the master and resolving the clocking issues.

Thank you for your support!

Seems error when recorded on I2S2. Please try with below commands and confirm if I2S2 SCLK clock is measurable on scope.

amixer -c APE cset name=‘ADMAIF2 Mux’ ‘I2S2’
amixer -c APE cset name=‘I2S2 BCLK Ratio’ 2
arecord -D hw:APE,1 -f cd -t wav -d 50 -c 1 test.wav

We have done the commends, and didn’t see any clock movement on I2S2 SCLK from the 40 header pin side.