UE5.2 crash caused by niagara particle system + audio spectrum 'NiagaraDataInterfaceAudio'

CrashReportClientEditor_qeYiDNMqzA

UE5.2 crashes when using an audio spectrum scratch module in the stack when pressing ‘play’ to test the game.

The set up is simple: Particles are positioned on the normals of a custom static mesh. Such as using ‘static mesh location’.

The particle size and velocity is then driven using a scratch pad module where the audio spectrum is driving these vectors when the music plays.

in-editor it works fine. When playing the project the whole thing crashes.

This is the same now for using either static mesh location, a custom scratch module for triangle position reference or using the various methods of skeletal mesh location so that the particles take the form of the mesh.

I am currently installing symbols for debugging and will report back what I find.

UPDATE:

More info here.

What happened is that when I first booted the engine and hit ‘play’ to test my level, the system worked fine including the music reactivity for the particles.

When I stopped the playtest and opened up the niagara system. I closed it making no changes and then hit ‘play’ again to test my level. The editor crashed again and now it keeps crashing there after even after a restart.

Here it is in copy/ paste format:

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0xffffffff00000000

UnrealEditor_Niagara!FNiagaraDataInterfaceProxySubmix::AddSubmixListener() [D:\build++UE5\Sync\Engine\Plugins\FX\Niagara\Source\Niagara\Private\NiagaraDataInterfaceAudio.cpp:191]
UnrealEditor_Niagara!TBaseRawMethodDelegateInstance<0,FNiagaraDataInterfaceProxySubmix,void __cdecl(unsigned int),FDefaultTSDelegateUserPolicy>::ExecuteIfSafe() [D:\build++UE5\Sync\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:425]
UnrealEditor_Engine!TMulticastDelegate<void __cdecl(unsigned int),FDefaultTSDelegateUserPolicy>::Broadcast() [D:\build++UE5\Sync\Engine\Source\Runtime\Core\Public\Delegates\DelegateSignatureImpl.inl:988]
UnrealEditor_Engine!FAudioDeviceManager::CreateNewDevice() [D:\build++UE5\Sync\Engine\Source\Runtime\Engine\Private\AudioDeviceManager.cpp:752]
UnrealEditor_Engine!FAudioDeviceManager::RequestAudioDevice() [D:\build++UE5\Sync\Engine\Source\Runtime\Engine\Private\AudioDeviceManager.cpp:477]
UnrealEditor_Engine!UGameViewportClient::Init() [D:\build++UE5\Sync\Engine\Source\Runtime\Engine\Private\GameViewportClient.cpp:527]
UnrealEditor_UnrealEd!UEditorEngine::CreateInnerProcessPIEGameInstance() [D:\build++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\PlayLevel.cpp:3075]
UnrealEditor_UnrealEd!UEditorEngine::OnLoginPIEComplete_Deferred() [D:\build++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\PlayLevel.cpp:1680]
UnrealEditor_UnrealEd!UEditorEngine::CreateNewPlayInEditorInstance() [D:\build++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\PlayLevel.cpp:1943]
UnrealEditor_UnrealEd!UEditorEngine::StartPlayInEditorSession() [D:\build++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\PlayLevel.cpp:2956]
UnrealEditor_UnrealEd!UEditorEngine::StartQueuedPlaySessionRequestImpl() [D:\build++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\PlayLevel.cpp:1257]
UnrealEditor_UnrealEd!UEditorEngine::StartQueuedPlaySessionRequest() [D:\build++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\PlayLevel.cpp:1160]
UnrealEditor_UnrealEd!UEditorEngine::Tick() [D:\build++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\EditorEngine.cpp:1792]
UnrealEditor_UnrealEd!UUnrealEdEngine::Tick() [D:\build++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\UnrealEdEngine.cpp:519]
UnrealEditor!FEngineLoop::Tick() [D:\build++UE5\Sync\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:5812]
UnrealEditor!GuardedMain() [D:\build++UE5\Sync\Engine\Source\Runtime\Launch\Private\Launch.cpp:188]
UnrealEditor!GuardedMainWrapper() [D:\build++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:107]
UnrealEditor!LaunchWindowsStartup() [D:\build++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:244]
UnrealEditor!WinMain() [D:\build++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:284]
UnrealEditor!__scrt_common_main_seh() [D:\a_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
kernel32
ntdll

Here’s an alternative version of the crash report after adding a default submix from the ‘engine content’

2 Likes

having the same issue. just started looking into the code. thats where it is crashing

void FNiagaraDataInterfaceProxySubmix::AddSubmixListener(const Audio::FDeviceId InDeviceId)
{
	check(!SubmixListeners.Contains(InDeviceId)); //LINE 191
	SubmixListeners.Emplace(InDeviceId, new FNiagaraSubmixListener(PatchMixer, NumSamplesToBuffer, InDeviceId, SubmixRegisteredTo));
	SubmixListeners[InDeviceId]->RegisterToSubmix();
}

in fact the chack statement intentionally crashes the app if the condition is not met.

so to me it seems like there got some bug into 5.2 that should be handled by the devs

if you have a source build and can change it you could change that line to

if(SubmixListeners.Contains(InDeviceId))
{
  //report warning to fix later
  return;
}

this may however lead to other crashes :slight_smile:

1 Like

Thanks, it’s a known issue and on the list for 5.3 to be fixed.

3 Likes

Thank you so much LukasDaum for finding this. I was going to look myself to see if there was anything I could do but I’m not using a source build.

A workaround for now seems to be to just do the work you need to then restart the engine, then without touching anything just press play and it’ll work.

This ofcourse isn’t good at all. I’m hoping 5.3 comes out quickly I don’t have much time left on this project lol

The issue is resolved in the current 5.3 branch.
If you go to Unreal Engine Issues and Bug Tracker (UE-152571) you can see a link to the Github commit. It’s a simple fix that you can easy backport into a 5.2 source build if needed.

4 Likes

seems it is also fixed in 5.2.1. i updated and tried it. no crash in editor, niagara editor or PIE.

also the release notes mention a bugfix regarding submix stuff :wink:

2 Likes

Thanks for fixing this, it made my day!

@Michael.Galetzka What is the process of backporting a fix to an older engine version (5.2 source)?
I tried updating the scripts and rebuilding the plugin, but it didn’t work. Would doing a full rebuild of the packaging process, after updating the scripts, work?

Are you using a source build from github? If so, you should be able to merge the linked change directly via git and then rebuild your engine. Otherwise you can manually look at the change and merge it to your c++ files by hand.

What do you mean by “it didn’t work”, do you get a compile error?

@Michael.Galetzka Thanks for the reply.

So I have to rebuild the entire engine?

What I tried that didn’t work was manually updating the scripts (making sure I changed things exactly), and using RunUAT.bat to build the Niagara plugin folder. I do get an error when doing so.
I’m not sure if this is the right approach, not sure if I need to rebuild the engine, just the project, or simply do a full rebuild inside the editor when packaging.

Edit: I tried making a copy of the Niagara plugin and moving to my project folder to edit it there, so it would take precedence over the engine plugin. However, packaging returned an unknown error. Are there any logs where I can look into the specifics of what went wrong?

Yes, you have to rebuild the entire engine, not just the Niagara plugin.

You also can’t copy the Niagara plugin to your project as it needs access to engine modules that it won’t get from your project folder. It would also break dependencies from other plugins and modules to Niagara.

1 Like

I understand, thanks a lot for clarifying! I’ll keep this in mind for similar cases.

not fixed yet! even in 5.4

UE5.4.4 (2024) Stanalone only