You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Turning bluetooth headphones on or off when paired with PC crashes godot hard to console immediately 100%. Affects games, project menu and editors.
godot.windows.opt.tools.64.exe!CowData<Ref<AudioEffectInstance>>::get(int p_index) Line 156
at \godot-src\core\cowdata.h(156)
[Inline Frame] godot.windows.opt.tools.64.exe!Vector<Ref<AudioEffectInstance>>::operator[](int) Line 87
at \godot-src\core\vector.h(87)
godot.windows.opt.tools.64.exe!AudioServer::_mix_step() Line 366
at \godot-src\servers\audio_server.cpp(366)
godot.windows.opt.tools.64.exe!AudioServer::_driver_process(int p_frames, int * p_buffer) Line 251
at C:\gamedev\godot-src\servers\audio_server.cpp(251)
It appears to be a race condition where new bus->channels are made but without corresponding bus->channels->effect_instances.
voidAudioServer::_mix_step() {
// ...for (int i = buses.size() - 1; i >= 0; i--) {
// ...//process effectsif (!bus->bypass) {
for (int j = 0; j < bus->effects.size(); j++) {
// ...for (int k = 0; k < bus->channels.size(); k++) {
// Crash occurs here, I imagine in bus->channels[k].effect_instances[j]if (!(bus->channels[k].active || bus->channels[k].effect_instances[j]->process_silence())) {
continue;
Steps to reproduce
Run Godot [editor or a game]
Have a 5.1 sound system, bluetooth headphones. (not sure if the 5.1 is required)
Set sound system as default if headphones are off. Otherwise headphones. (not sure if changing default is sufficient to reproduce)
Ensure the audio stack has an effect (only reproduced with "Compressor" on master channel.
Turn headphones on (if they were off) or off (if they were on). Either case reproduces 100%.
Observe immediate Godot crash
Note:
I managed to reproduce just by changing the primary audio device between my headphones and speakers a few times. Took 3 switches.
We had the same issue in our game but with a ps5 dualsense controller crashing randomly editor/game after connecting it to a windows 10/11 pc by usb or bluetooth.
After debugging a bit We found the issue was the audio input from the ps5 controller and We found this issue.
We tested with the ps5 controller the demo attached in this issue and crashed.
Here is a video of what happens when the ps5 controller is connected in this issue demo using 3.4.4 with a debug custom build without modifications based in 3.4.4.stable for more console output:
Audioserver.crash.mp4
And here is an screenshot with some prints of channel/effect size and current index before crash:
Godot version
3.4.beta - head e443796 and 3.3.2.stable.official
System information
Windows 10
Issue description
Turning bluetooth headphones on or off when paired with PC crashes godot hard to console immediately 100%. Affects games, project menu and editors.
It appears to be a race condition where new bus->channels are made but without corresponding bus->channels->effect_instances.
Steps to reproduce
Note:
I managed to reproduce just by changing the primary audio device between my headphones and speakers a few times. Took 3 switches.
Minimal reproduction project
A project where I accessed the audio menu, added a compressor and saved.
godot_Audio_compressor.zip
The text was updated successfully, but these errors were encountered: