PS5 Deadlock Between Main Thread and FMOD Studio Update Thread Causing Game Freeze

Hi,

We’ve encountered a deadlock issue on PS5 when using FMOD Studio. The game completely freezes because two threads are waiting on each other while holding FMOD critical sections.

The issue has only been reproduced on PS5. We have not observed it on any other platform (PC, Xbox, etc.).

Thread #1 (Main Thread) is stuck inside FMOD::System::getChannelsPlaying() called from FFMODStudioModule::Tick():

Call stack:

FFMODStudioModule::Tick(float DeltaTime)
FMOD::System::getChannelsPlaying()
FMOD::System::validate()
FMOD::System::enterMainUpdateLock()
FMOD::System::enterCrit(FMOD_SYSTEM_CRIT)

Thread #2 (FMOD Studio Update Thread) is blocked in FMOD’s internal update code:

FMOD_OS_Thread_Callback()
FMOD::AsyncManager::threadLoop()
FMOD::AsyncManager::asyncProcessAndUpdate()
FMOD::RuntimeAPIManager::update()
FMOD::PlaybackSystem::update()
FMOD::System::update()
FMOD::System::updateInternal()
FMOD::DSPPanner::commandInternal()
FMOD::System::lockDSPQueueCmd()
FMOD::System::flushDSPQueue()
FMOD::System::enterCrit(FMOD_SYSTEM_CRIT)

It appears that both threads are waiting for locks held by each other, resulting in a deadlock.

Additional information:

  • Platform: PS5
  • FMOD integration: Unreal Engine 5.4
  • The freeze is permanent (the game never recovers).
  • Reproduced only on PS5.
  • Other platforms do not exhibit this behavior
  • FMod version 2.03.14
  • PS SDK: 12
    .

Has this issue been reported before on PS5, or is there any known workaround or recommended synchronization strategy for these FMOD API calls?

Any help would be appreciated. Thanks!

I can’t see any known issues or recent fixes related to deadlocks in our backend. I have done some slow stepping and freezing through these threads around those callsites but I can’t get them to deadlocklock on their own so I suspect there’s another thread at play- looks like the mixer thread is also making some calls into DSPPanner which could potentially hold a relevant crit under some circumstances.
Can you please upload a dump with full memory to your FMOD Profile so I can take a closer look at what’s happening in these threads?

How can I send you the dump? The forum here doesn’t allow me to attach it.

You should be able to upload it to your FMOD Profile:

Please let me know if you encounter any issues accessing this page.

I just downloaded the dump

Thank you for sending that over. Here is what I’m seeing on my end:

  • The FMOD Unreal integration is making a call to getChannelsPlaying, which is waiting on a crit called MAINUPDATE.
  • The FMOD studio update thread is holding the MAINUPDATE crit, and waiting on a different crit called DSPMIXER.
  • The FMOD mixer thread is holding DSPMIXER, and is currently waiting for a large instance of a streaming sound to complete playing.
  • The FMOD feeder thread is trying to load a large stream, but it just received SCE_AJM_ERROR_OUT_OF_RESOURCES and is waiting for streams to become available.

So, the core problem appears to be that FMOD can freeze your game on PS5 if you run out of hardware Opus codecs. While I investigate this issue, can you please try rebuilding your bank as Vorbis and let me know if you can still reproduce this issue?

Yep, vorbis banks fixes it