cancel
Showing results for 
Search instead for 
Did you mean: 

I2S DMA Audio stuttering/repeating snippets on STM32G071RB

spottame12
Associate

Hi everyone, I'm new to STM32 and I'm building an audio player. I'm using an SD card (via SPI) to feed audio data to a dac via I2S.The audio stutters and often plays the same 1-2 second snippets twice before moving on.I've tried implementing double buffering and i've checked the i2s configuration in circular mode.Code:https://github.com/darty555/stm32-i2s-dma.git

4 REPLIES 4
AScha.3
Super User

Hi,

> I'm building an audio player.

Good !  I made a player also. :)

>I'm new to STM32

Not good...for such a project. 

>on STM32G071RB

Hmmm....i used a STM32F411 at first, that was working ok ; but i think, this class is minimum for a real good working player : SD-card interface , 100MHz core, 128KB ram .

Now i use a STM32H743ZIT , can play wav, flac, mp3 ; 

+

Basically you doing it right , similar to my first version on F411 : circular dma, reading/filling data in callbacks.

But what data speed you get in SPI mode from card ? check it, i suppose its too slow.

If you feel a post has answered your question, please click "Accept as Solution".
spottame12
Associate

For SPI i have 32 Mbits/s

So you set the SPI to 32 M ? But did you check, what data rate you get from card ?

Because i never tried it with spi reading, only SDIO or SDMMC ; and even here the card needs about 0.5...2 ms to respond to a command, then data coming with ...16MB/s (200 Mbit speed, in 4bit-mode) in my tests.

Did you test real data speed ? and how is it working, with the unknown delay after a command, until data is coming from card ? + what delay you get, until data coming , in spi mode ?

If you feel a post has answered your question, please click "Accept as Solution".
FBL
ST Employee

Hi @spottame12 

In my understanding, bytes_read points to nowhere. FatFs will attempt to write the number of bytes read into that address.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.




Best regards,
FBL