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 3fb7e46b..738217b3 100644 --- a/app/src/main/cpp/skyline/services/audio/IAudioRenderer/IAudioRenderer.cpp +++ b/app/src/main/cpp/skyline/services/audio/IAudioRenderer/IAudioRenderer.cpp @@ -6,7 +6,7 @@ namespace skyline::service::audio::IAudioRenderer { IAudioRenderer::IAudioRenderer(const DeviceState &state, ServiceManager &manager, AudioRendererParameters ¶meters) - : releaseEvent(std::make_shared(state)), parameters(parameters), BaseService(state, manager, Service::audio_IAudioRenderer, "audio:IAudioRenderer", { + : systemEvent(std::make_shared(state)), parameters(parameters), BaseService(state, manager, Service::audio_IAudioRenderer, "audio:IAudioRenderer", { {0x0, SFUNC(IAudioRenderer::GetSampleRate)}, {0x1, SFUNC(IAudioRenderer::GetSampleCount)}, {0x2, SFUNC(IAudioRenderer::GetMixBufferCount)}, @@ -16,7 +16,7 @@ namespace skyline::service::audio::IAudioRenderer { {0x6, SFUNC(IAudioRenderer::Stop)}, {0x7, SFUNC(IAudioRenderer::QuerySystemEvent)}, }) { - track = state.audio->OpenTrack(constant::ChannelCount, parameters.sampleRate, [this]() { releaseEvent->Signal(); }); + track = state.audio->OpenTrack(constant::ChannelCount, parameters.sampleRate, []() {}); track->Start(); memoryPools.resize(parameters.effectCount + parameters.voiceCount * 4); @@ -80,6 +80,7 @@ namespace skyline::service::audio::IAudioRenderer { effects[i].ProcessInput(effectsIn[i]); UpdateAudio(); + systemEvent->Signal(); UpdateDataHeader outputHeader{ .revision = constant::RevMagic, @@ -178,8 +179,8 @@ namespace skyline::service::audio::IAudioRenderer { } void IAudioRenderer::QuerySystemEvent(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { - auto handle = state.process->InsertItem(releaseEvent); - state.logger->Debug("Audren Buffer Release Event Handle: 0x{:X}", handle); + auto handle = state.process->InsertItem(systemEvent); + state.logger->Debug("Audren System Event Handle: 0x{:X}", handle); response.copyHandles.push_back(handle); } } diff --git a/app/src/main/cpp/skyline/services/audio/IAudioRenderer/IAudioRenderer.h b/app/src/main/cpp/skyline/services/audio/IAudioRenderer/IAudioRenderer.h index 134869a2..6d983df2 100644 --- a/app/src/main/cpp/skyline/services/audio/IAudioRenderer/IAudioRenderer.h +++ b/app/src/main/cpp/skyline/services/audio/IAudioRenderer/IAudioRenderer.h @@ -66,11 +66,11 @@ namespace skyline { AudioRendererParameters parameters; //!< The parameters to use for the renderer RevisionInfo revisionInfo{}; //!< Stores info about supported features for the audren revision used std::shared_ptr track; //!< The audio track associated with the audio renderer - std::shared_ptr releaseEvent; //!< The KEvent that is signalled when a buffer has been released + std::shared_ptr systemEvent; //!< The KEvent that is signalled when the DSP has processed all the commands std::vector memoryPools; //!< An vector of all memory pools that the guest may need std::vector effects; //!< An vector of all effects that the guest may need std::vector voices; //!< An vector of all voices that the guest may need - std::array sampleBuffer; //!< The final output data that is appended to the stream + std::array sampleBuffer{}; //!< The final output data that is appended to the stream skyline::audio::AudioOutState playbackState{skyline::audio::AudioOutState::Stopped}; //!< The current state of playback /**