Disconnecting Bluetooth headset hangs game

shamsi shared this bug 3 years 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!

Replies (11)

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
2

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
2

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
photo
1

I guess i can reproduce the problem. I also have sony headset connected via bluetooth. What could i do to collect data for support?

photo
1

Hello, Peter!

If you could please post some reliable steps for the reproduction of the issue - That would be a great help :)

Kind Regards

Laura, QA Department

photo
1

I am using Sony WH-1000XM2. I have a running game and bring it into "pause" mode by pressing "pause" key.

I switch into a different app and switch on and off my headset.

This is "crashing" the game.

photo
1

Hello, Peter!

Thank you for this information. Unfortunately, I do not have that headset but have tried both Bluetooth headphones and also a wired headset and the sound switches without issue. I have followed your steps for bringing the game to a pause and then switching over but sadly, nothing like your report so far

Kind Regards

Laura, QA Department

photo
1

Is it possible for me to collect (debug) info for you?

photo
1

Hello, Peter!

Is it possible you could supply a log first please from when this happens?

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

Yes - i will do this. If i have some time to play ;-)

photo
1

Here's what i did:

start game over steam

continue game

move arround

save game, go back with ESC

press PAUSE key

switch to other running program like browser

switch off headset

--> program crashed

photo
1

Hello, Peter!

Thank you for the logs and steps. I have been trying to reproduce the issue with you steps but each time I switch off the headset, the game allows me to go back and unpause the game without issue sadly. With regards to the log, there doesn't appear to be a crash/exception. Is it freezing for you and you have to force quit the process? Or, is it actually crashing?

Kind Regards

Laura, QA Department

photo
1

It is freezing.

If i go back to the window i can not disable pause mode ore use the program in any way.

I can see in task manager that the the program is still using CPU as if it would be running.

but no way to give any command.

Is it possible to enable some more detailed debugging?

i am still able to reproduce the issue.

photo
1

@Peter

From your recent log I see you have RealisticSound enabled. Try disabling the realistic sound to see if the problem persists.

@Laura K

When trying to reproduce the scenario do you have RealisticSound enabled in your game? RealisticSound has been know to be causing many problems both in Space Engineers as well as in Medieval Engineers.

photo
1

yes, realistic mode was enabled in this world. I switched back to "arcade" and the geme did not crash in the same scenario. To be sure, this is really depending to the problem, i will try out over some time and provide feedback.

photo
1

well - realistic sound is not the problem. I was playing the game, no pause, no save. just playing and switching off headset. game did not react any more.

As far as i could see, the drill was rotating and i heard drilling sound so i wonder if the issue mgiht be together with my bluetooth keayboard? It's a Logitech K520. Could it be, that not the game is freezing but the keyboard gets lost in the game? I can still switch tasks and go into task manager to stop space engineers so the problem is local in the game.

photo
1

I came across this thread while trying to find a solution to the problem Ive been having, and I see many posts from QA here saying they cannot reproduce this Particular issue. I have had this bug occur multiple times recently while using my Generation 2 Airpods, and each time it occured when i followed these steps:


  • While the game is Open, Alt-Tab to Desktop, Activate or Deactivate Spatial Sound
  • Game will lock up and require a Force Quit through Task Manager

OR


  • While the game is open, Put the Airpods into the Charging Case, turning them off. (Or, use them until they die, causing them to disconnect)
  • Game will lock up and require a Force Quit through Task Manager


I'm assuming that this should happen with any Bluetooth Headset. Im not sure how you have been unable to replicate this, as its been pretty consistent in my experience. Im on Windows 10, running the latest version of the Game.

photo
1

Hello, CommanderChet!

Thank you for your steps with the Airpods. As I have them, I have tried both of these options and at best, I get a small second of lag when trying the second option. If I try the first with spatial sound, there is no change at all. There must be something that is different for us that is causing some people to have this and others to not which is why it's proving difficult to narrow down the issue.

Kind Regards

Laura, QA Department

photo
1

Additional info - For two years the game will freeze if my bluetooth earpiece is disconnected while playing SE. I finally start playing GTA online on the PC instead of console and experienced the exact same issue (GTA freezing and having to force it closed when my bluetooth disconnected). What if this issue is related to Steam instead of SE directly? Is QA testing this bug through a steam interface or just the game directly? It may need to be fixed by Steam.

photo
1

Hello, Memlapse!

Thank you for the additional information. I will do some research to find similar games with this issue. I am testing through Steam so not a case of testing it without it in this instance :)

Kind Regards

Laura, QA Department

photo
1

Hello, Back Again. Had a Crash today from my Bluetoth Set Disconnecting


2022-01-26 15:59:19.180 - Thread: 20 -> Audio device removed

2022-01-26 15:59:19.300 - Thread: 1 -> Exception occurred: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

at SharpDX.XAudio2.Voice.SetVolume(Single volume, Int32 operationSet)

at VRage.Audio.MySourceVoice.SetVolume(Single volume)

at Sandbox.Game.Entities.MyEntity3DSoundEmitter.set_VolumeMultiplier(Single value)

at Sandbox.Game.EntityComponents.MyShipSoundComponent.UpdateVolumes(Single shipSpeed, Single originalSpeed)

