summaryrefslogtreecommitdiff
path: root/Source/Core/AudioCommon/Src
diff options
context:
space:
mode:
authorPierre Bourdon <delroth@gmail.com>2012-03-22 15:21:52 +0100
committerPierre Bourdon <delroth@gmail.com>2012-03-22 15:21:52 +0100
commit0ffc12bbfd6ac44b3030ec30f400a58e951087b7 (patch)
tree53a6fac9ec79bcd71fe2046d8fb579478da12fd2 /Source/Core/AudioCommon/Src
parent006923e871e496a7c6c0fe9ba76da4ee939ce14e (diff)
parentd95e31af3f779bfa3141047e8b6275e1fd2e4bbb (diff)
Merge branch 'master' into zcomploc-support
Conflicts: Source/Core/VideoCommon/Src/PixelShaderGen.cpp
Diffstat (limited to 'Source/Core/AudioCommon/Src')
-rw-r--r--Source/Core/AudioCommon/Src/AOSoundStream.cpp2
-rw-r--r--Source/Core/AudioCommon/Src/AlsaSoundStream.cpp1
-rw-r--r--Source/Core/AudioCommon/Src/AudioCommonConfig.cpp5
-rw-r--r--Source/Core/AudioCommon/Src/AudioCommonConfig.h1
-rw-r--r--Source/Core/AudioCommon/Src/DSoundStream.cpp4
-rw-r--r--Source/Core/AudioCommon/Src/OpenALStream.cpp2
-rw-r--r--Source/Core/AudioCommon/Src/PulseAudioStream.cpp2
-rw-r--r--Source/Core/AudioCommon/Src/aldlist.cpp3
8 files changed, 15 insertions, 5 deletions
diff --git a/Source/Core/AudioCommon/Src/AOSoundStream.cpp b/Source/Core/AudioCommon/Src/AOSoundStream.cpp
index e864ad1211..99ae2e661c 100644
--- a/Source/Core/AudioCommon/Src/AOSoundStream.cpp
+++ b/Source/Core/AudioCommon/Src/AOSoundStream.cpp
@@ -25,6 +25,8 @@
void AOSound::SoundLoop()
{
+ Common::SetCurrentThreadName("Audio thread - ao");
+
uint_32 numBytesToRender = 256;
ao_initialize();
default_driver = ao_default_driver_id();
diff --git a/Source/Core/AudioCommon/Src/AlsaSoundStream.cpp b/Source/Core/AudioCommon/Src/AlsaSoundStream.cpp
index 76f13b6cb1..710275d55a 100644
--- a/Source/Core/AudioCommon/Src/AlsaSoundStream.cpp
+++ b/Source/Core/AudioCommon/Src/AlsaSoundStream.cpp
@@ -60,6 +60,7 @@ void AlsaSound::SoundLoop()
thread_data = 2;
return;
}
+ Common::SetCurrentThreadName("Audio thread - alsa");
while (!thread_data)
{
m_mixer->Mix(reinterpret_cast<short *>(mix_buffer), frames_to_deliver);
diff --git a/Source/Core/AudioCommon/Src/AudioCommonConfig.cpp b/Source/Core/AudioCommon/Src/AudioCommonConfig.cpp
index 1ab4c261e2..533c6b4313 100644
--- a/Source/Core/AudioCommon/Src/AudioCommonConfig.cpp
+++ b/Source/Core/AudioCommon/Src/AudioCommonConfig.cpp
@@ -18,6 +18,7 @@
#include "AudioCommon.h"
#include "CommonPaths.h"
#include "FileUtil.h"
+#include "../../Core/Src/ConfigManager.h"
AudioCommonConfig ac_Config;
@@ -31,7 +32,6 @@ void AudioCommonConfig::Load()
file.Load(File::GetUserPath(F_DSPCONFIG_IDX));
file.Get("Config", "EnableDTKMusic", &m_EnableDTKMusic, true);
- file.Get("Config", "EnableThrottle", &m_EnableThrottle, true);
file.Get("Config", "EnableJIT", &m_EnableJIT, true);
file.Get("Config", "DumpAudio", &m_DumpAudio, false);
#if defined __linux__ && HAVE_ALSA
@@ -54,7 +54,6 @@ void AudioCommonConfig::SaveSettings()
file.Load(File::GetUserPath(F_DSPCONFIG_IDX));
file.Set("Config", "EnableDTKMusic", m_EnableDTKMusic);
- file.Set("Config", "EnableThrottle", m_EnableThrottle);
file.Set("Config", "EnableJIT", m_EnableJIT);
file.Set("Config", "DumpAudio", m_DumpAudio);
file.Set("Config", "Backend", sBackend);
@@ -67,7 +66,7 @@ void AudioCommonConfig::SaveSettings()
// Update according to the values (stream/mixer)
void AudioCommonConfig::Update() {
if (soundStream) {
- soundStream->GetMixer()->SetThrottle(m_EnableThrottle);
+ soundStream->GetMixer()->SetThrottle(SConfig::GetInstance().m_Framelimit == 2);
soundStream->GetMixer()->SetDTKMusic(m_EnableDTKMusic);
soundStream->SetVolume(m_Volume);
}
diff --git a/Source/Core/AudioCommon/Src/AudioCommonConfig.h b/Source/Core/AudioCommon/Src/AudioCommonConfig.h
index 49124344e0..076ef2d4e1 100644
--- a/Source/Core/AudioCommon/Src/AudioCommonConfig.h
+++ b/Source/Core/AudioCommon/Src/AudioCommonConfig.h
@@ -34,7 +34,6 @@
struct AudioCommonConfig
{
bool m_EnableDTKMusic;
- bool m_EnableThrottle;
bool m_EnableJIT;
bool m_DumpAudio;
int m_Volume;
diff --git a/Source/Core/AudioCommon/Src/DSoundStream.cpp b/Source/Core/AudioCommon/Src/DSoundStream.cpp
index 38fbc2a851..b252dc90c5 100644
--- a/Source/Core/AudioCommon/Src/DSoundStream.cpp
+++ b/Source/Core/AudioCommon/Src/DSoundStream.cpp
@@ -96,6 +96,8 @@ bool DSound::WriteDataToBuffer(DWORD dwOffset, // Our own write
// The audio thread.
void DSound::SoundLoop()
{
+ Common::SetCurrentThreadName("Audio thread - dsound");
+
currentPos = 0;
lastPos = 0;
dsBuffer->Play(0, 0, DSBPLAY_LOOPING);
@@ -130,7 +132,7 @@ bool DSound::Start()
DWORD num1;
short* p1;
- dsBuffer->Lock(0, bufferSize, (void* *)&p1, &num1, 0, 0, 0);
+ dsBuffer->Lock(0, bufferSize, (void* *)&p1, &num1, 0, 0, DSBLOCK_ENTIREBUFFER);
memset(p1, 0, num1);
dsBuffer->Unlock(p1, num1, 0, 0);
thread = std::thread(std::mem_fun(&DSound::SoundLoop), this);
diff --git a/Source/Core/AudioCommon/Src/OpenALStream.cpp b/Source/Core/AudioCommon/Src/OpenALStream.cpp
index 91d2b3270c..99220f0ed2 100644
--- a/Source/Core/AudioCommon/Src/OpenALStream.cpp
+++ b/Source/Core/AudioCommon/Src/OpenALStream.cpp
@@ -121,6 +121,8 @@ void OpenALStream::Clear(bool mute)
void OpenALStream::SoundLoop()
{
+ Common::SetCurrentThreadName("Audio thread - openal");
+
ALenum err;
u32 ulFrequency = m_mixer->GetSampleRate();
diff --git a/Source/Core/AudioCommon/Src/PulseAudioStream.cpp b/Source/Core/AudioCommon/Src/PulseAudioStream.cpp
index 6b3f9e7217..4851b4bd12 100644
--- a/Source/Core/AudioCommon/Src/PulseAudioStream.cpp
+++ b/Source/Core/AudioCommon/Src/PulseAudioStream.cpp
@@ -58,6 +58,8 @@ void PulseAudio::Update()
// Called on audio thread.
void PulseAudio::SoundLoop()
{
+ Common::SetCurrentThreadName("Audio thread - pulse");
+
thread_running = PulseInit();
while (thread_running)
diff --git a/Source/Core/AudioCommon/Src/aldlist.cpp b/Source/Core/AudioCommon/Src/aldlist.cpp
index 2008842486..69d42148ae 100644
--- a/Source/Core/AudioCommon/Src/aldlist.cpp
+++ b/Source/Core/AudioCommon/Src/aldlist.cpp
@@ -27,6 +27,9 @@
#ifdef _WIN32
#include "../../../../Externals/OpenAL/include/al.h"
#include "../../../../Externals/OpenAL/include/alc.h"
+#elif defined(__APPLE__)
+#include <al.h>
+#include <alc.h>
#else
#include <AL/al.h>
#include <AL/alc.h>