-
-
Notifications
You must be signed in to change notification settings - Fork 20.8k
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
Setting AudioStreamPlayer's stream causes crash in HTML5 threads build #52010
Comments
cc @Faless Can you reproduce this in an HTML5 exported project with threads disabled? |
No. When running with a non-threads build the crash doesn't occur (tested with 3.3.3). |
If I had to guess, I'd say WAV streams likely don't have this same issue. I'd also say that it seems likely the AudioStreamPlayer thinks it's currently playing audio, since the only time
As a workaround, you can try converting the stream to a wav if it's a short sound effect. Otherwise, you could try creating a new AudioStreamPlayer and I'm very curious to know if either of these workarounds will work, and it might be helpful for others in the future or for whoever ends up fixing this bug, so reporting back will be helpful :) |
Changing my OGGs to WAVs on my sound effects completely fixed this issue on my and my users' end. |
That sounds likely. I guess we'll have to wait for a WebGL renderer to make a comeback in A crash is pretty bad so it would still be important to find a fix for |
EDIT: Seems my crash may be a different bug, so I've opened a separate issue here: #54866 I may be having a different issue, but I'm getting occasional crashes in native builds in FWOP (https://github.com/jitspoe/floppy_fish/tree/main/floppy_fish_godot) in both 3.3.4 and 3.4 which I SUSPECT are related to audio. Unfortunately, I haven't been able to reproduce the crash with a debugger attached. Been trying to reproduce for the past hour or 2. On windows, the game just instantly quits with no error. On Linux, somebody got this: (No debugging symbols found in FWOP.x86_64) (gdb) run Starting program: /home/christopher/Downloads/FWOP_linux_update/FWOP.x86_64 [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [New Thread 0x7ffff6eda700 (LWP 14976)] ERROR: _get_modified_time: Method failed. Returning: 0 At: drivers/unix/file_access_unix.cpp:322. Godot Engine v3.3.4.stable.official.faf3f883d - https://godotengine.org [Detaching after fork from child pr Other thing that makes me think it's audio related is when I fade out the music in, there's a pop in the ambient sound, and things like checking if an audio stream was playing too frequently caused major stutters. |
@jitspoe I would suggest opening a new issue for this. It might be related but that's a wild guess for now and this issue was specifically about the HTML5 multi-threaded build (though that doesn't mean the issue couldn't happen on other platforms). We can always merge them together if/when we figure out that they're the same root cause, but if they aren't, debugging two bugs in the same issue is tricky :) Edit: Also, I know it was a trap to get me to spent 10 min on your frustrating game not managing to go anywhere :P No crash so far, but if you manage to reproduce it somewhat reliably on Linux, you could use a debug template from https://github.com/Calinou/godot-debug-builds/releases to have a detailed crash stacktrace. |
LOL! I didn't want to open a new issue unless I confirmed it WASN'T related, especially since all the symptoms sounded similar, and it's like a 1/100 crash -- very difficult to know if it's fixed or not. It's crashed on me like 3-4 times over the course of 30-40 hours. I wasn't the one crashing on Linux, so I'll forward that info on and see if we can get any further info. Side note: I fixed the popping during music fade out by stopping the music BEFORE the volume reached 0. Not sure if that was related to the crash at all, as I haven't been able to reproduce it with or without the change recently. :| |
Godot version
3.3.stable, 3.3.3.stable
System information
Windows 10, Chrome 92.0.4515.159
Issue description
When setting the stream of an AudioStreamPlayer in a threads build in HTML5, the game sometimes crashes.
The crash happens in both debug and release. It does not happen when running the game natively.
It looks like a race condition. I've attached a reproduction project that resets the stream every frame to trigger the crash.
Here's an example error stacktrace:
Steps to reproduce
(Tested with 3.3.3 and 3.3.0)
Minimal reproduction project
audio_sample_thread_crash.zip
The text was updated successfully, but these errors were encountered: