Skip to main content
Fib
Associate
May 3, 2019
Solved

Microphones streaming through I2S

  • May 3, 2019
  • 2 replies
  • 1212 views

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?

This topic has been closed for replies.
Best answer by Eleon BORLINI

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

2 replies

Eleon BORLINI
Eleon BORLINIBest answer
ST Employee
May 7, 2019

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
Visitor II
July 29, 2019

Hello. I have the same problem.

Have you solved your problem ?