Crash in FDynamicsProcessor::ProcessAudio when unplugging controller

We have been getting a crash in FDynamicsProcessor::ProcessAudio when playing audio through a PS5 controller and unplugging the controller, or plugging headphones into the controller. The line that is failing is:

check(GetKeyNumChannels() <= GetNumChannels());

I have fixed it by adding the following to the top of that function:

int32 NumChannels = GetNumChannels();

if (GetKeyNumChannels() > NumChannels)

{

SetKeyNumChannels(NumChannels);

}

I found an old report of the same issue on this forum from 10 months ago which suggests it was fixed with a commit in October 2024. We are on version 5.7.1 so do have that revision but were still seeing the issue.

The fix we have made seems to work fine, so I really just wanted to report this, and if there is a better way to address it then please let me know.

Thanks,

Adrien

[Attachment Removed]

Hey Adrien,

Thanks a ton for reaching out. I’ll ask my team to look at the fix.

[Attachment Removed]

Apologies for the late response, I have been tasked with getting this in for 5.8. I will link the submission here once I get in. Thanks you for your patience!

[Attachment Removed]

Again, so sorry for the long delays. I have submitted this fix, which will make its way into 5.8. You can see the change here. Feel free to pull the change (linked below)!

https://github.com/EpicGames/UnrealEngine/commit/dffc64760645fa76d0510277c37db1de188eb757

[Attachment Removed]

Thanks!

[Attachment Removed]