MyXAudio2 Crashing to desktop

Shane Stixrud shared this bug 2 years ago
Won't Fix

The following is more likely to occur the more audio that is going on at a given time. Easy to reproduce during large ship battles.

2020-03-21 08:21:28.769 - Thread: 1 -> Exception occured: ParallelTasks.TaskException: An exception(s) was thrown while executing a task.

at ParallelTasks.WorkItem.ThrowExceptionsInternal(Int32 runId)

at ParallelTasks.Task.WaitOrExecute(Boolean blocking)

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)

Task exception, inner exception 0:

System.NullReferenceException: Object reference not set to an instance of an object.

at VRage.Audio.MyXAudio2.Update3DCuePosition(IMy3DSoundEmitter source)

at VRage.Audio.MyXAudio2.Update3DCuesState(Boolean updatePosition)

at VRage.Audio.MyXAudio2.Update(Int32 stepSizeInMS, Vector3 listenerPosition, Vector3 listenerUp, Vector3 listenerFront, Vector3 listenerVelocity)

at Sandbox.MySandboxGame.UpdateSound()

at ParallelTasks.DelegateWork.DoWork(WorkData workData)

at ParallelTasks.WorkItem.DoWork(Int32 expectedID)

Replies (5)


No need for large scale ship battles, crashes my game everytime i try to fire a single turret with the exact same exeption in the crash log... Please fix, makes WC unusable for me.


Hopefully hot-fixed in v194.081. Please let us know if it helps. If not, provide more info about this problem.


Unfortunately it is not fixed in the recent hotfix. From my experience on Xocliw's stream. The crash appears to happen more frequently as the world is up.


The following code reproduces the issue. It seems to be MUCH easier to trigger the issue by calling sounds in Draw() (which I know is not ideal). However, I also see it happen in BeforeSimulation, just much more rare and seems to depend on normal game play load / situations that are more difficult to reproduce reliably. My guess is it is easy to reproduce in Draw() because this is around the same time Keen kicks off the audio thread.

[MySessionComponentDescriptor(MyUpdateOrder.BeforeSimulation | MyUpdateOrder.AfterSimulation | MyUpdateOrder.Simulation, int.MaxValue - 1)]

public class Session : MySessionComponentBase


internal readonly MySoundPair Sound = new MySoundPair();

internal readonly MyEntity3DSoundEmitter SoundEmitter = new MyEntity3DSoundEmitter(null, true, 1f);

internal Random Rnd = new Random(123);

internal string[] Sounds = {"WepShipGatlingShot", "ArcWepLrgWarheadExpl", "ArcWepExplSmall"};

public override void Draw()


Sound.Init(Sounds[Rnd.Next(0, 3)], false);

SoundEmitter.PlaySound(Sound, Rnd.Next(0, 1) == 1);




Hello, everyone!

Are you still experiencing this issue on the latest game version 199.025? We apologize for the late response, we are receiving a large number of bugs that we are trying to process. Thank you.

Kind regards,

Keen Software House: QA Department


Hello, Engineer!

Because there is no new comment from you, and we are unable to reproduce the issue on our own, I will close this thread now as outdated.

If you or any other player will experience this issue again, please make a new thread and provide all needed info there.

Thank you for understanding.

Kind Regards

Keen Software House: QA Department

Leave a Comment
Attach a file