# FMOD iOS App Hang on Resume: "The app was terminated while unresponsive"

**URL:** <https://qa.fmod.com/t/fmod-ios-app-hang-on-resume-the-app-was-terminated-while-unresponsive/24326>\
**Category:** Unity\
**Tags:** ios\
**Created:** [June 10, 2026, 3:02am UTC](https://qa.fmod.com/t/fmod-ios-app-hang-on-resume-the-app-was-terminated-while-unresponsive/24326 "2026-06-10T03:02:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![PandaJoker](https://avatars.discourse-cdn.com/v4/letter/p/9e8a1a/32.png) [@PandaJoker](https://qa.fmod.com/u/PandaJoker)\
**Post date:** [June 10, 2026, 3:02am UTC](https://qa.fmod.com/t/fmod-ios-app-hang-on-resume-the-app-was-terminated-while-unresponsive/24326/1 "2026-06-10T03:02:16Z")

</div>

Hi everyone,

I’m encountering a persistent issue with FMOD in my Unity project on iOS. When the app resumes from the background, the OS occasionally terminates it with the error: **“The app was terminated while unresponsive.”**

I suspect this is related to how I’m handling `AVAudioSession` reactivation. During resume, if `setActive:TRUE` fails with `AVAudioSessionErrorCodeCannotStartPlaying`, I am currently using a `while` loop to retry activation (as shown in the code below). I suspect this blocking loop is triggering the iOS Watchdog to kill the app.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/e/ed18c237459424a5f5ad411951d0819067e7b397.png)

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [June 16, 2026, 5:20am UTC](https://qa.fmod.com/t/fmod-ios-app-hang-on-resume-the-app-was-terminated-while-unresponsive/24326/2 "2026-06-16T05:20:29Z")

</div>

Hi,

Can I get some more info from you? Specifically:

- Your FMOD version
- Your Unity version
- You iOS version
- What Category your AVAudioSession is using

Thanks!

---

<div class="post-metadata">

**Author:** ![PandaJoker](https://avatars.discourse-cdn.com/v4/letter/p/9e8a1a/32.png) [@PandaJoker](https://qa.fmod.com/u/PandaJoker)\
**Post date:** [June 25, 2026, 2:50am UTC](https://qa.fmod.com/t/fmod-ios-app-hang-on-resume-the-app-was-terminated-while-unresponsive/24326/3 "2026-06-25T02:50:52Z")

</div>

Hi, here is the version information:

Unity version:6000.3.7f1  
Unity\_Fmod :2.03.11  
IPhone 17 Pro max ,IOS 26.4  
User-reported crash log from backend. Not sure what the AVAudioSession category is.

I would really appreciate it if you could help locate the issue.

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [June 30, 2026, 4:28am UTC](https://qa.fmod.com/t/fmod-ios-app-hang-on-resume-the-app-was-terminated-while-unresponsive/24326/4 "2026-06-30T04:28:28Z")

</div>

Thanks for the additional info!

At the point of the `usleep()`, FMOD is unable to set the AVAudioSession as active due to circumstances outside of its control (i.e. some other app taking priority), and since the `AVAudioSession` is handled by iOS, it’s not really possible for FMOD to do anything else. I’d recommend modifying that section of the code to use periodically attempt to set the session as active without using `usleep` - the [`NSTimer`](https://developer.apple.com/documentation/foundation/timer?language=objc) class might be worth looking into.

---

<div class="post-metadata">

**Author:** ![PandaJoker](https://avatars.discourse-cdn.com/v4/letter/p/9e8a1a/32.png) [@PandaJoker](https://qa.fmod.com/u/PandaJoker)\
**Post date:** [July 6, 2026, 2:41am UTC](https://qa.fmod.com/t/fmod-ios-app-hang-on-resume-the-app-was-terminated-while-unresponsive/24326/5 "2026-07-06T02:41:57Z")

</div>

> [@Leah\_FMOD](#):
>
> `usleep`

Thank you for your response!

I would like to provide some additional information. The `-usleep` method is actually in the Objective-C code generated by Unity when exporting to Xcode, rather than in our source code, so I am unsure how to change it. Could you please clarify how to call the “… use periodically attempt to set the session…” solution you suggested?

Thank you for your help!

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [July 8, 2026, 6:38am UTC](https://qa.fmod.com/t/fmod-ios-app-hang-on-resume-the-app-was-terminated-while-unresponsive/24326/6 "2026-07-08T06:38:57Z")

</div>

> [@PandaJoker](#):
>
> I would like to provide some additional information. The `-usleep` method is actually in the Objective-C code generated by Unity when exporting to Xcode, rather than in our source code, so I am unsure how to change it.

The Objective-C code you’re looking at is actually code that comes with the FMOD for Unity integration, specifically for handling suspending/resuming and interruptions on iOS. You can find it at `./Assets/Plugins/FMOD/platform_ios.mm`.

> [@PandaJoker](#):
>
> Could you please clarify how to call the “… use periodically attempt to set the session…” solution you suggested?

You should take a look at deleting the entire `while` loop around the `usleep` call a d replacing it with an `NSTimer`, as previously mentioned. Here’s a theoretical example, which may or may not suit your needs:

```objc
[NSTimer scheduledTimerWithTimeInterval:.01 repeats:YES block:^(NSTimer * _Nonnull timer) {
    if ([[AVAudioSession sharedInstance] setActive:TRUE error:nil]){
        [timer invalidate];
    }
}];

```
