Disconnecting Bluetooth headset hangs game

shamsi shared this bug 56 days ago
Need More Information

I caught it this time because a debugger was attached, but I don't have a _reliable_ way to reproduce it, other than to have your BT headset be disconnected by you walking too far away or something like that. Turning the headset off manually seems to work fine. /8b579f80e2080cc764ccbe8c1fc2824f

Hope this helps somehow!

Comments (7)

photo
1

Hello, shamsi!

Sorry to hear you're experiencing this issue. I've been trying this on some Airpods as my normal headset is wired. I have been able to reproduce a small issue where if I'm flying a ship, for example, there is a few second 'blip' where they have been disconnected. You mentioned yours hangs, is it possible to tell me a bit more about that or even provide a video? What I'm experiencing must be no more than two seconds so wonder if yours is more severe? I assume it then recovers after the hang? Please let me know :)

Kind Regards

Laura, QA Department

photo
1

I will think how I can capture it. No, after it hangs I have to force quit and restart the game. :(

photo
1

Hello, shamsi!

Thank you for letting me know. So in terms of the questions, I asked previously, this does not sound like what I'm experiencing. Would you agree? Could you answer those please just for a bit more information? Could I ask what headset you are using? Is it also please possible to supply a copy of the log from this happening? I appreciate you have provided the above screenshot but a log would be excellent too.

  • You can access your log files by typing %appdata% into your Windows search bar and you will be redirected to the hidden Roaming folder. After that just follow: \Roaming\SpaceEngineers.

Kind Regards

Laura, QA Department

photo
1

Hi, so I'm attaching a video of the game as I disconnect my Sony WH-CH700N headphones. The game falls to the debugger, when I resumed, it crashed with the attached log.

We might be talking about some similar but related bugs, or one bug, I'm not sure. I've had three outcomes happen when I disconnect headphones:

* the game crashes with a log

* the game hangs and must be force quit

* the game stays up but there no more volume, and playing with the volume bar in the settings to reset things doesn't work

Hope this helps somehow

photo
1

Oops it seems there's something wrong with the video, guess OBS couldn't record it crashing. It's basically my drum machine that's using a lot of sound blocks at once.

photo
1

Hello, shamsi!

Thank you so much for the information and log. A few further questions - Does this still happen even without the attached debugger? For instance, if you started it without this? Could you also please supply a copy of that world mentioned above to see if I can reproduce it on that rather than a fresh world of my own?

  • You can access your save files by typing %appdata% into your Windows search bar and you will be redirected to the hidden Roaming folder. After that just follow: \Roaming\SpaceEngineers\Saves. There should be a folder with your SteamID and your saves.
  • Please zip the file and attach it here. If you are having difficulty attaching files you can optionally use Google Drive. When sharing a google drive link please make sure it is set to be downloadable by anyone with the link.

Kind Regards

Laura, QA Department

photo
1

Yes, it happens even without the debugger, in fact I only recently started attaching the debugger. It has been happening consistently for a long time, I think it tends to happen more when the disconnect is from something other than me turning off the headphones (for instance I walk away too far, or the headset battery dies). Sometimes it happens when I turn off the headset using the button, but I think it happens less. I think. ¯\_(ツ)_/¯

I will try to attach the file but you need to install a mod and malware's plugin which removes code size limits.

photo
1

Hello, shamsi!

Thank you for the further update and information :) Hopefully, you can send the file via Google Drive if you are having difficulty with this.

Kind Regards

Laura, QA Department

photo
1

Hi Laura, sorry for the delay. Please find attached the save file. I've been working in this world for the past few months, but I think I've also had this issue with other worlds too, I just assumed it was a generic SE thing. 🤷‍♂

photo
1

Hello, shamsi!

Is it possible to please try to send over your save again? That save appears to be corrupted.

Kind Regards

Laura, QA Department

photo
1

Hello, shamsi!

Please could you send over the file again if possible? The original was corrupted.

Kind Regards

Laura, QA Department

photo
photo
1

As I already stated in another similar thread: https://support.keenswh.com/spaceengineers/pc/topic/game-locks-up-when-bluetooth-headphone-disconnected

I believe this bug occurs because Space Engineers initializes its XAudio2 sound engine using XAUDIO2_NO_VIRTUAL_AUDIO_CLIENT flag. This means that the sound engine is bound directly to specific audio output device.

Since most modern USB based or Bluetooth based Headphones are detected by system as individual audio output devices it means that as soon connection to one of them is interrupted that audio output device is no longer present so SE sound engine has nowhere to output its sound.

Now this internally raises Xaudio2 OnCriticalError Event which application can then use in order to reinitialize its sound interface to another Audio output device but it seems Se doesn't handle this properly and thus causes its audio system to crash and hang entire game.

So in order to fix this bug the above mention OnCriticalError must be handled properly.

Another solution would be to initialize XAudio2 sound engine without XAUDIO2_NO_VIRTUAL_AUDIO_CLIENT. This would initialize audio system as virtual client which means that it can handle switching of Audio Output devices without any interruptions. But it might have some other drawbacks. For instance I don't know how switching from 4 channel audio to 2 channel audio would be handled. It might lead to sound that would otherwise be played on 3rd and 4th channel of simply not being played.

PS: You can read a bit more about OnCriticalError event handling here: https://docs.microsoft.com/en-us/windows/win32/api/xaudio2/nf-xaudio2-ixaudio2enginecallback-oncriticalerror

PPS: I guess it would be most easy to reproduce this scenario by unplugging USB based headphones. Some Bluetooth based headphones does not remove their Audio output device right away but with a bit longer delay.

photo
1

Hello, SIlvo!

Thank you for your comment. In regards to the USB headset, have you managed to reproduce this issue? I cannot on both Bluetooth or USB. Are you able to provide a save in which this happens for you?

Kind Regards

Laura, QA Department

photo
1

To be honest I haven't experienced this in SE as I haven't played any games by using a headset for years now.

But a few years ago when I was forced to play games on a headset as my speakers died I did encounter pretty much same issue with several different games.

And since I'm learning game development as a hobby I already learned a few thing about how game and sound engines work. That is how I managed to quickly find part of official documentation that might hold crucial information.

photo
1

Game really does not like it when I disconnect my USB headset while loading in a world for the second time in a session. Half the time it CTDs, other half it stops so hard that Alt+F4 does nothing. Had to kill it through Alt+Tab and then through task manager. Once I even got an infinite loading wheel.

photo