Crash when disconnectiong soundcard

ALAudioRenderer ~907:
throw new AssertionError("Unexpected state: " +
“A looping sound has stopped playing”);

So when I disconnect/ disable the soundcard jme is runing with, it crashes due to this.

How To:
a) Use linux and change the audio config via pulseaudio
b) Use windows and a usb headset and accidentially pull the plug
(probably) c) use android with bluetooth speakers and they disconnect

Expected behaviour
a) sound might go mute untill game restart (ok)
b) sound continues playing on different soundcard (great)

Actual behaviour
a) game crashes with no way to save/ cleanly disconnect anymore.

So the big question is, why is this an assertionError? On of the very few types not expected to be cached like evver? An Illegal state exception would make way more sense. Also if noone oposes I would try to develop a fix for this, that tries to continue on the new default sounddevice if existent, else just stays mute.

→ A use might accept that the game looses audio for this
→ But is probably frustrated if it just crashes, and he cannot even save and properly restart it

Yeah, this would be great.

Sound always feels like it’s barely hanging on in JME… some TLC would be nice to catch these cases.

TLC? what do you mean?


Fixed in AL: fix crash when device is disconnected · jMonkeyEngine/jmonkeyengine@78b6357 · GitHub

Wow that was fast :slight_smile: thanks