From 68103993520166dc2d573bdb5dfe0ed7a2f641ea Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 10 Aug 2021 14:50:43 -0700 Subject: [PATCH] Enable AAUDIO driver for Android I thought this was already enabled for 2.0.16, but apparently not. Fixes https://github.com/libsdl-org/SDL/issues/3710 --- CMakeLists.txt | 2 +- WhatsNew.txt | 8 +++++++- configure.ac | 9 +++++++++ include/SDL_config.h.in | 2 ++ include/SDL_config_android.h | 2 +- 5 files changed, 20 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 70a482e93..17f0a5f51 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1010,7 +1010,7 @@ if(ANDROID) find_library(ANDROID_OPENSLES_LIBRARY OpenSLES) list(APPEND EXTRA_LIBS ${ANDROID_DL_LIBRARY} ${ANDROID_OPENSLES_LIBRARY}) - set(SDL_AUDIO_DRIVER_AAUDIO 0) + set(SDL_AUDIO_DRIVER_AAUDIO 1) file(GLOB AAUDIO_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/aaudio/*.c) set(SOURCE_FILES ${SOURCE_FILES} ${AAUDIO_AUDIO_SOURCES}) diff --git a/WhatsNew.txt b/WhatsNew.txt index 69d2e7480..08d82c00a 100644 --- a/WhatsNew.txt +++ b/WhatsNew.txt @@ -1,6 +1,13 @@ This is a list of major changes in SDL's version history. +--------------------------------------------------------------------------- +2.0.18: +--------------------------------------------------------------------------- + +Android: +* Added support for audio output and capture using AAudio + --------------------------------------------------------------------------- 2.0.16: --------------------------------------------------------------------------- @@ -30,7 +37,6 @@ Linux: * Added the hint SDL_HINT_AUDIO_DEVICE_STREAM_ROLE to describe the role of your application for audio control panels Android: -* Added support for audio output and capture using AAudio * Added SDL_AndroidShowToast() to show a lightweight notification iOS: diff --git a/configure.ac b/configure.ac index 3ef13d4f7..8076f92f8 100644 --- a/configure.ac +++ b/configure.ac @@ -3660,6 +3660,15 @@ case "$host" in AC_DEFINE(SDL_AUDIO_DRIVER_ANDROID, 1, [ ]) SOURCES="$SOURCES $srcdir/src/audio/android/*.c" SUMMARY_audio="${SUMMARY_audio} android" + + AC_DEFINE(SDL_AUDIO_DRIVER_OPENSLES, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/audio/openslES/*.c" + SUMMARY_audio="${SUMMARY_audio} openslES" + + AC_DEFINE(SDL_AUDIO_DRIVER_AAUDIO, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/audio/aaudio/*.c" + SUMMARY_audio="${SUMMARY_audio} aaudio" + have_audio=yes ;; nto) diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in index 0d999d920..245998537 100644 --- a/include/SDL_config.h.in +++ b/include/SDL_config.h.in @@ -262,6 +262,7 @@ #undef SDL_FILESYSTEM_DISABLED /* Enable various audio drivers */ +#undef SDL_AUDIO_DRIVER_AAUDIO #undef SDL_AUDIO_DRIVER_ALSA #undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC #undef SDL_AUDIO_DRIVER_ANDROID @@ -283,6 +284,7 @@ #undef SDL_AUDIO_DRIVER_NAS #undef SDL_AUDIO_DRIVER_NAS_DYNAMIC #undef SDL_AUDIO_DRIVER_NETBSD +#undef SDL_AUDIO_DRIVER_OPENSLES #undef SDL_AUDIO_DRIVER_OSS #undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H #undef SDL_AUDIO_DRIVER_PAUDIO diff --git a/include/SDL_config_android.h b/include/SDL_config_android.h index cd43314a2..9414ccc1c 100644 --- a/include/SDL_config_android.h +++ b/include/SDL_config_android.h @@ -143,7 +143,7 @@ /* Enable various audio drivers */ #define SDL_AUDIO_DRIVER_ANDROID 1 #define SDL_AUDIO_DRIVER_OPENSLES 1 -#define SDL_AUDIO_DRIVER_AAUDIO 0 +#define SDL_AUDIO_DRIVER_AAUDIO 1 #define SDL_AUDIO_DRIVER_DUMMY 1 /* Enable various input drivers */