cancel
Showing results for 
Search instead for 
Did you mean: 

Microphones streaming through I2S

Fib
Associate II

Hi,

I'm trying to implement the streaming of two MEMS microphones via I2S.

Following some examples provided by ST, I was able to implement the acquisition of the two microphones: I obtain a 32 samples buffer PCM every 1 ms (left and right channel).

Now I'm trying to send these samples through I2S (16 Bits Data on 16 Bits Frame, 16 KHz) using DMA in circular mode. So, I can fill the buffer while the transmission goes on.

I've created a 128-elements buffer. Every 1 ms I put in the buffer 32 elements. When the buffer contains 64 elements, I launch the transfer using "HAL_I2S_Transmit_DMA".

The problem is that probably the DMA transfer goes slowly compared to the 1 ms filling routine, so what I obtain is that the sound isn't clear.

How can I sync these two operations?

1 ACCEPTED SOLUTION

Accepted Solutions
Eleon BORLINI
ST Employee

Hi Fib, could you share some more details of your code? The procedure you are doing is similar the kind of processing of the Bluecoin tool (https://www.st.com/content/st_com/en/products/embedded-software/evaluation-tool-software/stsw-bcnkt01.html:( here there is an example called Audio Loopback that exactly performs what you are wishing to do. Regards

View solution in original post

2 REPLIES 2
Eleon BORLINI
ST Employee

Hi Fib, could you share some more details of your code? The procedure you are doing is similar the kind of processing of the Bluecoin tool (https://www.st.com/content/st_com/en/products/embedded-software/evaluation-tool-software/stsw-bcnkt01.html:( here there is an example called Audio Loopback that exactly performs what you are wishing to do. Regards

RFabi.14
Associate

Hello. I have the same problem.

Have you solved your problem ?