How to enable dummy audio codec in NVIDIA Jetson TX2 NX(I2S0)?

Hi all,

I want to interface I2S0 of TX2 NX with an audio processor .I am setting audio processor as slave and NVIDIA as master.NVIDIA needs to communicate with audio processor by outputting bclk and fsync.I am trying to create a dummy codec for this.How can we do the same?

Hi joseneethu75,

Dummy card is available by default under name “tegrasndt186ref” and TX2 NX I2S’s are in master mode by default.

Assuming that your audio processor is able to handle the signals it receives, to enable playback on TX2 NX I2S, need to follow below steps:

  1. Enable pinmux for I2S1
    sudo /opt/nvidia/jetson-io/config-by-function.py -o dtb i2s1
    sudo reboot

Above method is mentioned at
https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/hw_setup_jetson_io.html# for the same

  1. Set mixer settings and initiate playback

amixer -c tegrasndt186ref cset name=“I2S1 Mux” ADMAIF1
aplay -D hw:tegrasndt186ref,0 <playback.wav>

Above will start sending signals on I2S1 SCLK, FS, DOUT which can be connected to your audio processor and handled as appropriate or you can probe the lines with oscilloscope to confirm

Also encourage you to refer relevant documentation at https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/asoc_driver.19.1.html# for things that are not clear

Thanks

Hi @atalambedu ,

Thanks for the response. I am using I2S0 of Jetson TX2 NX for interfacing with the audio processor.So do we need any DT configuration for the same?I tried for I2S1 .But system is not booting up after reboot.We are testing in the custom carrier board

Hi @atalambedu ,

I have taken 193(i2s0_dout),195,197 and 199 of TX2 NX for checking the I2S signals . I2S0 was initially configured as GPIOs .Hence it is configured as I2S signals by changing the pinmux table of TX2 NX. Generated .cfg files ,flashed the device and checked by probing the lines.But while playing a wav file i2s0 is not outputting sclk,ws,and dout. But aplay is listing dummy codec. Please help us to resolve the issue.

Thanks in advance

Hi joseneethu75,

Which card was used for playback?

Use card 2 for playback (from above list) after setting mixer controls as per my earlier comment and let us know if you still don’t see data on I2S lines

Regarding “But aplay is listing dummy codec”. Did you do anything explicit to enable the Dummy card (like enabling config while building kernel). Its not necessary. You could use "tegrasndt186ref " for your usecase.

Thanks

Hi @atalambedu ,

I am getting this while using amixer command.
amixer -c tegrasndt186ref cset name=“I2S1 Mux” ADMAIF1
amixer: Cannot find the given element from control hw:2

why we are getting this?

Hi @atalambedu ,

Regarding “Did you do anything explicit to enable the Dummy card (like enabling config while building kernel)” ,yes I have enabled dummy card explicitly in the config file.I removed it and flashed the device again with the pinmux changes.Following are list of aplay

**** List of PLAYBACK Hardware Devices ****
card 0: tegrahda [tegra-hda], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: tegrahda [tegra-hda], device 7: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 0: ADMAIF1 CIF ADMAIF1-0
Subdevices: 0/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 1: ADMAIF2 CIF ADMAIF2-1
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 2: ADMAIF3 CIF ADMAIF3-2
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 3: ADMAIF4 CIF ADMAIF4-3
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 4: ADMAIF5 CIF ADMAIF5-4
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 5: ADMAIF6 CIF ADMAIF6-5
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 6: ADMAIF7 CIF ADMAIF7-6
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 7: ADMAIF8 CIF ADMAIF8-7
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 8: ADMAIF9 CIF ADMAIF9-8
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 9: ADMAIF10 CIF ADMAIF10-9
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 10: ADMAIF11 CIF ADMAIF11-10
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 11: ADMAIF12 CIF ADMAIF12-11
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 12: ADMAIF13 CIF ADMAIF13-12
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 13: ADMAIF14 CIF ADMAIF14-13
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 14: ADMAIF15 CIF ADMAIF15-14
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 15: ADMAIF16 CIF ADMAIF16-15
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 16: ADMAIF17 CIF ADMAIF17-16
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 17: ADMAIF18 CIF ADMAIF18-17
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 18: ADMAIF19 CIF ADMAIF19-18
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 19: ADMAIF20 CIF ADMAIF20-19
Subdevices: 1/1
Subdevice #0: subdevice #0

amixer -c tegrasndt186ref cset name=“I2S1 Mux” ADMAIF1 is showing the following error
amixer: Cannot find the given element from control hw:1
It is not outputting sclk and ws
Could you please help me on this?

Hi joseneethu75,

Use below command instead. The quotes have been formatted incorrectly earlier

amixer -c tegrasndt186ref cset name="I2S1 Mux" ADMAIF1

If SCLK and WS are still not seen from I2S1, ensure pinmux configuration is as below

cat /sys/kernel/debug/tegra_pinctrl_reg | grep -i dap1
Bank: 0 Reg: 0x02431028 Val: 0x00000440 -> dap1_fs_pj3
Bank: 0 Reg: 0x02431030 Val: 0x00000450 -> dap1_din_pj2
Bank: 0 Reg: 0x02431038 Val: 0x00000400 -> dap1_dout_pj1
Bank: 0 Reg: 0x02431040 Val: 0x00000440 -> dap1_sclk_pj0

Thanks

Hi @atalambedu ,

I am not getting SCLK and WS .I checked cat /sys/kernel/debug/tegra_pinctrl_reg | grep -i dap1. Output is as given below.I am using I2S0 .pins are 193,195,197 and 199 of TX2 NX

Bank: 0 Reg: 0x02431028 Val: 0x00000454 → dap1_fs_pj3
Bank: 0 Reg: 0x02431030 Val: 0x00000454 → dap1_din_pj2
Bank: 0 Reg: 0x02431038 Val: 0x00000454 → dap1_dout_pj1
Bank: 0 Reg: 0x02431040 Val: 0x00000454 → dap1_sclk_pj0

Please help

Hi joseneethu75,

Above pinmux config is incorrect. Please recheck cfg generation.

You can alternatively try setting pinmux with below commands and see if it helps

sudo apt-get install -y busybox
busybox devmem 0x02431028 32 0x00000440
busybox devmem 0x02431030 32 0x00000450
busybox devmem 0x02431038 32 0x00000400
busybox devmem 0x02431040 32 0x00000440

Thanks

Hi @atalambedu ,

Thank you .Let me check and update you

Hi @atalambedu ,

It is working fine after writing the registers.Could you please tell me the pinmux changes required for getting the above register values? I have done the following changes for I2S0.

image

Could you please confirm whether the changes are correct or not?

Above settings seem fine and are resulting in below config at my end

pinmux.0x02431040 = 0x00000444; # dap1_sclk_pj0: i2s1, pull-down, tristate-disable, input-enable, lpdr-disable
pinmux.0x02431038 = 0x00000404; # dap1_dout_pj1: i2s1, pull-down, tristate-disable, input-disable, lpdr-disable
pinmux.0x02431030 = 0x00000454; # dap1_din_pj2: i2s1, pull-down, tristate-enable, input-enable, lpdr-disable
pinmux.0x02431028 = 0x00000444; # dap1_fs_pj3: i2s1, pull-down, tristate-disable, input-enable, lpdr-disable

Please regenerate cfg at your end

Hi @atalambedu ,

cfg file was not updated properly.Now it is working fine.Thank you so much for your support.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.