Can ESP32 S2 run as a wifi webserver and play mp3 audio at the same time?

felixcollins
Posts: 125
Joined: Fri May 24, 2019 2:02 am

Can ESP32 S2 run as a wifi webserver and play mp3 audio at the same time?

Postby felixcollins » Wed Apr 20, 2022 5:12 am

We are currently using ESP32 WROOMD module. Our application plays mp3 from sd card and serves a web page over wifi simultaneously. esp32 is obviously dual core and S2 is single core. Can the S2 perform this same amazing feat? The reason I ask, is that we would love to have the S2's native USB support to implement Mass Storage Device on the ESP (not simultaneously though!).

ESP_Sprite
Posts: 9757
Joined: Thu Nov 26, 2015 4:08 am

Re: Can ESP32 S2 run as a wifi webserver and play mp3 audio at the same time?

Postby ESP_Sprite » Wed Apr 20, 2022 6:46 am

In theory, yes. There's a RTOS running in ESP-IDF that'll happily run multiple threads at once.

felixcollins
Posts: 125
Joined: Fri May 24, 2019 2:02 am

Re: Can ESP32 S2 run as a wifi webserver and play mp3 audio at the same time?

Postby felixcollins » Tue May 10, 2022 1:56 am

Yes, I'm well aware of that. What I was getting at was the capacity of the processor to run these two fairly demanding realtime processes at the same time. If it is too slow responding to wifi traffic the connection will drop, if it is too slow filling an audio buffer the audio will glitch. Has anyone tried this on the S2?

johboh
Posts: 8
Joined: Sat Apr 29, 2017 5:58 pm

Re: Can ESP32 S2 run as a wifi webserver and play mp3 audio at the same time?

Postby johboh » Mon Jul 25, 2022 3:34 pm

Yes this is possible. I'm using ESP-ADF on a ESP32-S2 to stream music from an remote HTTPS server, decrypt it, OGG decode it and then feeding it to the DAC, at the same time as there is a web-server running, another websocket connection open as well as continuous separate HTTPS calls happening (for reporting).
The thing to think about is to make sure any thread associated with the audio have higher priority then less important tasks.

felixcollins
Posts: 125
Joined: Fri May 24, 2019 2:02 am

Re: Can ESP32 S2 run as a wifi webserver and play mp3 audio at the same time?

Postby felixcollins » Fri Jul 29, 2022 2:19 am

Thanks johboh!

Who is online

Users browsing this forum: No registered users and 36 guests