diff --git a/CMake/FindAO.cmake b/CMake/FindAO.cmake deleted file mode 100644 index e091eeb4dc..0000000000 --- a/CMake/FindAO.cmake +++ /dev/null @@ -1,42 +0,0 @@ -# - Find AO library -# This module defines -# AO_INCLUDE_DIR -# AO_LIBRARIES -# AO_FOUND -# -# vim: expandtab sw=4 ts=4 sts=4: - -include(FindPkgConfig) -pkg_check_modules (AO_PKG QUIET ao) - -find_path(AO_INCLUDE_DIR NAMES ao/ao.h - PATHS - ${AO_PKG_INCLUDE_DIRS} - /usr/include/ao - /usr/include - /usr/local/include/ao - /usr/local/include -) - -find_library(AO_LIBRARIES NAMES ao - PATHS - ${AO_PKG_LIBRARY_DIRS} - /usr/lib - /usr/local/lib -) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(AO - REQUIRED_VARS AO_LIBRARIES AO_INCLUDE_DIR) - -if(AO_FOUND) - if(NOT TARGET AO::AO) - add_library(AO::AO UNKNOWN IMPORTED) - set_target_properties(AO::AO PROPERTIES - IMPORTED_LOCATION ${AO_LIBRARIES} - INTERFACE_INCLUDE_DIRECTORIES ${AO_INCLUDE_DIR} - ) - endif() -endif() - -mark_as_advanced(AO_INCLUDE_DIR AO_LIBRARIES) diff --git a/CMakeLists.txt b/CMakeLists.txt index e6136fe091..aba2ac8768 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,6 @@ option(ENABLE_LTO "Enables Link Time Optimization" OFF) option(ENABLE_GENERIC "Enables generic build that should run on any little-endian host" OFF) option(ENABLE_HEADLESS "Enables running Dolphin as a headless variant" OFF) option(ENABLE_ALSA "Enables ALSA sound backend" ON) -option(ENABLE_AO "Enables libao sound backend" ON) option(ENABLE_PULSEAUDIO "Enables PulseAudio sound backend" ON) option(ENABLE_OPENAL "Enables OpenAL sound backend" ON) option(ENABLE_LLVM "Enables LLVM support, for disassembly" ON) diff --git a/Source/Core/AudioCommon/AOSoundStream.cpp b/Source/Core/AudioCommon/AOSoundStream.cpp deleted file mode 100644 index 93f1759785..0000000000 --- a/Source/Core/AudioCommon/AOSoundStream.cpp +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2008 Dolphin Emulator Project -// Licensed under GPLv2+ -// Refer to the license.txt file included. - -#include - -#include "AudioCommon/AOSoundStream.h" -#include "AudioCommon/Mixer.h" -#include "Common/Logging/Log.h" -#include "Common/MsgHandler.h" - -#if defined(HAVE_AO) && HAVE_AO - -void AOSound::SoundLoop() -{ - Common::SetCurrentThreadName("Audio thread - ao"); - - uint_32 numBytesToRender = 256; - ao_initialize(); - default_driver = ao_default_driver_id(); - format.bits = 16; - format.channels = 2; - format.rate = m_mixer->GetSampleRate(); - format.byte_format = AO_FMT_LITTLE; - - device = ao_open_live(default_driver, &format, nullptr /* no options */); - if (!device) - { - PanicAlertT("AudioCommon: Error opening AO device.\n"); - ao_shutdown(); - Stop(); - return; - } - - buf_size = format.bits / 8 * format.channels * format.rate; - - while (m_run_thread.IsSet()) - { - m_mixer->Mix(realtimeBuffer, numBytesToRender >> 2); - - { - std::lock_guard lk(soundCriticalSection); - ao_play(device, (char*)realtimeBuffer, numBytesToRender); - } - - soundSyncEvent.Wait(); - } -} - -bool AOSound::Start() -{ - m_run_thread.Set(); - memset(realtimeBuffer, 0, sizeof(realtimeBuffer)); - - thread = std::thread(&AOSound::SoundLoop, this); - return true; -} - -void AOSound::Update() -{ - soundSyncEvent.Set(); -} - -void AOSound::Stop() -{ - m_run_thread.Clear(); - soundSyncEvent.Set(); - - { - std::lock_guard lk(soundCriticalSection); - thread.join(); - - if (device) - ao_close(device); - - ao_shutdown(); - - device = nullptr; - } -} - -#endif diff --git a/Source/Core/AudioCommon/AOSoundStream.h b/Source/Core/AudioCommon/AOSoundStream.h deleted file mode 100644 index f81bca64da..0000000000 --- a/Source/Core/AudioCommon/AOSoundStream.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2008 Dolphin Emulator Project -// Licensed under GPLv2+ -// Refer to the license.txt file included. - -#pragma once - -#include -#include - -#include "AudioCommon/SoundStream.h" -#include "Common/Event.h" -#include "Common/Thread.h" - -#if defined(HAVE_AO) && HAVE_AO -#include -#endif - -class AOSound final : public SoundStream -{ -#if defined(HAVE_AO) && HAVE_AO - std::thread thread; - Common::Flag m_run_thread; - std::mutex soundCriticalSection; - Common::Event soundSyncEvent; - - int buf_size; - - ao_device* device; - ao_sample_format format; - int default_driver; - - short realtimeBuffer[1024 * 1024]; - -public: - bool Start() override; - void SoundLoop() override; - void Stop() override; - void Update() override; - - static bool isValid() { return true; } -#endif -}; diff --git a/Source/Core/AudioCommon/AudioCommon.cpp b/Source/Core/AudioCommon/AudioCommon.cpp index 77551829bf..59f62d7cd9 100644 --- a/Source/Core/AudioCommon/AudioCommon.cpp +++ b/Source/Core/AudioCommon/AudioCommon.cpp @@ -3,7 +3,6 @@ // Refer to the license.txt file included. #include "AudioCommon/AudioCommon.h" -#include "AudioCommon/AOSoundStream.h" #include "AudioCommon/AlsaSoundStream.h" #include "AudioCommon/CoreAudioSoundStream.h" #include "AudioCommon/Mixer.h" @@ -42,8 +41,6 @@ void InitSoundStream() else if (XAudio2_7::isValid()) g_sound_stream = std::make_unique(); } - else if (backend == BACKEND_AOSOUND && AOSound::isValid()) - g_sound_stream = std::make_unique(); else if (backend == BACKEND_ALSA && AlsaSound::isValid()) g_sound_stream = std::make_unique(); else if (backend == BACKEND_COREAUDIO && CoreAudioSound::isValid()) @@ -115,8 +112,6 @@ std::vector GetSoundBackends() backends.push_back(BACKEND_NULLSOUND); if (XAudio2_7::isValid() || XAudio2::isValid()) backends.push_back(BACKEND_XAUDIO2); - if (AOSound::isValid()) - backends.push_back(BACKEND_AOSOUND); if (AlsaSound::isValid()) backends.push_back(BACKEND_ALSA); if (CoreAudioSound::isValid()) diff --git a/Source/Core/AudioCommon/AudioCommon.vcxproj b/Source/Core/AudioCommon/AudioCommon.vcxproj index bba0c496c9..c057a61dd5 100644 --- a/Source/Core/AudioCommon/AudioCommon.vcxproj +++ b/Source/Core/AudioCommon/AudioCommon.vcxproj @@ -50,7 +50,6 @@ - @@ -78,4 +77,4 @@ - \ No newline at end of file + diff --git a/Source/Core/AudioCommon/AudioCommon.vcxproj.filters b/Source/Core/AudioCommon/AudioCommon.vcxproj.filters index 4447f9687a..3103ad558e 100644 --- a/Source/Core/AudioCommon/AudioCommon.vcxproj.filters +++ b/Source/Core/AudioCommon/AudioCommon.vcxproj.filters @@ -30,9 +30,6 @@ - - SoundStreams - SoundStreams @@ -64,4 +61,4 @@ - \ No newline at end of file + diff --git a/Source/Core/AudioCommon/CMakeLists.txt b/Source/Core/AudioCommon/CMakeLists.txt index 7c3fd3363a..f09b7ef823 100644 --- a/Source/Core/AudioCommon/CMakeLists.txt +++ b/Source/Core/AudioCommon/CMakeLists.txt @@ -29,20 +29,6 @@ else() message(STATUS "ALSA explicitly disabled, disabling ALSA sound backend") endif() -if(ENABLE_AO) - find_package(AO) - if(AO_FOUND) - message(STATUS "ao found, enabling ao sound backend") - target_sources(audiocommon PRIVATE AOSoundStream.cpp) - target_link_libraries(audiocommon PRIVATE AO::AO) - target_compile_definitions(audiocommon PRIVATE HAVE_AO=1) - else() - message(STATUS "ao NOT found, disabling ao sound backend") - endif() -else() - message(STATUS "ao explicitly disabled, disabling ao sound backend") -endif() - if(ENABLE_OPENAL) if(WIN32) set(ENV{OPENALDIR} ${PROJECT_SOURCE_DIR}/Externals/OpenAL) diff --git a/Source/Core/Core/ConfigManager.h b/Source/Core/Core/ConfigManager.h index 5bb8b8780f..6d7fb619f9 100644 --- a/Source/Core/Core/ConfigManager.h +++ b/Source/Core/Core/ConfigManager.h @@ -32,7 +32,6 @@ class TMDReader; // DSP Backend Types #define BACKEND_NULLSOUND _trans("No audio output") #define BACKEND_ALSA "ALSA" -#define BACKEND_AOSOUND "AOSound" #define BACKEND_COREAUDIO "CoreAudio" #define BACKEND_OPENAL "OpenAL" #define BACKEND_PULSEAUDIO "Pulse"