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.

0 votes

For out-of-place effect plugins, IAkEffectPlugin::Init mentions the io_rFormat can be changed.  Changing from an input of 1 to 3 channels works as expected, but 2 to 3 (with respective changes to fields like uBlockAlign and channel mask) crashes in wwise.  This occurs in various versions, e.g. v2023.1.5.8522.  Any recommendations for effect plugins that change the number of channels? 
Stacks below:

CRASH 1:
Crashes immediately upon playback:

> UnrealEditor-WwiseSoundEngine.dll!CAkIndexBase::AkIndexKeyPolicy::Key(const CAkIndexable * in_pItem) Line 239 C++

  UnrealEditor-WwiseSoundEngine.dll!AkHashListBare<unsigned int,CAkIndexable,AkArrayAllocatorNoAlign<0>,CAkIndexBase::AkIndexKeyPolicy,AkHashListBareMemberPolicy<unsigned int,CAkIndexable>>::ExistsInList(unsigned int in_Key, unsigned int in_uiTable) Line 1216 C++

  UnrealEditor-WwiseSoundEngine.dll!AkHashListBare<unsigned int,CAkIndexable,AkArrayAllocatorNoAlign<0>,CAkIndexBase::AkIndexKeyPolicy,AkHashListBareMemberPolicy<unsigned int,CAkIndexable>>::Exists(unsigned int in_Key) Line 1029 C++

  UnrealEditor-WwiseSoundEngine.dll!CAkIndexBase::AddRefUnsafe(unsigned int in_ID) Line 209 C++

  UnrealEditor-WwiseSoundEngine.dll!CAkIndexBase::AddRefIndexable(unsigned int in_ID) Line 70 C++

  UnrealEditor-WwiseSoundEngine.dll!CAkIndexItem<CAkFxCustom *>::GetPtrAndAddRef(unsigned int in_ID) Line 255 C++

  UnrealEditor-WwiseSoundEngine.dll!AkEffectStruct::ToFXPtr() Line 56 C++

  UnrealEditor-WwiseSoundEngine.dll!CAkParameterNodeBase::GetOverridenFX(unsigned int in_uFXIndex, CAkRegisteredObj * in_GameObjPtr) Line 1140 C++

~~~~~~~~~~~~~~~~~~~~~CRASH 2:

plays the content, throws Wwise errors about "in_uIndex < NumChannels()", and then crashes when I exit PIE

 ntdll.dll!RtlEnterCriticalSection() Unknown

> UnrealEditor-WwiseSoundEngine.dll!CAkLock::Lock() Line 55 C++

  UnrealEditor-WwiseSoundEngine.dll!CAkFxBase::RemoveInstance(PluginRTPCSub * in_instance) Line 496 C++

  UnrealEditor-WwiseSoundEngine.dll!PluginRTPCSub::Term() Line 1290 C++

  UnrealEditor-WwiseSoundEngine.dll!CAkBusFX::Processor::_DropEffect(unsigned int idx) Line 188 C++

  UnrealEditor-WwiseSoundEngine.dll!CAkBusFX::Processor::GarbageCollect(const CAkBusFX & in_owner, unsigned char in_uProcessorIdx, const AkArray<CAkBusFX::Object,CAkBusFX::Object const &,AkArrayAllocatorNoAlign<5>,AkGrowByPolicy_Proportional,AkTransferMovePolicy<CAkBusFX::Object>> * in_pInputObjects, const AK::AkHashTable<unsigned __int64,unsigned int> * in_pInputObjIndex, const AkArray<CAkBusFX::Object,CAkBusFX::Object const &,AkArrayAllocatorNoAlign<5>,AkGrowByPolicy_Proportional,AkTransferMovePolicy<CAkBusFX::Object>> * & out_pOutputObjects, const AK::AkHashTable<unsigned __int64,unsigned int> * & out_pOutputObjIndex, bool & out_bStaleDependencies) Line 292 C++

  UnrealEditor-WwiseSoundEngine.dll!CAkVPLMixBusNode::ReleaseBuffer() Line 1803 C++

  UnrealEditor-WwiseSoundEngine.dll!CAkLEngine::ReleaseBuffersAndFeedback() Line 3319 C++

  UnrealEditor-WwiseSoundEngine.dll!CAkLEngine::DispatchBusGraphAsync::__l5::<lambda>() Line 3187 C++

  UnrealEditor-WwiseSoundEngine.dll!AK::JobMgr::Job::ThenWithGlobalLock::__l2::<lambda>() Line 147 C++

  UnrealEditor-WwiseSoundEngine.dll!AK::JobMgr::Internal::JobBody<AK::JobMgr::Job <lambda>(void),AK::JobMgr::Job>::Execute() Line 278 C++

  UnrealEditor-WwiseSoundEngine.dll!AK::JobMgr::Internal::JobManager_internalWorkerFunction(AK::JobMgr::Internal::WorkerState & workerState, unsigned int in_uExecutionTimeUsec) Line 653 C++

  UnrealEditor-WwiseSoundEngine.dll!AK::JobMgr::WorkUntilDone(AK::JobMgr::Job && targetJob) Line 1341 C++

  UnrealEditor-WwiseSoundEngine.dll!CAkAudioMgr::Perform(bool in_bProcessMessageQueueOnly) Line 607 C++

  UnrealEditor-WwiseSoundEngine.dll!CAkAudioMgr::PerformOnline() Line 547 C++

  UnrealEditor-WwiseSoundEngine.dll!CAkAudioThread::EventMgrThreadFunc(void * lpParameter) Line 70 C++

in General Discussion by Sserpenthraxus-fw (110 points)

1 Answer

0 votes
Hi,

Reviewing the code, and behaviour around some Out-of-place effect plug-ins that we have, things continue to operate within our expectations. That is, setting a new value for io_rFormat's channel configuration during plug-in initialization should be reflected in the channel count of the output audiobuffer when executing the plug-in later, with the memory properly allocated with whatever the channel config specified was.

Since we do not have any publicly accessible examples of an out-of-place effect plug-in in action to refer to, would it be possible to provide your plug-in's code for a brief review to see what may be going wrong, so that we can do a brief review to see if a problem sticks out?

Or, if you wish to debug yourself, one debugging tool that we have, which may be useful, is our stomp allocator. This can be enabled by initializing the memory allocator with AkMemSettings::uMemoryDebugLevel to 2 as described here: https://www.audiokinetic.com/en/library/2023.1.9_8628/?source=SDK&id=memorymanager.html

The crashes that you're describing seem like the kind of issue that would result from a memory overrun, so this tool should help to catch any memory overruns that may be performed by the code, be it yours, or ours. Since you appear to be running Wwise using the Wwise-Unreal Integration, you may have to modify the code in the integration to activate this setting. Instead of Unreal, it may also be worth attempting to get your plug-in operational in our IntegrationDemo application included in the SDK, if only so that you can test your plug-in in isolation of a full game engine application, giving you more direct control of the memory management and other configuration settings for Wwise, but also provide a more lightweight operating environment.
by ak_dcrooks (220 points)
...