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.
This commit is contained in:
Billy Laws 2021-02-10 10:42:38 +00:00 committed by ◱ Mark
parent 7e7a792dc5
commit ce0e032255

View File

@ -7,7 +7,7 @@
namespace skyline::service::audio::IAudioRenderer { namespace skyline::service::audio::IAudioRenderer {
IAudioRenderer::IAudioRenderer(const DeviceState &state, ServiceManager &manager, AudioRendererParameters &parameters) IAudioRenderer::IAudioRenderer(const DeviceState &state, ServiceManager &manager, AudioRendererParameters &parameters)
: systemEvent(std::make_shared<type::KEvent>(state, true)), parameters(parameters), BaseService(state, manager) { : systemEvent(std::make_shared<type::KEvent>(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(); track->Start();
memoryPools.resize(parameters.effectCount + parameters.voiceCount * 4); memoryPools.resize(parameters.effectCount + parameters.voiceCount * 4);
@ -69,7 +69,6 @@ namespace skyline::service::audio::IAudioRenderer {
effects[i].ProcessInput(effectsIn[i]); effects[i].ProcessInput(effectsIn[i]);
UpdateAudio(); UpdateAudio();
systemEvent->Signal();
UpdateDataHeader outputHeader{ UpdateDataHeader outputHeader{
.revision = constant::RevMagic, .revision = constant::RevMagic,