summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/audio
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2018-11-27 00:34:07 +0100
committerZach Hilman <zachhilman@gmail.com>2018-11-29 14:45:41 +0100
commitff610103b58b3e0dd39fafb539a1cc0bc0fae577 (patch)
treecbd54b09f9270f6f1d92a2f45a5ccdb307569093 /src/core/hle/service/audio
parenthle_ipc: Use event pair for SleepClientThread (diff)
downloadyuzu-ff610103b58b3e0dd39fafb539a1cc0bc0fae577.tar
yuzu-ff610103b58b3e0dd39fafb539a1cc0bc0fae577.tar.gz
yuzu-ff610103b58b3e0dd39fafb539a1cc0bc0fae577.tar.bz2
yuzu-ff610103b58b3e0dd39fafb539a1cc0bc0fae577.tar.lz
yuzu-ff610103b58b3e0dd39fafb539a1cc0bc0fae577.tar.xz
yuzu-ff610103b58b3e0dd39fafb539a1cc0bc0fae577.tar.zst
yuzu-ff610103b58b3e0dd39fafb539a1cc0bc0fae577.zip
Diffstat (limited to 'src/core/hle/service/audio')
-rw-r--r--src/core/hle/service/audio/audout_u.cpp14
-rw-r--r--src/core/hle/service/audio/audren_u.cpp24
2 files changed, 24 insertions, 14 deletions
diff --git a/src/core/hle/service/audio/audout_u.cpp b/src/core/hle/service/audio/audout_u.cpp
index 2ee9bc273..b5012e579 100644
--- a/src/core/hle/service/audio/audout_u.cpp
+++ b/src/core/hle/service/audio/audout_u.cpp
@@ -13,8 +13,10 @@
#include "common/swap.h"
#include "core/core.h"
#include "core/hle/ipc_helpers.h"
-#include "core/hle/kernel/event.h"
#include "core/hle/kernel/hle_ipc.h"
+#include "core/hle/kernel/kernel.h"
+#include "core/hle/kernel/readable_event.h"
+#include "core/hle/kernel/writable_event.h"
#include "core/hle/service/audio/audout_u.h"
#include "core/memory.h"
@@ -67,8 +69,8 @@ public:
// This is the event handle used to check if the audio buffer was released
auto& kernel = Core::System::GetInstance().Kernel();
- buffer_event =
- Kernel::Event::Create(kernel, Kernel::ResetType::Sticky, "IAudioOutBufferReleased");
+ buffer_event = Kernel::WritableEvent::CreateRegisteredEventPair(
+ kernel, Kernel::ResetType::Sticky, "IAudioOutBufferReleased");
stream = audio_core.OpenStream(audio_params.sample_rate, audio_params.channel_count,
std::move(unique_name), [=]() { buffer_event->Signal(); });
@@ -121,7 +123,9 @@ private:
IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(RESULT_SUCCESS);
- rb.PushCopyObjects(buffer_event);
+ const auto& event{
+ Core::System::GetInstance().Kernel().FindNamedEvent("IAudioOutBufferReleased")};
+ rb.PushCopyObjects(event->second);
}
void AppendAudioOutBufferImpl(Kernel::HLERequestContext& ctx) {
@@ -188,7 +192,7 @@ private:
AudoutParams audio_params{};
/// This is the evend handle used to check if the audio buffer was released
- Kernel::SharedPtr<Kernel::Event> buffer_event;
+ Kernel::SharedPtr<Kernel::WritableEvent> buffer_event;
};
void AudOutU::ListAudioOutsImpl(Kernel::HLERequestContext& ctx) {
diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp
index 1c418a9bb..9b7f7b201 100644
--- a/src/core/hle/service/audio/audren_u.cpp
+++ b/src/core/hle/service/audio/audren_u.cpp
@@ -12,8 +12,10 @@
#include "common/logging/log.h"
#include "core/core.h"
#include "core/hle/ipc_helpers.h"
-#include "core/hle/kernel/event.h"
#include "core/hle/kernel/hle_ipc.h"
+#include "core/hle/kernel/kernel.h"
+#include "core/hle/kernel/readable_event.h"
+#include "core/hle/kernel/writable_event.h"
#include "core/hle/service/audio/audren_u.h"
namespace Service::Audio {
@@ -41,8 +43,8 @@ public:
RegisterHandlers(functions);
auto& kernel = Core::System::GetInstance().Kernel();
- system_event =
- Kernel::Event::Create(kernel, Kernel::ResetType::Sticky, "IAudioRenderer:SystemEvent");
+ system_event = Kernel::WritableEvent::CreateRegisteredEventPair(
+ kernel, Kernel::ResetType::Sticky, "IAudioRenderer:SystemEvent");
renderer = std::make_unique<AudioCore::AudioRenderer>(audren_params, system_event);
}
@@ -112,7 +114,9 @@ private:
IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(RESULT_SUCCESS);
- rb.PushCopyObjects(system_event);
+ const auto& event{
+ Core::System::GetInstance().Kernel().FindNamedEvent("IAudioRenderer:SystemEvent")};
+ rb.PushCopyObjects(event->second);
}
void SetRenderingTimeLimit(Kernel::HLERequestContext& ctx) {
@@ -135,7 +139,7 @@ private:
rb.Push(rendering_time_limit_percent);
}
- Kernel::SharedPtr<Kernel::Event> system_event;
+ Kernel::SharedPtr<Kernel::WritableEvent> system_event;
std::unique_ptr<AudioCore::AudioRenderer> renderer;
u32 rendering_time_limit_percent = 100;
};
@@ -162,8 +166,8 @@ public:
RegisterHandlers(functions);
auto& kernel = Core::System::GetInstance().Kernel();
- buffer_event = Kernel::Event::Create(kernel, Kernel::ResetType::OneShot,
- "IAudioOutBufferReleasedEvent");
+ buffer_event = Kernel::WritableEvent::CreateRegisteredEventPair(
+ kernel, Kernel::ResetType::OneShot, "IAudioOutBufferReleasedEvent");
}
private:
@@ -211,7 +215,9 @@ private:
IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(RESULT_SUCCESS);
- rb.PushCopyObjects(buffer_event);
+ const auto& event{
+ Core::System::GetInstance().Kernel().FindNamedEvent("IAudioOutBufferReleasedEvent")};
+ rb.PushCopyObjects(event->second);
}
void GetActiveChannelCount(Kernel::HLERequestContext& ctx) {
@@ -222,7 +228,7 @@ private:
rb.Push<u32>(1);
}
- Kernel::SharedPtr<Kernel::Event> buffer_event;
+ Kernel::SharedPtr<Kernel::WritableEvent> buffer_event;
}; // namespace Audio