-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mp3streamer failed to allocate SharedArrayBuffer. #1111
Comments
Thanks for giving the new example a try. The MP3 streaming uses some memory so it is not surprising there are memory failures in some environments. I don't have a an M5stack, but I will take a look on M5Stack Fire. Maybe they are similar enough. |
The mp3streamer example runs on M5Stack Fire by adding the following VM creation parameters to the application manifest: "creation": {
"static": 32768,
"chunk": {
"initial": 1536,
"incremental": 1536
},
"heap": {
"initial": 128,
"incremental": 64
},
"stack": 256
} I found a couple of other errors in the new MP3 examples while reviewing this. We'll push some fixes today or tomorrow for those as well. Thank you for your patience. |
Some improvements to the MP3 support have been committed:
I expect the memory use and buffering will continue to evolve as we gain experience using these implementations. |
Awesome work!! This change makes M5stack play mp3stream 👍 I can use elevenlabs TTS from stack-chan. IMG_2529.MOV |
Wonderful. And the lip-sync even works! |
After this fix,
|
I have't seen that myself. You can try adjusting the chunk allocation in the application manifest. |
I deleted |
Interesting, OK. So, we can eliminate the custom creation. That's simpler. FWIW – With the updates to the MP3 streaming support last week, the buffering changed a bit. Now, more MP3 compressed data is buffered instead of buffering it as uncompressed audio. That reduces the total amount of memory needed. The MP3 compressed data buffer is in the JavaScript heap, which may have stressed the smaller allocation just enough to cause failures in some cases. To help reduce peak memory use, I made a small change to the mp3 streamer to defer allocation of the MP3 compressed data buffer until after the connection is established. The peak TLS memory use is during the handshake, while establishing the connection. |
Moddable: fece720,
Build environment: macOS,
Target device: M5stack
Steps to Reproduce
xamples/pins/audioout/mp3-http-stream
using this build command:mcconfig -d -m -p esp32/m5stack ssid="wifi_ssid" password="wifi_passwod"
/Users/satoshi/Projects/moddable/examples/pins/audioout/mp3-http-stream/mp3streamer.js (160) # Break: SharedArrayBuffer: cannot allocate SharedArrayBuffer!
.Other information
M5stack core2 has no problem.
The text was updated successfully, but these errors were encountered: