# Crash when packaging a project containing NiagaraAudioSpectrum in UE5.0.1

**URL:** <https://forums.unrealengine.com/t/crash-when-packaging-a-project-containing-niagaraaudiospectrum-in-ue5-0-1/552399>\
**Category:** Feedback & Requests\
**Tags:** bug, unreal-engine, UE5-0, bug-report, question\
**Created:** [May 9, 2022, 3:39am UTC](https://forums.unrealengine.com/t/crash-when-packaging-a-project-containing-niagaraaudiospectrum-in-ue5-0-1/552399 "2022-05-09T03:39:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![t-hoshino](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@t-hoshino](https://forums.unrealengine.com/u/t-hoshino)\
**Post date:** [May 9, 2022, 3:39am UTC](https://forums.unrealengine.com/t/crash-when-packaging-a-project-containing-niagaraaudiospectrum-in-ue5-0-1/552399/1 "2022-05-09T03:39:35Z")

</div>

When I package a project including NiagaraAudioSpectrum and then launch the exe, it crashes.

We have confirmed that it can be reproduced by creating a new project and then following these steps  
Create a NiagaraSystem containing NiagaraAudioSpectrum, place it in a level and package it, then launch the exe.  
The packaging setup did not change the results no matter which one I tried, from Debug to Shipping.

Also, it can be launched in PIE or standalone without any problems.

Below is part of the log of the crash.

```auto
[2022.05.09-02.25.17:821][0]LogWindows: Could not start crash report client using ../../../Engine/Binaries/Win64/CrashReportClient-Win64-Debug.exe
[2022.05.09-02.25.17:821][0]LogMemory: Platform Memory Stats for Windows
[2022.05.09-02.25.17:821][0]LogMemory: Process Physical Memory: 404.27 MB used, 409.68 MB peak
[2022.05.09-02.25.17:821][0]LogMemory: Process Virtual Memory: 619.62 MB used, 620.30 MB peak
[2022.05.09-02.25.17:821][0]LogMemory: Physical Memory: 13516.57 MB used, 18992.85 MB free, 32509.42 MB total
[2022.05.09-02.25.17:821][0]LogMemory: Virtual Memory: 20359.93 MB used, 147668.41 MB free, 168028.33 MB total
[2022.05.09-02.25.17:821][0]Message dialog closed, result: Ok, title: The UE5-MyProject2 Game has crashed and will close, text: Assertion failed: IsInGameThread() [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\AudioThread.cpp] [Line: 663] 

[2022.05.09-02.25.17:821][0]LogThreadingWindows: Error: Runnable thread FAsyncLoadingThread crashed.
[2022.05.09-02.25.17:821][0]LogWindows: Error: === Critical error: ===
[2022.05.09-02.25.17:821][0]LogWindows: Error: 
[2022.05.09-02.25.17:821][0]LogWindows: Error: Assertion failed: IsInGameThread() [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\AudioThread.cpp] [Line: 663] 
[2022.05.09-02.25.17:821][0]LogWindows: Error: 
[2022.05.09-02.25.17:821][0]LogWindows: Error: 
[2022.05.09-02.25.17:821][0]LogWindows: Error: 
[2022.05.09-02.25.17:821][0]LogWindows: Error: [Callstack] 0x00007ff759b00e17 UnrealGame.exe!FAudioCommandFence::BeginFence() []
[2022.05.09-02.25.17:821][0]LogWindows: Error: [Callstack] 0x00007ff75429cbc2 UnrealGame.exe!FNiagaraSubmixListener::RegisterToSubmix() []
[2022.05.09-02.25.17:821][0]LogWindows: Error: [Callstack] 0x00007ff75423a1e2 UnrealGame.exe!FNiagaraDataInterfaceProxySubmix::AddSubmixListener() []
[2022.05.09-02.25.17:821][0]LogWindows: Error: [Callstack] 0x00007ff759b18fea UnrealGame.exe!FAudioDeviceManager::IterateOverAllDevices() []
[2022.05.09-02.25.17:821][0]LogWindows: Error: [Callstack] 0x00007ff7542922f8 UnrealGame.exe!FNiagaraDataInterfaceProxySubmix::OnUpdateSubmix() []
[2022.05.09-02.25.17:821][0]LogWindows: Error: [Callstack] 0x00007ff7542978af UnrealGame.exe!UNiagaraDataInterfaceAudioSpectrum::PostInitProperties() []
[2022.05.09-02.25.17:821][0]LogWindows: Error: [Callstack] 0x00007ff755836cfc UnrealGame.exe!FObjectInitializer::PostConstructInit() []
[2022.05.09-02.25.17:821][0]LogWindows: Error: [Callstack] 0x00007ff7558081e4 UnrealGame.exe!FObjectInitializer::~FObjectInitializer() []
[2022.05.09-02.25.17:821][0]LogWindows: Error: [Callstack] 0x00007ff75584d3a3 UnrealGame.exe!StaticConstructObject_Internal() []
[2022.05.09-02.25.17:821][0]LogWindows: Error: [Callstack] 0x00007ff75552541b UnrealGame.exe!FAsyncPackage2::EventDrivenCreateExport() []
[2022.05.09-02.25.17:821][0]LogWindows: Error: [Callstack] 0x00007ff755530b27 UnrealGame.exe!FAsyncPackage2::Event_ProcessExportBundle() []
[2022.05.09-02.25.17:821][0]LogWindows: Error: [Callstack] 0x00007ff755534c83 UnrealGame.exe!FEventLoadNode2::Execute() []
[2022.05.09-02.25.17:821][0]LogWindows: Error: [Callstack] 0x00007ff75554e986 UnrealGame.exe!FAsyncLoadEventQueue2::PopAndExecute() []
[2022.05.09-02.25.17:821][0]LogWindows: Error: [Callstack] 0x00007ff75556dc44 UnrealGame.exe!FAsyncLoadingThread2::Run() []
[2022.05.09-02.25.17:821][0]LogWindows: Error: [Callstack] 0x00007ff755449e4b UnrealGame.exe!FRunnableThreadWin::Run() []
[2022.05.09-02.25.17:821][0]LogWindows: Error: [Callstack] 0x00007ff755442d50 UnrealGame.exe!FRunnableThreadWin::GuardedRun() []
[2022.05.09-02.25.17:821][0]LogWindows: Error: [Callstack] 0x00007fff73a954e0 KERNEL32.DLL!UnknownFunction []
[2022.05.09-02.25.17:821][0]LogWindows: Error: [Callstack] 0x00007fff750c485b ntdll.dll!UnknownFunction []
[2022.05.09-02.25.17:821][0]LogWindows: Error: 
[2022.05.09-02.25.17:821][0]LogWindows: Error: Crash in runnable thread FAsyncLoadingThread
[2022.05.09-02.25.17:839][0]LogExit: Executing StaticShutdownAfterError
[2022.05.09-02.25.17:839][0]LogWindows: FPlatformMisc::RequestExit(1)
[2022.05.09-02.25.17:839][0]LogWindows: FPlatformMisc::RequestExitWithStatus(1, 3)
[2022.05.09-02.25.17:839][0]LogCore: Engine exit requested (reason: Win RequestExit)
[2022.05.09-02.25.17:848][0]Log file closed, 05/09/22 11:25:17

```

---

<div class="post-metadata">

**Author:** ![t-hoshino](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@t-hoshino](https://forums.unrealengine.com/u/t-hoshino)\
**Post date:** [May 12, 2022, 4:49am UTC](https://forums.unrealengine.com/t/crash-when-packaging-a-project-containing-niagaraaudiospectrum-in-ue5-0-1/552399/2 "2022-05-12T04:49:42Z")

</div>

You can see the same phenomenon from this product question

> **[Niagara Audio Visualizer：エフェクト - UE マーケットプレイス](https://www.unrealengine.com/marketplace/ja/product/niagaraaudiovisualizer/questions)**
>
> This is an audio visualizer made by Niagara. Includes a basic emitter and a collection of examples.

---

<div class="post-metadata">

**Author:** ![t-hoshino](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@t-hoshino](https://forums.unrealengine.com/u/t-hoshino)\
**Post date:** [May 17, 2022, 1:27am UTC](https://forums.unrealengine.com/t/crash-when-packaging-a-project-containing-niagaraaudiospectrum-in-ue5-0-1/552399/3 "2022-05-17T01:27:05Z")

</div>

Reported as a bug in the engine

> **[The Unreal Engine Issues and Bug Tracker](https://issues.unrealengine.com/issue/UE-152571)**
>
> Welcome to the Unreal Engine Issue and Bug Tracker. You can check the status of an issue and search for existing bugs. See latest bug fixes too.

---

<div class="post-metadata">

**Author:** ![Teella](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/teella/32/1037992_2.png) [@Teella](https://forums.unrealengine.com/u/Teella)\
**Post date:** [July 11, 2022, 9:18pm UTC](https://forums.unrealengine.com/t/crash-when-packaging-a-project-containing-niagaraaudiospectrum-in-ue5-0-1/552399/4 "2022-07-11T21:18:11Z")

</div>

The problem is the async loading. When the NiagaraDataInterfaceAudioSpectrum loads async, it checks to see if it’s on the main game thread when RegisterToSubmix.

One fix is to disable Async Loading Thread in project settings

 ![disableAsyncLoading](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/9/c/29c974a1d8a7c9539b355f90ae9e21b8ed0bf2bd.jpeg)

OR

Go into Engine\Source\Runtime\Engine\Private\AudioThread.cpp and comment out all  
`check(IsInGameThread());`

Since the audio thread runs in it’s own thread and the source file is called AudioThread.cpp not sure why there is a check to make sure it’s on the main game thread. This check is ignored by the editor.

I’ve tested both. And since I want async loading, I went with option 2…  
`//check(IsInGameThread());`

This is still happening in 5.0.3 (github 5.0 branch latest)… the Bug is flagged not to look at until 5.1

---

<div class="post-metadata">

**Author:** ![ChrixBed](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chrixbed/32/702407_2.png) [@ChrixBed](https://forums.unrealengine.com/u/ChrixBed)\
**Post date:** [October 9, 2022, 10:55pm UTC](https://forums.unrealengine.com/t/crash-when-packaging-a-project-containing-niagaraaudiospectrum-in-ue5-0-1/552399/5 "2022-10-09T22:55:40Z")

</div>

That works, thanks !

---

<div class="post-metadata">

**Author:** ![guyal](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@guyal](https://forums.unrealengine.com/u/guyal)\
**Post date:** [January 18, 2023, 2:57pm UTC](https://forums.unrealengine.com/t/crash-when-packaging-a-project-containing-niagaraaudiospectrum-in-ue5-0-1/552399/6 "2023-01-18T14:57:27Z")

</div>

Now flagged for 5.2 ☹  
Upvote at [Unreal Engine Issues and Bug Tracker (UE-152571)](https://issues.unrealengine.com/issue/UE-152571)

---

<div class="post-metadata">

**Author:** ![guyal](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@guyal](https://forums.unrealengine.com/u/guyal)\
**Post date:** [July 27, 2023, 10:00pm UTC](https://forums.unrealengine.com/t/crash-when-packaging-a-project-containing-niagaraaudiospectrum-in-ue5-0-1/552399/7 "2023-07-27T22:00:52Z")

</div>

Issues site lists it as Fixed in 5.3

> **[The Unreal Engine Issues and Bug Tracker](https://issues.unrealengine.com/issue/search?q=fix%3A5.3%2C5.3.0&resolution=fixed&component=ue_audio_submixes&sort=votes)**
>
> Welcome to the Unreal Engine Issue and Bug Tracker. You can check the status of an issue and search for existing bugs. See latest bug fixes too.
