Closed parabuzzle closed 1 year ago
SPIFFS is horribly slow for both reads and writes (but it does have other benefits for flash usage and longevity with small updates, so horses for courses). You are showing an I2S underflow, meaning the app isn't sending decompressed data to the I2S device fast enough.
I suggest trying LittleFS instead as it's several X faster in my own experience than SPIFFS. You might also try adjusting the buffer size (up or down), but that may be specific file-dependent and not a general solution.
Thank you.
For those that stumble upon this issue I just want to close the loop.
The problem was actually the SPIFFS speed. I switched to reading the data from an SD card and it worked without issue. LittleFS also seemed to still have the issue but it wasn't as often or consistent.
So bottom line is, SPIFFS is not really fast enough to service higher bitrate audio files.
Hello,
I'm using an ESP32-WROVER-E-N16R8 but I've reproduced this on multiple E and IE series WROVER devices connected to a PCM5102a (I've used multiple modules to make sure it wasn't something related to the module either)
I noticed that the audio skips for a second randomly like there's a clock sync issue or something. This happens for WAV and MP3 files.
Any idea on why this dropout is happening? I have a hunch its the data reading from SPIFFS not loading a buffer fast enough on initial start up but I haven't been able to prove that.
Here's my Arduino sketch:
The pins don't seem to make a difference. I've moved them around and even used the default pins for the library. The skip is still there.
I can see the skip on the scope:
channel 1: word clock (yellow) channel 2: data (blue) channel 3: bit clock (purple)
This one shows that the skip duration is 64ms
The zoomed in signal (the probes are connected directly to the MCU pins.
zoomed in on the start of the dropout
zoomed in on the end of the dropout