2026-03-17 11:22 AM
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
2026-03-17 12:16 PM
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.
2026-03-17 12:46 PM
For SPI i have 32 Mbits/s
2026-03-17 1:34 PM - edited 2026-03-17 1:37 PM
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 ?
2026-03-30 3:07 AM
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.