SharpDX Sound Error Exceptions - from vanilla sounds

BDCarrillo shared this bug 16 months ago
Investigating

The recent batch of SharpDX errors since the update has been troublesome. In the modding community some sources have been identified, such as 0kb start/stop sounds in loops, incorrect bitrates, or converting troublesome files to xmw.


Earlier today it seems that a vanilla sound file induced the error, specifically ArcWepShipGatlingShot. I also see a log line from SE showing the last null was written by OnSoundVoiceStopped. The last line was logging I added to WeaponCore to help narrow troublesome sound files.

Anecdotally the error below occurred during a grid collision.

2024-06-29 16:45:10.526 - Thread: 1 -> Exception occurred: SharpDX.SharpDXException: HRESULT: [0x88960001], Module: [SharpDX.XAudio2], ApiCode: [XAUDIO2_E_INVALID_CALL/InvalidCall], Message: Unknown
 at SharpDX.Result.CheckError()
 at SharpDX.XAudio2.SourceVoice.SubmitSourceBuffer(AudioBuffer bufferRef, Nullable`1 bufferWMARef)
 at SharpDX.XAudio2.SourceVoice.SubmitSourceBuffer(AudioBuffer bufferRef, UInt32[] decodedXMWAPacketInfo)
 at VRage.Audio.MySourceVoice.Start(Boolean skipIntro, Boolean skipToEnd)
 at VRage.Audio.MyXAudio2.PlaySound(MyCueId cueId, IMy3DSoundEmitter source, MySoundDimensions type, Boolean skipIntro, Boolean skipToEnd, Boolean isMusic)
 at VRage.Audio.MyXAudio2.VRage.Audio.IMyAudio.PlaySound(MyCueId cueId, IMy3DSoundEmitter source, MySoundDimensions type, Boolean skipIntro, Boolean skipToEnd)
 at Sandbox.Game.Entities.MyEntity3DSoundEmitter.PlaySoundInternal(Boolean skipIntro, Boolean skipToEnd, Boolean force2D, Boolean alwaysHearOnRealistic, Nullable`1 force3D)
2024-06-29 16:45:10.526 - Thread: 1 -> Last null written by: OnSoundVoiceStopped
2024-06-29 16:45:10.526 - Thread: 1 -> Error: Sound error with ammo: NATO_25x184mm from soundID ArcWepShipGatlingShot cuename ArcWepShipGatlingShot

Replies (13)

photo
1

Hello, engineer!

Thank you for writing to us, and we sincerely apologize for the issue you have been experiencing.

Could you please try the following steps/workarounds to resolve this issue:

Verify your game files in Steam:

  • Right-click on Space Engineers in Steam Library → Properties → Installed Files → Verify Integrity of Game Files (wait till all the files are verified completely)

Update Sound Drivers:

  • Ensure all audio drivers are up-to-date.

Update your OS to its latest version.

If the issue still persists after trying these steps, please send us the complete log file from the time the issue occurred.

  • 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,

Keen Software House: QA Department

photo
6

I appreciate the utility of a boilerplate response, but note that this issue has been observed across many users and is highly intermittent. Your own internal logging caught the source of the error (2024-06-29 16:45:10.526 - Thread: 1 -> Last null written by: OnSoundVoiceStopped), and no driver nor OS update will resolve that.


Ash worked with Filip on this in March and we discovered one cause with mod-sourced sounds, but this is the first occurrence I've observed with original Keen sounds.

photo
4

One cause seems to be .wav files encoded to something other than 44100hz. Previously, the game could handle this (maybe with some oddities like static), but the signal update's change to some part of the audio system causes it to just crash instead. It's seemingly "random" because 10 years of mods and vanilla audio files that weren't properly set to that format are set like a landmine for clients to trip on.

The following world reproduces it 100% of the time:

https://steamcommunity.com/sharedfiles/filedetails/?id=3306037929

photo
2

I am now running into the same error. This is on a modded server but the point of failure seems to move from one to the other. Plays fine for a while, then client crashes (dedicated server I am hosting is doing just fine)


