We've followed the migration instructions (on both the Wwise project and the unreal side), everything went well. We generated the soundbanks, then Unreal got a notification that Wwise assets were going to be reloaded. Upon reload, the editor crashed in a stack overflow, in
FWwiseResourceLoaderImpl::WaitForFutures(...)
This function seems not shielded against infinite (or at least, very long) recursion. Anybody was able to fix this? From what I see in the callstack when the stack overflow happens, the originating operation leading to this cascade of recursive calls is from the execution of the lambda defined in
FWwiseFileHandlerBase::DecrementFileStateUse(...)
Did anybody encounter this? Did you solve it? Can Audiokinetic give any support on that or publish a hotfix? This is completely broken on our end (editor crashes at every launch now) and prevents us to migrate from 2021 to 2022...
EDIT
I tried fixing the WaitForFutures function like this:
void FWwiseResourceLoaderImpl::WaitForFutures(FCompletionFutureArray&& FutureArray, FCompletionCallback&& Callback, int NextId) const
{
if (FutureArray.Num() <= NextId)
{
return Callback();
}
// Prevent unbounded recursion and stack overflows in case FutureArray contains a LOT of completed futures
// (Indeed, Future.Next calls its callback in-stack if Future.IsReady !!)
TFuture<void> Future;
do
{
Future = MoveTemp(FutureArray[NextId]);
NextId += 1;
} while (Future.IsReady() && NextId < FutureArray.Num());
if (FutureArray.Num() <= NextId)
{
return Callback();
}
Future.Next([this, FutureArray = MoveTemp(FutureArray), Callback = MoveTemp(Callback), NextId/* = NextId + 1*/](int) mutable
{
WaitForFutures(MoveTemp(FutureArray), MoveTemp(Callback), NextId);
});
}
It doesn't stack overflow anymore but I have three of these errors after loading:
> Error LogWwiseResourceLoader LoadEventResources: Could not load 1 prerequisites for Event \Events\Default Work Unit\SomeEvent (737333533). Unloading and failing.
> Error LogWwiseResourceLoader LoadEventAsync: Could not load Event \Events\Default Work Unit\SomeEvent (737333533) in language SFX (0)
Could it be that those three assets lead the asset loading in a state not foreseen by the original WaitForFutures function?
EDIT2
Those events do play correctly from the editor content browser though, so not really sure why the error messages if those events work.
Then, I proceeded to open another map... and it crashed again, this time in
FWwiseResourceLoaderImpl::AddLoadSoundBankFutures(...)
in the FileExecutionQueue lambda. The LoadedSoundbanks reference is not valid anymore when the lambda gets executed.
Sigh.