Description

Cooked games will hang on startup when using the Oscilloscope data interface due to an indefinite wait in FNiagaraSubmixListener::UnregisterFromSubmix 

When setting GCVarEnableAudioCommandLogging to 1 the message changed to:

LogAudio: Display: Waited 25142.10 ms for audio thread. (Current Task: , Longest task: 0.00 ms)

Steps to Reproduce
  1. Create a Niagara system based on the fountain template
  2. Add a new scratch module to the particle update
  3. Add an Oscilloscope input to the module
  4. Sample the Audio Buffer on the Oscilloscope with "Sample Audio Buffer"
  5. Use Particles.NormalizedAge for the NormalizedPositionInBuffer
  6. Multiply the Amplitude by 100 and set Particles.SpriteSize with the results
  7. Apply, Compile, and Save
  8. Add the system to a level
  9. Trigger a sound to play on begin play
  10. Package to the project for Windows and run the exe

RESULT
The game will launch with a black screen and indefinitely print: LogAudio: Display: Waited 22330.441406 ms for audio thread.

Callstack

> R426-Win64-Debug.exe!FAudioCommandFence::Wait(bool bProcessGameThreadTasks) Line 565 C+> R426-Win64-Debug.exe!FAudioCommandFence::Wait(bool bProcessGameThreadTasks) Line 565 C  R426-Win64-Debug.exe!FNiagaraSubmixListener::UnregisterFromSubmix() Line 86 C  R426-Win64-Debug.exe!FNiagaraSubmixListener::~FNiagaraSubmixListener() Line 51 C  [External Code]   R426-Win64-Debug.exe!TSparseArray<TSetElement<TTuple<unsigned int,TUniquePtr<FNiagaraSubmixListener,TDefaultDelete<FNiagaraSubmixListener>>>>,TSparseArrayAllocator<TSizedDefaultAllocator<32>,FDefaultBitArrayAllocator>>::RemoveAt(int Index, int Count) Line 299 C  R426-Win64-Debug.exe!TSet<TTuple<unsigned int,TUniquePtr<FNiagaraSubmixListener,TDefaultDelete<FNiagaraSubmixListener>>>,TDefaultMapHashableKeyFuncs<unsigned int,TUniquePtr<FNiagaraSubmixListener,TDefaultDelete<FNiagaraSubmixListener>>,0>,FDefaultSetAllocator>::Remove(FSetElementId ElementId) Line 770 C  R426-Win64-Debug.exe!TSet<TTuple<unsigned int,TUniquePtr<FNiagaraSubmixListener,TDefaultDelete<FNiagaraSubmixListener>>>,TDefaultMapHashableKeyFuncs<unsigned int,TUniquePtr<FNiagaraSubmixListener,TDefaultDelete<FNiagaraSubmixListener>>,0>,FDefaultSetAllocator>::Remove(const unsigned int Key) Line 916 C  R426-Win64-Debug.exe!FNiagaraDataInterfaceProxyOscilloscope::UnregisterFromAllAudioDevices::_l5::<lambda>(unsigned int DeviceId, FAudioDevice * InDevice) Line 76 C  R426-Win64-Debug.exe!UE4Function_Private::TFunctionRefCaller<void <lambda>(unsigned int, FAudioDevice *),void __cdecl(unsigned int,FAudioDevice *)>::Call(void * Obj, unsigned int & <Params_0>, FAudioDevice * & <Params_1>) Line 549 C  R426-Win64-Debug.exe!UE4Function_Private::TFunctionRefBase<UE4Function_Private::TFunctionStorage<1>,void __cdecl(unsigned int,FAudioDevice *)>::operator()(unsigned int <Params_0>, FAudioDevice * <Params_1>) Line 677 C  R426-Win64-Debug.exe!FAudioDeviceManager::IterateOverAllDevices(TUniqueFunction<void __cdecl(unsigned int,FAudioDevice *)> ForEachDevice) Line 915 C  R426-Win64-Debug.exe!FNiagaraDataInterfaceProxyOscilloscope::UnregisterFromAllAudioDevices(USoundSubmix * Submix) Line 80 C  R426-Win64-Debug.exe!FNiagaraDataInterfaceProxyOscilloscope::OnUpdateSubmix(USoundSubmix * Submix) Line 91 C  R426-Win64-Debug.exe!UNiagaraDataInterfaceAudioOscilloscope::PostLoad() Line 435 C  R426-Win64-Debug.exe!UObject::ConditionalPostLoad() Line 1086 C  R426-Win64-Debug.exe!FAsyncPackage::PostLoadObjects() Line 6410 C  R426-Win64-Debug.exe!FAsyncPackage::TickAsyncPackage(bool InbUseTimeLimit, bool InbUseFullTimeLimit, float & InOutTimeLimit, FFlushTree * FlushTree) Line 5579 C  R426-Win64-Debug.exe!FAsyncLoadingThread::ProcessAsyncLoading(int & OutPackagesProcessed, bool bUseTimeLimit, bool bUseFullTimeLimit, float TimeLimit, FFlushTree * FlushTree) Line 4099 C  R426-Win64-Debug.exe!FAsyncLoadingThread::TickAsyncThread(bool bUseTimeLimit, bool bUseFullTimeLimit, float TimeLimit, bool & bDidSomething, FFlushTree * FlushTree) Line 4855 C  R426-Win64-Debug.exe!FAsyncLoadingThread::TickAsyncLoading(bool bUseTimeLimit, bool bUseFullTimeLimit, float TimeLimit, FFlushTree * FlushTree) Line 4555 C  R426-Win64-Debug.exe!FAsyncLoadingThread::FlushLoading(int PackageID) Line 7008 C  R426-Win64-Debug.exe!FlushAsyncLoading(int PackageID) Line 603 C  R426-Win64-Debug.exe!LoadPackageInternal(UPackage * InOuter, const wchar_t * InLongPackageNameOrFilename, unsigned int LoadFlags, FLinkerLoad * ImportLinker, FArchive * InReaderOverride, const FLinkerInstancingContext * InstancingContext) Line 1137 C  R426-Win64-Debug.exe!LoadPackage(UPackage * InOuter, const wchar_t * InLongPackageName, unsigned int LoadFlags, FArchive * InReaderOverride, const FLinkerInstancingContext * InstancingContext) Line 1458 C  R426-Win64-Debug.exe!UEngine::LoadMap(FWorldContext & WorldContext, FURL URL, UPendingNetGame * Pending, FString & Error) Line 12864 C  R426-Win64-Debug.exe!UEngine::Browse(FWorldContext & WorldContext, FURL URL, FString & Error) Line 12302 C  R426-Win64-Debug.exe!UGameInstance::StartGameInstance() Line 580 C  R426-Win64-Debug.exe!UGameEngine::Start() Line 1167 C  R426-Win64-Debug.exe!FEngineLoop::Init() Line 3990 C  R426-Win64-Debug.exe!EngineInit() Line 52 C  R426-Win64-Debug.exe!GuardedMain(const wchar_t * CmdLine) Line 153 C  R426-Win64-Debug.exe!WinMain(HINSTANCE_ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow) Line 257 C[External Code]

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-104341 in the post.

6
Login to Vote

Fixed
ComponentUE - Audio
Target Fix5.0
Fix Commit16752519
Release Commit16752519
CreatedDec 9, 2020
ResolvedJun 23, 2021
UpdatedDec 1, 2022
View Jira Issue