Microphone Adafruit SPH0645 compatibility with jetson Orin NX

I am trying to record audio from a room using an Adafruit SPH0645 I2S microphone connected to a Jetson Orin NX.

Its pins are connected as follows:

  • 3V: Pin 1
  • GND: Pin 6
  • BCLK: Pin 12
  • DOUT: Pin 40
  • LRCL: Pin 35
  • SEL: Not connected

I have configured the system so that the pins can be compatible with the SPH0645 microphone, using the code:

sudo /opt/nvidia/jetson-io/jetson-io.py

And using any command that appears in any of the forums that are open and you solve the problems of both Jetsons Nano and Xavier or Orin NX, it captures no signal and no noise from the microphone.

I am using Jetpack 5.1.1 and ubuntu 20.04 for the Orin.

Hi amorcilloelite,
As I understand you looking for Microphone capture. Can you connect DIN : Pin 38 to your microphone. DOUT: Pin40 is for playback from Tegra I2S perspective.

Right now is connected that way, i’ve tried some commands like amixer or even arecord, but i’m still getting no sound in the .wav archives

I’ve tried the following guide that worked in some way with the previous jetson nano, but with a Jetson Orin NX i don’t get any response form the points 3 to 8

Can you provide the commands used for your testing. Also confirm if Microphone power and clocking are fine.

Of course i’m gonna send you all the commands that I used.

Also in terms of power and clocking are fine. I tested in another product outside from Nvidia, that has compatibility with the microphone Ardafruit SPH0645, and i get sound in .wav

arecord -D hw:APE,0 -c2 -d 5 -r 48000 -f S32_LE ~/Escritorio/test8.wav
arecord -D hw:1,0 -f S16_LE -r 44100 -c 1 test2.wav
arecord -D hw:SPH0645LM4H,0 -r 44100 -f S32_LE -c 1 -d 10 -vv test3.wav
arecord -D hw:tegrasndt210ref,0 -r 44100 -f S32_LE -c 1 -d 10 -vv test3.wav
arecord -D plughw:0 -c2 -r 48000 -f S32_LE -t wav -V stereo -v file_stereo.wav
arecord -D hw:APE,0 -r 48000 -c 2 -f S24_LE cap_test.wav
arecord -D hw:1,0 -c2 -d 10 -r 44100 -f S16_LE ~/Desktop/test2.wav
arecord -D hw:APE,0 -c2 -d 5 -r 48000 -f S32_LE ~/Desktop/test.wav

Please try the below command and measure the I2S BCLK/LRCK

amixer -c APE cset name=“ADMAIF1 Mux” “I2S2”
arecord -D hw:APE,0 -c 2 -r 48000 -f S32_LE -d 10 test.wav

Just confirm if you could see clock output from Tegra I2S BCLK/LRCK

I’ve just try the code that you give me. I didn’t get any result.

I’m gonna show you the results of the commands you give me:
jetson@unbutu:~$ amixer -c APE cset name=“ADMAIF1 Mux” “I2S2”
amixer: Cannot find the given element from control hw:1

jetson@unbutu:~$ arecord -D hw:APE,0 -c 2 -r 48000 -f S32_LE -d 10 test.wav
Recording WAVE ‘test.wav’ : Signed 32 bit Little Endian, Rate 48000 Hz, Stereo

It could be maybe any problem with the amixer library??

Please fix the double quote in the amixer command, for some reason the quotes are not proper.

amixer -c APE cset name="ADMAIF1 Mux" "I2S2"

i’ve just use the command you give and it work in some way. I’m gonna post everything i get:

amixer -c APE cset name=“ADMAIF1 Mux” “I2S2”
numid=1264,iface=MIXER,name=‘ADMAIF1 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

After the mixer control please run arecord command and verify I2S clock presence to the external Mic.

arecord -D hw:APE,0 -c 2 -r 48000 -f S32_LE -d 10 test.wav

i’ve just use the command that you give me and i’m still not getting any sound from the audio. I’m gonna attach the file that i get from the command and the results of the terminal.

arecord -D hw:APE,0 -c 2 -r 48000 -f S32_LE -d 10 test4.wav
Recording WAVE ‘test4.wav’ : Signed 32 bit Little Endian, Rate 48000 Hz, Stereo

Provide the dump for below command

cat /sys/kernel/debug/pinctrl/2430000.pinmux/pinconf-groups

Response.txt (42.1 KB)

Thanks!, I can see you have not enabled the I2S2 pinmux on the 40 pin header.

Refer the below guide to enable the required pin and functionality for your usecase.
https://docs.nvidia.com/jetson/archives/r35.3.1/DeveloperGuide/text/HR/ConfiguringTheJetsonExpansionHeaders.html#hr-configuringthejetsonexpansionheaders

Also avoid pasting whole log here, instead you can dump to a file and attach the file here for better readability.

Okey, i’m gonna try search the pinmux.

Thanks for all, i’ll write in hours or tomorrow.

P.D. Sorry for the all code that i post

Good afternoon, i’ve tried all the metods to enable the i2s2 port in the pinmux of the carrier board, but like you can see in the images below they are enable.

I’ve tried all the commands that we were talking about but it didn’t work.


Seems like configuring the I2S2 with jetson io. After saving the config, do a reboot and dump the below command output to a file and attach.

cat /sys/kernel/debug/pinctrl/2430000.pinmux/pinconf-groups

good afternoon,

I attach you the LogFile

Logfile2.txt (39.3 KB)

Hi Amorcilloelite,
Good afternoon!.

Thanks for the attachment, I could see now I2S2 pinmux is set (refer soc_gpio41_ph7 in the file. func is set to i2s2). Now with the mixer control I suggested earlier should send clock to your external mic and capture data if things are fine.

Also if you have oscilloscope you can verify the I2S2 clock by probing the pin from 40 pin header or from mic point.

Good afternoon,

sorry for not answering your reply this time. I just performed the sound test with the recommendations and there was no solution, nor could I get the microphone to work.

In case someone knows how to fix this error I would like to know. Thank you very much anyway for the support given, you have been 10/10.