From 99fa0d6caeca00e2968beb364cd0493bdd560e61 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 10 Oct 2023 15:17:58 -0700 Subject: [PATCH] Disable low latency audio by default when using AAudio on Android Some devices have flat sounding audio when low latency mode is enabled. In particular this was reported on the Samsung SM-T290 running Android 11. --- src/audio/aaudio/SDL_aaudio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/audio/aaudio/SDL_aaudio.c b/src/audio/aaudio/SDL_aaudio.c index 977d84e4c..ea569503e 100644 --- a/src/audio/aaudio/SDL_aaudio.c +++ b/src/audio/aaudio/SDL_aaudio.c @@ -312,7 +312,9 @@ static int BuildAAudioStream(SDL_AudioDevice *device) ctx.AAudioStreamBuilder_setDirection(builder, direction); ctx.AAudioStreamBuilder_setErrorCallback(builder, AAUDIO_errorCallback, device); ctx.AAudioStreamBuilder_setDataCallback(builder, AAUDIO_dataCallback, device); +#if 0 // Some devices have flat sounding audio when low latency mode is enabled ctx.AAudioStreamBuilder_setPerformanceMode(builder, AAUDIO_PERFORMANCE_MODE_LOW_LATENCY); +#endif LOGI("AAudio Try to open %u hz %u bit chan %u %s samples %u", device->spec.freq, SDL_AUDIO_BITSIZE(device->spec.format),