커뮤니티 Q&A

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

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

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

+1 투표

General Information:

  • Crashes on unhandled read violation at nullptr (0x0000000000000000)
  • Unreal 4.22
  • Wwise 2019.1.1.6977
  • Engine Plugin
  • Vanilla Third Party DLL's (straight from the download, but we have the source for debugging)
  • Occurs unpredictably at runtime while the game is posting events (reliably within 5 minutes of play)

Here's the callstack, I'm fairly certain this is a threading error in the AK engine:

  vcruntime140.dll!00007ff92c4014d0() Unknown

  [Inline Frame] [Redacted].exe!AKPLATFORM::AkMemCpy(void *) Line 351 C++

  [Redacted].exe!Bypass_Native_NChan(AkAudioBuffer * io_pInBuffer, AkAudioBuffer * io_pOutBuffer, unsigned long uRequestedSize, AkInternalPitchState * io_pPitchState) Line 63 C++

  [Redacted].exe!CAkResampler::Execute(AkAudioBuffer * io_pInBuffer, AkAudioBuffer * io_pOutBuffer) Line 372 C++

  [Redacted].exe!CAkVPLPitchNode::ConsumeBuffer(AkVPLState & io_state) Line 176 C++

  [Redacted].exe!CAkLEngine::RunVPL(CAkVPLSrcCbxNode * in_pCbx, AkVPLState & io_state) Line 2244 C++

  [Inline Frame] [Redacted].exe!CAkLEngine::ProcessSources(bool) Line 2554 C++

  [Redacted].exe!CAkLEngine::SoftwarePerform() Line 2325 C++

  [Redacted].exe!CAkLEngine::Perform() Line 805 C++

  [Redacted].exe!CAkAudioMgr::Perform() Line 562 C++

  [Redacted].exe!CAkAudioThread::EventMgrThreadFunc(void * lpParameter) Line 74 C++

  [External Code]

 

 

From what I can discern, the AkMemCpy is copying from a nullptr in the pitch resampler. The buffer which is attempting to be read passes an assert in ConsumeBuffer() that verifies it has a valid pointer, but when the Bypass_Native_NChan() call comes through later the buffer has become nullptr. We have the source code for making some necessary integration changes to the sound engine, but this crash comes from the vanilla third party .dll's which we're testing before re-making our internal changes as we upgrade Unreal and Wwise. Our changes worked fine on UE 4.20 with 2018.1.0.6714 but we need to upgrade to UE 4.22 and our audio team needs features in Wwise 2019. 

I'm going to be tweaking the source and rebuilding this to attempt to keep this from crashing, but any help or knowledge on this issue would be greatly appreciated. 

Let me know if there's any information that I can provide that I missed here. 

General Discussion Tom G. (170 포인트) 로 부터

1 답변

+1 투표
After more investigation, it appears that the task queue used to move events from the calling-thread to the audio-thread is no longer fully thread-safe. The issue is that in our implementation we would call functions in the AkAudioDevice from callbacks on the audio thread. The solution is to simply not do this. It was fine to do in Wwise 2018, but the newer version of Wwise 2019 does not handle this and will crash as shown above.

Actionable note:
Do not call Wwise functions from any non-game thread in Unreal. Feel free to use "ensure(IsInGameThread())" to verify your calls are all coming from the correct thread when upgrading to 2019.
Tom G. (170 포인트) 로 부터
Which third party plugin was this?  Hundreds of other games are calling functions from any threads without issue, daily.  I'm more suspicious of a memory stomp due to the third party plugin itself.
As far as I understand, this failure isn't related to a third-party plug in. The crash occurs in the software pipeline in the AkAudioLib which isn't a part of any third-party code, I can confirm that I was capable of reproducing this issue when playing both sounds that were mostly vanilla (non-spatialized sounds with no third-party effects) and heavily modified sounds (spatialized, trash-boxed, reverbed, etc).

The issue may have been explicitly calls from the audio thread, the call that was most to blame for the failure in our implementation was SeekOnEvent which we used to sync time to events in game. I haven't looked closely at any changes in the CAkEvent queue implementation that might have made this operation change between 2018 and 2019.

If I get some time to burn in the near future, I can modify our project to strip all third party plugins out and attempt to reproduce the problem then. If you'd like to test the issue yourself, you can re-implement the worst-offender we had which was to call SeekOnEvent() when the event callback fired with the callback type of AK_Duration.
We are facing similar issues on UE4 integration 2019.2.1.7250, is this note still the same with 2019.2.1.7250? Please let us know because we are calling Ak functions from non-game threads for sure... (animation threads -> AK notify)
Howdy,
I'm fairy certain the Anim Notify thread is safe since there are vanilla AK notify events that call on that thread. It's likely that only AK's callback thread is one of the few crashing locations. This is easy to test as you'll definitely crash if implemented incorrectly.
...