Already made sure I am fully up to date on my OS, GPU driver, DX redists and VCRedists. Multiple users have experienced this issue.


2024-10-23 04:12:40.549 - Thread:   1 ->  Exception occurred: SharpDX.SharpDXException: HRESULT: [0x88960001], Module: [SharpDX.XAudio2], ApiCode: [XAUDIO2_E_INVALID_CALL/InvalidCall], Message: Unknown
   at SharpDX.Result.CheckError()
   at SharpDX.XAudio2.SourceVoice.SubmitSourceBuffer(AudioBuffer bufferRef, Nullable`1 bufferWMARef)
   at SharpDX.XAudio2.SourceVoice.SubmitSourceBuffer(AudioBuffer bufferRef, UInt32[] decodedXMWAPacketInfo)
   at VRage.Audio.MySourceVoice.Start(Boolean skipIntro, Boolean skipToEnd)
   at VRage.Audio.MyXAudio2.PlaySound(MyCueId cueId, IMy3DSoundEmitter source, MySoundDimensions type, Boolean skipIntro, Boolean skipToEnd, Boolean isMusic)
   at VRage.Audio.MyXAudio2.VRage.Audio.IMyAudio.PlaySound(MyCueId cueId, IMy3DSoundEmitter source, MySoundDimensions type, Boolean skipIntro, Boolean skipToEnd)
   at Sandbox.Game.Entities.MyEntity3DSoundEmitter.PlaySoundInternal(Boolean skipIntro, Boolean skipToEnd, Boolean force2D, Boolean alwaysHearOnRealistic, Nullable`1 force3D)
2024-10-23 04:12:40.549 - Thread:   1 ->  Last null written by: OnSoundVoiceStopped
2024-10-23 04:12:40.549 - Thread:   1 ->  Error: Sound error with ammo: 25mm NATO from  soundID ArcWepShipGatlingShot cuename WepShipGatlingShotFireEmitter.Entity null? False 
 Origin: X:-4764129.64631053 Y:897280.621864357 Z:366634.465999111
2024-10-23 04:12:40.563 - Thread:   1 ->  Exception: SharpDX.SharpDXException: HRESULT: [0x88960001], Module: [SharpDX.XAudio2], ApiCode: [XAUDIO2_E_INVALID_CALL/InvalidCall], Message: Unknown
   at CoreSystems.Support.AvShot.SetupSounds(Double distanceFromCameraSqr)
   at CoreSystems.Projectiles.Projectile.Start()
   at CoreSystems.Projectiles.Projectiles.GenProjectiles()
   at CoreSystems.Projectiles.Projectiles.SpawnAndMove()
   at CoreSystems.Session.Simulate()
   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)
2024-10-23 04:12:40.573 - Thread:   1 ->  Exception occurred: SharpDX.SharpDXException: HRESULT: [0x88960001], Module: [SharpDX.XAudio2], ApiCode: [XAUDIO2_E_INVALID_CALL/InvalidCall], Message: Unknown
   at CoreSystems.Support.AvShot.SetupSounds(Double distanceFromCameraSqr)
   at CoreSystems.Projectiles.Projectile.Start()
   at CoreSystems.Projectiles.Projectiles.GenProjectiles()
   at CoreSystems.Projectiles.Projectiles.SpawnAndMove()
   at CoreSystems.Session.Simulate()
   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)
   at avaness.SpaceEngineersLauncher.Program.StartSpaceEngineers(String[] args)
   at avaness.SpaceEngineersLauncher.Program.Main(String[] args)

photo
1

I also reproduced the issue with the word provided by Validpoint above and included the log below.

photo
1

Hello, Engineer!


Thank you for providing the logs. Unfortunately it seems like both logs in the above posts are pointing towards a mod. Please attempt to disable the WeaponCore mod on your side and let us know if the issue persists. If it doesn't, the issue will need to be fixed by the mod creator.


Kind Regards,

Keen Software House: QA Department

photo
2

The mod in question is using Keen methods to call sounds. The SharpDX Exception happens external to WeaponCore, on the Keen side. The only reason WeaponCore appears in the stack later is that I'm letting it throw the exception passed back from SharpDX.

