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.

+5 votes

Hi,

I was attempting to integrate wwise into a Unity project using Unity 2019.3.  I'm using Wwise 2019.2.0 build 7216.  Everything was going smoothly until I started testing in levels.  There are some levels where after testing in the editor, Wwise hangs and completely locks up Unity.  Looking at the call stack, it's here:

AkSoundEngine:ClearBanks ()+0x1 at D:\projects\XXX\Assets\Wwise\Deployment\API\Generated\Windows\AkSoundEngine_Windows.cs:[530:41-530:99]

AKRESULT AkSoundEngine:ClearBanks ()+0x1 at D:\projects\xxx\Assets\Wwise\Deployment\API\Generated\Windows\AkSoundEngine_Windows.cs:[530:41-530:99]

Void AkWwiseInitializationSettings:TerminateSoundEngine ()+0x18 at D:\projects\xxx\Assets\Wwise\Deployment\API\Handwritten\Common\AkWwiseInitializationSettings.cs:[385:3-385:30]

Void AkSoundEngineController:Terminate ()+0x17 at D:\projects\xxx\Assets\Wwise\Deployment\Components\AkSoundEngineController.cs:[148:3-148:56]

Void AkInitializer:OnApplicationQuit ()+0x15 at D:\projects\xxx\Assets\Wwise\Deployment\Components\AkInitializer.cs:[79:4-79:49]

This is happening 100% of the time on my level, both on OSX and in Windows.  I took a look at the process threads; it looks like the main unity thread may be waiting on thread Thread_193361 which is waiting for some other thread..

2180 Thread_193359
    + 2180 thread_start  (in libsystem_pthread.dylib) + 13  [0x7fff6fae340d]
    +   2180 _pthread_start  (in libsystem_pthread.dylib) + 66  [0x7fff6fae7249]
    +     2180 _pthread_body  (in libsystem_pthread.dylib) + 126  [0x7fff6fae42eb]
    +       2180 AK::StreamMgr::CAkIOThread::IOSchedThread(void*)  (in AkSoundEngine) + 75  [0x21753057b]
    +         2180 _pthread_cond_wait  (in libsystem_pthread.dylib) + 722  [0x7fff6fae756e]
    +           2180 __psynch_cvwait  (in libsystem_kernel.dylib) + 10  [0x7fff6fa28866]

    2180 Thread_193361
    + 2180 thread_start  (in libsystem_pthread.dylib) + 13  [0x7fff6fae340d]
    +   2180 _pthread_start  (in libsystem_pthread.dylib) + 66  [0x7fff6fae7249]
    +     2180 _pthread_body  (in libsystem_pthread.dylib) + 126  [0x7fff6fae42eb]
    +       2180 CAkThreadedBankMgr::BankThreadFunc(void*)  (in AkSoundEngine) + 56  [0x217651168]
    +         2180 CAkThreadedBankMgr::ExecuteCommand()  (in AkSoundEngine) + 227  [0x2176512e3]
    +           2180 CAkBankMgr::ExecuteCommand(CAkBankMgr::AkBankQueueItem&)  (in AkSoundEngine) + 661  [0x21759a385]
    +             2180 CAkBankMgr::ClearBanksInternal(CAkBankMgr::AkBankQueueItem)  (in AkSoundEngine) + 461  [0x21759b45d]
    +               2180 CAkBankMgr::KillSlotSync(CAkUsageSlot*)  (in AkSoundEngine) + 102  [0x21759e526]
    +                 2180 semaphore_wait_trap  (in libsystem_kernel.dylib) + 10  [0x7fff6fa25256]
    2180 Thread_193362
    + 2180 thread_start  (in libsystem_pthread.dylib) + 13  [0x7fff6fae340d]
    +   2180 _pthread_start  (in libsystem_pthread.dylib) + 66  [0x7fff6fae7249]
    +     2180 _pthread_body  (in libsystem_pthread.dylib) + 126  [0x7fff6fae42eb]
    +       2180 CAkOutputMgr::SuspendedThread(void*)  (in AkSoundEngine) + 59  [0x2175ef6fb]
    +         2180 semaphore_wait_trap  (in libsystem_kernel.dylib) + 10  [0x7fff6fa25256]
    2180 Thread_193363
    + 2180 thread_start  (in libsystem_pthread.dylib) + 13  [0x7fff6fae340d]
    +   2180 _pthread_start  (in libsystem_pthread.dylib) + 66  [0x7fff6fae7249]
    +     2180 _pthread_body  (in libsystem_pthread.dylib) + 126  [0x7fff6fae42eb]
    +       2180 CAkAudioThread::EventMgrThreadFunc(void*)  (in AkSoundEngine) + 56  [0x217658be8]
    +         2180 CAkAudioMgr::Perform()  (in AkSoundEngine) + 1069  [0x21758ee7d]
    +           2180 CAkURenderer::PerformContextNotif()  (in AkSoundEngine) + 234  [0x21765483a]
    +             2180 CAkPBI::Term(bool)  (in AkSoundEngine) + 231  [0x2175f2687]
    +               2180 CAkPlayingMgr::CheckRemovePlayingID(unsigned int, CAkPlayingMgr::PlayingMgrItem*)  (in AkSoundEngine) + 536  [0x217609208]
    +                 2180 AkCallbackSerializer::EventCallback(AkCallbackType, AkCallbackInfo*)  (in AkSoundEngine) + 302  [0x2174a8dee]
    +                   2180 AkSerializedEventCallbackInfo* AllocNewStruct<AkSerializedEventCallbackInfo>(bool, void*, unsigned int, unsigned int)  (in AkSoundEngine) + 243  [0x2174a92a3]
    +                     2180 semaphore_wait_trap  (in libsystem_kernel.dylib) + 10  [0x7fff6fa25256]

 

I'm not sure what to do from here.  Any help?

thanks,

sam

 

in General Discussion by Sam c. (160 points)

I'm still getting the same error with 2019.2.7.7402.1888.
It usually happens when the game is running and code is changed, forcing the engine to recompile. It hangs in the ResetSoundEngine call at ClearBanks ()

This is still an issue in Wwise 2023.1.9.8471.3062 and Unity 2022.3.21f1. It happens sometimes for some developers (and then it happens a lot)
It also happens when entering Play-mode

Stack trace
AkSoundEngine.ClearBanks()
AkSoundEngineInitialization.ClearBanks()
AkSoundEngineInitialization.ResetSoundEngine()
AkSoundEngineController.Init()
AkInitializer.OnEnable()
Same exact thing on Unity 2023.2.11f1, Wwise 2023.1.1.8417

1 Answer

+1 vote
Definitely still an issue in 2020.2, happens when exiting play mode roughly 20% of the time for me. Forces me to terminate the Unity process and restart the Editor. Extremely annoying.
by Reinier V. (170 points)
This is still an issue in Wwise 2023.1.9.8471.3062 and Unity 2022.3.21f1. It happens sometimes for some developers (and then it happens a lot)
It also happens when entering Play-mode

Stack trace
AkSoundEngine.ClearBanks()
AkSoundEngineInitialization.ClearBanks()
AkSoundEngineInitialization.ResetSoundEngine()
AkSoundEngineController.Init()
AkInitializer.OnEnable()
...