Can ESP32 S2 run as a wifi webserver and play mp3 audio at the same time?
-
- 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?
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!).
-
- 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?
In theory, yes. There's a RTOS running in ESP-IDF that'll happily run multiple threads at once.
-
- 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?
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?
Re: Can ESP32 S2 run as a wifi webserver and play mp3 audio at the same time?
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.
The thing to think about is to make sure any thread associated with the audio have higher priority then less important tasks.
-
- Posts: 125
- Joined: Fri May 24, 2019 2:02 am
Who is online
Users browsing this forum: No registered users and 36 guests