I2S Working on TX2 but not TX1

We are trying to use two Adafruit I2S MEMS Microphones to record audio. Following this post I am able to get audio from the devices on our TX2 development boards, but not on our TX1 development boards. What do I need to do to get these working on the TX1 also?

I’ve tried the following:

amixer -c tegrasndt210ref sset "ADMAIF1 Mux" "I2S1"
arecord -D hw:tegrasndt210ref,0 -r 48000 -f S32_LE -c 2 -d 10 cap.wav

There are no errors, I just get 0 for the data.

Thanks!

Hello!

Please can you see this comment and let me know if this helps …

https://devtalk.nvidia.com/default/topic/1037219/jetson-tx1/pmodi2s-/post/5269691/#5269691

Regards,
Jon

Here is the pin dump without the change. Port B GPIO_CNF is set to 0xf as you pointed out.

dax@hydrogen:~$ sudo cat /sys/kernel/debug/tegra_gpio
0:0 24 00 00 04 00 00 000000
<b>0:1 0f 00 00 00 00 00 000000</b>
0:2 1f 00 00 00 00 00 000000
0:3 00 00 00 00 00 00 000000
1:0 70 00 00 00 00 00 000000
1:1 00 00 00 00 00 00 000000
1:2 00 00 00 00 00 00 000000
1:3 ff 1b 03 40 00 00 002024
2:0 0f 0d 05 02 00 00 000000
2:1 00 00 00 00 00 00 000000
2:2 f0 20 00 d0 00 80 008000
2:3 02 00 00 02 00 02 000000
3:0 00 00 00 00 00 00 000000
3:1 00 00 00 00 00 00 000000
3:2 00 00 00 00 00 00 000000
3:3 00 00 00 00 00 00 000000
4:0 00 00 00 00 00 00 000000
4:1 00 00 00 00 00 00 000000
4:2 f0 f0 30 00 00 00 000000
4:3 03 03 00 00 00 00 000000
5:0 0c 00 00 00 00 00 000000
5:1 6e 26 00 40 00 40 004000
5:2 00 00 00 00 00 00 000000
5:3 ff 00 00 fc 00 70 606000
6:0 03 00 00 03 00 01 010100
6:1 1f 08 08 04 00 07 030300
6:2 00 00 00 00 00 00 000000
6:3 0d 04 00 00 00 00 000000
7:0 32 10 00 22 00 02 020200
7:1 00 00 00 00 00 00 000000
7:2 00 00 00 00 00 00 000000
7:3 00 00 00 00 00 00 000000

I added this block to gpio@6000d000 as referenced in Troubleshooting “Issue 2: Sound Not Audible”

p2597-j21-audio {
    gpio-hog;
    function;
    gpios = <0x8 0x0 0x9 0x0 0xa 0x0 0xb 0x0 0xd8 0x0 0x24 0x0 0x25 0x0>;
    label = "I2S0_LRCLK", "I2S0_SDIN", "I2S0_SDOUT", "I2S0_CLK", "AUDIO_MCLK", "DMIC3_CLK", "DMIC3_DAT";
    status = "okay";
};

Now GPIO_CNF is 0x0

sudo cat /sys/kernel/debug/tegra_gpio
0:0 24 00 00 04 00 00 000000
<b>0:1 00 00 00 00 00 00 000000</b>
0:2 1f 00 00 00 00 00 000000
0:3 00 00 00 00 00 00 000000
1:0 40 00 00 00 00 00 000000
1:1 00 00 00 00 00 00 000000
1:2 00 00 00 00 00 00 000000
1:3 ff 1b 03 40 00 00 002024
2:0 0f 0d 05 02 00 00 000000
2:1 00 00 00 00 00 00 000000
2:2 f0 20 00 d0 00 80 008000
2:3 02 00 00 02 00 02 000000
3:0 00 00 00 00 00 00 000000
3:1 00 00 00 00 00 00 000000
3:2 00 00 00 00 00 00 000000
3:3 00 00 00 00 00 00 000000
4:0 00 00 00 00 00 00 000000
4:1 00 00 00 00 00 00 000000
4:2 f0 f0 30 00 00 00 000000
4:3 03 03 00 00 00 00 000000
5:0 0c 00 00 00 00 00 000000
5:1 6e 26 00 40 00 40 004000
5:2 00 00 00 00 00 00 000000
5:3 ff 00 00 fc 00 70 606000
6:0 03 00 00 03 00 01 010100
6:1 1f 08 08 04 00 07 030300
6:2 00 00 00 00 00 00 000000
6:3 04 04 00 00 00 00 000000
7:0 32 10 00 22 00 02 020200
7:1 00 00 00 00 00 00 000000
7:2 00 00 00 00 00 00 000000
7:3 00 00 00 00 00 00 000000

I run the following commands:

amixer -c tegrasndt210ref sset "ADMAIF1 Mux" "I2S1"
arecord -D hw:tegrasndt210ref,0 -r 48000 -f S32_LE -c 2 -d 10 cap.wav
gst-launch-1.0 filesrc location=cap.wav ! wavparse ! audioconvert ! fakesink dump=true

Still nothing in the wav file:

...
00003240 (0x7f9c009ad0): 00 00 00 80 00 00 00 00 00 00 00 80 00 00 00 00  ................
00003250 (0x7f9c009ae0): 00 00 00 80 00 00 00 00 00 00 00 80 00 00 00 00  ................
00003260 (0x7f9c009af0): 00 00 00 80 00 00 00 00 00 00 00 80 00 00 00 00  ................
00003270 (0x7f9c009b00): 00 00 00 80 00 00 00 00 00 00 00 80 00 00 00 00  ................
00003280 (0x7f9c009b10): 00 00 00 80 00 00 00 00 00 00 00 80 00 00 00 00  ................
00003290 (0x7f9c009b20): 00 00 00 80 00 00 00 00 00 00 00 80 00 00 00 00  ................
000032a0 (0x7f9c009b30): 00 00 00 80 00 00 00 00 00 00 00 80 00 00 00 00  ................
000032b0 (0x7f9c009b40): 00 00 00 80 00 00 00 00 00 00 00 80 00 00 00 00  ................
...

I also checked hardware/nvidia/soc/t210/kernel-dts/tegra210-soc/tegra210-audio.dtsi, but everything was enabled.

I do recommend that you use the ‘TEGRA_GPIO’ macro in your DT as opposed to just using hex values, but the above looks fine and the hex values in your DT look fine too.

Can you check the pinmux’ing for DAP1?

$ sudo grep dap1 /sys/kernel/debug/tegra_pinctrl_reg
Bank: 1 Reg: 0x70003124 Val: 0x00006044 -> dap1_fs_pb0
Bank: 1 Reg: 0x70003128 Val: 0x00006044 -> dap1_din_pb1
Bank: 1 Reg: 0x7000312c Val: 0x00006044 -> dap1_dout_pb2
Bank: 1 Reg: 0x70003130 Val: 0x00006044 -> dap1_sclk_pb3

Hopefully, you have something similar to the above. We want to ensure that bits [1:0] in the above are 0 and bit 6 is set at least for the din to enable the input on the pad.

Do you have an oscilloscope? If so are you able to see if the bit clock and frame-sync are active?

Regards
Jon

I did use TEGRA_GPIO in the dtsi, I should have mentioned I pulled that block from the compiled DTB as a verification step.

After swapping the mics to another robot to test with the oscilloscope the audio started working! I expect there might have been a cold joint where we connected it to the previous bot so something wasn’t going through.

Thanks for the help!