photo
1

getting the same issue here, happens a good 75% of times any weapon fires near me. it was happening before i added weaponcore to my save as well, so it's not that mods fault.

photo
2

Did some more digging and the sounds that cause issues are not 44.1khz/16 bit, as they should be.


image

photo
1

Ive solved the error. the Vanilla gatling sound is hoo high of a hz quality. Keen needs to export the gatling audio file in 44100hz mono and these errors should be resolved. Now that I read up, BDCarrillo has said the same thing

photo
2

I did this myself in audacity with the files named "ArcWepShipGatlingShot" in "C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Content\Audio\ARC\WEP" and it seems to have solved the issue for me. So if anyone else want to try it, theres an answer.

photo
1

Excellent find!

I followed your lead and found a list of WAV files in that structure (started 2 levels higher) and changed all that were not 44100 to 44100 and all my 3-10 second audio-drop-outs that have been happening all year finally stopped!

I changed all of them as it was never a Gatling gun that triggered it for me, rather a lot of different things, especially when exiting a cockpit.

Thank you very much!

Anyone who is interested in doing the same, there are two other sample sizes I found. I didn't do any testing between other than to verify between the two command lines that the audio files remained usable. All originals have a .orig suffix so are easy to move pack (or "Verify Files").

Sorry - I'm running Linux, so windows people will probably have to find some other tools to do this.

I ran this in ~/.steam/root/steamapps/common/SpaceEngineers/Content/Audio/

for w in $(for x in $(find . -type f -iname \*.wav ); do /usr/bin/echo -e "$x: \c" ; soxi -r $x ; done  | grep 48000 | cut -d: -f1 ); do /usr/bin/echo -e "Fixing $w: \c" ; mv -i $w $w.orig ; sox $w.orig -r 44100 $w ; echo "done" ; done
 for w in $(for x in $(find . -type f -iname \*.wav ); do /usr/bin/echo -e "$x: \c" ; soxi -r $x ; done  | grep 96000 | cut -d: -f1 ); do /usr/bin/echo -e "Fixing $w: \c" ; mv -i $w $w.orig ; sox $w.orig -r 44100 $w ; echo "done" ; done
The list of changed files (here are the originals renamed):

