From 6f1b2d7748c2ebe5db7e17d0308f4106d04e71d4 Mon Sep 17 00:00:00 2001 From: nitsuja Date: Fri, 30 Dec 2011 20:22:48 -0800 Subject: [PATCH] name all audio threads (that I know how to) for debugging, as suggested in response to revision d00b719966ed. --- Source/Core/AudioCommon/Src/AOSoundStream.cpp | 2 ++ Source/Core/AudioCommon/Src/AlsaSoundStream.cpp | 1 + Source/Core/AudioCommon/Src/DSoundStream.cpp | 4 ++-- Source/Core/AudioCommon/Src/OpenALStream.cpp | 2 ++ Source/Core/AudioCommon/Src/PulseAudioStream.cpp | 2 ++ 5 files changed, 9 insertions(+), 2 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(mix_buffer), frames_to_deliver); diff --git a/Source/Core/AudioCommon/Src/DSoundStream.cpp b/Source/Core/AudioCommon/Src/DSoundStream.cpp index 78e79e1057..b252dc90c5 100644 --- a/Source/Core/AudioCommon/Src/DSoundStream.cpp +++ b/Source/Core/AudioCommon/Src/DSoundStream.cpp @@ -96,7 +96,7 @@ bool DSound::WriteDataToBuffer(DWORD dwOffset, // Our own write // The audio thread. void DSound::SoundLoop() { - Common::SetCurrentThreadName("Audio thread"); + Common::SetCurrentThreadName("Audio thread - dsound"); currentPos = 0; lastPos = 0; @@ -132,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)