# \[Bug\]\[2.02.06\] Android startup crash

**URL:** <https://qa.fmod.com/t/bug-2-02-06-android-startup-crash/18789>\
**Category:** FMOD Engine\
**Tags:** unity\
**Created:** [May 23, 2022, 2:58pm UTC](https://qa.fmod.com/t/bug-2-02-06-android-startup-crash/18789 "2022-05-23T14:58:43Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [July 31, 2022, 10:50pm UTC](https://qa.fmod.com/t/bug-2-02-06-android-startup-crash/18789/21 "2022-07-31T22:50:09Z")

</div>

Just to confirm, are you using the Unity Integration, Unreal Integration or the FMOD C/C++ API?  
This crash should be fixed in the Unity Integration in the next release, in the meantime there is [small change](https://qa.fmod.com/t/bug-2-02-06-android-startup-crash/18789/18) you can make to RuntimeManager.cs to workaround the issue.  
Please let me know if you are not using the FMOD Unity Integration and I will investigate further.

---

<div class="post-metadata">

**Author:** ![maksimomelyanchuk](https://avatars.discourse-cdn.com/v4/letter/m/eb8c5e/32.png) [@maksimomelyanchuk](https://qa.fmod.com/u/maksimomelyanchuk)\
**Post date:** [August 1, 2022, 12:40am UTC](https://qa.fmod.com/t/bug-2-02-06-android-startup-crash/18789/22 "2022-08-01T00:40:13Z")

</div>

We are using FMOD C/C++ API.

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [August 1, 2022, 3:25am UTC](https://qa.fmod.com/t/bug-2-02-06-android-startup-crash/18789/23 "2022-08-01T03:25:16Z")

</div>

The solution in the case of the Unity integration is essentially to call `java.lang.System.loadLibrary("fmod")` before calling into the FMOD API. In the C++ API examples we call this from a static initialization block as described in the [Android Platform Specifics](https://fmod.com/docs/2.02/api/platforms-android.html#java) section of the docs. Are you making a similar call in your application?

---

<div class="post-metadata">

**Author:** ![maksimomelyanchuk](https://avatars.discourse-cdn.com/v4/letter/m/eb8c5e/32.png) [@maksimomelyanchuk](https://qa.fmod.com/u/maksimomelyanchuk)\
**Post date:** [August 24, 2022, 12:42pm UTC](https://qa.fmod.com/t/bug-2-02-06-android-startup-crash/18789/24 "2022-08-24T12:42:59Z")

</div>

We’ve added all needed code as described in documentation but still having same crashes with  
Java\_org\_fmod\_FMOD\_OutputAAudioHeadphonesChanged. Do you have any ideas?

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [August 26, 2022, 1:35am UTC](https://qa.fmod.com/t/bug-2-02-06-android-startup-crash/18789/25 "2022-08-26T01:35:59Z")

</div>

Thank you for giving that a shot. You mentioned already trying all the workarounds here, but can you please confirm whether you have also tried setting the [`FMOD_OUTPUTTYPE`](https://fmod.com/docs/2.02/api/core-api-system.html#fmod_outputtype) to OpenSL?

---

<div class="post-metadata">

**Author:** ![maksimomelyanchuk](https://avatars.discourse-cdn.com/v4/letter/m/eb8c5e/32.png) [@maksimomelyanchuk](https://qa.fmod.com/u/maksimomelyanchuk)\
**Post date:** [August 29, 2022, 3:53am UTC](https://qa.fmod.com/t/bug-2-02-06-android-startup-crash/18789/26 "2022-08-29T03:53:08Z")

</div>

We use OpenSL only for 26 Android SDK because of the bug with AAudio in that version. Do you recomend to switch to OpenSL for all versions or what we should do?

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [August 30, 2022, 12:15am UTC](https://qa.fmod.com/t/bug-2-02-06-android-startup-crash/18789/27 "2022-08-30T00:15:28Z")

</div>

It is probably best not to change output type for everything, but I would like to know whether any of your users who are on Android SDK 26, and therefore are using OpenSL, are also getting this Java\_org\_fmod\_FMOD\_OutputAAudioHeadphonesChanged crash.  
If you have any other device information on affected users we may be able to attempt a reproduction on our end?

---

<div class="post-metadata">

**Author:** ![maksimomelyanchuk](https://avatars.discourse-cdn.com/v4/letter/m/eb8c5e/32.png) [@maksimomelyanchuk](https://qa.fmod.com/u/maksimomelyanchuk)\
**Post date:** [August 30, 2022, 2:13am UTC](https://qa.fmod.com/t/bug-2-02-06-android-startup-crash/18789/28 "2022-08-30T02:13:58Z")

</div>

We have such crashes only on Xiaomi devices with Android 11, 12. Most affected devices are Redmi Note 10/10s.

---

<div class="post-metadata">

**Author:** ![maksimomelyanchuk](https://avatars.discourse-cdn.com/v4/letter/m/eb8c5e/32.png) [@maksimomelyanchuk](https://qa.fmod.com/u/maksimomelyanchuk)\
**Post date:** [September 5, 2022, 1:23pm UTC](https://qa.fmod.com/t/bug-2-02-06-android-startup-crash/18789/29 "2022-09-05T13:23:12Z")

</div>

We’ve found stable way to reproduce the problem. Device is Xiaomi Note 10 pro. Before start you need to enable device option here: Options → Sound and vibration → Sound helper → Application sound control (It makes you able to control sound volume for all applications separetely). With that option enabled app crashes all the time when it goes foreground after being in background. Also it’s possibly connected with high workload of the device.

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [September 6, 2022, 2:15am UTC](https://qa.fmod.com/t/bug-2-02-06-android-startup-crash/18789/30 "2022-09-06T02:15:47Z")

</div>

Thank you for the additional info, I have passed this onto the Development team to look into in more detail. I will see if it is possible for us to order one of these devices in; it is sometimes difficult for us to get the exact models required in our country. Can you please go into your settings, click on “About phone” and tell me what the specific _Model_ value of your test device is?

---

<div class="post-metadata">

**Author:** ![maksimomelyanchuk](https://avatars.discourse-cdn.com/v4/letter/m/eb8c5e/32.png) [@maksimomelyanchuk](https://qa.fmod.com/u/maksimomelyanchuk)\
**Post date:** [September 6, 2022, 6:58am UTC](https://qa.fmod.com/t/bug-2-02-06-android-startup-crash/18789/31 "2022-09-06T06:58:34Z")

</div>

Xiaomi Readmi Note 10 Pro 8/128  
Model M2101K6G  
Android Version 12 SKQ1.210908.001  
MIUI Version 13.0.3.0(SKFRUXM)

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [September 7, 2022, 12:23am UTC](https://qa.fmod.com/t/bug-2-02-06-android-startup-crash/18789/32 "2022-09-07T00:23:45Z")

</div>

Thank you for the additional device details, I have passed these details along to the Dev team.  
One of our developers pointed out that FMOD 2.02.06 should not be able to produce the callstack you are seeing- just to confirm there aren’t any issues with mismatched libs or anything like that can you please try re-downloading the 2.02.06 version of the FMOD API, replace your project’s libs and includes, and see if you still get a crash on your test device?

---

<div class="post-metadata">

**Author:** ![maksimomelyanchuk](https://avatars.discourse-cdn.com/v4/letter/m/eb8c5e/32.png) [@maksimomelyanchuk](https://qa.fmod.com/u/maksimomelyanchuk)\
**Post date:** [September 7, 2022, 8:04am UTC](https://qa.fmod.com/t/bug-2-02-06-android-startup-crash/18789/33 "2022-09-07T08:04:39Z")

</div>

Now the most common crashes look like this:

```auto
    libaudioclient.so 0x49a98244 + 606788
    libaudioclient.so 0x49a98238 + 606776
    libaaudio_internal.so 0x94b59b74 + 183156
    libaaudio_internal.so 0x94b4aa10 + 121360
    libaudioclient.so 0x49ab9ab0 + 744112
    libaudioclient.so 0x49a47a08 + 277000
    libbinder.so 0x33393880 + 301184
    libbinder.so 0x3339d910 + 342288
    libbinder.so 0x3339d42c + 341036
    libbinder.so 0x3339dcdc + 343260
    libbinder.so 0x333ca418 + 525336
    libutils.so 0x49be058c + 79244
    libandroid_runtime.so 0x31ef34b8 + 783544
    libutils.so 0x49bdfde8 + 77288
    libc.so 0x313cbd44 + 986436
    libc.so 0x3136857c + 578940

```

And in the same time nearby threads contain this:

```auto
* libc.so 0x313b6fa8 + 901032
* libc.so 0x31370c08 + 613384
* libbinder.so 0x3339d0b4 + 340148
* libbinder.so 0x3339e2f0 + 344816
* libbinder.so 0x3339e034 + 344116
* libbinder.so 0x33395b28 + 310056 * ---
* libfmod.so Java_org_fmod_FMOD_OutputAAudioHeadphonesChanged
* libfmod.so Java_org_fmod_FMOD_OutputAAudioHeadphonesChanged
* libfmod.so FMOD::SystemI::setInternalCallback(int, FMOD_RESULT (*)(FMOD_SYSTEM*, unsigned int, void*, void*, void*), void*)
* libfmod.so FMOD::System::init(int, unsigned int, void*)
* libfmodstudio.so0xd88fb934 + 383284
* libfmodstudio.soFMOD::Studio::System::initialize(int, unsigned int, unsigned int, void*)

```

or this:

```auto
    libc.so 0x39486020 + 540704
    libfmod.so JNI_OnLoad
    libfmod.so Java_org_fmod_FMOD_OutputAAudioHeadphonesChanged
    libfmod.so Java_org_fmod_FMOD_OutputAAudioHeadphonesChanged
    libfmod.so FMOD::Geometry::getUserData(void**)
    libfmod.so FMOD5_Reverb3D_GetUserData
    libfmod.so FMOD5_Reverb3D_GetUserData
    libfmod.so FMOD::SystemI::createDiskFile(char const*, FMOD_CREATESOUNDEXINFO*, FMOD::File**, bool*)
    libfmod.so FMOD::System::update()
    libfmodstudio.so 0x95558d14 + 314644
    libfmodstudio.so 0x95560f88 + 348040
    libfmodstudio.so FMOD::Studio::CommandReplay::setUserData(void*)
    libfmodstudio.so FMOD::Studio::CommandReplay::setUserData(void*)
    libfmodstudio.so FMOD::Studio::CommandReplay::setUserData(void*)
    libfmodstudio.so FMOD::Studio::CommandReplay::setUserData(void*)
    libc.so 0x39485588 + 537992
    libc.so 0x394261dc + 147932

```

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [September 9, 2022, 1:16am UTC](https://qa.fmod.com/t/bug-2-02-06-android-startup-crash/18789/34 "2022-09-09T01:16:22Z")

</div>

I am not sure on the reliability of those fmod callstacks there, but this one has some promising details:

> [@maksimomelyanchuk](#):
>
> ```apache
> libaudioclient.so 0x49a98244 + 606788
> libaudioclient.so 0x49a98238 + 606776
> libaaudio_internal.so 0x94b59b74 + 183156
> libaaudio_internal.so 0x94b4aa10 + 121360
> libaudioclient.so 0x49ab9ab0 + 744112
> libaudioclient.so 0x49a47a08 + 277000
> libbinder.so 0x33393880 + 301184
> libbinder.so 0x3339d910 + 342288
> libbinder.so 0x3339d42c + 341036
> libbinder.so 0x3339dcdc + 343260
> libbinder.so 0x333ca418 + 525336
> libutils.so 0x49be058c + 79244
> libandroid_runtime.so 0x31ef34b8 + 783544
> libutils.so 0x49bdfde8 + 77288
> libc.so 0x313cbd44 + 986436
> libc.so 0x3136857c + 578940
> 
> ```

The order of the libs being called resemble that of a [known issue](https://qa.fmod.com/t/fmod-crash-on-android-crash-stack-libaudioclient-so/18266/12) on Android, which should be resolved in Android 13. Here is the stack trace of that bug for comparison:

```apache
      libaudioclient.so (android::AudioTrack::setVolume(float, float)+468)
      libaaudio_internal.so (aaudio::AudioStreamTrack::doSetVolume()+116)
      libaaudio_internal.so (aaudio::AudioStream::MyPlayerBase::playerSetVolume()+340)
      libaudioclient.so (android::PlayerBase::setVolume(float)+148)
      libaudioclient.so (android::media::BnPlayer::onTransact(unsigned int, android::Parcel const&, android::Parcel*, unsigned int)+668)
      libbinder.so (android::BBinder::transact(unsigned int, android::Parcel const&, android::Parcel*, unsigned int)+252)
      libbinder.so (android::IPCThreadState::executeCommand(int)+1048)
      libbinder.so (android::IPCThreadState::getAndExecuteCommand()+164)
      libbinder.so (android::IPCThreadState::joinThreadPool(bool)+72)
      libbinder.so (android::PoolThread::threadLoop()+28)
      libutils.so (android::thread::_threadLoop(void*)+264)
      libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+148)
      libutils.so (thread_data_t::trampoline(thread_data_t const*)+408)
      libc.so (__pthread_start(void*)+264)
      libc.so (__start_thread+68)

```

If you were to make a debug/logging build of your application I suspect you would see it ending on `android::AudioTrack::setVolume` as well. Since you have a test device available, perhaps you could try updating to Android 13 and see if you can still reproduce this crash?

---

<div class="post-metadata">

**Author:** ![maksimomelyanchuk](https://avatars.discourse-cdn.com/v4/letter/m/eb8c5e/32.png) [@maksimomelyanchuk](https://qa.fmod.com/u/maksimomelyanchuk)\
**Post date:** [October 3, 2022, 6:49am UTC](https://qa.fmod.com/t/bug-2-02-06-android-startup-crash/18789/35 "2022-10-03T06:49:53Z")

</div>

Yes, it seems that problem caused by that Android bug. As I understood it can be fixed by using OpenSL for Android versions less than 33(Android 13). But [here](https://qa.fmod.com/t/bug-2-02-06-android-startup-crash/18789/27) you said that it’s not best idea. Can you explain why?

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [October 3, 2022, 10:38pm UTC](https://qa.fmod.com/t/bug-2-02-06-android-startup-crash/18789/36 "2022-10-03T22:38:19Z")

</div>

Previously we had seen that Unity users had not benefited from switching to OpenSL:

> [@Mordred](#):
>
> Started getting this crash on 2.02.07. Tested on OpenSL too, still crashing.

> [@iwandi](#):
>
> We tried OpenSL, and still the same error.

At the time I thought it would have been a useful data point to see if switching to OpenSL would change things when using just the FMOD C++ API and not Unity, but when you mentioned you were using OpenSL for Android 26 that opened up new questions and I thought testing with OpenSL for all API levels wouldn’t have been necessary.  
However, your case seems to have a different root cause to the Unity crashes, and since you now have a test device and reliable reproduction steps I think it would be useful to see if switching to OpenSL makes a difference.

---

<div class="post-metadata">

**Author:** ![Reymundo911](https://avatars.discourse-cdn.com/v4/letter/r/59ef9b/32.png) [@Reymundo911](https://qa.fmod.com/u/Reymundo911)\
**Post date:** [March 17, 2023, 2:14pm UTC](https://qa.fmod.com/t/bug-2-02-06-android-startup-crash/18789/37 "2023-03-17T14:14:19Z")

</div>

Hello,  
I am bumping this thread because we still have this issue on Android and cannot update to the new FMOD versions until it is. Here is stack trace of what is happening in prod on latest FMOD

```auto
Fatal Exception: java.lang.UnsatisfiedLinkError: No implementation found for void org.fmod.FMOD.OutputAAudioHeadphonesChanged() (tried Java_org_fmod_FMOD_OutputAAudioHeadphonesChanged and Java_org_fmod_FMOD_OutputAAudioHeadphonesChanged__)
       at org.fmod.FMOD.OutputAAudioHeadphonesChanged(FMOD.java)
       at org.fmod.FMOD.access$000()
       at org.fmod.FMOD$PluginBroadcastReceiver.onReceive()
       at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$android-app-LoadedApk$ReceiverDispatcher$Args(LoadedApk.java:1790)
       at android.app.LoadedApk$ReceiverDispatcher$Args$$ExternalSyntheticLambda0.run(:2)
       at android.os.Handler.handleCallback(Handler.java:942)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loopOnce(Looper.java:201)
       at android.os.Looper.loop(Looper.java:288)
       at android.app.ActivityThread.main(ActivityThread.java:7872)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

```

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [March 19, 2023, 10:41pm UTC](https://qa.fmod.com/t/bug-2-02-06-android-startup-crash/18789/38 "2023-03-19T22:41:42Z")

</div>

Are you using Unity, Unreal, or the FMOD Engine C/C++ API?

---

<div class="post-metadata">

**Author:** ![Reymundo911](https://avatars.discourse-cdn.com/v4/letter/r/59ef9b/32.png) [@Reymundo911](https://qa.fmod.com/u/Reymundo911)\
**Post date:** [March 30, 2023, 2:14pm UTC](https://qa.fmod.com/t/bug-2-02-06-android-startup-crash/18789/39 "2023-03-30T14:14:02Z")

</div>

Hello Jeff,

Sorry for the delay. We are using the core C/C++ API. This bug is causing us many problems, because we require the latest Android NDK, which doesn’t seem to work with older versions of FMOD. If you require more information, please let me know.

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [April 2, 2023, 11:18pm UTC](https://qa.fmod.com/t/bug-2-02-06-android-startup-crash/18789/40 "2023-04-02T23:18:00Z")

</div>

> [@Reymundo911](#):
>
> … which doesn’t seem to work with older versions of FMOD

What version of FMOD are you using?

> [@Reymundo911](#):
>
> … we still have this issue on Android and cannot update to the new FMOD versions until it is

Just to clarify, is the problem that you need to use an old version of FMOD and you are hitting this error with the latest Android NDK? Or is the problem that you are trying to update to a new version of FMOD, but are hitting this error with the new version of FMOD and the latest Android NDK?

[Previous page](https://qa.fmod.com/t/bug-2-02-06-android-startup-crash/18789.md?page=1)

[Next page](https://qa.fmod.com/t/bug-2-02-06-android-startup-crash/18789.md?page=3)
