summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorMichael Maltese <michaeljosephmaltese@gmail.com>2017-03-31 14:59:54 -0700
committerMichael Maltese <michaeljosephmaltese@gmail.com>2017-03-31 14:59:57 -0700
commitaf63235dc4104f23cc78b33000bb6f9e0319dbd5 (patch)
tree3166208bda647c1c15ba790f0b5ee945549e5e63 /Source/Core
parent0aec9fa4dbaab839ba0a0c3dba11339464c20626 (diff)
Remove libao sound backend
A single person uses it[0], and it sometimes messes up the Linux buildbots ("ninja: error: 'ao', needed by 'Binaries/dolphin-emu', missing and no known rule to make it"). [0]: https://analytics.dolphin-emu.org/stats/popular-audio-backends.txt
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/AudioCommon/AOSoundStream.cpp82
-rw-r--r--Source/Core/AudioCommon/AOSoundStream.h42
-rw-r--r--Source/Core/AudioCommon/AudioCommon.cpp5
-rw-r--r--Source/Core/AudioCommon/AudioCommon.vcxproj3
-rw-r--r--Source/Core/AudioCommon/AudioCommon.vcxproj.filters5
-rw-r--r--Source/Core/AudioCommon/CMakeLists.txt14
-rw-r--r--Source/Core/Core/ConfigManager.h1
7 files changed, 2 insertions, 150 deletions
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 <cstring>
-
-#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<std::mutex> 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<std::mutex> 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 <mutex>
-#include <thread>
-
-#include "AudioCommon/SoundStream.h"
-#include "Common/Event.h"
-#include "Common/Thread.h"
-
-#if defined(HAVE_AO) && HAVE_AO
-#include <ao/ao.h>
-#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<XAudio2_7>();
}
- else if (backend == BACKEND_AOSOUND && AOSound::isValid())
- g_sound_stream = std::make_unique<AOSound>();
else if (backend == BACKEND_ALSA && AlsaSound::isValid())
g_sound_stream = std::make_unique<AlsaSound>();
else if (backend == BACKEND_COREAUDIO && CoreAudioSound::isValid())
@@ -115,8 +112,6 @@ std::vector<std::string> 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 @@
<ItemGroup>
<ClInclude Include="aldlist.h" />
<ClInclude Include="AlsaSoundStream.h" />
- <ClInclude Include="AOSoundStream.h" />
<ClInclude Include="AudioCommon.h" />
<ClInclude Include="CoreAudioSoundStream.h" />
<ClInclude Include="DPL2Decoder.h" />
@@ -78,4 +77,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
-</Project> \ No newline at end of file
+</Project>
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 @@
<ClInclude Include="DPL2Decoder.h" />
<ClInclude Include="Mixer.h" />
<ClInclude Include="WaveFile.h" />
- <ClInclude Include="AOSoundStream.h">
- <Filter>SoundStreams</Filter>
- </ClInclude>
<ClInclude Include="NullSoundStream.h">
<Filter>SoundStreams</Filter>
</ClInclude>
@@ -64,4 +61,4 @@
<ItemGroup>
<Text Include="CMakeLists.txt" />
</ItemGroup>
-</Project> \ No newline at end of file
+</Project>
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"