at Sandbox.Game.EntityComponents.MyShipSoundComponent.Update()

at Sandbox.Game.Entities.MyCubeGrid.Dispatch(UpdateQueue queue, Boolean parallel)

at Sandbox.Game.Entities.MyCubeGrid.UpdateBeforeSimulation()

at Sandbox.Game.Entities.MyParallelEntityUpdateOrchestrator.UpdateBeforeSimulation()

at Sandbox.Game.Entities.MyParallelEntityUpdateOrchestrator.DispatchBeforeSimulation()

at Sandbox.Game.Entities.MyEntities.UpdateBeforeSimulation()

at Sandbox.Game.World.MySector.UpdateBeforeSimulation()

at Sandbox.Game.World.MySession.UpdateComponents()

at Sandbox.Game.World.MySession.Update(MyTimeSpan updateTime)

at Sandbox.MySandboxGame.Update()

at Sandbox.Engine.Platform.Game.UpdateInternal()

at Sandbox.Engine.Platform.Game.RunSingleFrame()

at Sandbox.Engine.Platform.FixedLoop.<>c__DisplayClass11_0.<Run>b__0()

at Sandbox.Engine.Platform.GenericLoop.Run(VoidAction tickCallback)

at Sandbox.Engine.Platform.Game.RunLoop()

at Sandbox.MySandboxGame.Run(Boolean customRenderLoop, Action disposeSplashScreen)

at SpaceEngineers.MyProgram.Main(String[] args)

2022-01-26 15:59:19.302 - Thread: 1 -> Showing message

2022-01-26 15:59:21.666 - Thread: 1 ->

================================== CRASH INFO ==================================

AppVersion: 01_199_025

GameName: Space Engineers

IsOutOfMemory: False

IsGPU: False

IsNative: False

IsTask: False

IsExperimental: True

ProcessRunTime: 3237

PCUCount: 10358

IsHang: False

GCMemory: 2398

GCMemoryAllocated: 2398

HWAvailableMemory: 4068

ProcessPrivateMemory: 12908

AnalyticId: SE

================================== OFNI HSARC ==================================


2022-01-26 15:59:21.666 - Thread: 1 -> Log Closed


Maybe that would be useful?

photo
1

Hello, CommanderChet!

Thank you so much for the log.

Can I please ask if you experience this in any other games? I have just been doing some digging and can see that there have been reports of this in Stardew & Rocket League to name a couple.

Kind Regards

Laura, QA Department

photo
1

Hello, unfortunately i cannot say i've had a similar experience in other games, or the games listed.

photo
1

just wondering - coul this be a "timing" issue?

What is happening if the device is disconnected but the game still wants to send audio to it? Couldn't this generate an error 0x5-access denied as memory is envolved that had been released by the device?

This also would make sense to me in rgard of the "non-reproducebility". The OS is releasing the device and memory but the application does not get this info as it's currently working in a different thread. As it comes back to "audio output" the memory is released. Maybe a check before sending audio to a device might help? "Is device available" or something like this?

photo
photo
3

Just commenting here, since I've experienced the same issue, but with a wired headset.

Here's all the details I know from my experience:

  • Computer defaults to my headset when plugged in, otherwise it goes to speakers that are plugged in.
  • My speakers were powered off when encountering this issue.
  • Headset is a wired HyperX Cloud II Gaming Headset.
  • The save that I encountered this issue in has audio set to "Arcade".
  • My game has contextual music disabled, and music volume at lowest value.
  • The save that was loaded where I experienced this issue was in space, inside a large-grid ship that was pressurized, and powered on.
  • I did not pause the game while swapping audio playback devices.
  • I am unsure if the game froze when I unplugged the headset, or when I plugged it back in after rearranging the wire.

Order of events before encountering this issue:

Booted up Space Engineers > loaded offline creative game > within 5-10 seconds after loading I plugged my headset into the USB port > game audio swapped to headset, but all ambient audio was gone, except for footsteps > sat in, and then got back out of seat inside ship which "refreshed" the audio, and ambient audio returned > unplugged USB headset to rearrange wire > plugged headset back in > game was frozen when attempting to resume play, and no audio at all was heard > checked if Steam overlay still worked, and it did, and then closed it > minimized, and then maximized game > game was still frozen > force closed the game.

Obviously unsure what information may be helpful, I provided everything that I remember. Let me know if there are any questions. Hope this issue is resolved soon!

photo
2

I have had the same issue with my Bluetooth headphones, wired headset, and monitor speakers. I allowed the game to sit frozen while reading this thread. I tried going back to the game and it was not on my taskbar but steam still showed it as running. Went to task manager and it showed up (first) in my background processes, while still using my GPU.

97fbeeeb45e850c67e8457fa6f6b2d7d

Maybe this could help the troubleshooting process. Feel free to let me know if there is anything else I could provide or if you want some help reproducing the issue.

photo
2

I'm running into the same problem, with wired headphones plugged directly into the audio jack of my PC. It seems to happen pretty consistently when I unplug my headphones and windows automatically switches audio devices to my monitor. Same as above, the game doesn't respond to any input or to alt+f4, but doesn't crash and doesn't show as unresponsive in task manager.

Leave a Comment
 
Attach a file