From ce0e0322552abb438221561f2daa24680b6eb119 Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Wed, 10 Feb 2021 10:42:38 +0000 Subject: [PATCH] Avoid constantly signalling audren DSP done event This was causing a significant amount of sched thrashing and pinning a core to 100% as games constantly updated audren, now change it to only signal on buffer release. --- .../skyline/services/audio/IAudioRenderer/IAudioRenderer.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/cpp/skyline/services/audio/IAudioRenderer/IAudioRenderer.cpp b/app/src/main/cpp/skyline/services/audio/IAudioRenderer/IAudioRenderer.cpp index 4d09aa45..a7dd5c5b 100644 --- a/app/src/main/cpp/skyline/services/audio/IAudioRenderer/IAudioRenderer.cpp +++ b/app/src/main/cpp/skyline/services/audio/IAudioRenderer/IAudioRenderer.cpp @@ -7,7 +7,7 @@ namespace skyline::service::audio::IAudioRenderer { IAudioRenderer::IAudioRenderer(const DeviceState &state, ServiceManager &manager, AudioRendererParameters ¶meters) : systemEvent(std::make_shared(state, true)), parameters(parameters), BaseService(state, manager) { - track = state.audio->OpenTrack(constant::ChannelCount, constant::SampleRate, []() {}); + track = state.audio->OpenTrack(constant::ChannelCount, constant::SampleRate, [&]() {systemEvent->Signal();}); track->Start(); memoryPools.resize(parameters.effectCount + parameters.voiceCount * 4); @@ -69,7 +69,6 @@ namespace skyline::service::audio::IAudioRenderer { effects[i].ProcessInput(effectsIn[i]); UpdateAudio(); - systemEvent->Signal(); UpdateDataHeader outputHeader{ .revision = constant::RevMagic,