커뮤니티 Q&A

Audiokinetic의 커뮤니티 Q&A 포럼에 오신 것을 환영합니다. 이 포럼은 Wwise와 Strata 사용자들이 서로 도움을 주는 곳입니다. Audiokinetic의 직접적인 도움을 얻으려면 지원 티켓 페이지를 사용하세요. 버그를 보고하려면 Audiokinetic 런처에서 Bug Report 옵션을 사용하세요. (Q&A 포럼에 제출된 버그 보고는 거절됩니다. 전용 Bug Report 시스템을 사용하면 보고 내용이 담당자에게 정확히 전달되어 문제 해결 가능성이 크게 높아집니다.)<segment 6493>

빠르고 정확한 답변을 얻으려면 질문을 올릴 때 다음 팁을 참고하세요.

  • 구체적인 내용을 적어주세요: 무엇을 하려는지, 혹은 어떤 특정 문제에 부딪혔는지 설명하세요.
  • 핵심 정보를 포함하세요: Wwise와 게임 엔진 버전, 운영체제 등 관련 정보를 함께 제공하세요.
  • 시도한 방법들을 알려주세요: 문제 해결을 위해 이미 어떤 단계를 시도해봤는지 설명해주세요.
  • 객관적인 사실에 초점을 맞추세요: 문제의 기술적 사실을 중심으로 설명하세요. 문제에 집중할수록 다른 사람들이 더 빠르게 해결책을 찾을 수 있습니다.

0 투표
We are experiencing recurrent deadlocks in our iOS application using Wwise version 2019.2 when set Wwise uMemAllocationSizeLimit  to 100M for memory optimism. We have captured logs and thread stacks for two different scenarios that lead to a complete application freeze. We would appreciate your insight into these issues.

Scenario 1: Deadlock between SetPosition and LoadBank
In this scenario, the application freezes due to a deadlock between a game thread calling AK::SoundEngine::SetPosition and a Wwise thread loading a SoundBank.

Analysis:

Thread 30 (Game Logic) gets stuck inside AK::SoundEngine::SetPosition. It appears to be waiting for a lock within CAkAudioMgr::ReserveQueue.
Thread 39 (Wwise Bank Loading) is simultaneously stuck inside CAkBankMgr::LoadBank while trying to acquire a lock in CAkBankMgr::ReadSourceParent.
We suspect a classic A-B/B-A deadlock, where the game thread has locked a resource within CAkAudioMgr and is waiting for the bank to load, while the bank loading thread has locked a resource in CAkBankMgr and is waiting for a resource from CAkAudioMgr.

Key Call Stacks for Scenario 1:

some log may helps:

 

AVAudioSessionClient_Common.mm:597   Failed to set properties, error: -50

AK Error: Vorbis decoder failure: 691920477

AK Error: Audio command queue is full, blocking caller.  Reduce number of calls to sound engine or boost command queue memory.

 

Thread 30 (Waiting in SetPosition)
#3  in __psynch_mutexwait ()
#4  in CAkAudioMgr::ReserveQueue at AkAudioMgr.cpp:428
#5  in AK::SoundEngine::SetPositionInternal at AkAudioLib.cpp:1366
#6  in AK::SoundEngine::SetPosition at AkAudioLib.cpp:1355
#7  in Messiah::SoundManagerWwise::_Tick_on_ot at SoundManagerWwise.cpp:680
...
1
2
3
4
5
6
Thread 39 (Waiting in LoadBank)

#3  in __psynch_mutexwait ()
#4  in CAkBankMgr::ReadSourceParent<CAkSound> at AkBankMgr.h:547
#5  in CAkBankMgr::ProcessHircChunk at AkBankMgr.cpp:2096
#6  in CAkBankMgr::LoadBank at AkBankMgr.cpp:889
#7  in CAkThreadedBankMgr::ExecuteCommand at AkThreadedBankMgr.cpp:193
#8  in CAkThreadedBankMgr::BankThreadFunc at AkThreadedBankMgr.cpp:134
...

Scenario 2: Deadlock Triggered by Memory Allocation Failure
This scenario also results in a deadlock, but it appears to be triggered by a memory allocation failure within the Wwise audio rendering thread.

Analysis:

Thread 39 (Wwise Audio Rendering) is stuck in AkMonitor::MonitorAllocFailure after a call to AK::MemoryMgr::Malloc failed during Opus stream decoding (CAkSrcFileOpus::SeekHelper). We believe the error handling path attempts to acquire a lock that is already held, causing it to freeze.
Thread 37 (Wwise Bank Loading) is stuck in the middle of a CAkBankMgr::LoadBank operation, holding a lock that Thread 39 is likely waiting for.
Thread 28 (Game Logic) is blocked on a synchronous call to AK::SoundEngine::UnloadBank. It is waiting for the bank manager thread (Thread 37), which is already deadlocked and cannot process the unload request.
The root cause appears to be memory exhaustion in the audio engine, which leads to a deadlock between the audio rendering thread and the bank manager thread during the error reporting process.

 

Key Call Stacks for Scenario 2:

some log may helps:

AVAudioSessionClient_Common.mm:597   Failed to set properties, error: -50

AK Error: ….

AK Error: Error while decoding Opus header.: 863644167

AK Error: Error while decoding Opus header.: 290020993

AK Error: Error while decoding Opus header.: 290020993

AK Error: Insufficient Space to Load Bank

AK Error: Bank Load Failed

 

Thread 39 (Stuck in Error Handling)
#1  in AkMonitor::MonitorAllocFailure at AkMonitor.cpp:183
#2  in AK::MemoryMgr::Malloc at AkMemoryMgrBase.cpp:395
#3  in ::AK_malloc at AkOpusLib.cpp:67
#4  in ogg_sync_buffer_AK at framing.c:647
#5  in op_get_next_page at opusfile.c:209
#6  in op_pcm_seek_AK at opusfile.c:2633
#7  in CAkSrcFileOpus::SeekHelper at AkSrcFileOpus.cpp:658
#8  in CAkLEngine::ProcessSources at AkLEngine_SoftwarePipeline.cpp:2585
#9  in CAkAudioMgr::Perform at AkAudioMgr.cpp:585
#10 in CAkAudioThread::EventMgrThreadFunc at AkAudioThread.cpp:66

Thread 37 (Waiting in LoadBank)

#3  in __psynch_mutexwait ()
#4  in CAkBankMgr::ReadSourceParent<CAkSound> at AkBankMgr.h:547
#5  in CAkBankMgr::ProcessHircChunk at AkBankMgr.cpp:2096
#6  in CAkBankMgr::LoadBank at AkBankMgr.cpp:889
#7  in CAkThreadedBankMgr::ExecuteCommand at AkThreadedBankMgr.cpp:193
#8  in CAkThreadedBankMgr::BankThreadFunc at AkThreadedBankMgr.cpp:134
...

Thread 28 (Waiting in UnloadBank)

 

#1  in semaphore_wait_trap ()
#2  in CAkThreadedBankMgr::WaitForSyncOp at AkThreadedBankMgr.cpp:177
#3  in AK::SoundEngine::UnloadBank at AkAudioLib.cpp:4302
#4  in Messiah::SoundManagerWwise::HandleLoadBankAsyncCallback at SoundManagerWwise.cpp:3256
...

Could you please let us know if these are known issues or if you have any recommendations for how to resolve or work around them? The memory allocation failure in the second scenario is particularly concerning.

Thank you for your time and assistance.
General Discussion aaron chen (100 포인트) 로 부터

Please sign-in or register to answer this question.

...