Audio I2S on 40 Pin Connector

Hello!

Sorry, I am making too many assumptions here. For this to work, you need access to the serial console via one of the headers on the Jetson Nano [0]. I realise that you do not have access and so this is not going to work for you. Please note what I am suggesting is very much a workaround and it is not intended that people need to going through all these pains just to setup some pins.

It is disappointing that we have still not released the pinmux spreadsheet that is required to do this. I have shared your commentary on this to let the appropriate people know that is not satisfactory and needs to be fixed ASAP.

Regards,
Jon

[0] Jetson Nano Style - Serial Console - JetsonHacks

what works at once is hdmi->vga adapter with 3.5 mm audio jack

1 Like

Jon, I followed the link to the guide for serial communications.

Using your r/w instructions to the register, yields the follow.

$ sudo grep “Name:|J:|BB:” /sys/kernel/debug/tegra_gpio
Name:Bank:Port CNF OE OUT IN INT_STA INT_ENB INT_LVL
J: 2:1 00 00 00 00 00 00 000000
BB: 6:3 01 00 00 00 00 00 000000

Jon, I have been attempting to get the ics43434 mems mic to work but no luck. The mic works on the a raspberry pi. So I know that and the pins are correct. On the Nano I get the error: “arecord: pcm_read:2103: read error: Input/output error”.

I reviewed the pages:
https://devtalk.nvidia.com/default/topic/1032785/no-sound-using-i2s-to-cs4344-codec/
https://devtalk.nvidia.com/default/topic/1032970/i2s-mic-with-tx2/

Nothing there helped.

Hello!

What does the following show …

sudo grep dap4 /sys/kernel/debug/tegra_pinctrl_reg

Regards,
Jon

Here is the result:

Bank: 1 Reg: 0x70003144 Val: 0x00000044 → dap4_fs_pj4
Bank: 1 Reg: 0x70003148 Val: 0x00000044 → dap4_din_pj5
Bank: 1 Reg: 0x7000314c Val: 0x00000044 → dap4_dout_pj6
Bank: 1 Reg: 0x70003150 Val: 0x00000044 → dap4_sclk_pj7

Hello!

The above looks good.

Can you clarify the exact commands that you are executing when attempting capture? Specifically, the amixer commands and arecord command.

Thanks!
Jon

amixer -c tegrasndt210ref sset “ADMAIF1 Mux” “I2S1”

arecord -D hw:tegrasndt210ref,0 -r 16000 -f S16_LE -c 1 -d 10 test.wav

I have also tried variations of rate and format, e.g, 44100 / 48000 and S24_LE / S32_LE

A USB mic was successful using arecord.

1 Like

See my post on testing audio by enabling I2S.

Hello!

Jetson Nano exposes I2S4 on the 40-pin header which is different from other Jetson platforms and so what you want is …

$ amixer -c tegrasndt210ref sset "ADMAIF1 Mux" "I2S4"
$ arecord -D hw:tegrasndt210ref,0 -r 16000 -f S16_LE -c 1 -d 10 test.wav

Note that by default I2S4 should be mapped to ADMAIF1 so you should also be able to just do the following you should see the it is mapped.

$ alsactl init tegrasndt210ref
$ amixer -c tegrasndt210ref sget "ADMAIF1 Mux"

Regards,
Jon

This is excellent! Thanks for sharing!

Jon

Jon,

One last remaining question. After a reboot, the register reverts from SFIO to GPIO. Will the new DTB you sent fix this to be permanent?

Would Nvidia buy this Nano back from me for half price? Never mind, I got rid of it. I’ll be back in a few years to see if you really followed through with great documentation and something that is easily expandable. See you in 2030.

1 Like

Hello!

Sorry, I missed this question. Yes if you flash the DTB, then the pins will remain configured as SFIO on every boot. That is the intended method. The method I had suggested was a temporary means for testing.

Regards,
Jon

Dear Jon,

Would you follow the same steps if you tried to enable I2S mic (Adafruit I2S MEMS Microphone Breakout - SPH0645LM4H : ID 3421 : $6.95 : Adafruit Industries, Unique & fun DIY electronics and kits) on Jetson Nano?

I have tried to use the microphone using the commands below, but I am not getting any sound.

$ amixer -c tegrasndt210ref sset "ADMAIF1 Mux" "I2S4"
$ arecord -D hw:tegrasndt210ref,0 -r 16000 -f S16_LE -c 1 -d 10 test.wav

