Using Adafruit SPH0645 I2S microphone with Jetson AGX Xavier


I have been trying to connect and record sound with an I2S microphone (Adafruit I2S MEMS Microphone Breakout - SPH0645LM4H : ID 3421 : $6.95 : Adafruit Industries, Unique & fun DIY electronics and kits) on the Jetson AGX Xavier dev kit. I have come across a few closely related topics, and have gone through the Jetson documentation on recording sound, but they haven’t permitted me to achieve this yet.

The above mic has 6 pins and I’ve connected them to the AGX Xavier as follows (using some information from here:

SEL → not connected
LRCL → pin 35
DOUT → pin 40
BCLK → pin 12
GND → pin 39
3V → pin 1

Here are more precise questions I have:

  1. After doing the above connections, is there any way to confirm (e.g via the command line) that the mic has been [correctly] connected ?

  2. How do I actually record the audio? The Jetson documentation has so much information and unfortunately I get lost in the details, and not sure what to do exactly. So far I’ve tried the command:
    arecord -D hw:APE,0 -r 48000 -c 2 -f S24_LE cap.wav but the resulting file seems to be “broken” and won’t play when I test it on my laptop computer.

Thanks in advance for your help

Dear @petersonyuhala,
I moved to relavant forum. Please post your topics at Jetson AGX Xavier - NVIDIA Developer Forums for future queries .

Hi petersonyuhala.

Follow below steps to resolve issue

  1. First set I2S pinmux settings using Jetson-IO tool if not done already. (Configuring the Jetson Expansion Headers — Jetson Linux<br/>Developer Guide 34.1 documentation)

  2. Pin 40 of GPIO Expansion header is to send out playback data. You need to connect your mic data codec pin to pin 38 of GPIO Expansion header as it corresponds to I2S Data IN.

  3. Being able to record with the card is the way to confirm connection is fine as there are no detection pins in the card. Record command mentioned in your comment should help. If not try for alternate formats like S16_LE and check once


Hello @atalambedu ,

Thanks for your response. I’ve configured the 40-pin expansion header as advised, and modified my pin connections for the I2S DOUT --> I2S Data IN on pin 38.

But I still can’t hear the sound I record when I play the output cap.wav output file. Just a bunch of “noise”. I’ve also tried S16_LE format, same problem. Do you know what could be the issue?

Hi petersonyuhala,

Is the codec component ensured to be non-defective?

To ensure Jetson I2S is not defective, you could try I2S loopback by playing and then starting record (for this you need to enable i2s config via Jetson-IO) and connecting Jetson I2S DOUT to DIN ( I dont suspect any issue here though)

Share the final pinmux settings for I2S (can take a snapshot of Jetson IO-tool 40 pin header layout). It will show the function assigned to each pin after they are applied

Share the mixer settings (amixer -c 1 contents #Assuming 1 is APE card number. Cross check this before dumping)

Also check if the voltage required in the codec card sheet if its 3.3v or 5v. Accordingly connect pins if not alligned with requirement


Regarding the final pinmux settings, here is a gitlab link to the screen-shot: jetson-40pin-config.png · master · Peterson Yuhala / jetson-xavier · GitLab

As for the APE dump, it is too long and can’t be included here directly. Here is a gitlab link to the dump file: jetson-ape-dump.txt · master · Peterson Yuhala / jetson-xavier · GitLab

The Adafruit I2S SPH0645LM4H specifes VIN/Logic : 3.3V so I believe it is indeed 3.3V and not 5V.

As for the loopback test, I’m not sure of all the steps but I’d read the docs more closely and try to do that.

If it could be of any help, here is the datasheet for the SPH0645 I2S mic:

New information:
The website for the above mic: Adafruit I2S MEMS Microphone Breakout - SPH0645LM4H : ID 3421 : $6.95 : Adafruit Industries, Unique & fun DIY electronics and kits states that the microphone is a “single mono element” , and that the select pin (SEL) should be connected to power or ground to choose whether to record on the left or right channel.

The previous tests above have been recording on 2 channels: -c 2. So I’ve connected the select pin to ground, and modified the recording command to record on one channel: arecord -D hw:APE,0 -r 48000 -c 1 -f S24_LE cap.wav.

The above command produces the following error while recording:

arecord: pcm_read:2178: read error: Input/output error

Does anyone have a hint on the reason for this error?

I can now do recordings successfully.

  • Before recording, I did: amixer -c APE cset name="ADMAIF1 Mux" "I2S2" , and kept using the original recording command on 2 channels without connecting the SEL pin: arecord -Dhw:APE,0 -r 48000 -c 2 -f S24_LE cap.wav.

The recorded sound is noisy, but I believe I can mitigate this by testing with a lower sample rate.

Thanks for all your help.

Glad to hear that you could resolve the issue.