Changing the sample rate of DMic on the i.MX RT685-AUD-EVK

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Changing the sample rate of DMic on the i.MX RT685-AUD-EVK

648 Views
MrRv
Contributor II

I am attempting to change the sampling rate of the dmic_multi_channel driver example for the iMX RT685 board.

I have changed the following values from 48000 to 16000:

DEMO_I2S_SAMPLE_RATE

MrRv_0-1672065021513.png

the .sample_rate field under .format

MrRv_1-1672065062882.png

 

Additionally, i have changed the values in CLOCK_SetClkDiv here

MrRv_2-1672065117393.png

(2 - > 3 and 8 -> 32) from the USB example "dev_composite_audio_multi_ch_unified_bm" (which reads audio from the single on-board microphone at 16000 Hz).

 

However, when playing the audio from a speaker connected to the board, it sounds high-pitched and distorted, and when leaving the divider values as default, I get an assertion error when calling the DEMO_InitCodec function.

Which parameters do I need to change in order to correctly adjust the sample rate of the DMic and speaker? Do the sample rates need to be identical?

Additionally, is there a reference resource which can be used to determine the required parameters values for different sampling rates for the DMic and speakers?

 

Thanks in advance!

Labels (2)
Tags (1)
0 Kudos
Reply
2 Replies

630 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

For the example "dev_composite_audio_multi_ch_unified_bm", I suppose it is complicated to change the sampling rate, this is the PCM stream connection:

The PCM generated by DMIC are outputted to the codec WM8904, and also outputted to USB, the sampling rate of both DMIC and Codec WM8904 must be the same, furthermore, in order to avoid that part of PCM are missing or emptying, for example, assume that DMIC sampling is 48KHz, and PCM is 24 bits(extended to 32 bits with padding a byte), the 1K USB frame will cover 48*32bits*2 or 48*8bytes=384 Bytes.

If you want to change the sampling rate, all the Codec, DMIC and USB have to be modified.

Hope it can help you

BR

XiangJun Rong

 

0 Kudos
Reply

619 Views
MrRv
Contributor II

Hello,

Thank you for the reply.

I was able to fix the sound coming from the speaker by setting the DMic clock divider to 24.

0 Kudos
Reply