# tvOS audio interruption

**URL:** <https://qa.fmod.com/t/tvos-audio-interruption/15040>\
**Category:** Unity\
**Created:** [September 12, 2019, 6:55am UTC](https://qa.fmod.com/t/tvos-audio-interruption/15040 "2019-09-12T06:55:06Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![wildboystudios](https://avatars.discourse-cdn.com/v4/letter/w/7cd45c/32.png) [@wildboystudios](https://qa.fmod.com/u/wildboystudios)\
**Post date:** [September 12, 2019, 6:55am UTC](https://qa.fmod.com/t/tvos-audio-interruption/15040/1 "2019-09-12T06:55:06Z")

</div>

When minimizing and un-minimizing a game on tvOS - sometimes the audio doesn’t resume correctly.

Generally it happens rarely, but when a BeatEventCallback is active, it happens 25% of the time. ( could just be a coincidence, only managed to reproduce it around 10 times for now. )

I’ve checked the log and OnApplicationPause with mixerResume is being called, even when the audio doesn’t resume. Minimizing and unminimizing after an audio freeze, will make the audio continue again.  
This is the last issue blocking our release.

Unity 2019.2.3f1, FMOD 1.10.15

---

<div class="post-metadata">

**Author:** ![wildboystudios](https://avatars.discourse-cdn.com/v4/letter/w/7cd45c/32.png) [@wildboystudios](https://qa.fmod.com/u/wildboystudios)\
**Post date:** [September 13, 2019, 4:25am UTC](https://qa.fmod.com/t/tvos-audio-interruption/15040/2 "2019-09-13T04:25:43Z")

</div>

Also how do I get logs to work in a build ? FMODSettings logging is set to LOG, logs work in the Editor, but I won’t get any logs when doing a development/debug build for AppleTV. Thanks

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [September 18, 2019, 1:38am UTC](https://qa.fmod.com/t/tvos-audio-interruption/15040/3 "2019-09-18T01:38:51Z")

</div>

As long as you are using the FMOD logging libs (see [iOS audio session interruption](https://qa.fmod.com/t/ios-audio-session-interruption/15014/14)) FMOD will provide extra logging. When using the logging libs, if [`Debug_Initialize`](https://fmod.com/resources/documentation-api?version=2.0&page=core-api-common.html#debug_initialize) isn’t called, it will still be used but using default values ([`FMOD_DEBUG_LEVEL_LOG`](https://fmod.com/resources/documentation-api?version=2.0&page=core-api-common.html#fmod_debug_flags) and [`FMOD_DEBUG_MODE_TTY`](https://fmod.com/resources/documentation-api?version=2.0&page=core-api-common.html#fmod_debug_mode)) which will output to the devices console.

---

<div class="post-metadata">

**Author:** ![wildboystudios](https://avatars.discourse-cdn.com/v4/letter/w/7cd45c/32.png) [@wildboystudios](https://qa.fmod.com/u/wildboystudios)\
**Post date:** [September 18, 2019, 9:18am UTC](https://qa.fmod.com/t/tvos-audio-interruption/15040/4 "2019-09-18T09:18:57Z")

</div>

Thank you Cameron. I’ve got logs now - I’m not sure what it is tho… maybe a race condition between fmod/unity resuming and tvOS still locking the audio session.

Anyway after the audio freezes, calling mixerResume fires with RESULT\_OK, but no audio comes back. Mixer suspend is being called before, which shows in the logs. I’ve uploaded two log files, a short one where it happened after the second try and a longer one where it happened multiple times.

tvOS interestingly fires a native Interruption notification started but doesn’t fire a stopped, with every minimizing/unminimizing action.

I’ve tried calling the native [[AVAudioSession sharedInstance] setActive: **TRUE** error: **nil** ]; as well but no luck. Audio will only always come back after loosing and regaining focus ( either Screensaver comes on, or minimizing/un…)

---

<div class="post-metadata">

**Author:** ![wildboystudios](https://avatars.discourse-cdn.com/v4/letter/w/7cd45c/32.png) [@wildboystudios](https://qa.fmod.com/u/wildboystudios)\
**Post date:** [September 18, 2019, 10:42am UTC](https://qa.fmod.com/t/tvos-audio-interruption/15040/5 "2019-09-18T10:42:45Z")

</div>

I’ve just created a completely empty FMOD project with 1 event 1 assets, empty Unity Project and reproduced the freeze after 20-30 attempts. Definitely a tick harder to reproduce then in our game.

At least I get the error message now :  
**[avas] AVAudioSession.mm:998:-[AVAudioSession setActive:withOptions:error:]: Deactivating an audio session that has running I/O. All I/O should be stopped or paused prior to deactivating the audio session.**

I’m not sure why I can’t see this in our project. ( I guess maybe .net version or exception handling )

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [September 25, 2019, 2:05am UTC](https://qa.fmod.com/t/tvos-audio-interruption/15040/6 "2019-09-25T02:05:48Z")

</div>

I don’t think there is much we can do if the OS isn’t triggering a stopped notification. When an interruption notification triggers, it will tear down the current Audio Session so if we don’t use `mixerSuspend/Resume` we won’t be able to get the audio back.

> **Note:** There is no guarantee that a begin interruption will have a corresponding end interruption. Your app needs to be aware of a switch to a foreground running state or the user pressing a Play button. In either case, determine whether your app should reactivate its audio session.

From the Apple [Audio Session docs](https://developer.apple.com/library/archive/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/HandlingAudioInterruptions/HandlingAudioInterruptions.html#//apple_ref/doc/uid/TP40007875-CH4-SW9).

---

<div class="post-metadata">

**Author:** ![klei.victorchow](https://avatars.discourse-cdn.com/v4/letter/k/77aa72/32.png) [@klei.victorchow](https://qa.fmod.com/u/klei.victorchow)\
**Post date:** [January 6, 2021, 12:51am UTC](https://qa.fmod.com/t/tvos-audio-interruption/15040/7 "2021-01-06T00:51:35Z")

</div>

Hi, old thread but we just experienced this issue on tvOS (14.3) with an Apple TV HD (A8X) with FMOD + Unity integration 2.01.05 (preview package with support for Apple Silicon, [from this thread](https://qa.fmod.com/t/apple-silicon-fmod-unity-support/16203/7)) running on Unity 2020.2.1f1. Was there ever a resolution to this?

We’ve never had this problem with Unity 2019.4.x and FMOD + Unity integration 1.10.19 running on the same hardware.

A race condition or some load-dependent factor is also suspected as a minimal standalone project with just the FMOD integration cannot easily repro this problem (if at all).

---

<div class="post-metadata">

**Author:** ![klei.victorchow](https://avatars.discourse-cdn.com/v4/letter/k/77aa72/32.png) [@klei.victorchow](https://qa.fmod.com/u/klei.victorchow)\
**Post date:** [January 7, 2021, 12:39am UTC](https://qa.fmod.com/t/tvos-audio-interruption/15040/8 "2021-01-07T00:39:21Z")

</div>

I’ve sent a message directly to FMOD support as I’ve discovered the nature of our issue is related to having an active video player component in the scene.

And contrary to what I stated earlier, this issue does occur on Unity 2019.4.x and FMOD integration 1.10.19.