./ARC/SHIP/ArcCockpitOut3d.wav.orig
./ARC/EXPL/FIREWORKS_EXPLODE_CLOSE_1.wav.orig
./ARC/EXPL/FIREWORKS_EXPLODE_FAR_1.wav.orig
./ARC/HUD/HudQuestlogDetail.wav.orig
./ARC/HUD/HudGPSNotification1.wav.orig
./ARC/HUD/HudBleep.wav.orig
./ARC/HUD/Target_Lock_Confirmation_2.wav.orig
./ARC/HUD/HudGPSNotification2.wav.orig
./ARC/HUD/Target_Lock_Loading_Loop.wav.orig
./ARC/HUD/HudNewItemImpact.wav.orig
./ARC/WEP/ArcWepShipGatlingShot3d02.wav.orig
./ARC/WEP/Shell_Pass_Test_1.wav.orig
./ARC/WEP/ArcWepShipGatlingShot3d05.wav.orig
./ARC/WEP/ArcWepTurretGatlingFire3d07.wav.orig
./ARC/WEP/FIREWORKS_LAUNCH_1.wav.orig
./ARC/WEP/ArcWepTurretGatlingFire3d01.wav.orig
./ARC/WEP/ArcWepShipGatlingShot3d03.wav.orig
./ARC/WEP/ArcWepTurretGatlingFire3d06.wav.orig
./ARC/WEP/ArcWepShipGatlingShot3d04.wav.orig
./ARC/WEP/ArcWepShipGatlingShot3d07.wav.orig
./ARC/WEP/ArcWepTurretGatlingFire3d05.wav.orig
./ARC/WEP/ArcWepTurretGatlingFire3d02.wav.orig
./ARC/WEP/ArcWepTurretGatlingFire3d04.wav.orig
./ARC/WEP/Shell_FLYBY_02.wav.orig
./ARC/WEP/ArcWepShipGatlingShot3d06.wav.orig
./ARC/WEP/RailGun_Charging_Without_Siren.wav.orig
./ARC/WEP/ArcWepTurretGatlingFire3d03.wav.orig
./ARC/WEP/RailGun_S_Grid_Charge_01.wav.orig
./ARC/WEP/ArcWepShipGatlingShot3d01.wav.orig
./ARC/BLOCK/ArcBlockContainerLoop3d.wav.orig
./ARC/BLOCK/ArcBlockSafeZoneStart3d.wav.orig
./ARC/BLOCK/ArcBlockSafeZoneLoop3d.wav.orig
./ARC/BLOCK/ArcBlockHydrogenEngineEnd3d.wav.orig
./ARC/BLOCK/ArcBlockSafeZoneEnd3d.wav.orig
./ARC/BLOCK/ArcBlockHydrogenEngineLoop3d.wav.orig
./ARC/BLOCK/ArcBlockHydrogenEngineStart3d.wav.orig
./REAL/HUD/RealHudNewItemImpact.wav.orig
./REAL/BLOCK/RealBlockContainerLoop3d.wav.orig
./MUS/MusCompetition/Space_Engineers_Main_Theme_KhydroDjent.wav.orig
./MUS/MusCompetition/Last_Day_on_Triton_Aaron_Schxfer.wav.orig
./MUS/MusCompetition/Entropy_Epicarmina.wav.orig
./MUS/MusCompetition/Into_the_Asteroid_Field_Lynxi_Ft_Umbria.wav.orig
./MUS/MusCompetition/Sands_of_the_Slave_Princess_Windflower_Falls.wav.orig
./MUS/MusCompetition/The_City_Lies_Exelan.wav.orig
./MUS/MusCompetition/Sector_347_Jan_Altherr.wav.orig
./MUS/MusCompetition/Colossus_On_Fire_Dave_Rodriguez.wav.orig
./MUS/MusCompetition/Space_Angels_Musicfonts.wav.orig
./MUS/MusCompetition/Designing_The_Fleet_Limnull.wav.orig
./MUS/MusCompetition/Space_Elevator_Gordon_Saverimuthu.wav.orig
./MUS/MusCompetition/SpaceItOut_SWAUSAGE.wav.orig
./MUS/MusCompetition/EXODUS_Gordon_Saverimuthu.wav.orig
./MUS/MusCompetition/Space_Pirates_Bart_Zeal_Ruben_Isarin.wav.orig
./MUS/MusCompetition/Timeless_Space_Marcin_Klysewicz.wav.orig
./MUS/MusCompetition/Growing_Wild_Timo_Letsch.wav.orig
./MUS/MusConcert/10YA_Track4_mix1.wav.orig
./MUS/MusConcert/10YA_Track9_mix1.wav.orig
./MUS/MusConcert/10YA_Track2_mix2.wav.orig
./MUS/MusConcert/10YA_Track3_mix1.wav.orig
./MUS/MusConcert/10YA_Track6_mix1.wav.orig
./MUS/MusConcert/10YA_Track7_mix1.wav.orig
./MUS/MusConcert/10YA_Track8_mix1.wav.orig
./MUS/MusConcert/10YA_Track10_mix1.wav.orig
./MUS/MusConcert/10YA_Track5_mix1.wav.orig
./MUS/MusPvPMatch/se_PvP_tie.wav.orig
./MUS/MusPvPMatch/se_PvP_win.wav.orig
./MUS/MusPvPMatch/se_PvP_lose.wav.orig
Note that there's a boo-boo in there where one of the WAV files has a space in the name. This causes the above command lines to toss an error. It's can be ignored as it already has a 44100Hz sample rate and I found no reference to it in any file in SE, so it appears to be unused.

photo
photo
1

Same problem here, my game log is attached. Crashes can happen during grid collisions, ship-to-ship combat, or even at random (that's rarer).

Leave a Comment
 
Attach a file