diff options
Diffstat (limited to 'src')
5 files changed, 14 insertions, 27 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 3da342ea3..2e549bc6f 100644 --- a/src/audio_core/adsp/apps/audio_renderer/audio_renderer.cpp +++ b/src/audio_core/adsp/apps/audio_renderer/audio_renderer.cpp | |||
| @@ -88,8 +88,13 @@ MailboxMessage AudioRenderer::Receive(Direction dir, bool block) { | |||
| 88 | return mailbox.Receive(dir, block); | 88 | return mailbox.Receive(dir, block); |
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | void AudioRenderer::SetCommandBuffer(s32 session_id, CommandBuffer& buffer) noexcept { | 91 | void AudioRenderer::SetCommandBuffer(s32 session_id, CpuAddr buffer, u64 size, u64 time_limit, |
| 92 | command_buffers[session_id] = buffer; | 92 | u64 applet_resource_user_id, bool reset) noexcept { |
| 93 | command_buffers[session_id].buffer = buffer; | ||
| 94 | command_buffers[session_id].size = size; | ||
| 95 | command_buffers[session_id].time_limit = time_limit; | ||
| 96 | command_buffers[session_id].applet_resource_user_id = applet_resource_user_id; | ||
| 97 | command_buffers[session_id].reset_buffer = reset; | ||
| 93 | } | 98 | } |
| 94 | 99 | ||
| 95 | u32 AudioRenderer::GetRemainCommandCount(s32 session_id) const noexcept { | 100 | u32 AudioRenderer::GetRemainCommandCount(s32 session_id) const noexcept { |
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 b225e10fb..3f5b7dca2 100644 --- a/src/audio_core/adsp/apps/audio_renderer/audio_renderer.h +++ b/src/audio_core/adsp/apps/audio_renderer/audio_renderer.h | |||
| @@ -75,7 +75,8 @@ public: | |||
| 75 | void Send(Direction dir, MailboxMessage message); | 75 | void Send(Direction dir, MailboxMessage message); |
| 76 | MailboxMessage Receive(Direction dir, bool block = true); | 76 | MailboxMessage Receive(Direction dir, bool block = true); |
| 77 | 77 | ||
| 78 | void SetCommandBuffer(s32 session_id, CommandBuffer& buffer) noexcept; | 78 | void SetCommandBuffer(s32 session_id, CpuAddr buffer, u64 size, u64 time_limit, |
| 79 | u64 applet_resource_user_id, bool reset) noexcept; | ||
| 79 | u32 GetRemainCommandCount(s32 session_id) const noexcept; | 80 | u32 GetRemainCommandCount(s32 session_id) const noexcept; |
| 80 | void ClearRemainCommandCount(s32 session_id) noexcept; | 81 | void ClearRemainCommandCount(s32 session_id) noexcept; |
| 81 | u64 GetRenderingStartTick(s32 session_id) const noexcept; | 82 | u64 GetRenderingStartTick(s32 session_id) const noexcept; |
diff --git a/src/audio_core/adsp/apps/audio_renderer/command_list_processor.cpp b/src/audio_core/adsp/apps/audio_renderer/command_list_processor.cpp index acbc9100c..24e4d0496 100644 --- a/src/audio_core/adsp/apps/audio_renderer/command_list_processor.cpp +++ b/src/audio_core/adsp/apps/audio_renderer/command_list_processor.cpp | |||
| @@ -37,11 +37,6 @@ u32 CommandListProcessor::GetRemainingCommandCount() const { | |||
| 37 | return command_count - processed_command_count; | 37 | return command_count - processed_command_count; |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | void CommandListProcessor::SetBuffer(const CpuAddr buffer, const u64 size) { | ||
| 41 | commands = reinterpret_cast<u8*>(buffer + sizeof(Renderer::CommandListHeader)); | ||
| 42 | commands_buffer_size = size; | ||
| 43 | } | ||
| 44 | |||
| 45 | Sink::SinkStream* CommandListProcessor::GetOutputSinkStream() const { | 40 | Sink::SinkStream* CommandListProcessor::GetOutputSinkStream() const { |
| 46 | return stream; | 41 | return stream; |
| 47 | } | 42 | } |
diff --git a/src/audio_core/adsp/apps/audio_renderer/command_list_processor.h b/src/audio_core/adsp/apps/audio_renderer/command_list_processor.h index 9d6fe1851..4e5fb793e 100644 --- a/src/audio_core/adsp/apps/audio_renderer/command_list_processor.h +++ b/src/audio_core/adsp/apps/audio_renderer/command_list_processor.h | |||
| @@ -57,14 +57,6 @@ public: | |||
| 57 | u32 GetRemainingCommandCount() const; | 57 | u32 GetRemainingCommandCount() const; |
| 58 | 58 | ||
| 59 | /** | 59 | /** |
| 60 | * Set the command buffer. | ||
| 61 | * | ||
| 62 | * @param buffer - The buffer to use. | ||
| 63 | * @param size - The size of the buffer. | ||
| 64 | */ | ||
| 65 | void SetBuffer(CpuAddr buffer, u64 size); | ||
| 66 | |||
| 67 | /** | ||
| 68 | * Get the stream for this command list. | 60 | * Get the stream for this command list. |
| 69 | * | 61 | * |
| 70 | * @return The stream associated with this command list. | 62 | * @return The stream associated with this command list. |
diff --git a/src/audio_core/renderer/system.cpp b/src/audio_core/renderer/system.cpp index 8f02754c5..d29754634 100644 --- a/src/audio_core/renderer/system.cpp +++ b/src/audio_core/renderer/system.cpp | |||
| @@ -609,17 +609,11 @@ void System::SendCommandToDsp() { | |||
| 609 | time_limit_percent = 70.0f; | 609 | time_limit_percent = 70.0f; |
| 610 | } | 610 | } |
| 611 | 611 | ||
| 612 | AudioRenderer::CommandBuffer command_buffer{ | 612 | auto time_limit{ |
| 613 | .buffer{translated_addr}, | 613 | static_cast<u64>((time_limit_percent / 100) * 2'880'000.0 * |
| 614 | .size{command_size}, | 614 | (static_cast<f32>(render_time_limit_percent) / 100.0f))}; |
| 615 | .time_limit{ | 615 | audio_renderer.SetCommandBuffer(session_id, translated_addr, command_size, time_limit, |
| 616 | static_cast<u64>((time_limit_percent / 100) * 2'880'000.0 * | 616 | applet_resource_user_id, reset_command_buffers); |
| 617 | (static_cast<f32>(render_time_limit_percent) / 100.0f))}, | ||
| 618 | .applet_resource_user_id{applet_resource_user_id}, | ||
| 619 | .reset_buffer{reset_command_buffers}, | ||
| 620 | }; | ||
| 621 | |||
| 622 | audio_renderer.SetCommandBuffer(session_id, command_buffer); | ||
| 623 | reset_command_buffers = false; | 617 | reset_command_buffers = false; |
| 624 | command_buffer_size = command_size; | 618 | command_buffer_size = command_size; |
| 625 | if (remaining_command_count == 0) { | 619 | if (remaining_command_count == 0) { |