From 37b49c98dcbf4796c987b6a022de10185dbd70e4 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 7 Nov 2024 19:05:03 -0800 Subject: [PATCH] Fixed setting up surround sound on NVIDIA Shield TV --- src/audio/aaudio/SDL_aaudio.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/audio/aaudio/SDL_aaudio.c b/src/audio/aaudio/SDL_aaudio.c index 1146b19e9..64d77dfac 100644 --- a/src/audio/aaudio/SDL_aaudio.c +++ b/src/audio/aaudio/SDL_aaudio.c @@ -298,7 +298,6 @@ static bool BuildAAudioStream(SDL_AudioDevice *device) #endif aaudio_format_t format; -#ifdef SET_AUDIO_FORMAT if ((device->spec.format == SDL_AUDIO_S32) && (SDL_GetAndroidSDKVersion() >= 31)) { format = AAUDIO_FORMAT_PCM_I32; } else if (device->spec.format == SDL_AUDIO_F32) { @@ -308,7 +307,6 @@ static bool BuildAAudioStream(SDL_AudioDevice *device) } ctx.AAudioStreamBuilder_setFormat(builder, format); ctx.AAudioStreamBuilder_setSampleRate(builder, device->spec.freq); -#endif ctx.AAudioStreamBuilder_setChannelCount(builder, device->spec.channels); const aaudio_direction_t direction = (recording ? AAUDIO_DIRECTION_INPUT : AAUDIO_DIRECTION_OUTPUT); @@ -323,9 +321,9 @@ static bool BuildAAudioStream(SDL_AudioDevice *device) SDL_Log("Low latency audio disabled\n"); } - LOGI("AAudio Try to open %u hz %u bit %u channels %s samples %u", - device->spec.freq, SDL_AUDIO_BITSIZE(device->spec.format), - device->spec.channels, SDL_AUDIO_ISBIGENDIAN(device->spec.format) ? "BE" : "LE", device->sample_frames); + LOGI("AAudio Try to open %u hz %s %u channels samples %u", + device->spec.freq, SDL_GetAudioFormatName(device->spec.format), + device->spec.channels, device->sample_frames); res = ctx.AAudioStreamBuilder_openStream(builder, &hidden->stream); if (res != AAUDIO_OK) { @@ -373,9 +371,9 @@ static bool BuildAAudioStream(SDL_AudioDevice *device) return false; } - LOGI("AAudio Actually opened %u hz %u bit %u channels %s samples %u, buffers %d", - device->spec.freq, SDL_AUDIO_BITSIZE(device->spec.format), - device->spec.channels, SDL_AUDIO_ISBIGENDIAN(device->spec.format) ? "BE" : "LE", device->sample_frames, hidden->num_buffers); + LOGI("AAudio Actually opened %u hz %s %u channels samples %u, buffers %d", + device->spec.freq, SDL_GetAudioFormatName(device->spec.format), + device->spec.channels, device->sample_frames, hidden->num_buffers); res = ctx.AAudioStream_requestStart(hidden->stream); if (res != AAUDIO_OK) {