Suspending application on Android hangs in mixer thread system call

Hello!

We’ve got a native game application that hangs when it hits the FMOD suspend call. This call happens after the Android lifecycle event APP_CMD_STOP, which routes through our audio system and ultimately suspends FMOD. We’ve also made sure that no FMOD calls are being made between suspend/resume.

It looks like this is an issue between FMOD and the Android OS because we’re hanging on a system call. The callstack (Audio Mixer thread):

syscall 0x0000007d1a51a65c
android::ClientProxy::obtainBuffer(android::Proxy::Buffer *, const timespec *, timespec *) 0x0000007d308d0490
android::AudioTrack::obtainBuffer(android::AudioTrack::Buffer *, const timespec *, timespec *, unsigned long *) 0x0000007d308be350
android::AudioTrack::write(const void *, unsigned long, bool) 0x0000007d308cb430
android_media_AudioTrack_writeArray<…>(_JNIEnv *, _jobject *, _jshortArray *, int, int, int, unsigned char) 0x0000007d1e161818
art_jni_trampoline 0x00000000727f6e44
nterp_helper 0x0000007a8680a9dc

It’s not guaranteed to hang, but it happens much more often than not (~90%). Are there any known issues in this space? We’ve tried FMOD versions 2.0.0, 2.02.21, and 2.02.26 with no discernable differences.

Thank you for any help!

I can’t seem to reproduce this on my end. How long does it hang for, and do you have a specific device you are testing with?
We made some changes to mixerSuspend/mixerResume in 2.02.27 to shut down the output rather than locking it out, which could potentially prevent the OS from trying to obtain the buffer while suspended. Could you please try testing with 2.02.27 and let me know if it makes a difference at all?