# Delayed FMOD initialization - for fix crash on Android 8.0

**URL:** <https://qa.fmod.com/t/delayed-fmod-initialization-for-fix-crash-on-android-8-0/15046>\
**Category:** Unity\
**Created:** [September 13, 2019, 10:23am UTC](https://qa.fmod.com/t/delayed-fmod-initialization-for-fix-crash-on-android-8-0/15046 "2019-09-13T10:23:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MichalCervenkaGeewa](https://avatars.discourse-cdn.com/v4/letter/m/b487fb/32.png) [@MichalCervenkaGeewa](https://qa.fmod.com/u/MichalCervenkaGeewa)\
**Post date:** [September 13, 2019, 10:23am UTC](https://qa.fmod.com/t/delayed-fmod-initialization-for-fix-crash-on-android-8-0/15046/1 "2019-09-13T10:23:33Z")

</div>

Hi FMOD (Unity 2019.1.13f1) generating a random crashing on all Android 8.0 devices from AAudio API. Android 8.1 and other version works fine. For us will be the best quick solution to use OPENSL output for Android API-26.  
We tryed to change the output in first Awake in Unity, bust it’s too late, because FMOD is already initialized. Ofcourse, is possible to modify RuntimeManager.cs, but it’s not a clear solution.

We using FMOD 2.00.04.

Here is crashlog:

```
2019-09-10 20:51:19.227 13621-13694/com.company.game E/AndroidRuntime: FATAL EXCEPTION: UnityMain
    Process: com.company.game, PID: 13621
    java.lang.Error: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0000000000000000
    Build fingerprint: 'HONOR/LLD-L31/HWLLD-H:8.0.0/HONORLLD-L31/121(C432):user/release-keys'
    Revision: '0'
    pid: 13621, tid: 14167, name: Binder:13621_6 >>> com.company.game <<<
        x0 000000733f5171c8 x1 000000736ccb49c0 x2 0000000000000001 x3 0000000000000002
        x4 0000000000000104 x5 0000000000000000 x6 0000000000000000 x7 0000007362618a80
        x8 000000733f517108 x9 00000000000000c0 x10 0000000000000008 x11 0000000000000000
        x12 000000734ec3b298 x13 000000734ec3b2d0 x14 000000736cae7320 x15 0000000000000000
        x16 000000736d2f1368 x17 00000073707dd758 x18 0000000013040000 x19 0000000000000000
        x20 000000736ccb49c0 x21 000000733f5171c8 x22 0000000000000000 x23 00000073707e0f14
        x24 000000734ec3b570 x25 000000734eb3f000 x26 0000000000000000 x27 0000000000000000
        x28 0000000000000000 x29 000000734ec3b350 x30 000000736d2a7a2c
        sp 000000734ec3b330 pc 00000073707dd774 pstate 0000000060000000
        at [vdso].(:0)
        at libutils._ZNK7android7RefBase9decStrongEPKv(_ZNK7android7RefBase9decStrongEPKv:24)
        at libbinder._ZN7android14IPCThreadState20processPendingDerefsEv(_ZN7android14IPCThreadState20processPendingDerefsEv:136)
        at libbinder._ZN7android14IPCThreadState14joinThreadPoolEb(_ZN7android14IPCThreadState14joinThreadPoolEb:52)
        at libbinder.(:0)
        at libutils._ZN7android6Thread11_threadLoopEPv(_ZN7android6Thread11_threadLoopEPv:280)
        at libandroid_runtime._ZN7android14AndroidRuntime15javaThreadShellEPv(_ZN7android14AndroidRuntime15javaThreadShellEPv:136)
        at libc._ZL15__pthread_startPv(_ZL15__pthread_startPv:36)
        at libc.__start_thread(__start_thread:68)
```

---

<div class="post-metadata">

**Author:** ![MichalCervenkaGeewa](https://avatars.discourse-cdn.com/v4/letter/m/b487fb/32.png) [@MichalCervenkaGeewa](https://qa.fmod.com/u/MichalCervenkaGeewa)\
**Post date:** [September 13, 2019, 11:23am UTC](https://qa.fmod.com/t/delayed-fmod-initialization-for-fix-crash-on-android-8-0/15046/2 "2019-09-13T11:23:41Z")

</div>

I can confirm, that changing the output to OPENSL in RuntimeManager.cs works. Adding this lines to RuntimeManager.cs:198 is a quick solution for this crashes:

```
        #if !UNITY_EDITOR && UNITY_ANDROID
        if (SystemInfo.operatingSystem.Contains("API-26"))
            outputType = FMOD.OUTPUTTYPE.OPENSL;
        #endif
```

---

<div class="post-metadata">

**Author:** ![boyjunqiang](https://avatars.discourse-cdn.com/v4/letter/b/8edcca/32.png) [@boyjunqiang](https://qa.fmod.com/u/boyjunqiang)\
**Post date:** [September 21, 2019, 9:11am UTC](https://qa.fmod.com/t/delayed-fmod-initialization-for-fix-crash-on-android-8-0/15046/3 "2019-09-21T09:11:23Z")

</div>

[Michal](https://qa.fmod.com/u/MichalCervenkaGeewa) You are a time saver, I face the same problem, unity 2019.02.06 + FMOD 2.00.04, Crash on android 8.0 when the game switches from background to foreground; I follow your method and the problem is solved! thanks!

---

<div class="post-metadata">

**Author:** ![kindkiwi](https://avatars.discourse-cdn.com/v4/letter/k/bbe5ce/32.png) [@kindkiwi](https://qa.fmod.com/u/kindkiwi)\
**Post date:** [September 26, 2019, 9:15am UTC](https://qa.fmod.com/t/delayed-fmod-initialization-for-fix-crash-on-android-8-0/15046/4 "2019-09-26T09:15:33Z")

</div>

I solved it thanks to you.

---

<div class="post-metadata">

**Author:** ![luzay341](https://avatars.discourse-cdn.com/v4/letter/l/34f0e0/32.png) [@luzay341](https://qa.fmod.com/u/luzay341)\
**Post date:** [April 1, 2020, 5:15am UTC](https://qa.fmod.com/t/delayed-fmod-initialization-for-fix-crash-on-android-8-0/15046/5 "2020-04-01T05:15:24Z")

</div>

Is it a bug？Is there anyother solution fot it？  
For AAUDIO is Default on android 8.0 and above。
