summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2023-10-11 15:24:16 +0200
committerGitHub <noreply@github.com>2023-10-11 15:24:16 +0200
commit5ecdcfa33453d73d35b1718c65b3af7406ee8ac3 (patch)
treef15cd4196a4ffe6cab3f666983e1cab9d9745ead
parentMerge pull request #11683 from Kelebek1/do_not_sync_on_written_buffer (diff)
parentClear DSP buffer after each execution (diff)
downloadyuzu-5ecdcfa33453d73d35b1718c65b3af7406ee8ac3.tar
yuzu-5ecdcfa33453d73d35b1718c65b3af7406ee8ac3.tar.gz
yuzu-5ecdcfa33453d73d35b1718c65b3af7406ee8ac3.tar.bz2
yuzu-5ecdcfa33453d73d35b1718c65b3af7406ee8ac3.tar.lz
yuzu-5ecdcfa33453d73d35b1718c65b3af7406ee8ac3.tar.xz
yuzu-5ecdcfa33453d73d35b1718c65b3af7406ee8ac3.tar.zst
yuzu-5ecdcfa33453d73d35b1718c65b3af7406ee8ac3.zip
-rw-r--r--src/audio_core/adsp/apps/audio_renderer/audio_renderer.cpp9
-rw-r--r--src/audio_core/adsp/apps/audio_renderer/audio_renderer.h2
2 files changed, 11 insertions, 0 deletions
diff --git a/src/audio_core/adsp/apps/audio_renderer/audio_renderer.cpp b/src/audio_core/adsp/apps/audio_renderer/audio_renderer.cpp
index 972d5e45b..ef301d8b4 100644
--- a/src/audio_core/adsp/apps/audio_renderer/audio_renderer.cpp
+++ b/src/audio_core/adsp/apps/audio_renderer/audio_renderer.cpp
@@ -77,6 +77,7 @@ void AudioRenderer::Wait() {
"{}, got {}",
Message::RenderResponse, msg);
}
+ PostDSPClearCommandBuffer();
}
void AudioRenderer::Send(Direction dir, u32 message) {
@@ -96,6 +97,14 @@ void AudioRenderer::SetCommandBuffer(s32 session_id, CpuAddr buffer, u64 size, u
command_buffers[session_id].reset_buffer = reset;
}
+void AudioRenderer::PostDSPClearCommandBuffer() noexcept {
+ for (auto& buffer : command_buffers) {
+ buffer.buffer = 0;
+ buffer.size = 0;
+ buffer.reset_buffer = false;
+ }
+}
+
u32 AudioRenderer::GetRemainCommandCount(s32 session_id) const noexcept {
return command_buffers[session_id].remaining_command_count;
}
diff --git a/src/audio_core/adsp/apps/audio_renderer/audio_renderer.h b/src/audio_core/adsp/apps/audio_renderer/audio_renderer.h
index 85874d88a..57b89d9fe 100644
--- a/src/audio_core/adsp/apps/audio_renderer/audio_renderer.h
+++ b/src/audio_core/adsp/apps/audio_renderer/audio_renderer.h
@@ -85,6 +85,8 @@ private:
*/
void CreateSinkStreams();
+ void PostDSPClearCommandBuffer() noexcept;
+
/// Core system
Core::System& system;
/// The output sink the AudioRenderer will send samples to