Audiokinetic's Community Q&A is the forum where users can ask and answer questions within the Wwise and Strata communities. If you would like to get an answer from Audiokinetic's Technical support team, make sure you use the Support Tickets page.

+3 votes
Hello,

we are getting this error when generating sound data in UE 4.26 (Wwise 2021.10).  Does anyone else have same problem? We don't use event based packaging.

 

Assertion failed: IsInGameThread() [File:B:/UnrealEngineSourceBuild/Engine/Source/Runtime/Engine/Private/StreamableManager.cpp] [Line: 584]

UE4Editor_Core!AssertFailedImplV() [b:\unrealenginesourcebuild\engine\source\runtime\core\private\misc\assertionmacros.cpp:102]
UE4Editor_Core!FDebug::CheckVerifyFailedImpl() [b:\unrealenginesourcebuild\engine\source\runtime\core\private\misc\assertionmacros.cpp:458]
UE4Editor_Engine!FStreamableHandle::ReleaseHandle() [b:\unrealenginesourcebuild\engine\source\runtime\engine\private\streamablemanager.cpp:584]
UE4Editor_AudiokineticTools!AkSoundDataBuilder::~AkSoundDataBuilder() [D:\Dev\payback-game\Plugins\Wwise\Source\AudiokineticTools\Private\AssetManagement\AkSoundDataBuilder.cpp:95]
UE4Editor_AudiokineticTools!<lambda_98943428dbac4f04fd156ca3b2654230>::~<lambda_98943428dbac4f04fd156ca3b2654230>()
UE4Editor_AudiokineticTools!UE4Function_Private::TFunction_UniqueOwnedObject<<lambda_98943428dbac4f04fd156ca3b2654230>,1>::`scalar deleting destructor'()
UE4Editor_AudiokineticTools!UE4Function_Private::IFunction_OwnedObject_OnHeap<<lambda_98943428dbac4f04fd156ca3b2654230> >::Destroy() [D:\Dev\UnrealEngine\Engine\Source\Runtime\Core\Public\Templates\Function.h:148]
UE4Editor_AudiokineticTools!TGraphTask<TFunctionGraphTaskImpl<void __cdecl(void),0> >::ExecuteTask() [D:\Dev\UnrealEngine\Engine\Source\Runtime\Core\Public\Async\TaskGraphInterfaces.h:887]
UE4Editor_Core!FTaskThreadAnyThread::ProcessTasks() [b:\unrealenginesourcebuild\engine\source\runtime\core\private\async\taskgraph.cpp:1065]
UE4Editor_Core!FTaskThreadAnyThread::ProcessTasksUntilQuit() [b:\unrealenginesourcebuild\engine\source\runtime\core\private\async\taskgraph.cpp:888]
UE4Editor_Core!FTaskThreadAnyThread::Run() [b:\unrealenginesourcebuild\engine\source\runtime\core\private\async\taskgraph.cpp:965]
UE4Editor_Core!FRunnableThreadWin::Run() [b:\unrealenginesourcebuild\engine\source\runtime\core\private\windows\windowsrunnablethread.cpp:86]
in General Discussion by Radek Karnik (990 points)
Same here. Really want to know.
Though we are using the event based pipeline.

1 Answer

0 votes
Hi, we had this same issue. We use event based packaging and here is what we found and our approach to fix it.

The sound data builder AkSoundDataBuilder holds a handle for an asset it has loaded, this handle have to be released on the game thread as there are checks to see if IsInGameThread() is true when releasing it. We found it was released on a background thread so we fixed this by changing the code in ~AkSoundDataBuilder() to dispatch the cleanup to the game thread like below:
AkSoundDataBuilder::~AkSoundDataBuilder()
{
    // The handle can not be released on this thread, move and release it on the game thread.
    auto requestAsyncCleanupTask = FFunctionGraphTask::CreateAndDispatchWhenReady([handle = MoveTemp(loadedAssetsHandle)] {
        if (handle.IsValid())
        {
            handle->ReleaseHandle();
        }
    }, GET_STATID(STAT_EventPlatformDataEventGroup), nullptr, ENamedThreads::GameThread);
}

Hope this helps anyone else with this issue.
by Gustav L. (250 points)
...