Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement AAudio for modern Android devices #3710

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 5 comments
Closed

Implement AAudio for modern Android devices #3710

SDLBugzilla opened this issue Feb 11, 2021 · 5 comments
Assignees
Milestone

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

Reported in version: HG 2.0
Reported for operating system, platform: Android (All), All

Comments on the original bug report:

On 2020-05-29 05:14:13 +0000, Ryan C. Gordon wrote:

Modern Android releases have an audio API called AAudio...

https://developer.android.com/ndk/guides/audio/aaudio/aaudio

...which is meant to be preferred over OpenSL ES. Implement this (leaving our OpenSL ES target as a fallback for older devices, of course).

--ryan.

@icculus icculus self-assigned this Feb 14, 2021
@icculus
Copy link
Collaborator

icculus commented Feb 14, 2021

Assigning myself for now, but this is probably post-2.0.16 work. Feel free to steal if you want to work on this!

@1bsyl
Copy link
Contributor

1bsyl commented Apr 15, 2021

I've added the AAudio back-end, nothing special except:

  • it dynamically loads the libaaudio.so, which may not be present if the API < 26
  • uses GetDeviceBuf / PlayDevice, with SDL_RunAudio thread
  • tested with playback and capture

List of commits:

  • Android: OpenSLES, explicitly initialise the global variable 'bqPlayer' 4118fe6
  • Android: add AAudio back-end, with playback and capture: 04b2f5f
  • AAudio: add bootstrap in SDL_audio.c f1fab24
  • AAudio: add compilation to Android.mk, but not activated in SDL_config_android.h 146656c
  • Android: add openslES and AAudio compilation to CMakeLists 02b1ebc
  • AAudio: add aaudio pause/resume function to android events loop b4f89c5
  • Android: add AAudio entry in CMake SDL_config 859230e

TODO:
enable audio for Android.mk, and CMake :

@icculus
Copy link
Collaborator

icculus commented Apr 15, 2021

Ooh, nice work!

Let's leave it inactive in the config until 2.0.16 ships, and then make it the default right after, so it has time for testing.

@1bsyl
Copy link
Contributor

1bsyl commented Apr 15, 2021

ok!

@icculus icculus added this to the 2.0.18 milestone Apr 22, 2021
@icculus
Copy link
Collaborator

icculus commented Apr 22, 2021

Marking with 2.0.18 milestone so we don't forget to flip this in the config. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants