From a91c61e5e23a4b282193dddfd6322db55abc02a4 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 6 Dec 2020 16:58:41 -0600 Subject: [PATCH] Remove Raspberry Pi PulseAudio avoidance hack Not only is it no longer required (PA works great now), it actually breaks audio with Pi OS's new PA config --- app/streaming/audio/renderers/sdlaud.cpp | 27 ------------------------ 1 file changed, 27 deletions(-) diff --git a/app/streaming/audio/renderers/sdlaud.cpp b/app/streaming/audio/renderers/sdlaud.cpp index 6a4efe06..1dc1e049 100644 --- a/app/streaming/audio/renderers/sdlaud.cpp +++ b/app/streaming/audio/renderers/sdlaud.cpp @@ -13,33 +13,6 @@ SdlAudioRenderer::SdlAudioRenderer() { SDL_assert(!SDL_WasInit(SDL_INIT_AUDIO)); -#ifdef HAVE_MMAL - // HACK: PulseAudio on Raspberry Pi suffers from horrible underruns, - // so switch to ALSA if we detect that we're on a Pi. We need to - // actually set a bogus PULSE_SERVER so it doesn't try to get smart on us - // and find PA anyway. SDL_AUDIODRIVER=pulseaudio can override this logic. - if (qgetenv("SDL_AUDIODRIVER").toLower() != "pulseaudio") { - QFile file("/proc/cpuinfo"); - if (file.open(QIODevice::ReadOnly | QFile::Text)) { - QTextStream textStream(&file); - if (textStream.readAll().contains("Raspberry Pi")) { - SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, - "Avoiding PulseAudio on Raspberry Pi"); - - qputenv("PULSE_SERVER", ""); - if (SDL_InitSubSystem(SDL_INIT_AUDIO) != 0) { - SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, - "ALSA failed; falling back to default"); - qunsetenv("PULSE_SERVER"); - } - else { - SDL_QuitSubSystem(SDL_INIT_AUDIO); - } - } - } - } -#endif - if (SDL_InitSubSystem(SDL_INIT_AUDIO) != 0) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_InitSubSystem(SDL_INIT_AUDIO) failed: %s",