Audio recording is with noise in 44.1/48khz sampling rate

Hi,

I am connecting MIC in I2S1 line (pinmuxed to DMIC-modified in pinmux excel sheet) without any external codec to the Xavier carrier board which has TX2-NX SoM mounted.When we do amixer setting and try to record with arecord command,we are getting noise when sampling is set greater than or equal to 44.1Khz

Below is the amixer setting done and arecord command used for recording,

amixer -c tegrasndt186ref cset name=“MVC1 Mux” DMIC1
amixer -c tegrasndt186ref cset name=“ADMAIF1 Mux” MVC1
amixer -c tegrasndt186ref cset name=“DMIC1 Boost Gain” 50
amixer -c tegrasndt186ref cset name=“MVC1 Vol” 12602
amixer -c tegrasndt186ref cset name=“MVC1 input bit format” 32
amixer -c tegrasndt186ref cset name=“DMIC1 output bit format” 32

arecord -D hw:tegrasndt186ref,0 -r 48000 -c 1 -f S16_LE mic_testing.wav

Also i am attaching the audio files recorded in different sampling rates,
audio_files_diff_sample_rate.zip (2.7 MB)

Note:When we tried to set the channel for Mono in amixer setting(amixer -c tegrasndt186ref cset name=“DMIC1 Mono Channel Select” L) we were getting below error,
amixer: Cannot find the given element from control hw:1

I’m not really a “sound guy”, but that popping first made me think that part of the software is operating at a different sample rate than the other software (which doesn’t seem to be the actual case). I don’t have a mic to try, so I can’t give much in the way of useful feedback other than “that’s a software setting and not a hardware failure”. Looking at the audio in Audacity I see though that it might just be a case of clipping rather than difference in sample rate at two different places in software. So much clipping tends to distort what is heard, and at this level of clipping, it just might be an otherwise good audio stream turns into that popping/clicking.

This is a screenshot of levels in Audacity for 32k:

This is the same in 44.1k:

The 32k stream sounds good. Notice that gain levels are the same on reading this and the 44.1k stream, but the 32k stream never reaches 100%. Almost every single part of the 44.1k stream clips at 100%. Check microphone gain settings at 44.1k.

Just a side thought: Audacity says both streams are at their advertised sample rates, and it also states that both streams are 32-bit. I emphasize “32-bit” because if some part of the software thought this was 16-bit in the 44.1k case, then it is possible for mic gain to be correct, and yet have “clipping” as 32 bits are supplied to software maxing out at 16 bits.

Hello!

This is a good point. One thing that looks odd to me is that the ‘bit format’ for the MVC and DMIC1 is set to 32-bits, yet arecord is using 16-bit. Typically, you should not need to override the bit format in the MVC and DMIC and just let arecord pass the necessary bit size.

amixer -c tegrasndt186ref cset name=“MVC1 input bit format” 32
amixer -c tegrasndt186ref cset name=“DMIC1 output bit format” 32

arecord -D hw:tegrasndt186ref,0 -r 48000 -c 1 -f S16_LE mic_testing.wav

Regards,
Jon

We configured to 16bit in the arecord command with following mixture settings,
amixer -c tegrasndt186ref cset name=“MVC1 Mux” DMIC1
amixer -c tegrasndt186ref cset name=“ADMAIF1 Mux” MVC1
amixer -c tegrasndt186ref cset name=“DMIC1 Boost Gain” 50
amixer -c tegrasndt186ref cset name=“MVC1 Vol” 12602
amixer -c tegrasndt186ref cset name=“MVC1 input bit format” 16
amixer -c tegrasndt186ref cset name=“DMIC1 output bit format” 16

arecord -D hw:tegrasndt186ref,0 -r 48000 -c 1 -f S16_LE mic_testing.wav

We configured to 32bit in the arecord command with following mixture settings,
amixer -c tegrasndt186ref cset name=“MVC1 Mux” DMIC1
amixer -c tegrasndt186ref cset name=“ADMAIF1 Mux” MVC1
amixer -c tegrasndt186ref cset name=“DMIC1 Boost Gain” 50
amixer -c tegrasndt186ref cset name=“MVC1 Vol” 12602
amixer -c tegrasndt186ref cset name=“MVC1 input bit format” 32
amixer -c tegrasndt186ref cset name=“DMIC1 output bit format” 32

arecord -D hw:tegrasndt186ref,0 -r 48000 -c 1 -f S32_LE mic_testing.wav

In both these cases,the recorded audio is being played with lot of noise.
Can you please let us know what can be the reason for this behaviour?

Hello!

What is the MIC that you are using? What sample size does it output?

Thanks
Jon

Hi Jon,

The mic we are using is SPH0641LM4H-1.

Hi Jon,

Can you give us some clue on why this issue is happening particularly in 44.1/48Khz alone?

Hello!

Sorry for the delay. Can you check that the following mixer control …

$ amixer -c tegrasndt186ref cset name=“DMIC1 OSR Value"

We want this to be set to OSR_64. From what we can tell the MIC supports clocks upto 4.8MHz and at 48kHz with an over-sampling ratio (OSR) of 64, this will yield a 3.072MHz clock. If the OSR is 128 then the clock will be 6.144MHz which is too high for the MIC. If the OSR is 64 and it is still noisy then maybe there is a signal integrity issue. How is the MIC connected to Jetson? Are you using jumper wires?

Regards,
Jon