schreibfaul1 / ESP32-audioI2S

Play mp3 files from SD via I2S
GNU General Public License v3.0
1.14k stars 291 forks source link

Cracking noises and some playbacks stop #887

Open foorschtbar opened 2 weeks ago

foorschtbar commented 2 weeks ago

After switching from Release 3.0.8 to 3.0.12 i had two problems:

Nothing special in the debug output. Anyone has the same problem?

PS: @schreibfaul1 awesome library!

dominickairmyne commented 1 week ago

I have been having alot of issues with this as well!

ra0943-VK3ACH commented 4 days ago

Im also having issues with this. Would you be able to share your code? and are you playing local files or streaming them

schreibfaul1 commented 4 days ago

In the old version, the audio.loop() did everything. Since the WiFiClient is not blocking-free, I have moved the part responsible for decoding and I2S "feeding" to an extra task. This way many streams, especially m3u8, run more smoothly. This relieves the audio.loop(), which runs on core 1 by default. It may be that there is not enough time for other tasks, in which case a vTaskDelay() 1...10ms provides a remedy.

image

Otherwise, it may be that in some projects core 0 is now overloaded, e.g. by your own tasks, in which case the audio task can be moved from core 1 to core 0. audio.setAudioTaskCore(uint8_t coreID)

ra0943-VK3ACH commented 4 days ago

Adding vTaskDelay has solved the issue for me! Thankyou!

foorschtbar commented 4 days ago

Yes, the vTaskDelay(1); fixed the crackings also for me, thank u.

But i still need to downgrade to 3.0.8 to play a mp3 that stops playing (or is quiet until the end) with 3.0.12. No useful information with audio_info. And the end of the file, you could here something and then audio_eof_mp3 is called.