I have connected the microphone using the following pinout:

Pin1 = 3V
Pin12 = BCLK
Pin35 = LRCL
Pin38 = DOUT
Pin39 = GND

Your help would be much appreciated.

Many thanks,

Kira

Hello Kira,

Yes you would follow the same steps. The above connections look good and so probably just a matter of setting the default pin configuration. Alternatively to what I posted previous, someone else has shared some information on how to enable I2S on the Jetson Nano here …

Regards,
Jon

Hi Jon,

I have followed the steps that you mentioned.

Now, my Jetson shows the following configuration:
$ sudo grep dap4 /sys/kernel/debug/tegra_pinctrl_reg
Bank: 1 Reg: 0x70003144 Val: 0x00000044 → dap4_fs_pj4
Bank: 1 Reg: 0x70003148 Val: 0x00000044 → dap4_din_pj5
Bank: 1 Reg: 0x7000314c Val: 0x00000044 → dap4_dout_pj6
Bank: 1 Reg: 0x70003150 Val: 0x00000044 → dap4_sclk_pj7

$ sudo grep “Name:|J:|BB:” /sys/kernel/debug/tegra_gpio
Name:Bank:Port CNF OE OUT IN INT_STA INT_ENB INT_LVL
J: 2:1 00 00 00 00 00 00 000000
BB: 6:3 01 00 00 00 00 00 000000

However, my microphone is still not recording any sound.
I have tested the mic on raspberry pie, so I know that it works.

Is there anything else I could check to figure out what the problem is?

Many thanks,
Kira

Hi Kira,

The above looks good indeed. Are you able to probe the signals with an oscilloscope to see if the BCLK, LRCK and DOUT are being driven?

The only other suggestion I have is to change the number of channels from 1 to 2 …

$ arecord -D hw:tegrasndt210ref,0 -r 16000 -f S16_LE -c 2 -d 10 test.wav

I2S signaling is always 2 channels even if the mic you have connected is mono. We can get the I2S interface to convert the 2 channels recorded into a single mono stream, but I am curious if you record 2 channels if you hear audio on one of the channels or not.

Regards,
Jon

Hi Jon,

So we’ve used an oscilloscope to see if the BCLK, LRCL and DOUT are driven. I’ve compared the outputs of Jetson (where the mic still does not work…) to Raspberry Pi where the same microphone works well. Here are the outputs for both:

LRCL Signal:

(a) Raspberry Pi
External Media

(b) Jetson (1.5V)
External Media

BCLK Signal:

(a) Raspberry Pi
External Media

(b) Jetson (1.5V)
External Media

GND and 3.3V are the same on both Raspberry Pi and Jetson:

GND:
External Media

3.3V:
External Media

However, microphone signal is only obtained on Raspberry:
External Media

Perhaps the drivers on Jetson are not working correctly?

Again, your help is very much appreciated!!!

Best,

Kira







Hi Kira,

That is strange that you do not see the signal toggling. The I2S interface has been verified and it is known to be working fine on the L4T release 32.1. Other users have had this working fine. Please note that if you configure the I2S pins via the U-Boot command line, you need to do this every you reboot or power-on the board. Those pin settings will be reset everytime the board is shutdown. As mentioned in comment #36, another user had posted an updated DTB that can be flashed so you do not need to reconfigure the pinmux on every boot.

Can you send the output from the following command so that I can see what board version you have?

dmesg | grep DTS

Can you send the output from the following command …

$ sudo cat /sys/kernel/debug/pinctrl/7000e400.pmc/pinconf-pins

Finally, send the output from the following commands …

$ echo 0 | sudo tee /sys/kernel/debug/tracing/trace
$ echo 0 | sudo tee /sys/kernel/debug/tracing/events/enable
$ echo 1 | sudo tee /sys/kernel/debug/tracing/tracing_on
$ echo 1 | sudo tee /sys/kernel/debug/tracing/events/asoc/snd_soc_dapm_widget_power/enable
$ amixer -c tegrasndt210ref sset "ADMAIF1 Mux" "I2S4"
$ arecord -D hw:tegrasndt210ref,0 -r 16000 -f S16_LE -c 2 -d 10 test.wav
$ sudo cat /sys/kernel/debug/tracing/trace

Thanks
Jon