I2S not working on Jetson Nano Devkit

Hi, I’m trying to setup i2s4 on a Jetson Nano Devkit (p3448 + p3449 b00) in order to control a HiLetgo PCM5102 module.

  1. I have enabled i2s4 using jetson-io.py.

  2. And then connected i2s4 to ADMAIF1 using amixer -c tegrasndt210ref cset name='I2S4 Mux' ADMAIF1.

  3. I set up a logic analyzer probes on pin 12, 35 and 39.

But when I launch speaker-test -D hw:tegrasndt210ref,0 -r 48000 -c 2 -F S16_LE -t sine, I see no signal on my logic analyzer…

What have I missed ? Thanks in advance !

Hi ! Bumping this subject !

Hi Valentin,
Can you attach the log after running speaker-test.

Refer the below right probe point pins for I2S mapping on 40 pin header

I2S4_FS 35
I2S4_SCLK 12
I2S4_SDIN 38
I2S4_SDOUT 40

Cross check the pinmux of I2S4 on target. I assume none of the I2S signal are coming out?. If so it could be pinmux issue, provide the below dump log

sudo grep dap4 /sys/kernel/debug/tegra_pinctrl_reg

Log from speaker-test -r 48000 -F S16_LE -c 2 -twav -D plughw:CAARD=tegrasndt210ref,DEV=0 :


speaker-test 1.1.3

Playback device is plughw:CARD=tegrasndt210ref,DEV=0
Stream parameters are 48000Hz, S16_LE, 2 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 32 to 8192
Period size range from 32 to 4096
Using max buffer size 8192
Periods = 4
was set period_size = 2048
was set buffer_size = 8192
 0 - Front Left
 1 - Front Right
Time per period = 2,860507
 0 - Front Left
 1 - Front Right
Time per period = 3,026817
 0 - Front Left
 1 - Front Right
Time per period = 2,988541
 0 - Front Left
 1 - Front Right

The output of sudo grep dap4 /sys/kernel/debug/tegra_pinctrl_reg :

Bank: 1 Reg: 0x70003144 Val: 0x00000044 -> dap4_fs_pj4
Bank: 1 Reg: 0x70003148 Val: 0x00000054 -> dap4_din_pj5
Bank: 1 Reg: 0x7000314c Val: 0x00000004 -> dap4_dout_pj6
Bank: 1 Reg: 0x70003150 Val: 0x00000044 -> dap4_sclk_pj7

The output of sudo cat /sys/kernel/debug/tegra_gpio :

Name:Bank:Port CNF OE OUT IN INT_STA INT_ENB INT_LVL
 A: 0:0 64 40 40 04 00 00 000000
 B: 0:1 f0 00 00 80 00 00 000000
 C: 0:2 1f 00 00 18 00 00 000000
 D: 0:3 00 00 00 00 00 00 000000
 E: 1:0 40 00 00 00 00 00 000000
 F: 1:1 00 00 00 00 00 00 000000
 G: 1:2 0c 00 00 04 00 00 000000
 H: 1:3 fd 99 00 60 00 00 000000
 I: 2:0 07 07 03 02 00 00 000000
 J: 2:1 f0 00 00 10 00 00 000000
 K: 2:2 00 00 00 00 00 00 000000
 L: 2:3 00 00 00 00 00 00 000000
 M: 3:0 00 00 00 00 00 00 000000
 N: 3:1 00 00 00 00 00 00 000000
 O: 3:2 00 00 00 00 00 00 000000
 P: 3:3 00 00 00 00 00 00 000000
 Q: 4:0 00 00 00 00 00 00 000000
 R: 4:1 00 00 00 00 00 00 000000
 S: 4:2 a0 80 00 00 00 00 000000
 T: 4:3 01 01 00 00 00 00 000000
 U: 5:0 00 00 00 00 00 00 000000
 V: 5:1 01 00 00 00 00 00 000000
 W: 5:2 00 00 00 00 00 00 000000
 X: 5:3 78 08 08 70 00 60 606000
 Y: 6:0 06 00 00 02 00 00 000000
 Z: 6:1 0f 08 08 04 00 06 020600
AA: 6:2 00 00 00 00 00 00 000000
BB: 6:3 01 00 00 00 00 00 000000
CC: 7:0 92 80 80 12 00 12 121200
DD: 7:1 01 00 00 01 00 00 000000
EE: 7:2 00 00 00 00 00 00 000000
FF: 7:3 00 00 00 00 00 00 000000

So it seems that the pinmux is not correctly set ! I found on the forum that during the boot, I can directly change the pinmux registers so I do the following at boot time:


mw 0x70003144 0x6044
mw 0x70003148 0x6044
mw 0x7000314c 0x6044
mw 0x70003150 0x6044
mw 0x6000d204 0

Now, it works, I receive the correct signals on my logic analyzer ! The problem is that it’s not persistent through reboot… jetson-io doesn’t seem to properly configure the device tree for the pinmux.

Here is the generated device tree:
kernel_tegra210-p3448-0000-p3449-0000-b00-user-custom.zip (41.7 KB)

Could you explain how to modify this device tree so it correctly enables the pinmux ?

Thanks !

Thats good news you could able to see the signals coming out.

About persistent issue, Did you followed the steps mentioned @ https://docs.nvidia.com/jetson/archives/l4t-archived/l4t-3276/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/hw_setup_jetson_io.html#

This should help you.

Hi ! As per my first message, yes I did. It seems that jetson-io doesnt properly configure the pinmux (which is the reason for this thread). You can refer to my device tree posted above to examine the device tree generated by jetson io.

Hi Valentin,
Alternatively, you can try modifying the DT directly for this, Can you give a try with the below changes in DT (tegra210-porg-p3448-common.dtsi)

gpio@6000d000 {
	40pin_audio_pinmux: audio_pins {
		/* For I2S4 */
		gpio-hog;
		function;
		gpios = <
			TEGRA_GPIO(J, 4) 0
			TEGRA_GPIO(J, 5) 0
			TEGRA_GPIO(J, 6) 0
			TEGRA_GPIO(J, 7) 0
			TEGRA_GPIO(BB, 0) 0
			>;
		label = "I2S4_LRCLK", "I2S4_SDIN", "I2S4_SDOUT",
			"I2S4_CLK", "AUDIO_MCLK";

		status = "okay";
	};
};

Also please change “nvidia,function” entries @ tegra210-porg-pinmux-p3448-0000-b00.dtsi

      dap4_din_pj5 {
			nvidia,pins = "dap4_din_pj5";
			nvidia,function = "i2s4b";
			nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
			nvidia,tristate = <TEGRA_PIN_DISABLE>;
			nvidia,enable-input = <TEGRA_PIN_ENABLE>;
		};

		dap4_dout_pj6 {
			nvidia,pins = "dap4_dout_pj6";
			nvidia,function = "i2s4b";
			nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
			nvidia,tristate = <TEGRA_PIN_DISABLE>;
			nvidia,enable-input = <TEGRA_PIN_ENABLE>;
		};

		dap4_fs_pj4 {
			nvidia,pins = "dap4_fs_pj4";
			nvidia,function = "i2s4b";
			nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
			nvidia,tristate = <TEGRA_PIN_DISABLE>;
			nvidia,enable-input = <TEGRA_PIN_ENABLE>;
		};

		dap4_sclk_pj7 {
			nvidia,pins = "dap4_sclk_pj7";
			nvidia,function = "i2s4b";
			nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
			nvidia,tristate = <TEGRA_PIN_DISABLE>;
			nvidia,enable-input = <TEGRA_PIN_ENABLE>;
		};

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