# OpenSL vs AudioTrack on Android API 26+ (avoiding AAudio)

**URL:** <https://qa.fmod.com/t/opensl-vs-audiotrack-on-android-api-26-avoiding-aaudio/23421>\
**Category:** FMOD Engine\
**Created:** [October 2, 2025, 7:07pm UTC](https://qa.fmod.com/t/opensl-vs-audiotrack-on-android-api-26-avoiding-aaudio/23421 "2025-10-02T19:07:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sviudes](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@sviudes](https://qa.fmod.com/u/sviudes)\
**Post date:** [October 2, 2025, 7:07pm UTC](https://qa.fmod.com/t/opensl-vs-audiotrack-on-android-api-26-avoiding-aaudio/23421/1 "2025-10-02T19:07:14Z")

</div>

I’m using the FMOD Core API on Android. On some devices, System\_Init() takes 400 ms or more when the output is AAudio. For my case, I prefer to avoid AAudio for now.

That leaves me with OpenSL or AudioTrack. I prefer OpenSL because it offers finer granularity, but I’m not sure if it is safe to use it on every device my app can run on (API 26+).

Is it safe to always use OpenSL on API 26+ devices? If not, is there a way to ask FMOD which one (OpenSL vs AudioTrack) is better for the current device, like calling init with AUTODETECT but excluding AAudio? If not, what criteria should I use to decide between OpenSL and AudioTrack?

Thanks!

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [October 6, 2025, 8:43am UTC](https://qa.fmod.com/t/opensl-vs-audiotrack-on-android-api-26-avoiding-aaudio/23421/2 "2025-10-06T08:43:51Z")

</div>

Hi,

There was a known issue with slow AAudio start up times which has been solved in the most recent release: [FMOD Engine | Welcome Revision History](https://fmod.com/docs/2.03/api/welcome-revision-history.html#:~:text=Core%20API%20%2D%20Android%20%2D%20Fixed%20slow%20startup%20times%20when%20using%20AAudio.). Would it be possible to update to the latest to confirm if the issue persists?

---

<div class="post-metadata">

**Author:** ![sviudes](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@sviudes](https://qa.fmod.com/u/sviudes)\
**Post date:** [October 8, 2025, 5:01pm UTC](https://qa.fmod.com/t/opensl-vs-audiotrack-on-android-api-26-avoiding-aaudio/23421/3 "2025-10-08T17:01:58Z")

</div>

> [@Connor\_FMOD](#):
>
> There was a known issue with slow AAudio start up times which has been solved in the most recent release: [FMOD Engine | Welcome Revision History](https://fmod.com/docs/2.03/api/welcome-revision-history.html#:~:text=Core%20API%20%2D%20Android%20%2D%20Fixed%20slow%20startup%20times%20when%20using%20AAudio.). Would it be possible to update to the latest to confirm if the issue persists?

I’m currently using **FMOD Engine 2.03.09** , which according to the changelog already includes the fix for “slow startup times when using AAudio.”

On a **Pixel 9A** , AAudio still takes around **350 ms** to initialize, while OpenSL only takes about **50 ms**.

I understand the difference may not be huge, but AAudio doesn’t provide any clear advantage for my use case, and I need to minimize initialization time as much as possible.

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [October 12, 2025, 10:41pm UTC](https://qa.fmod.com/t/opensl-vs-audiotrack-on-android-api-26-avoiding-aaudio/23421/4 "2025-10-12T22:41:19Z")

</div>

Thank you for confirming.

Are you able to reproduce the issue with the included android API examples in the FMOD Android Engine download: `fmodstudioapi20309android\api\core\examples\androidstudio\cmake\play_sound`  
How are you testing the initialization time? Any reproduction steps would be great!

---

<div class="post-metadata">

**Author:** ![sviudes](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@sviudes](https://qa.fmod.com/u/sviudes)\
**Post date:** [October 13, 2025, 3:46pm UTC](https://qa.fmod.com/t/opensl-vs-audiotrack-on-android-api-26-avoiding-aaudio/23421/5 "2025-10-13T15:46:18Z")

</div>

Thank you. I reproduced it using the sample you mentioned. I added simple logging around `System::init()` and switched the output explicitly via `System::setOutput()`.

Changes in `play_sound.cpp:`

```auto
#include <android/log.h>
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, "FMODPlaySound",__VA_ARGS__)

    // in FMOD_Main():

    FMOD_OUTPUTTYPE desiredOutput = FMOD_OUTPUTTYPE_OPENSL; // or FMOD_OUTPUTTYPE_AAUDIO
    result = system->setOutput(desiredOutput);
    ERRCHECK(result);

    LOGI("[Init] About to call system->init(32, FMOD_INIT_NORMAL, ...) with desiredOutput=%d", (int)desiredOutput);

    result = system->init(32, FMOD_INIT_NORMAL, extradriverdata);
    ERRCHECK(result);

    LOGI("[Init] Finished system->init()");

```

(And linked `-llog` in `Android.mk`.)

**Logs**

> AAudio: **~519 ms** (961 − 442):

```auto
2025-10-13 17:19:40.442 22172-22233 FMODPlaySound org.fmod.example I [Init] About to call system->init(32, FMOD_INIT_NORMAL, ...) with desiredOutput=18
2025-10-13 17:19:40.961 22172-22233 FMODPlaySound org.fmod.example I [Init] Finished system->init()

```

> OpenSL: **~47 ms** (270 − 223):

```auto
2025-10-13 17:22:00.223 23163-23197 FMODPlaySound org.fmod.example I [Init] About to call system->init(32, FMOD_INIT_NORMAL, ...) with desiredOutput=12
2025-10-13 17:22:00.270 23163-23197 FMODPlaySound org.fmod.example I [Init] Finished system->init()

```

This matches what I see in my app: AAudio ~500 ms vs OpenSL ~50 ms on this device. For my use-case I’m optimizing cold start, and I don’t see a functional advantage from AAudio here.

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [October 21, 2025, 4:31am UTC](https://qa.fmod.com/t/opensl-vs-audiotrack-on-android-api-26-avoiding-aaudio/23421/6 "2025-10-21T04:31:27Z")

</div>

Thank you for testing that and sharing your code.

I have been able to reproduce the same times. I will pass this info on to our development team. However, I will note our docs which addresses latency on Android: [FMOD Engine | Platforms Android - Audio Latency](https://fmod.com/docs/2.03/api/platforms-android.html#audio-latency).

> [@sviudes](#):
>
> Is it safe to always use OpenSL on API 26+ devices?

As OpenSl has been deprecated: [https://developer.android.com/ndk/guides/audio/opensl](https://developer.android.com/ndk/guides/audio/opensl), I cannot say that it will be safe on all devices. You could attempt to initialize the FMOD system with OpenSL and on failure resort to AAudio?

> [@sviudes](#):
>
> If not, is there a way to ask FMOD which one (OpenSL vs AudioTrack) is better for the current device, like calling init with AUTODETECT but excluding AAudio?

Unfortunately, you cannot filter outputs when using `AUTODETECT`, I could suggest this to our development team to look into however.

I will link to a post where some options for dealing with latency were discussed: [High latency with AAudio - #2 by jeff\_fmod](https://qa.fmod.com/t/high-latency-with-aaudio/19196/2).

---

<div class="post-metadata">

**Author:** ![sviudes](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@sviudes](https://qa.fmod.com/u/sviudes)\
**Post date:** [October 22, 2025, 5:01pm UTC](https://qa.fmod.com/t/opensl-vs-audiotrack-on-android-api-26-avoiding-aaudio/23421/7 "2025-10-22T17:01:54Z")

</div>

Thanks for the detailed reply, and for the link about latency.

Just to clarify, my concern here isn’t about **latency during playback** , but rather the **initialization time** of the FMOD system.

For now, I’ll continue using **OpenSL** , with a **fallback to AUTODETECT** if either `setOutput()` or `init()` return an error. That seems like the safest balance for the moment.

It would be great if future versions could either **match the initialization speed** between AAudio and OpenSL, or provide a way to **automatically skip AAudio** during output selection.

Thanks again for your help and for forwarding the info to the dev team.
