aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/audio_core
diff options
context:
space:
mode:
authorKelebek1 <[email protected]>2023-10-10 14:29:07 +0100
committerKelebek1 <[email protected]>2023-10-10 18:22:08 +0100
commitec6ddaf766ec53aa6ca4bbd58b7cfd61a8116e99 (patch)
tree1cca3c1c303082985f7da4af7e7c41d6dcdeed1b /src/audio_core
parent1c1959eaebb09a3dc0708be6c20dc001ac30a102 (diff)
downloadyuzu-android-ec6ddaf766ec53aa6ca4bbd58b7cfd61a8116e99.tar.gz
yuzu-android-ec6ddaf766ec53aa6ca4bbd58b7cfd61a8116e99.zip
Clear DSP buffer after each execution
Diffstat (limited to 'src/audio_core')
-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