At max I just need a few MB for reading a websocket response into internal RAM and to feed the audio loop that is running on Core 1. The issue is that the Network delivers at around 25 KB/s but the audio playback consumes 48 KB/s (buffer underrun). I can’t lower the sample rate (I tried). I’d change to another codec like Opus but Deepgram API does only support PCM at 24 KHz.
Comment on Should I upgrade to ESP32-P4-WIFI?
just_another_person@lemmy.world 17 hours ago
It’s to say without more specifics, but you’d only be getting up to 64MB max on the P4.
What audio are you streaming to the device exactly? Are you using any offloading? What’s the memory until on your current project?
I’m not sure what kind of lagging you’re talking about, but these devices are meant to be anything but responsive or real-time. Thinking of some audio applications I’ve run on a few, and they all have that 250ms sort of lag when dealing with audio operations. I’ve never dug deeper into myself.
q1p_@lemmy.zip 15 hours ago
just_another_person@lemmy.world 11 hours ago
You probably only want to use the websocket as a control point, and have another socket open to receive an audio as passthrough? Pretty sure that’s how Sonos et al do it. More lightweight, and you don’t have to worry about overruns like you’re dealing with now perhaps.
q1p_@lemmy.zip 7 hours ago
The connection is bi-directional with different states.
q1p_@lemmy.zip 12 hours ago
EDIT: I fixed the issue I had with dynamic buffer allocation (I’m dynamically calculating the buffer length based on stream metrics). But will order the P4 anyway, because I want to get my hands on it.