diff options
Diffstat (limited to 'src')
173 files changed, 1051 insertions, 1257 deletions
diff --git a/src/audio_core/CMakeLists.txt b/src/audio_core/CMakeLists.txt index e7b595459..67dfe0290 100644 --- a/src/audio_core/CMakeLists.txt +++ b/src/audio_core/CMakeLists.txt | |||
| @@ -2,6 +2,14 @@ | |||
| 2 | # SPDX-License-Identifier: GPL-2.0-or-later | 2 | # SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | add_library(audio_core STATIC | 4 | add_library(audio_core STATIC |
| 5 | adsp/adsp.cpp | ||
| 6 | adsp/adsp.h | ||
| 7 | adsp/mailbox.h | ||
| 8 | adsp/apps/audio_renderer/audio_renderer.cpp | ||
| 9 | adsp/apps/audio_renderer/audio_renderer.h | ||
| 10 | adsp/apps/audio_renderer/command_buffer.h | ||
| 11 | adsp/apps/audio_renderer/command_list_processor.cpp | ||
| 12 | adsp/apps/audio_renderer/command_list_processor.h | ||
| 5 | audio_core.cpp | 13 | audio_core.cpp |
| 6 | audio_core.h | 14 | audio_core.h |
| 7 | audio_event.h | 15 | audio_event.h |
| @@ -32,13 +40,6 @@ add_library(audio_core STATIC | |||
| 32 | out/audio_out_system.cpp | 40 | out/audio_out_system.cpp |
| 33 | out/audio_out_system.h | 41 | out/audio_out_system.h |
| 34 | precompiled_headers.h | 42 | precompiled_headers.h |
| 35 | renderer/adsp/adsp.cpp | ||
| 36 | renderer/adsp/adsp.h | ||
| 37 | renderer/adsp/audio_renderer.cpp | ||
| 38 | renderer/adsp/audio_renderer.h | ||
| 39 | renderer/adsp/command_buffer.h | ||
| 40 | renderer/adsp/command_list_processor.cpp | ||
| 41 | renderer/adsp/command_list_processor.h | ||
| 42 | renderer/audio_device.cpp | 43 | renderer/audio_device.cpp |
| 43 | renderer/audio_device.h | 44 | renderer/audio_device.h |
| 44 | renderer/audio_renderer.h | 45 | renderer/audio_renderer.h |
diff --git a/src/audio_core/adsp/adsp.cpp b/src/audio_core/adsp/adsp.cpp new file mode 100644 index 000000000..0580990f5 --- /dev/null +++ b/src/audio_core/adsp/adsp.cpp | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #include "audio_core/adsp/adsp.h" | ||
| 5 | #include "core/core.h" | ||
| 6 | |||
| 7 | namespace AudioCore::ADSP { | ||
| 8 | |||
| 9 | ADSP::ADSP(Core::System& system, Sink::Sink& sink) { | ||
| 10 | audio_renderer = | ||
| 11 | std::make_unique<AudioRenderer::AudioRenderer>(system, system.ApplicationMemory(), sink); | ||
| 12 | } | ||
| 13 | |||
| 14 | AudioRenderer::AudioRenderer& ADSP::AudioRenderer() { | ||
| 15 | return *audio_renderer.get(); | ||
| 16 | } | ||
| 17 | |||
| 18 | } // namespace AudioCore::ADSP | ||
diff --git a/src/audio_core/adsp/adsp.h b/src/audio_core/adsp/adsp.h new file mode 100644 index 000000000..bd5bcc63b --- /dev/null +++ b/src/audio_core/adsp/adsp.h | |||
| @@ -0,0 +1,50 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #pragma once | ||
| 5 | |||
| 6 | #include "audio_core/adsp/apps/audio_renderer/audio_renderer.h" | ||
| 7 | #include "common/common_types.h" | ||
| 8 | |||
| 9 | namespace Core { | ||
| 10 | class System; | ||
| 11 | } // namespace Core | ||
| 12 | |||
| 13 | namespace AudioCore { | ||
| 14 | namespace Sink { | ||
| 15 | class Sink; | ||
| 16 | } | ||
| 17 | |||
| 18 | namespace ADSP { | ||
| 19 | |||
| 20 | /** | ||
| 21 | * Represents the ADSP embedded within the audio sysmodule. | ||
| 22 | * This is a 32-bit Linux4Tegra kernel from nVidia, which is launched with the sysmodule on boot. | ||
| 23 | * | ||
| 24 | * The kernel will run the apps you write for it, Nintendo have the following: | ||
| 25 | * | ||
| 26 | * Gmix - Responsible for mixing final audio and sending it out to hardware. This is last place all | ||
| 27 | * audio samples end up, and we skip it entirely, since we have very different backends and | ||
| 28 | * mixing is implicitly handled by the OS (but also due to lack of research/simplicity). | ||
| 29 | * | ||
| 30 | * AudioRenderer - Receives command lists generated by the audio render | ||
| 31 | * system on the host, processes them, and sends the samples to Gmix. | ||
| 32 | * | ||
| 33 | * OpusDecoder - Contains libopus, and decodes Opus audio packets into raw pcm data. | ||
| 34 | * | ||
| 35 | * Communication between the host and ADSP is done through mailboxes, and mapping of shared memory. | ||
| 36 | */ | ||
| 37 | class ADSP { | ||
| 38 | public: | ||
| 39 | explicit ADSP(Core::System& system, Sink::Sink& sink); | ||
| 40 | ~ADSP() = default; | ||
| 41 | |||
| 42 | AudioRenderer::AudioRenderer& AudioRenderer(); | ||
| 43 | |||
| 44 | private: | ||
| 45 | /// AudioRenderer app | ||
| 46 | std::unique_ptr<AudioRenderer::AudioRenderer> audio_renderer{}; | ||
| 47 | }; | ||
| 48 | |||
| 49 | } // namespace ADSP | ||
| 50 | } // namespace AudioCore | ||
diff --git a/src/audio_core/renderer/adsp/audio_renderer.cpp b/src/audio_core/adsp/apps/audio_renderer/audio_renderer.cpp index 9ca716b60..3da342ea3 100644 --- a/src/audio_core/renderer/adsp/audio_renderer.cpp +++ b/src/audio_core/adsp/apps/audio_renderer/audio_renderer.cpp | |||
| @@ -1,12 +1,12 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include <array> | 4 | #include <array> |
| 5 | #include <chrono> | 5 | #include <chrono> |
| 6 | 6 | ||
| 7 | #include "audio_core/adsp/apps/audio_renderer/audio_renderer.h" | ||
| 7 | #include "audio_core/audio_core.h" | 8 | #include "audio_core/audio_core.h" |
| 8 | #include "audio_core/common/common.h" | 9 | #include "audio_core/common/common.h" |
| 9 | #include "audio_core/renderer/adsp/audio_renderer.h" | ||
| 10 | #include "audio_core/sink/sink.h" | 10 | #include "audio_core/sink/sink.h" |
| 11 | #include "common/logging/log.h" | 11 | #include "common/logging/log.h" |
| 12 | #include "common/microprofile.h" | 12 | #include "common/microprofile.h" |
| @@ -16,108 +16,92 @@ | |||
| 16 | 16 | ||
| 17 | MICROPROFILE_DEFINE(Audio_Renderer, "Audio", "DSP", MP_RGB(60, 19, 97)); | 17 | MICROPROFILE_DEFINE(Audio_Renderer, "Audio", "DSP", MP_RGB(60, 19, 97)); |
| 18 | 18 | ||
| 19 | namespace AudioCore::AudioRenderer::ADSP { | 19 | namespace AudioCore::ADSP::AudioRenderer { |
| 20 | 20 | ||
| 21 | void AudioRenderer_Mailbox::HostSendMessage(RenderMessage message_) { | 21 | AudioRenderer::AudioRenderer(Core::System& system_, Core::Memory::Memory& memory_, |
| 22 | adsp_messages.enqueue(message_); | 22 | Sink::Sink& sink_) |
| 23 | adsp_event.Set(); | 23 | : system{system_}, memory{memory_}, sink{sink_} {} |
| 24 | } | ||
| 25 | 24 | ||
| 26 | RenderMessage AudioRenderer_Mailbox::HostWaitMessage() { | 25 | AudioRenderer::~AudioRenderer() { |
| 27 | host_event.Wait(); | 26 | Stop(); |
| 28 | RenderMessage msg{RenderMessage::Invalid}; | ||
| 29 | if (!host_messages.try_dequeue(msg)) { | ||
| 30 | LOG_ERROR(Service_Audio, "Failed to dequeue host message!"); | ||
| 31 | } | ||
| 32 | return msg; | ||
| 33 | } | 27 | } |
| 34 | 28 | ||
| 35 | void AudioRenderer_Mailbox::ADSPSendMessage(const RenderMessage message_) { | 29 | void AudioRenderer::Start() { |
| 36 | host_messages.enqueue(message_); | 30 | CreateSinkStreams(); |
| 37 | host_event.Set(); | ||
| 38 | } | ||
| 39 | 31 | ||
| 40 | RenderMessage AudioRenderer_Mailbox::ADSPWaitMessage() { | 32 | mailbox.Initialize(AppMailboxId::AudioRenderer); |
| 41 | adsp_event.Wait(); | ||
| 42 | RenderMessage msg{RenderMessage::Invalid}; | ||
| 43 | if (!adsp_messages.try_dequeue(msg)) { | ||
| 44 | LOG_ERROR(Service_Audio, "Failed to dequeue ADSP message!"); | ||
| 45 | } | ||
| 46 | return msg; | ||
| 47 | } | ||
| 48 | 33 | ||
| 49 | CommandBuffer& AudioRenderer_Mailbox::GetCommandBuffer(const u32 session_id) { | 34 | main_thread = std::jthread([this](std::stop_token stop_token) { Main(stop_token); }); |
| 50 | return command_buffers[session_id]; | ||
| 51 | } | ||
| 52 | 35 | ||
| 53 | void AudioRenderer_Mailbox::SetCommandBuffer(const u32 session_id, const CommandBuffer& buffer) { | 36 | mailbox.Send(Direction::DSP, {Message::InitializeOK, {}}); |
| 54 | command_buffers[session_id] = buffer; | 37 | if (mailbox.Receive(Direction::Host).msg != Message::InitializeOK) { |
| 38 | LOG_ERROR(Service_Audio, "Host Audio Renderer -- Failed to receive shutdown " | ||
| 39 | "message response from ADSP!"); | ||
| 40 | return; | ||
| 41 | } | ||
| 42 | running = true; | ||
| 55 | } | 43 | } |
| 56 | 44 | ||
| 57 | u64 AudioRenderer_Mailbox::GetRenderTimeTaken() const { | 45 | void AudioRenderer::Stop() { |
| 58 | return command_buffers[0].render_time_taken + command_buffers[1].render_time_taken; | 46 | if (!running) { |
| 59 | } | 47 | return; |
| 48 | } | ||
| 60 | 49 | ||
| 61 | u64 AudioRenderer_Mailbox::GetSignalledTick() const { | 50 | mailbox.Send(Direction::DSP, {Message::Shutdown, {}}); |
| 62 | return signalled_tick; | 51 | if (mailbox.Receive(Direction::Host).msg != Message::Shutdown) { |
| 63 | } | 52 | LOG_ERROR(Service_Audio, "Host Audio Renderer -- Failed to receive shutdown " |
| 53 | "message response from ADSP!"); | ||
| 54 | } | ||
| 55 | main_thread.request_stop(); | ||
| 56 | main_thread.join(); | ||
| 64 | 57 | ||
| 65 | void AudioRenderer_Mailbox::SetSignalledTick(const u64 tick) { | 58 | for (auto& stream : streams) { |
| 66 | signalled_tick = tick; | 59 | if (stream) { |
| 60 | stream->Stop(); | ||
| 61 | sink.CloseStream(stream); | ||
| 62 | stream = nullptr; | ||
| 63 | } | ||
| 64 | } | ||
| 65 | running = false; | ||
| 67 | } | 66 | } |
| 68 | 67 | ||
| 69 | void AudioRenderer_Mailbox::ClearRemainCount(const u32 session_id) { | 68 | void AudioRenderer::Signal() { |
| 70 | command_buffers[session_id].remaining_command_count = 0; | 69 | signalled_tick = system.CoreTiming().GetGlobalTimeNs().count(); |
| 70 | Send(Direction::DSP, {Message::Render, {}}); | ||
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | u32 AudioRenderer_Mailbox::GetRemainCommandCount(const u32 session_id) const { | 73 | void AudioRenderer::Wait() { |
| 74 | return command_buffers[session_id].remaining_command_count; | 74 | auto received = Receive(Direction::Host); |
| 75 | if (received.msg != Message::RenderResponse) { | ||
| 76 | LOG_ERROR(Service_Audio, | ||
| 77 | "Did not receive the expected render response from the AudioRenderer! Expected " | ||
| 78 | "{}, got {}", | ||
| 79 | Message::RenderResponse, received.msg); | ||
| 80 | } | ||
| 75 | } | 81 | } |
| 76 | 82 | ||
| 77 | void AudioRenderer_Mailbox::ClearCommandBuffers() { | 83 | void AudioRenderer::Send(Direction dir, MailboxMessage message) { |
| 78 | command_buffers[0].buffer = 0; | 84 | mailbox.Send(dir, std::move(message)); |
| 79 | command_buffers[0].size = 0; | ||
| 80 | command_buffers[0].reset_buffers = false; | ||
| 81 | command_buffers[1].buffer = 0; | ||
| 82 | command_buffers[1].size = 0; | ||
| 83 | command_buffers[1].reset_buffers = false; | ||
| 84 | } | 85 | } |
| 85 | 86 | ||
| 86 | AudioRenderer::AudioRenderer(Core::System& system_) | 87 | MailboxMessage AudioRenderer::Receive(Direction dir, bool block) { |
| 87 | : system{system_}, sink{system.AudioCore().GetOutputSink()} { | 88 | return mailbox.Receive(dir, block); |
| 88 | CreateSinkStreams(); | ||
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | AudioRenderer::~AudioRenderer() { | 91 | void AudioRenderer::SetCommandBuffer(s32 session_id, CommandBuffer& buffer) noexcept { |
| 92 | Stop(); | 92 | command_buffers[session_id] = buffer; |
| 93 | for (auto& stream : streams) { | ||
| 94 | if (stream) { | ||
| 95 | sink.CloseStream(stream); | ||
| 96 | } | ||
| 97 | stream = nullptr; | ||
| 98 | } | ||
| 99 | } | 93 | } |
| 100 | 94 | ||
| 101 | void AudioRenderer::Start(AudioRenderer_Mailbox* mailbox_) { | 95 | u32 AudioRenderer::GetRemainCommandCount(s32 session_id) const noexcept { |
| 102 | if (running) { | 96 | return command_buffers[session_id].remaining_command_count; |
| 103 | return; | ||
| 104 | } | ||
| 105 | |||
| 106 | mailbox = mailbox_; | ||
| 107 | thread = std::jthread([this](std::stop_token stop_token) { ThreadFunc(stop_token); }); | ||
| 108 | running = true; | ||
| 109 | } | 97 | } |
| 110 | 98 | ||
| 111 | void AudioRenderer::Stop() { | 99 | void AudioRenderer::ClearRemainCommandCount(s32 session_id) noexcept { |
| 112 | if (!running) { | 100 | command_buffers[session_id].remaining_command_count = 0; |
| 113 | return; | 101 | } |
| 114 | } | ||
| 115 | 102 | ||
| 116 | for (auto& stream : streams) { | 103 | u64 AudioRenderer::GetRenderingStartTick(s32 session_id) const noexcept { |
| 117 | stream->Stop(); | 104 | return (1000 * command_buffers[session_id].render_time_taken_us) + signalled_tick; |
| 118 | } | ||
| 119 | thread.join(); | ||
| 120 | running = false; | ||
| 121 | } | 105 | } |
| 122 | 106 | ||
| 123 | void AudioRenderer::CreateSinkStreams() { | 107 | void AudioRenderer::CreateSinkStreams() { |
| @@ -130,41 +114,45 @@ void AudioRenderer::CreateSinkStreams() { | |||
| 130 | } | 114 | } |
| 131 | } | 115 | } |
| 132 | 116 | ||
| 133 | void AudioRenderer::ThreadFunc(std::stop_token stop_token) { | 117 | void AudioRenderer::Main(std::stop_token stop_token) { |
| 134 | static constexpr char name[]{"AudioRenderer"}; | 118 | static constexpr char name[]{"AudioRenderer"}; |
| 135 | MicroProfileOnThreadCreate(name); | 119 | MicroProfileOnThreadCreate(name); |
| 136 | Common::SetCurrentThreadName(name); | 120 | Common::SetCurrentThreadName(name); |
| 137 | Common::SetCurrentThreadPriority(Common::ThreadPriority::High); | 121 | Common::SetCurrentThreadPriority(Common::ThreadPriority::High); |
| 138 | if (mailbox->ADSPWaitMessage() != RenderMessage::AudioRenderer_InitializeOK) { | 122 | |
| 123 | // TODO: Create buffer map/unmap thread + mailbox | ||
| 124 | // TODO: Create gMix devices, initialize them here | ||
| 125 | |||
| 126 | if (mailbox.Receive(Direction::DSP).msg != Message::InitializeOK) { | ||
| 139 | LOG_ERROR(Service_Audio, | 127 | LOG_ERROR(Service_Audio, |
| 140 | "ADSP Audio Renderer -- Failed to receive initialize message from host!"); | 128 | "ADSP Audio Renderer -- Failed to receive initialize message from host!"); |
| 141 | return; | 129 | return; |
| 142 | } | 130 | } |
| 143 | 131 | ||
| 144 | mailbox->ADSPSendMessage(RenderMessage::AudioRenderer_InitializeOK); | 132 | mailbox.Send(Direction::Host, {Message::InitializeOK, {}}); |
| 145 | 133 | ||
| 146 | // 0.12 seconds (2304000 / 19200000) | 134 | // 0.12 seconds (2,304,000 / 19,200,000) |
| 147 | constexpr u64 max_process_time{2'304'000ULL}; | 135 | constexpr u64 max_process_time{2'304'000ULL}; |
| 148 | 136 | ||
| 149 | while (!stop_token.stop_requested()) { | 137 | while (!stop_token.stop_requested()) { |
| 150 | auto message{mailbox->ADSPWaitMessage()}; | 138 | auto received{mailbox.Receive(Direction::DSP)}; |
| 151 | switch (message) { | 139 | switch (received.msg) { |
| 152 | case RenderMessage::AudioRenderer_Shutdown: | 140 | case Message::Shutdown: |
| 153 | mailbox->ADSPSendMessage(RenderMessage::AudioRenderer_Shutdown); | 141 | mailbox.Send(Direction::Host, {Message::Shutdown, {}}); |
| 154 | return; | 142 | return; |
| 155 | 143 | ||
| 156 | case RenderMessage::AudioRenderer_Render: { | 144 | case Message::Render: { |
| 157 | if (system.IsShuttingDown()) [[unlikely]] { | 145 | if (system.IsShuttingDown()) [[unlikely]] { |
| 158 | std::this_thread::sleep_for(std::chrono::milliseconds(5)); | 146 | std::this_thread::sleep_for(std::chrono::milliseconds(5)); |
| 159 | mailbox->ADSPSendMessage(RenderMessage::AudioRenderer_RenderResponse); | 147 | mailbox.Send(Direction::Host, {Message::RenderResponse, {}}); |
| 160 | continue; | 148 | continue; |
| 161 | } | 149 | } |
| 162 | std::array<bool, MaxRendererSessions> buffers_reset{}; | 150 | std::array<bool, MaxRendererSessions> buffers_reset{}; |
| 163 | std::array<u64, MaxRendererSessions> render_times_taken{}; | 151 | std::array<u64, MaxRendererSessions> render_times_taken{}; |
| 164 | const auto start_time{system.CoreTiming().GetClockTicks()}; | 152 | const auto start_time{system.CoreTiming().GetGlobalTimeUs().count()}; |
| 165 | 153 | ||
| 166 | for (u32 index = 0; index < 2; index++) { | 154 | for (u32 index = 0; index < MaxRendererSessions; index++) { |
| 167 | auto& command_buffer{mailbox->GetCommandBuffer(index)}; | 155 | auto& command_buffer{command_buffers[index]}; |
| 168 | auto& command_list_processor{command_list_processors[index]}; | 156 | auto& command_list_processor{command_list_processors[index]}; |
| 169 | 157 | ||
| 170 | // Check this buffer is valid, as it may not be used. | 158 | // Check this buffer is valid, as it may not be used. |
| @@ -176,14 +164,14 @@ void AudioRenderer::ThreadFunc(std::stop_token stop_token) { | |||
| 176 | command_buffer.size, streams[index]); | 164 | command_buffer.size, streams[index]); |
| 177 | } | 165 | } |
| 178 | 166 | ||
| 179 | if (command_buffer.reset_buffers && !buffers_reset[index]) { | 167 | if (command_buffer.reset_buffer && !buffers_reset[index]) { |
| 180 | streams[index]->ClearQueue(); | 168 | streams[index]->ClearQueue(); |
| 181 | buffers_reset[index] = true; | 169 | buffers_reset[index] = true; |
| 182 | } | 170 | } |
| 183 | 171 | ||
| 184 | u64 max_time{max_process_time}; | 172 | u64 max_time{max_process_time}; |
| 185 | if (index == 1 && command_buffer.applet_resource_user_id == | 173 | if (index == 1 && command_buffer.applet_resource_user_id == |
| 186 | mailbox->GetCommandBuffer(0).applet_resource_user_id) { | 174 | command_buffers[0].applet_resource_user_id) { |
| 187 | max_time = max_process_time - render_times_taken[0]; | 175 | max_time = max_process_time - render_times_taken[0]; |
| 188 | if (render_times_taken[0] > max_process_time) { | 176 | if (render_times_taken[0] > max_process_time) { |
| 189 | max_time = 0; | 177 | max_time = 0; |
| @@ -193,7 +181,9 @@ void AudioRenderer::ThreadFunc(std::stop_token stop_token) { | |||
| 193 | max_time = std::min(command_buffer.time_limit, max_time); | 181 | max_time = std::min(command_buffer.time_limit, max_time); |
| 194 | command_list_processor.SetProcessTimeMax(max_time); | 182 | command_list_processor.SetProcessTimeMax(max_time); |
| 195 | 183 | ||
| 196 | streams[index]->WaitFreeSpace(stop_token); | 184 | if (index == 0) { |
| 185 | streams[index]->WaitFreeSpace(stop_token); | ||
| 186 | } | ||
| 197 | 187 | ||
| 198 | // Process the command list | 188 | // Process the command list |
| 199 | { | 189 | { |
| @@ -202,24 +192,24 @@ void AudioRenderer::ThreadFunc(std::stop_token stop_token) { | |||
| 202 | command_list_processor.Process(index) - start_time; | 192 | command_list_processor.Process(index) - start_time; |
| 203 | } | 193 | } |
| 204 | 194 | ||
| 205 | const auto end_time{system.CoreTiming().GetClockTicks()}; | 195 | const auto end_time{system.CoreTiming().GetGlobalTimeUs().count()}; |
| 206 | 196 | ||
| 207 | command_buffer.remaining_command_count = | 197 | command_buffer.remaining_command_count = |
| 208 | command_list_processor.GetRemainingCommandCount(); | 198 | command_list_processor.GetRemainingCommandCount(); |
| 209 | command_buffer.render_time_taken = end_time - start_time; | 199 | command_buffer.render_time_taken_us = end_time - start_time; |
| 210 | } | 200 | } |
| 211 | } | 201 | } |
| 212 | 202 | ||
| 213 | mailbox->ADSPSendMessage(RenderMessage::AudioRenderer_RenderResponse); | 203 | mailbox.Send(Direction::Host, {Message::RenderResponse, {}}); |
| 214 | } break; | 204 | } break; |
| 215 | 205 | ||
| 216 | default: | 206 | default: |
| 217 | LOG_WARNING(Service_Audio, | 207 | LOG_WARNING(Service_Audio, |
| 218 | "ADSP AudioRenderer received an invalid message, msg={:02X}!", | 208 | "ADSP AudioRenderer received an invalid message, msg={:02X}!", |
| 219 | static_cast<u32>(message)); | 209 | received.msg); |
| 220 | break; | 210 | break; |
| 221 | } | 211 | } |
| 222 | } | 212 | } |
| 223 | } | 213 | } |
| 224 | 214 | ||
| 225 | } // namespace AudioCore::AudioRenderer::ADSP | 215 | } // namespace AudioCore::ADSP::AudioRenderer |
diff --git a/src/audio_core/adsp/apps/audio_renderer/audio_renderer.h b/src/audio_core/adsp/apps/audio_renderer/audio_renderer.h new file mode 100644 index 000000000..b225e10fb --- /dev/null +++ b/src/audio_core/adsp/apps/audio_renderer/audio_renderer.h | |||
| @@ -0,0 +1,115 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #pragma once | ||
| 5 | |||
| 6 | #include <array> | ||
| 7 | #include <memory> | ||
| 8 | #include <thread> | ||
| 9 | |||
| 10 | #include "audio_core/adsp/apps/audio_renderer/command_buffer.h" | ||
| 11 | #include "audio_core/adsp/apps/audio_renderer/command_list_processor.h" | ||
| 12 | #include "audio_core/adsp/mailbox.h" | ||
| 13 | #include "common/common_types.h" | ||
| 14 | #include "common/polyfill_thread.h" | ||
| 15 | #include "common/reader_writer_queue.h" | ||
| 16 | #include "common/thread.h" | ||
| 17 | |||
| 18 | namespace Core { | ||
| 19 | class System; | ||
| 20 | namespace Timing { | ||
| 21 | struct EventType; | ||
| 22 | } | ||
| 23 | namespace Memory { | ||
| 24 | class Memory; | ||
| 25 | } | ||
| 26 | class System; | ||
| 27 | } // namespace Core | ||
| 28 | |||
| 29 | namespace AudioCore { | ||
| 30 | namespace Sink { | ||
| 31 | class Sink; | ||
| 32 | } | ||
| 33 | |||
| 34 | namespace ADSP::AudioRenderer { | ||
| 35 | |||
| 36 | enum Message : u32 { | ||
| 37 | Invalid = 0x00, | ||
| 38 | MapUnmap_Map = 0x01, | ||
| 39 | MapUnmap_MapResponse = 0x02, | ||
| 40 | MapUnmap_Unmap = 0x03, | ||
| 41 | MapUnmap_UnmapResponse = 0x04, | ||
| 42 | MapUnmap_InvalidateCache = 0x05, | ||
| 43 | MapUnmap_InvalidateCacheResponse = 0x06, | ||
| 44 | MapUnmap_Shutdown = 0x07, | ||
| 45 | MapUnmap_ShutdownResponse = 0x08, | ||
| 46 | InitializeOK = 0x16, | ||
| 47 | RenderResponse = 0x20, | ||
| 48 | Render = 0x2A, | ||
| 49 | Shutdown = 0x34, | ||
| 50 | }; | ||
| 51 | |||
| 52 | /** | ||
| 53 | * The AudioRenderer application running on the ADSP. | ||
| 54 | */ | ||
| 55 | class AudioRenderer { | ||
| 56 | public: | ||
| 57 | explicit AudioRenderer(Core::System& system, Core::Memory::Memory& memory, Sink::Sink& sink); | ||
| 58 | ~AudioRenderer(); | ||
| 59 | |||
| 60 | /** | ||
| 61 | * Start the AudioRenderer. | ||
| 62 | * | ||
| 63 | * @param mailbox The mailbox to use for this session. | ||
| 64 | */ | ||
| 65 | void Start(); | ||
| 66 | |||
| 67 | /** | ||
| 68 | * Stop the AudioRenderer. | ||
| 69 | */ | ||
| 70 | void Stop(); | ||
| 71 | |||
| 72 | void Signal(); | ||
| 73 | void Wait(); | ||
| 74 | |||
| 75 | void Send(Direction dir, MailboxMessage message); | ||
| 76 | MailboxMessage Receive(Direction dir, bool block = true); | ||
| 77 | |||
| 78 | void SetCommandBuffer(s32 session_id, CommandBuffer& buffer) noexcept; | ||
| 79 | u32 GetRemainCommandCount(s32 session_id) const noexcept; | ||
| 80 | void ClearRemainCommandCount(s32 session_id) noexcept; | ||
| 81 | u64 GetRenderingStartTick(s32 session_id) const noexcept; | ||
| 82 | |||
| 83 | private: | ||
| 84 | /** | ||
| 85 | * Main AudioRenderer thread, responsible for processing the command lists. | ||
| 86 | */ | ||
| 87 | void Main(std::stop_token stop_token); | ||
| 88 | |||
| 89 | /** | ||
| 90 | * Creates the streams which will receive the processed samples. | ||
| 91 | */ | ||
| 92 | void CreateSinkStreams(); | ||
| 93 | |||
| 94 | /// Core system | ||
| 95 | Core::System& system; | ||
| 96 | /// Memory | ||
| 97 | Core::Memory::Memory& memory; | ||
| 98 | /// The output sink the AudioRenderer will use | ||
| 99 | Sink::Sink& sink; | ||
| 100 | /// The active mailbox | ||
| 101 | Mailbox mailbox; | ||
| 102 | /// Main thread | ||
| 103 | std::jthread main_thread{}; | ||
| 104 | /// The current state | ||
| 105 | std::atomic<bool> running{}; | ||
| 106 | std::array<CommandBuffer, MaxRendererSessions> command_buffers{}; | ||
| 107 | /// The command lists to process | ||
| 108 | std::array<CommandListProcessor, MaxRendererSessions> command_list_processors{}; | ||
| 109 | /// The streams which will receive the processed samples | ||
| 110 | std::array<Sink::SinkStream*, MaxRendererSessions> streams{}; | ||
| 111 | u64 signalled_tick{0}; | ||
| 112 | }; | ||
| 113 | |||
| 114 | } // namespace ADSP::AudioRenderer | ||
| 115 | } // namespace AudioCore | ||
diff --git a/src/audio_core/adsp/apps/audio_renderer/command_buffer.h b/src/audio_core/adsp/apps/audio_renderer/command_buffer.h new file mode 100644 index 000000000..3fd1b09dc --- /dev/null +++ b/src/audio_core/adsp/apps/audio_renderer/command_buffer.h | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #pragma once | ||
| 5 | |||
| 6 | #include "audio_core/common/common.h" | ||
| 7 | #include "common/common_types.h" | ||
| 8 | |||
| 9 | namespace AudioCore::ADSP::AudioRenderer { | ||
| 10 | |||
| 11 | struct CommandBuffer { | ||
| 12 | // Set by the host | ||
| 13 | CpuAddr buffer{}; | ||
| 14 | u64 size{}; | ||
| 15 | u64 time_limit{}; | ||
| 16 | u64 applet_resource_user_id{}; | ||
| 17 | bool reset_buffer{}; | ||
| 18 | // Set by the DSP | ||
| 19 | u32 remaining_command_count{}; | ||
| 20 | u64 render_time_taken_us{}; | ||
| 21 | }; | ||
| 22 | |||
| 23 | } // namespace AudioCore::ADSP::AudioRenderer | ||
diff --git a/src/audio_core/renderer/adsp/command_list_processor.cpp b/src/audio_core/adsp/apps/audio_renderer/command_list_processor.cpp index 3a0f1ae38..acbc9100c 100644 --- a/src/audio_core/renderer/adsp/command_list_processor.cpp +++ b/src/audio_core/adsp/apps/audio_renderer/command_list_processor.cpp | |||
| @@ -1,9 +1,9 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include <string> | 4 | #include <string> |
| 5 | 5 | ||
| 6 | #include "audio_core/renderer/adsp/command_list_processor.h" | 6 | #include "audio_core/adsp/apps/audio_renderer/command_list_processor.h" |
| 7 | #include "audio_core/renderer/command/command_list_header.h" | 7 | #include "audio_core/renderer/command/command_list_header.h" |
| 8 | #include "audio_core/renderer/command/commands.h" | 8 | #include "audio_core/renderer/command/commands.h" |
| 9 | #include "common/settings.h" | 9 | #include "common/settings.h" |
| @@ -11,15 +11,15 @@ | |||
| 11 | #include "core/core_timing.h" | 11 | #include "core/core_timing.h" |
| 12 | #include "core/memory.h" | 12 | #include "core/memory.h" |
| 13 | 13 | ||
| 14 | namespace AudioCore::AudioRenderer::ADSP { | 14 | namespace AudioCore::ADSP::AudioRenderer { |
| 15 | 15 | ||
| 16 | void CommandListProcessor::Initialize(Core::System& system_, CpuAddr buffer, u64 size, | 16 | void CommandListProcessor::Initialize(Core::System& system_, CpuAddr buffer, u64 size, |
| 17 | Sink::SinkStream* stream_) { | 17 | Sink::SinkStream* stream_) { |
| 18 | system = &system_; | 18 | system = &system_; |
| 19 | memory = &system->ApplicationMemory(); | 19 | memory = &system->ApplicationMemory(); |
| 20 | stream = stream_; | 20 | stream = stream_; |
| 21 | header = reinterpret_cast<CommandListHeader*>(buffer); | 21 | header = reinterpret_cast<Renderer::CommandListHeader*>(buffer); |
| 22 | commands = reinterpret_cast<u8*>(buffer + sizeof(CommandListHeader)); | 22 | commands = reinterpret_cast<u8*>(buffer + sizeof(Renderer::CommandListHeader)); |
| 23 | commands_buffer_size = size; | 23 | commands_buffer_size = size; |
| 24 | command_count = header->command_count; | 24 | command_count = header->command_count; |
| 25 | sample_count = header->sample_count; | 25 | sample_count = header->sample_count; |
| @@ -38,7 +38,7 @@ u32 CommandListProcessor::GetRemainingCommandCount() const { | |||
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | void CommandListProcessor::SetBuffer(const CpuAddr buffer, const u64 size) { | 40 | void CommandListProcessor::SetBuffer(const CpuAddr buffer, const u64 size) { |
| 41 | commands = reinterpret_cast<u8*>(buffer + sizeof(CommandListHeader)); | 41 | commands = reinterpret_cast<u8*>(buffer + sizeof(Renderer::CommandListHeader)); |
| 42 | commands_buffer_size = size; | 42 | commands_buffer_size = size; |
| 43 | } | 43 | } |
| 44 | 44 | ||
| @@ -47,7 +47,7 @@ Sink::SinkStream* CommandListProcessor::GetOutputSinkStream() const { | |||
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | u64 CommandListProcessor::Process(u32 session_id) { | 49 | u64 CommandListProcessor::Process(u32 session_id) { |
| 50 | const auto start_time_{system->CoreTiming().GetClockTicks()}; | 50 | const auto start_time_{system->CoreTiming().GetGlobalTimeUs().count()}; |
| 51 | const auto command_base{CpuAddr(commands)}; | 51 | const auto command_base{CpuAddr(commands)}; |
| 52 | 52 | ||
| 53 | if (processed_command_count > 0) { | 53 | if (processed_command_count > 0) { |
| @@ -60,12 +60,12 @@ u64 CommandListProcessor::Process(u32 session_id) { | |||
| 60 | std::string dump{fmt::format("\nSession {}\n", session_id)}; | 60 | std::string dump{fmt::format("\nSession {}\n", session_id)}; |
| 61 | 61 | ||
| 62 | for (u32 index = 0; index < command_count; index++) { | 62 | for (u32 index = 0; index < command_count; index++) { |
| 63 | auto& command{*reinterpret_cast<ICommand*>(commands)}; | 63 | auto& command{*reinterpret_cast<Renderer::ICommand*>(commands)}; |
| 64 | 64 | ||
| 65 | if (command.magic != 0xCAFEBABE) { | 65 | if (command.magic != 0xCAFEBABE) { |
| 66 | LOG_ERROR(Service_Audio, "Command has invalid magic! Expected 0xCAFEBABE, got {:08X}", | 66 | LOG_ERROR(Service_Audio, "Command has invalid magic! Expected 0xCAFEBABE, got {:08X}", |
| 67 | command.magic); | 67 | command.magic); |
| 68 | return system->CoreTiming().GetClockTicks() - start_time_; | 68 | return system->CoreTiming().GetGlobalTimeUs().count() - start_time_; |
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | auto current_offset{CpuAddr(commands) - command_base}; | 71 | auto current_offset{CpuAddr(commands) - command_base}; |
| @@ -74,8 +74,8 @@ u64 CommandListProcessor::Process(u32 session_id) { | |||
| 74 | LOG_ERROR(Service_Audio, | 74 | LOG_ERROR(Service_Audio, |
| 75 | "Command exceeded command buffer, buffer size {:08X}, command ends at {:08X}", | 75 | "Command exceeded command buffer, buffer size {:08X}, command ends at {:08X}", |
| 76 | commands_buffer_size, | 76 | commands_buffer_size, |
| 77 | CpuAddr(commands) + command.size - sizeof(CommandListHeader)); | 77 | CpuAddr(commands) + command.size - sizeof(Renderer::CommandListHeader)); |
| 78 | return system->CoreTiming().GetClockTicks() - start_time_; | 78 | return system->CoreTiming().GetGlobalTimeUs().count() - start_time_; |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | if (Settings::values.dump_audio_commands) { | 81 | if (Settings::values.dump_audio_commands) { |
| @@ -101,8 +101,8 @@ u64 CommandListProcessor::Process(u32 session_id) { | |||
| 101 | last_dump = dump; | 101 | last_dump = dump; |
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | end_time = system->CoreTiming().GetClockTicks(); | 104 | end_time = system->CoreTiming().GetGlobalTimeUs().count(); |
| 105 | return end_time - start_time_; | 105 | return end_time - start_time_; |
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | } // namespace AudioCore::AudioRenderer::ADSP | 108 | } // namespace AudioCore::ADSP::AudioRenderer |
diff --git a/src/audio_core/renderer/adsp/command_list_processor.h b/src/audio_core/adsp/apps/audio_renderer/command_list_processor.h index d78269e1d..9d6fe1851 100644 --- a/src/audio_core/renderer/adsp/command_list_processor.h +++ b/src/audio_core/adsp/apps/audio_renderer/command_list_processor.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #pragma once | 4 | #pragma once |
| @@ -6,6 +6,7 @@ | |||
| 6 | #include <span> | 6 | #include <span> |
| 7 | 7 | ||
| 8 | #include "audio_core/common/common.h" | 8 | #include "audio_core/common/common.h" |
| 9 | #include "audio_core/renderer/command/command_list_header.h" | ||
| 9 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 10 | 11 | ||
| 11 | namespace Core { | 12 | namespace Core { |
| @@ -20,10 +21,11 @@ namespace Sink { | |||
| 20 | class SinkStream; | 21 | class SinkStream; |
| 21 | } | 22 | } |
| 22 | 23 | ||
| 23 | namespace AudioRenderer { | 24 | namespace Renderer { |
| 24 | struct CommandListHeader; | 25 | struct CommandListHeader; |
| 26 | } | ||
| 25 | 27 | ||
| 26 | namespace ADSP { | 28 | namespace ADSP::AudioRenderer { |
| 27 | 29 | ||
| 28 | /** | 30 | /** |
| 29 | * A processor for command lists given to the AudioRenderer. | 31 | * A processor for command lists given to the AudioRenderer. |
| @@ -85,7 +87,7 @@ public: | |||
| 85 | /// Stream for the processed samples | 87 | /// Stream for the processed samples |
| 86 | Sink::SinkStream* stream{}; | 88 | Sink::SinkStream* stream{}; |
| 87 | /// Header info for this command list | 89 | /// Header info for this command list |
| 88 | CommandListHeader* header{}; | 90 | Renderer::CommandListHeader* header{}; |
| 89 | /// The command buffer | 91 | /// The command buffer |
| 90 | u8* commands{}; | 92 | u8* commands{}; |
| 91 | /// The command buffer size | 93 | /// The command buffer size |
| @@ -114,6 +116,5 @@ public: | |||
| 114 | std::string last_dump{}; | 116 | std::string last_dump{}; |
| 115 | }; | 117 | }; |
| 116 | 118 | ||
| 117 | } // namespace ADSP | 119 | } // namespace ADSP::AudioRenderer |
| 118 | } // namespace AudioRenderer | ||
| 119 | } // namespace AudioCore | 120 | } // namespace AudioCore |
diff --git a/src/audio_core/adsp/mailbox.h b/src/audio_core/adsp/mailbox.h new file mode 100644 index 000000000..c31b73717 --- /dev/null +++ b/src/audio_core/adsp/mailbox.h | |||
| @@ -0,0 +1,69 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #pragma once | ||
| 5 | |||
| 6 | #include "common/bounded_threadsafe_queue.h" | ||
| 7 | #include "common/common_types.h" | ||
| 8 | |||
| 9 | namespace AudioCore::ADSP { | ||
| 10 | |||
| 11 | enum class AppMailboxId : u32 { | ||
| 12 | Invalid = 0, | ||
| 13 | AudioRenderer = 50, | ||
| 14 | AudioRendererMemoryMapUnmap = 51, | ||
| 15 | }; | ||
| 16 | |||
| 17 | enum class Direction : u32 { | ||
| 18 | Host, | ||
| 19 | DSP, | ||
| 20 | }; | ||
| 21 | |||
| 22 | struct MailboxMessage { | ||
| 23 | u32 msg; | ||
| 24 | std::span<u8> data; | ||
| 25 | }; | ||
| 26 | |||
| 27 | class Mailbox { | ||
| 28 | public: | ||
| 29 | void Initialize(AppMailboxId id_) { | ||
| 30 | Reset(); | ||
| 31 | id = id_; | ||
| 32 | } | ||
| 33 | |||
| 34 | AppMailboxId Id() const noexcept { | ||
| 35 | return id; | ||
| 36 | } | ||
| 37 | |||
| 38 | void Send(Direction dir, MailboxMessage&& message) { | ||
| 39 | auto& queue = dir == Direction::Host ? host_queue : adsp_queue; | ||
| 40 | queue.EmplaceWait(std::move(message)); | ||
| 41 | } | ||
| 42 | |||
| 43 | MailboxMessage Receive(Direction dir, bool block = true) { | ||
| 44 | auto& queue = dir == Direction::Host ? host_queue : adsp_queue; | ||
| 45 | MailboxMessage t; | ||
| 46 | if (block) { | ||
| 47 | queue.PopWait(t); | ||
| 48 | } else { | ||
| 49 | queue.TryPop(t); | ||
| 50 | } | ||
| 51 | return t; | ||
| 52 | } | ||
| 53 | |||
| 54 | void Reset() { | ||
| 55 | id = AppMailboxId::Invalid; | ||
| 56 | MailboxMessage t; | ||
| 57 | while (host_queue.TryPop(t)) { | ||
| 58 | } | ||
| 59 | while (adsp_queue.TryPop(t)) { | ||
| 60 | } | ||
| 61 | } | ||
| 62 | |||
| 63 | private: | ||
| 64 | AppMailboxId id{0}; | ||
| 65 | Common::SPSCQueue<MailboxMessage> host_queue; | ||
| 66 | Common::SPSCQueue<MailboxMessage> adsp_queue; | ||
| 67 | }; | ||
| 68 | |||
| 69 | } // namespace AudioCore::ADSP | ||
diff --git a/src/audio_core/audio_core.cpp b/src/audio_core/audio_core.cpp index 703ef4494..fcaab2b32 100644 --- a/src/audio_core/audio_core.cpp +++ b/src/audio_core/audio_core.cpp | |||
| @@ -11,7 +11,7 @@ namespace AudioCore { | |||
| 11 | AudioCore::AudioCore(Core::System& system) : audio_manager{std::make_unique<AudioManager>()} { | 11 | AudioCore::AudioCore(Core::System& system) : audio_manager{std::make_unique<AudioManager>()} { |
| 12 | CreateSinks(); | 12 | CreateSinks(); |
| 13 | // Must be created after the sinks | 13 | // Must be created after the sinks |
| 14 | adsp = std::make_unique<AudioRenderer::ADSP::ADSP>(system, *output_sink); | 14 | adsp = std::make_unique<ADSP::ADSP>(system, *output_sink); |
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | AudioCore ::~AudioCore() { | 17 | AudioCore ::~AudioCore() { |
| @@ -43,7 +43,7 @@ Sink::Sink& AudioCore::GetInputSink() { | |||
| 43 | return *input_sink; | 43 | return *input_sink; |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | AudioRenderer::ADSP::ADSP& AudioCore::GetADSP() { | 46 | ADSP::ADSP& AudioCore::ADSP() { |
| 47 | return *adsp; | 47 | return *adsp; |
| 48 | } | 48 | } |
| 49 | 49 | ||
diff --git a/src/audio_core/audio_core.h b/src/audio_core/audio_core.h index ea047773e..e4e27fc66 100644 --- a/src/audio_core/audio_core.h +++ b/src/audio_core/audio_core.h | |||
| @@ -5,8 +5,8 @@ | |||
| 5 | 5 | ||
| 6 | #include <memory> | 6 | #include <memory> |
| 7 | 7 | ||
| 8 | #include "audio_core/adsp/adsp.h" | ||
| 8 | #include "audio_core/audio_manager.h" | 9 | #include "audio_core/audio_manager.h" |
| 9 | #include "audio_core/renderer/adsp/adsp.h" | ||
| 10 | #include "audio_core/sink/sink.h" | 10 | #include "audio_core/sink/sink.h" |
| 11 | 11 | ||
| 12 | namespace Core { | 12 | namespace Core { |
| @@ -55,7 +55,7 @@ public: | |||
| 55 | * | 55 | * |
| 56 | * @return Ref to the ADSP. | 56 | * @return Ref to the ADSP. |
| 57 | */ | 57 | */ |
| 58 | AudioRenderer::ADSP::ADSP& GetADSP(); | 58 | ADSP::ADSP& ADSP(); |
| 59 | 59 | ||
| 60 | private: | 60 | private: |
| 61 | /** | 61 | /** |
| @@ -70,7 +70,7 @@ private: | |||
| 70 | /// Sink used for audio input | 70 | /// Sink used for audio input |
| 71 | std::unique_ptr<Sink::Sink> input_sink; | 71 | std::unique_ptr<Sink::Sink> input_sink; |
| 72 | /// The ADSP in the sysmodule | 72 | /// The ADSP in the sysmodule |
| 73 | std::unique_ptr<AudioRenderer::ADSP::ADSP> adsp; | 73 | std::unique_ptr<ADSP::ADSP> adsp; |
| 74 | }; | 74 | }; |
| 75 | 75 | ||
| 76 | } // namespace AudioCore | 76 | } // namespace AudioCore |
diff --git a/src/audio_core/audio_in_manager.cpp b/src/audio_core/audio_in_manager.cpp index 3dfb613cb..a3667524f 100644 --- a/src/audio_core/audio_in_manager.cpp +++ b/src/audio_core/audio_in_manager.cpp | |||
| @@ -73,7 +73,7 @@ void Manager::BufferReleaseAndRegister() { | |||
| 73 | } | 73 | } |
| 74 | } | 74 | } |
| 75 | 75 | ||
| 76 | u32 Manager::GetDeviceNames(std::vector<AudioRenderer::AudioDevice::AudioDeviceName>& names, | 76 | u32 Manager::GetDeviceNames(std::vector<Renderer::AudioDevice::AudioDeviceName>& names, |
| 77 | [[maybe_unused]] const u32 max_count, | 77 | [[maybe_unused]] const u32 max_count, |
| 78 | [[maybe_unused]] const bool filter) { | 78 | [[maybe_unused]] const bool filter) { |
| 79 | std::scoped_lock l{mutex}; | 79 | std::scoped_lock l{mutex}; |
diff --git a/src/audio_core/audio_in_manager.h b/src/audio_core/audio_in_manager.h index 8a519df99..5c4614cd1 100644 --- a/src/audio_core/audio_in_manager.h +++ b/src/audio_core/audio_in_manager.h | |||
| @@ -65,8 +65,8 @@ public: | |||
| 65 | * | 65 | * |
| 66 | * @return Number of names written. | 66 | * @return Number of names written. |
| 67 | */ | 67 | */ |
| 68 | u32 GetDeviceNames(std::vector<AudioRenderer::AudioDevice::AudioDeviceName>& names, | 68 | u32 GetDeviceNames(std::vector<Renderer::AudioDevice::AudioDeviceName>& names, u32 max_count, |
| 69 | u32 max_count, bool filter); | 69 | bool filter); |
| 70 | 70 | ||
| 71 | /// Core system | 71 | /// Core system |
| 72 | Core::System& system; | 72 | Core::System& system; |
diff --git a/src/audio_core/audio_out_manager.cpp b/src/audio_core/audio_out_manager.cpp index f22821360..316ea7c81 100644 --- a/src/audio_core/audio_out_manager.cpp +++ b/src/audio_core/audio_out_manager.cpp | |||
| @@ -73,7 +73,7 @@ void Manager::BufferReleaseAndRegister() { | |||
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | u32 Manager::GetAudioOutDeviceNames( | 75 | u32 Manager::GetAudioOutDeviceNames( |
| 76 | std::vector<AudioRenderer::AudioDevice::AudioDeviceName>& names) const { | 76 | std::vector<Renderer::AudioDevice::AudioDeviceName>& names) const { |
| 77 | names.emplace_back("DeviceOut"); | 77 | names.emplace_back("DeviceOut"); |
| 78 | return 1; | 78 | return 1; |
| 79 | } | 79 | } |
diff --git a/src/audio_core/audio_out_manager.h b/src/audio_core/audio_out_manager.h index 1e05ec5ed..c3e445d5d 100644 --- a/src/audio_core/audio_out_manager.h +++ b/src/audio_core/audio_out_manager.h | |||
| @@ -61,8 +61,7 @@ public: | |||
| 61 | * @param names - Output container to write names to. | 61 | * @param names - Output container to write names to. |
| 62 | * @return Number of names written. | 62 | * @return Number of names written. |
| 63 | */ | 63 | */ |
| 64 | u32 GetAudioOutDeviceNames( | 64 | u32 GetAudioOutDeviceNames(std::vector<Renderer::AudioDevice::AudioDeviceName>& names) const; |
| 65 | std::vector<AudioRenderer::AudioDevice::AudioDeviceName>& names) const; | ||
| 66 | 65 | ||
| 67 | /// Core system | 66 | /// Core system |
| 68 | Core::System& system; | 67 | Core::System& system; |
diff --git a/src/audio_core/audio_render_manager.cpp b/src/audio_core/audio_render_manager.cpp index 320715727..3c53e3afd 100644 --- a/src/audio_core/audio_render_manager.cpp +++ b/src/audio_core/audio_render_manager.cpp | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | #include "audio_core/common/feature_support.h" | 6 | #include "audio_core/common/feature_support.h" |
| 7 | #include "core/core.h" | 7 | #include "core/core.h" |
| 8 | 8 | ||
| 9 | namespace AudioCore::AudioRenderer { | 9 | namespace AudioCore::Renderer { |
| 10 | 10 | ||
| 11 | Manager::Manager(Core::System& system_) | 11 | Manager::Manager(Core::System& system_) |
| 12 | : system{system_}, system_manager{std::make_unique<SystemManager>(system)} { | 12 | : system{system_}, system_manager{std::make_unique<SystemManager>(system)} { |
| @@ -67,4 +67,4 @@ bool Manager::RemoveSystem(System& system_) { | |||
| 67 | return system_manager->Remove(system_); | 67 | return system_manager->Remove(system_); |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | } // namespace AudioCore::AudioRenderer | 70 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/audio_render_manager.h b/src/audio_core/audio_render_manager.h index fffa5944d..45537b270 100644 --- a/src/audio_core/audio_render_manager.h +++ b/src/audio_core/audio_render_manager.h | |||
| @@ -20,7 +20,7 @@ class System; | |||
| 20 | namespace AudioCore { | 20 | namespace AudioCore { |
| 21 | struct AudioRendererParameterInternal; | 21 | struct AudioRendererParameterInternal; |
| 22 | 22 | ||
| 23 | namespace AudioRenderer { | 23 | namespace Renderer { |
| 24 | /** | 24 | /** |
| 25 | * Wrapper for the audio system manager, handles service calls. | 25 | * Wrapper for the audio system manager, handles service calls. |
| 26 | */ | 26 | */ |
| @@ -101,5 +101,5 @@ private: | |||
| 101 | std::unique_ptr<SystemManager> system_manager{}; | 101 | std::unique_ptr<SystemManager> system_manager{}; |
| 102 | }; | 102 | }; |
| 103 | 103 | ||
| 104 | } // namespace AudioRenderer | 104 | } // namespace Renderer |
| 105 | } // namespace AudioCore | 105 | } // namespace AudioCore |
diff --git a/src/audio_core/common/audio_renderer_parameter.h b/src/audio_core/common/audio_renderer_parameter.h index 8c7892bcf..6c4e9fdc6 100644 --- a/src/audio_core/common/audio_renderer_parameter.h +++ b/src/audio_core/common/audio_renderer_parameter.h | |||
| @@ -51,10 +51,10 @@ struct AudioRendererSystemContext { | |||
| 51 | s32 session_id; | 51 | s32 session_id; |
| 52 | s8 channels; | 52 | s8 channels; |
| 53 | s16 mix_buffer_count; | 53 | s16 mix_buffer_count; |
| 54 | AudioRenderer::BehaviorInfo* behavior; | 54 | Renderer::BehaviorInfo* behavior; |
| 55 | std::span<s32> depop_buffer; | 55 | std::span<s32> depop_buffer; |
| 56 | AudioRenderer::UpsamplerManager* upsampler_manager; | 56 | Renderer::UpsamplerManager* upsampler_manager; |
| 57 | AudioRenderer::MemoryPoolInfo* memory_pool_info; | 57 | Renderer::MemoryPoolInfo* memory_pool_info; |
| 58 | }; | 58 | }; |
| 59 | 59 | ||
| 60 | } // namespace AudioCore | 60 | } // namespace AudioCore |
diff --git a/src/audio_core/renderer/adsp/adsp.cpp b/src/audio_core/renderer/adsp/adsp.cpp deleted file mode 100644 index b1db31e93..000000000 --- a/src/audio_core/renderer/adsp/adsp.cpp +++ /dev/null | |||
| @@ -1,117 +0,0 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #include "audio_core/renderer/adsp/adsp.h" | ||
| 5 | #include "audio_core/renderer/adsp/command_buffer.h" | ||
| 6 | #include "audio_core/sink/sink.h" | ||
| 7 | #include "common/logging/log.h" | ||
| 8 | #include "core/core.h" | ||
| 9 | #include "core/core_timing.h" | ||
| 10 | #include "core/memory.h" | ||
| 11 | |||
| 12 | namespace AudioCore::AudioRenderer::ADSP { | ||
| 13 | |||
| 14 | ADSP::ADSP(Core::System& system_, Sink::Sink& sink_) | ||
| 15 | : system{system_}, memory{system.ApplicationMemory()}, sink{sink_} {} | ||
| 16 | |||
| 17 | ADSP::~ADSP() { | ||
| 18 | ClearCommandBuffers(); | ||
| 19 | } | ||
| 20 | |||
| 21 | State ADSP::GetState() const { | ||
| 22 | if (running) { | ||
| 23 | return State::Started; | ||
| 24 | } | ||
| 25 | return State::Stopped; | ||
| 26 | } | ||
| 27 | |||
| 28 | AudioRenderer_Mailbox* ADSP::GetRenderMailbox() { | ||
| 29 | return &render_mailbox; | ||
| 30 | } | ||
| 31 | |||
| 32 | void ADSP::ClearRemainCount(const u32 session_id) { | ||
| 33 | render_mailbox.ClearRemainCount(session_id); | ||
| 34 | } | ||
| 35 | |||
| 36 | u64 ADSP::GetSignalledTick() const { | ||
| 37 | return render_mailbox.GetSignalledTick(); | ||
| 38 | } | ||
| 39 | |||
| 40 | u64 ADSP::GetTimeTaken() const { | ||
| 41 | return render_mailbox.GetRenderTimeTaken(); | ||
| 42 | } | ||
| 43 | |||
| 44 | u64 ADSP::GetRenderTimeTaken(const u32 session_id) { | ||
| 45 | return render_mailbox.GetCommandBuffer(session_id).render_time_taken; | ||
| 46 | } | ||
| 47 | |||
| 48 | u32 ADSP::GetRemainCommandCount(const u32 session_id) const { | ||
| 49 | return render_mailbox.GetRemainCommandCount(session_id); | ||
| 50 | } | ||
| 51 | |||
| 52 | void ADSP::SendCommandBuffer(const u32 session_id, const CommandBuffer& command_buffer) { | ||
| 53 | render_mailbox.SetCommandBuffer(session_id, command_buffer); | ||
| 54 | } | ||
| 55 | |||
| 56 | u64 ADSP::GetRenderingStartTick(const u32 session_id) { | ||
| 57 | return render_mailbox.GetSignalledTick() + | ||
| 58 | render_mailbox.GetCommandBuffer(session_id).render_time_taken; | ||
| 59 | } | ||
| 60 | |||
| 61 | bool ADSP::Start() { | ||
| 62 | if (running) { | ||
| 63 | return running; | ||
| 64 | } | ||
| 65 | |||
| 66 | running = true; | ||
| 67 | systems_active++; | ||
| 68 | audio_renderer = std::make_unique<AudioRenderer>(system); | ||
| 69 | audio_renderer->Start(&render_mailbox); | ||
| 70 | render_mailbox.HostSendMessage(RenderMessage::AudioRenderer_InitializeOK); | ||
| 71 | if (render_mailbox.HostWaitMessage() != RenderMessage::AudioRenderer_InitializeOK) { | ||
| 72 | LOG_ERROR( | ||
| 73 | Service_Audio, | ||
| 74 | "Host Audio Renderer -- Failed to receive initialize message response from ADSP!"); | ||
| 75 | } | ||
| 76 | return running; | ||
| 77 | } | ||
| 78 | |||
| 79 | void ADSP::Stop() { | ||
| 80 | systems_active--; | ||
| 81 | if (running && systems_active == 0) { | ||
| 82 | { | ||
| 83 | std::scoped_lock l{mailbox_lock}; | ||
| 84 | render_mailbox.HostSendMessage(RenderMessage::AudioRenderer_Shutdown); | ||
| 85 | if (render_mailbox.HostWaitMessage() != RenderMessage::AudioRenderer_Shutdown) { | ||
| 86 | LOG_ERROR(Service_Audio, "Host Audio Renderer -- Failed to receive shutdown " | ||
| 87 | "message response from ADSP!"); | ||
| 88 | } | ||
| 89 | } | ||
| 90 | audio_renderer->Stop(); | ||
| 91 | running = false; | ||
| 92 | } | ||
| 93 | } | ||
| 94 | |||
| 95 | void ADSP::Signal() { | ||
| 96 | const auto signalled_tick{system.CoreTiming().GetClockTicks()}; | ||
| 97 | render_mailbox.SetSignalledTick(signalled_tick); | ||
| 98 | render_mailbox.HostSendMessage(RenderMessage::AudioRenderer_Render); | ||
| 99 | } | ||
| 100 | |||
| 101 | void ADSP::Wait() { | ||
| 102 | std::scoped_lock l{mailbox_lock}; | ||
| 103 | auto response{render_mailbox.HostWaitMessage()}; | ||
| 104 | if (response != RenderMessage::AudioRenderer_RenderResponse) { | ||
| 105 | LOG_ERROR(Service_Audio, "Invalid ADSP response message, expected 0x{:02X}, got 0x{:02X}", | ||
| 106 | static_cast<u32>(RenderMessage::AudioRenderer_RenderResponse), | ||
| 107 | static_cast<u32>(response)); | ||
| 108 | } | ||
| 109 | |||
| 110 | ClearCommandBuffers(); | ||
| 111 | } | ||
| 112 | |||
| 113 | void ADSP::ClearCommandBuffers() { | ||
| 114 | render_mailbox.ClearCommandBuffers(); | ||
| 115 | } | ||
| 116 | |||
| 117 | } // namespace AudioCore::AudioRenderer::ADSP | ||
diff --git a/src/audio_core/renderer/adsp/adsp.h b/src/audio_core/renderer/adsp/adsp.h deleted file mode 100644 index f7a2f25e4..000000000 --- a/src/audio_core/renderer/adsp/adsp.h +++ /dev/null | |||
| @@ -1,171 +0,0 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #pragma once | ||
| 5 | |||
| 6 | #include <memory> | ||
| 7 | #include <mutex> | ||
| 8 | |||
| 9 | #include "audio_core/renderer/adsp/audio_renderer.h" | ||
| 10 | #include "common/common_types.h" | ||
| 11 | |||
| 12 | namespace Core { | ||
| 13 | namespace Memory { | ||
| 14 | class Memory; | ||
| 15 | } | ||
| 16 | class System; | ||
| 17 | } // namespace Core | ||
| 18 | |||
| 19 | namespace AudioCore { | ||
| 20 | namespace Sink { | ||
| 21 | class Sink; | ||
| 22 | } | ||
| 23 | |||
| 24 | namespace AudioRenderer::ADSP { | ||
| 25 | struct CommandBuffer; | ||
| 26 | |||
| 27 | enum class State { | ||
| 28 | Started, | ||
| 29 | Stopped, | ||
| 30 | }; | ||
| 31 | |||
| 32 | /** | ||
| 33 | * Represents the ADSP embedded within the audio sysmodule. | ||
| 34 | * This is a 32-bit Linux4Tegra kernel from nVidia, which is launched with the sysmodule on boot. | ||
| 35 | * | ||
| 36 | * The kernel will run apps you program for it, Nintendo have the following: | ||
| 37 | * | ||
| 38 | * Gmix - Responsible for mixing final audio and sending it out to hardware. This is last place all | ||
| 39 | * audio samples end up, and we skip it entirely, since we have very different backends and | ||
| 40 | * mixing is implicitly handled by the OS (but also due to lack of research/simplicity). | ||
| 41 | * | ||
| 42 | * AudioRenderer - Receives command lists generated by the audio render | ||
| 43 | * system, processes them, and sends the samples to Gmix. | ||
| 44 | * | ||
| 45 | * OpusDecoder - Contains libopus, and controls processing Opus audio and sends it to Gmix. | ||
| 46 | * Not much research done here, TODO if needed. | ||
| 47 | * | ||
| 48 | * We only implement the AudioRenderer for now. | ||
| 49 | * | ||
| 50 | * Communication for the apps is done through mailboxes, and some shared memory. | ||
| 51 | */ | ||
| 52 | class ADSP { | ||
| 53 | public: | ||
| 54 | explicit ADSP(Core::System& system, Sink::Sink& sink); | ||
| 55 | ~ADSP(); | ||
| 56 | |||
| 57 | /** | ||
| 58 | * Start the ADSP. | ||
| 59 | * | ||
| 60 | * @return True if started or already running, otherwise false. | ||
| 61 | */ | ||
| 62 | bool Start(); | ||
| 63 | |||
| 64 | /** | ||
| 65 | * Stop the ADSP. | ||
| 66 | */ | ||
| 67 | void Stop(); | ||
| 68 | |||
| 69 | /** | ||
| 70 | * Get the ADSP's state. | ||
| 71 | * | ||
| 72 | * @return Started or Stopped. | ||
| 73 | */ | ||
| 74 | State GetState() const; | ||
| 75 | |||
| 76 | /** | ||
| 77 | * Get the AudioRenderer mailbox to communicate with it. | ||
| 78 | * | ||
| 79 | * @return The AudioRenderer mailbox. | ||
| 80 | */ | ||
| 81 | AudioRenderer_Mailbox* GetRenderMailbox(); | ||
| 82 | |||
| 83 | /** | ||
| 84 | * Get the tick the ADSP was signalled. | ||
| 85 | * | ||
| 86 | * @return The tick the ADSP was signalled. | ||
| 87 | */ | ||
| 88 | u64 GetSignalledTick() const; | ||
| 89 | |||
| 90 | /** | ||
| 91 | * Get the total time it took for the ADSP to run the last command lists (both command lists). | ||
| 92 | * | ||
| 93 | * @return The tick the ADSP was signalled. | ||
| 94 | */ | ||
| 95 | u64 GetTimeTaken() const; | ||
| 96 | |||
| 97 | /** | ||
| 98 | * Get the last time a given command list took to run. | ||
| 99 | * | ||
| 100 | * @param session_id - The session id to check (0 or 1). | ||
| 101 | * @return The time it took. | ||
| 102 | */ | ||
| 103 | u64 GetRenderTimeTaken(u32 session_id); | ||
| 104 | |||
| 105 | /** | ||
| 106 | * Clear the remaining command count for a given session. | ||
| 107 | * | ||
| 108 | * @param session_id - The session id to check (0 or 1). | ||
| 109 | */ | ||
| 110 | void ClearRemainCount(u32 session_id); | ||
| 111 | |||
| 112 | /** | ||
| 113 | * Get the remaining number of commands left to process for a command list. | ||
| 114 | * | ||
| 115 | * @param session_id - The session id to check (0 or 1). | ||
| 116 | * @return The number of commands remaining. | ||
| 117 | */ | ||
| 118 | u32 GetRemainCommandCount(u32 session_id) const; | ||
| 119 | |||
| 120 | /** | ||
| 121 | * Get the last tick a command list started processing. | ||
| 122 | * | ||
| 123 | * @param session_id - The session id to check (0 or 1). | ||
| 124 | * @return The last tick the given command list started. | ||
| 125 | */ | ||
| 126 | u64 GetRenderingStartTick(u32 session_id); | ||
| 127 | |||
| 128 | /** | ||
| 129 | * Set a command buffer to be processed. | ||
| 130 | * | ||
| 131 | * @param session_id - The session id to check (0 or 1). | ||
| 132 | * @param command_buffer - The command buffer to process. | ||
| 133 | */ | ||
| 134 | void SendCommandBuffer(u32 session_id, const CommandBuffer& command_buffer); | ||
| 135 | |||
| 136 | /** | ||
| 137 | * Clear the command buffers (does not clear the time taken or the remaining command count) | ||
| 138 | */ | ||
| 139 | void ClearCommandBuffers(); | ||
| 140 | |||
| 141 | /** | ||
| 142 | * Signal the AudioRenderer to begin processing. | ||
| 143 | */ | ||
| 144 | void Signal(); | ||
| 145 | |||
| 146 | /** | ||
| 147 | * Wait for the AudioRenderer to finish processing. | ||
| 148 | */ | ||
| 149 | void Wait(); | ||
| 150 | |||
| 151 | private: | ||
| 152 | /// Core system | ||
| 153 | Core::System& system; | ||
| 154 | /// Core memory | ||
| 155 | Core::Memory::Memory& memory; | ||
| 156 | /// Number of systems active, used to prevent accidental shutdowns | ||
| 157 | u8 systems_active{0}; | ||
| 158 | /// ADSP running state | ||
| 159 | std::atomic<bool> running{false}; | ||
| 160 | /// Output sink used by the ADSP | ||
| 161 | Sink::Sink& sink; | ||
| 162 | /// AudioRenderer app | ||
| 163 | std::unique_ptr<AudioRenderer> audio_renderer{}; | ||
| 164 | /// Communication for the AudioRenderer | ||
| 165 | AudioRenderer_Mailbox render_mailbox{}; | ||
| 166 | /// Mailbox lock ffor the render mailbox | ||
| 167 | std::mutex mailbox_lock; | ||
| 168 | }; | ||
| 169 | |||
| 170 | } // namespace AudioRenderer::ADSP | ||
| 171 | } // namespace AudioCore | ||
diff --git a/src/audio_core/renderer/adsp/audio_renderer.h b/src/audio_core/renderer/adsp/audio_renderer.h deleted file mode 100644 index 88e558183..000000000 --- a/src/audio_core/renderer/adsp/audio_renderer.h +++ /dev/null | |||
| @@ -1,204 +0,0 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #pragma once | ||
| 5 | |||
| 6 | #include <array> | ||
| 7 | #include <memory> | ||
| 8 | #include <thread> | ||
| 9 | |||
| 10 | #include "audio_core/renderer/adsp/command_buffer.h" | ||
| 11 | #include "audio_core/renderer/adsp/command_list_processor.h" | ||
| 12 | #include "common/common_types.h" | ||
| 13 | #include "common/polyfill_thread.h" | ||
| 14 | #include "common/reader_writer_queue.h" | ||
| 15 | #include "common/thread.h" | ||
| 16 | |||
| 17 | namespace Core { | ||
| 18 | namespace Timing { | ||
| 19 | struct EventType; | ||
| 20 | } | ||
| 21 | class System; | ||
| 22 | } // namespace Core | ||
| 23 | |||
| 24 | namespace AudioCore { | ||
| 25 | namespace Sink { | ||
| 26 | class Sink; | ||
| 27 | } | ||
| 28 | |||
| 29 | namespace AudioRenderer::ADSP { | ||
| 30 | |||
| 31 | enum class RenderMessage { | ||
| 32 | /* 0x00 */ Invalid, | ||
| 33 | /* 0x01 */ AudioRenderer_MapUnmap_Map, | ||
| 34 | /* 0x02 */ AudioRenderer_MapUnmap_MapResponse, | ||
| 35 | /* 0x03 */ AudioRenderer_MapUnmap_Unmap, | ||
| 36 | /* 0x04 */ AudioRenderer_MapUnmap_UnmapResponse, | ||
| 37 | /* 0x05 */ AudioRenderer_MapUnmap_InvalidateCache, | ||
| 38 | /* 0x06 */ AudioRenderer_MapUnmap_InvalidateCacheResponse, | ||
| 39 | /* 0x07 */ AudioRenderer_MapUnmap_Shutdown, | ||
| 40 | /* 0x08 */ AudioRenderer_MapUnmap_ShutdownResponse, | ||
| 41 | /* 0x16 */ AudioRenderer_InitializeOK = 0x16, | ||
| 42 | /* 0x20 */ AudioRenderer_RenderResponse = 0x20, | ||
| 43 | /* 0x2A */ AudioRenderer_Render = 0x2A, | ||
| 44 | /* 0x34 */ AudioRenderer_Shutdown = 0x34, | ||
| 45 | }; | ||
| 46 | |||
| 47 | /** | ||
| 48 | * A mailbox for the AudioRenderer, allowing communication between the host and the AudioRenderer | ||
| 49 | * running on the ADSP. | ||
| 50 | */ | ||
| 51 | class AudioRenderer_Mailbox { | ||
| 52 | public: | ||
| 53 | /** | ||
| 54 | * Send a message from the host to the AudioRenderer. | ||
| 55 | * | ||
| 56 | * @param message - The message to send to the AudioRenderer. | ||
| 57 | */ | ||
| 58 | void HostSendMessage(RenderMessage message); | ||
| 59 | |||
| 60 | /** | ||
| 61 | * Host wait for a message from the AudioRenderer. | ||
| 62 | * | ||
| 63 | * @return The message returned from the AudioRenderer. | ||
| 64 | */ | ||
| 65 | RenderMessage HostWaitMessage(); | ||
| 66 | |||
| 67 | /** | ||
| 68 | * Send a message from the AudioRenderer to the host. | ||
| 69 | * | ||
| 70 | * @param message - The message to send to the host. | ||
| 71 | */ | ||
| 72 | void ADSPSendMessage(RenderMessage message); | ||
| 73 | |||
| 74 | /** | ||
| 75 | * AudioRenderer wait for a message from the host. | ||
| 76 | * | ||
| 77 | * @return The message returned from the AudioRenderer. | ||
| 78 | */ | ||
| 79 | RenderMessage ADSPWaitMessage(); | ||
| 80 | |||
| 81 | /** | ||
| 82 | * Get the command buffer with the given session id (0 or 1). | ||
| 83 | * | ||
| 84 | * @param session_id - The session id to get (0 or 1). | ||
| 85 | * @return The command buffer. | ||
| 86 | */ | ||
| 87 | CommandBuffer& GetCommandBuffer(u32 session_id); | ||
| 88 | |||
| 89 | /** | ||
| 90 | * Set the command buffer with the given session id (0 or 1). | ||
| 91 | * | ||
| 92 | * @param session_id - The session id to get (0 or 1). | ||
| 93 | * @param buffer - The command buffer to set. | ||
| 94 | */ | ||
| 95 | void SetCommandBuffer(u32 session_id, const CommandBuffer& buffer); | ||
| 96 | |||
| 97 | /** | ||
| 98 | * Get the total render time taken for the last command lists sent. | ||
| 99 | * | ||
| 100 | * @return Total render time taken for the last command lists. | ||
| 101 | */ | ||
| 102 | u64 GetRenderTimeTaken() const; | ||
| 103 | |||
| 104 | /** | ||
| 105 | * Get the tick the AudioRenderer was signalled. | ||
| 106 | * | ||
| 107 | * @return The tick the AudioRenderer was signalled. | ||
| 108 | */ | ||
| 109 | u64 GetSignalledTick() const; | ||
| 110 | |||
| 111 | /** | ||
| 112 | * Set the tick the AudioRenderer was signalled. | ||
| 113 | * | ||
| 114 | * @param tick - The tick the AudioRenderer was signalled. | ||
| 115 | */ | ||
| 116 | void SetSignalledTick(u64 tick); | ||
| 117 | |||
| 118 | /** | ||
| 119 | * Clear the remaining command count. | ||
| 120 | * | ||
| 121 | * @param session_id - Index for which command list to clear (0 or 1). | ||
| 122 | */ | ||
| 123 | void ClearRemainCount(u32 session_id); | ||
| 124 | |||
| 125 | /** | ||
| 126 | * Get the remaining command count for a given command list. | ||
| 127 | * | ||
| 128 | * @param session_id - Index for which command list to clear (0 or 1). | ||
| 129 | * @return The remaining command count. | ||
| 130 | */ | ||
| 131 | u32 GetRemainCommandCount(u32 session_id) const; | ||
| 132 | |||
| 133 | /** | ||
| 134 | * Clear the command buffers (does not clear the time taken or the remaining command count). | ||
| 135 | */ | ||
| 136 | void ClearCommandBuffers(); | ||
| 137 | |||
| 138 | private: | ||
| 139 | /// Host signalling event | ||
| 140 | Common::Event host_event{}; | ||
| 141 | /// AudioRenderer signalling event | ||
| 142 | Common::Event adsp_event{}; | ||
| 143 | /// Host message queue | ||
| 144 | |||
| 145 | Common::ReaderWriterQueue<RenderMessage> host_messages{}; | ||
| 146 | /// AudioRenderer message queue | ||
| 147 | |||
| 148 | Common::ReaderWriterQueue<RenderMessage> adsp_messages{}; | ||
| 149 | /// Command buffers | ||
| 150 | |||
| 151 | std::array<CommandBuffer, MaxRendererSessions> command_buffers{}; | ||
| 152 | /// Tick the AudioRnederer was signalled | ||
| 153 | u64 signalled_tick{}; | ||
| 154 | }; | ||
| 155 | |||
| 156 | /** | ||
| 157 | * The AudioRenderer application running on the ADSP. | ||
| 158 | */ | ||
| 159 | class AudioRenderer { | ||
| 160 | public: | ||
| 161 | explicit AudioRenderer(Core::System& system); | ||
| 162 | ~AudioRenderer(); | ||
| 163 | |||
| 164 | /** | ||
| 165 | * Start the AudioRenderer. | ||
| 166 | * | ||
| 167 | * @param mailbox The mailbox to use for this session. | ||
| 168 | */ | ||
| 169 | void Start(AudioRenderer_Mailbox* mailbox); | ||
| 170 | |||
| 171 | /** | ||
| 172 | * Stop the AudioRenderer. | ||
| 173 | */ | ||
| 174 | void Stop(); | ||
| 175 | |||
| 176 | private: | ||
| 177 | /** | ||
| 178 | * Main AudioRenderer thread, responsible for processing the command lists. | ||
| 179 | */ | ||
| 180 | void ThreadFunc(std::stop_token stop_token); | ||
| 181 | |||
| 182 | /** | ||
| 183 | * Creates the streams which will receive the processed samples. | ||
| 184 | */ | ||
| 185 | void CreateSinkStreams(); | ||
| 186 | |||
| 187 | /// Core system | ||
| 188 | Core::System& system; | ||
| 189 | /// Main thread | ||
| 190 | std::jthread thread{}; | ||
| 191 | /// The current state | ||
| 192 | std::atomic<bool> running{}; | ||
| 193 | /// The active mailbox | ||
| 194 | AudioRenderer_Mailbox* mailbox{}; | ||
| 195 | /// The command lists to process | ||
| 196 | std::array<CommandListProcessor, MaxRendererSessions> command_list_processors{}; | ||
| 197 | /// The output sink the AudioRenderer will use | ||
| 198 | Sink::Sink& sink; | ||
| 199 | /// The streams which will receive the processed samples | ||
| 200 | std::array<Sink::SinkStream*, MaxRendererSessions> streams; | ||
| 201 | }; | ||
| 202 | |||
| 203 | } // namespace AudioRenderer::ADSP | ||
| 204 | } // namespace AudioCore | ||
diff --git a/src/audio_core/renderer/adsp/command_buffer.h b/src/audio_core/renderer/adsp/command_buffer.h deleted file mode 100644 index 880b279d8..000000000 --- a/src/audio_core/renderer/adsp/command_buffer.h +++ /dev/null | |||
| @@ -1,21 +0,0 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #pragma once | ||
| 5 | |||
| 6 | #include "audio_core/common/common.h" | ||
| 7 | #include "common/common_types.h" | ||
| 8 | |||
| 9 | namespace AudioCore::AudioRenderer::ADSP { | ||
| 10 | |||
| 11 | struct CommandBuffer { | ||
| 12 | CpuAddr buffer; | ||
| 13 | u64 size; | ||
| 14 | u64 time_limit; | ||
| 15 | u32 remaining_command_count; | ||
| 16 | bool reset_buffers; | ||
| 17 | u64 applet_resource_user_id; | ||
| 18 | u64 render_time_taken; | ||
| 19 | }; | ||
| 20 | |||
| 21 | } // namespace AudioCore::AudioRenderer::ADSP | ||
diff --git a/src/audio_core/renderer/audio_device.cpp b/src/audio_core/renderer/audio_device.cpp index 0d9d8f6ce..2d9bf82bb 100644 --- a/src/audio_core/renderer/audio_device.cpp +++ b/src/audio_core/renderer/audio_device.cpp | |||
| @@ -10,7 +10,7 @@ | |||
| 10 | #include "audio_core/sink/sink.h" | 10 | #include "audio_core/sink/sink.h" |
| 11 | #include "core/core.h" | 11 | #include "core/core.h" |
| 12 | 12 | ||
| 13 | namespace AudioCore::AudioRenderer { | 13 | namespace AudioCore::Renderer { |
| 14 | 14 | ||
| 15 | constexpr std::array usb_device_names{ | 15 | constexpr std::array usb_device_names{ |
| 16 | AudioDevice::AudioDeviceName{"AudioStereoJackOutput"}, | 16 | AudioDevice::AudioDeviceName{"AudioStereoJackOutput"}, |
| @@ -71,4 +71,4 @@ f32 AudioDevice::GetDeviceVolume([[maybe_unused]] std::string_view name) const { | |||
| 71 | return output_sink.GetDeviceVolume(); | 71 | return output_sink.GetDeviceVolume(); |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | } // namespace AudioCore::AudioRenderer | 74 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/audio_device.h b/src/audio_core/renderer/audio_device.h index dd6be70ee..ca4040add 100644 --- a/src/audio_core/renderer/audio_device.h +++ b/src/audio_core/renderer/audio_device.h | |||
| @@ -16,7 +16,7 @@ namespace Sink { | |||
| 16 | class Sink; | 16 | class Sink; |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | namespace AudioRenderer { | 19 | namespace Renderer { |
| 20 | /** | 20 | /** |
| 21 | * An interface to an output audio device available to the Switch. | 21 | * An interface to an output audio device available to the Switch. |
| 22 | */ | 22 | */ |
| @@ -76,5 +76,5 @@ private: | |||
| 76 | const u32 user_revision; | 76 | const u32 user_revision; |
| 77 | }; | 77 | }; |
| 78 | 78 | ||
| 79 | } // namespace AudioRenderer | 79 | } // namespace Renderer |
| 80 | } // namespace AudioCore | 80 | } // namespace AudioCore |
diff --git a/src/audio_core/renderer/audio_renderer.cpp b/src/audio_core/renderer/audio_renderer.cpp index a8257eb2e..09efe9be9 100644 --- a/src/audio_core/renderer/audio_renderer.cpp +++ b/src/audio_core/renderer/audio_renderer.cpp | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | #include "core/hle/kernel/k_transfer_memory.h" | 9 | #include "core/hle/kernel/k_transfer_memory.h" |
| 10 | #include "core/hle/service/audio/errors.h" | 10 | #include "core/hle/service/audio/errors.h" |
| 11 | 11 | ||
| 12 | namespace AudioCore::AudioRenderer { | 12 | namespace AudioCore::Renderer { |
| 13 | 13 | ||
| 14 | Renderer::Renderer(Core::System& system_, Manager& manager_, Kernel::KEvent* rendered_event) | 14 | Renderer::Renderer(Core::System& system_, Manager& manager_, Kernel::KEvent* rendered_event) |
| 15 | : core{system_}, manager{manager_}, system{system_, rendered_event} {} | 15 | : core{system_}, manager{manager_}, system{system_, rendered_event} {} |
| @@ -64,4 +64,4 @@ Result Renderer::RequestUpdate(std::span<const u8> input, std::span<u8> performa | |||
| 64 | return system.Update(input, performance, output); | 64 | return system.Update(input, performance, output); |
| 65 | } | 65 | } |
| 66 | 66 | ||
| 67 | } // namespace AudioCore::AudioRenderer | 67 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/audio_renderer.h b/src/audio_core/renderer/audio_renderer.h index 90c6f9727..24650278b 100644 --- a/src/audio_core/renderer/audio_renderer.h +++ b/src/audio_core/renderer/audio_renderer.h | |||
| @@ -19,7 +19,7 @@ class KTransferMemory; | |||
| 19 | namespace AudioCore { | 19 | namespace AudioCore { |
| 20 | struct AudioRendererParameterInternal; | 20 | struct AudioRendererParameterInternal; |
| 21 | 21 | ||
| 22 | namespace AudioRenderer { | 22 | namespace Renderer { |
| 23 | class Manager; | 23 | class Manager; |
| 24 | 24 | ||
| 25 | /** | 25 | /** |
| @@ -31,7 +31,7 @@ public: | |||
| 31 | 31 | ||
| 32 | /** | 32 | /** |
| 33 | * Initialize the renderer. | 33 | * Initialize the renderer. |
| 34 | * Registers the system with the AudioRenderer::Manager, allocates workbuffers and initializes | 34 | * Registers the system with the Renderer::Manager, allocates workbuffers and initializes |
| 35 | * everything to a default state. | 35 | * everything to a default state. |
| 36 | * | 36 | * |
| 37 | * @param params - Input parameters to initialize the system with. | 37 | * @param params - Input parameters to initialize the system with. |
| @@ -93,5 +93,5 @@ private: | |||
| 93 | System system; | 93 | System system; |
| 94 | }; | 94 | }; |
| 95 | 95 | ||
| 96 | } // namespace AudioRenderer | 96 | } // namespace Renderer |
| 97 | } // namespace AudioCore | 97 | } // namespace AudioCore |
diff --git a/src/audio_core/renderer/behavior/behavior_info.cpp b/src/audio_core/renderer/behavior/behavior_info.cpp index 3d2a91312..058539042 100644 --- a/src/audio_core/renderer/behavior/behavior_info.cpp +++ b/src/audio_core/renderer/behavior/behavior_info.cpp | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | #include "audio_core/common/feature_support.h" | 4 | #include "audio_core/common/feature_support.h" |
| 5 | #include "audio_core/renderer/behavior/behavior_info.h" | 5 | #include "audio_core/renderer/behavior/behavior_info.h" |
| 6 | 6 | ||
| 7 | namespace AudioCore::AudioRenderer { | 7 | namespace AudioCore::Renderer { |
| 8 | 8 | ||
| 9 | BehaviorInfo::BehaviorInfo() : process_revision{CurrentRevision} {} | 9 | BehaviorInfo::BehaviorInfo() : process_revision{CurrentRevision} {} |
| 10 | 10 | ||
| @@ -190,4 +190,4 @@ bool BehaviorInfo::IsI3dl2ReverbChannelMappingChanged() const { | |||
| 190 | return CheckFeatureSupported(SupportTags::I3dl2ReverbChannelMappingChange, user_revision); | 190 | return CheckFeatureSupported(SupportTags::I3dl2ReverbChannelMappingChange, user_revision); |
| 191 | } | 191 | } |
| 192 | 192 | ||
| 193 | } // namespace AudioCore::AudioRenderer | 193 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/behavior/behavior_info.h b/src/audio_core/renderer/behavior/behavior_info.h index b52340229..a4958857a 100644 --- a/src/audio_core/renderer/behavior/behavior_info.h +++ b/src/audio_core/renderer/behavior/behavior_info.h | |||
| @@ -10,7 +10,7 @@ | |||
| 10 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 11 | #include "core/hle/service/audio/errors.h" | 11 | #include "core/hle/service/audio/errors.h" |
| 12 | 12 | ||
| 13 | namespace AudioCore::AudioRenderer { | 13 | namespace AudioCore::Renderer { |
| 14 | /** | 14 | /** |
| 15 | * Holds host and user revisions, checks whether render features can be enabled, and reports errors. | 15 | * Holds host and user revisions, checks whether render features can be enabled, and reports errors. |
| 16 | */ | 16 | */ |
| @@ -264,7 +264,7 @@ public: | |||
| 264 | /** | 264 | /** |
| 265 | * Check if skipping voice pitch and sample rate conversion is supported. | 265 | * Check if skipping voice pitch and sample rate conversion is supported. |
| 266 | * This speeds up the data source commands by skipping resampling if unwanted. | 266 | * This speeds up the data source commands by skipping resampling if unwanted. |
| 267 | * See AudioCore::AudioRenderer::DecodeFromWaveBuffers | 267 | * See AudioCore::Renderer::DecodeFromWaveBuffers |
| 268 | * | 268 | * |
| 269 | * @return True if supported, otherwise false. | 269 | * @return True if supported, otherwise false. |
| 270 | */ | 270 | */ |
| @@ -273,7 +273,7 @@ public: | |||
| 273 | /** | 273 | /** |
| 274 | * Check if resetting played sample count at loop points is supported. | 274 | * Check if resetting played sample count at loop points is supported. |
| 275 | * This resets the number of samples played in a voice state when a loop point is reached. | 275 | * This resets the number of samples played in a voice state when a loop point is reached. |
| 276 | * See AudioCore::AudioRenderer::DecodeFromWaveBuffers | 276 | * See AudioCore::Renderer::DecodeFromWaveBuffers |
| 277 | * | 277 | * |
| 278 | * @return True if supported, otherwise false. | 278 | * @return True if supported, otherwise false. |
| 279 | */ | 279 | */ |
| @@ -373,4 +373,4 @@ public: | |||
| 373 | u32 error_count{}; | 373 | u32 error_count{}; |
| 374 | }; | 374 | }; |
| 375 | 375 | ||
| 376 | } // namespace AudioCore::AudioRenderer | 376 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/behavior/info_updater.cpp b/src/audio_core/renderer/behavior/info_updater.cpp index e312eb166..667711e17 100644 --- a/src/audio_core/renderer/behavior/info_updater.cpp +++ b/src/audio_core/renderer/behavior/info_updater.cpp | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | #include "audio_core/renderer/splitter/splitter_context.h" | 15 | #include "audio_core/renderer/splitter/splitter_context.h" |
| 16 | #include "audio_core/renderer/voice/voice_context.h" | 16 | #include "audio_core/renderer/voice/voice_context.h" |
| 17 | 17 | ||
| 18 | namespace AudioCore::AudioRenderer { | 18 | namespace AudioCore::Renderer { |
| 19 | 19 | ||
| 20 | InfoUpdater::InfoUpdater(std::span<const u8> input_, std::span<u8> output_, | 20 | InfoUpdater::InfoUpdater(std::span<const u8> input_, std::span<u8> output_, |
| 21 | const u32 process_handle_, BehaviorInfo& behaviour_) | 21 | const u32 process_handle_, BehaviorInfo& behaviour_) |
| @@ -536,4 +536,4 @@ Result InfoUpdater::CheckConsumedSize() { | |||
| 536 | return ResultSuccess; | 536 | return ResultSuccess; |
| 537 | } | 537 | } |
| 538 | 538 | ||
| 539 | } // namespace AudioCore::AudioRenderer | 539 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/behavior/info_updater.h b/src/audio_core/renderer/behavior/info_updater.h index c817d8d8d..fb4b7d25a 100644 --- a/src/audio_core/renderer/behavior/info_updater.h +++ b/src/audio_core/renderer/behavior/info_updater.h | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | #include "common/common_types.h" | 8 | #include "common/common_types.h" |
| 9 | #include "core/hle/service/audio/errors.h" | 9 | #include "core/hle/service/audio/errors.h" |
| 10 | 10 | ||
| 11 | namespace AudioCore::AudioRenderer { | 11 | namespace AudioCore::Renderer { |
| 12 | class BehaviorInfo; | 12 | class BehaviorInfo; |
| 13 | class VoiceContext; | 13 | class VoiceContext; |
| 14 | class MixContext; | 14 | class MixContext; |
| @@ -202,4 +202,4 @@ private: | |||
| 202 | BehaviorInfo& behaviour; | 202 | BehaviorInfo& behaviour; |
| 203 | }; | 203 | }; |
| 204 | 204 | ||
| 205 | } // namespace AudioCore::AudioRenderer | 205 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/command_buffer.cpp b/src/audio_core/renderer/command/command_buffer.cpp index 0bd418306..67d43e69a 100644 --- a/src/audio_core/renderer/command/command_buffer.cpp +++ b/src/audio_core/renderer/command/command_buffer.cpp | |||
| @@ -16,7 +16,7 @@ | |||
| 16 | #include "audio_core/renderer/voice/voice_info.h" | 16 | #include "audio_core/renderer/voice/voice_info.h" |
| 17 | #include "audio_core/renderer/voice/voice_state.h" | 17 | #include "audio_core/renderer/voice/voice_state.h" |
| 18 | 18 | ||
| 19 | namespace AudioCore::AudioRenderer { | 19 | namespace AudioCore::Renderer { |
| 20 | 20 | ||
| 21 | template <typename T, CommandId Id> | 21 | template <typename T, CommandId Id> |
| 22 | T& CommandBuffer::GenerateStart(const s32 node_id) { | 22 | T& CommandBuffer::GenerateStart(const s32 node_id) { |
| @@ -713,4 +713,4 @@ void CommandBuffer::GenerateCompressorCommand(s16 buffer_offset, EffectInfoBase& | |||
| 713 | GenerateEnd<CompressorCommand>(cmd); | 713 | GenerateEnd<CompressorCommand>(cmd); |
| 714 | } | 714 | } |
| 715 | 715 | ||
| 716 | } // namespace AudioCore::AudioRenderer | 716 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/command_buffer.h b/src/audio_core/renderer/command/command_buffer.h index 162170846..12e8c2c81 100644 --- a/src/audio_core/renderer/command/command_buffer.h +++ b/src/audio_core/renderer/command/command_buffer.h | |||
| @@ -10,7 +10,7 @@ | |||
| 10 | #include "audio_core/renderer/performance/performance_manager.h" | 10 | #include "audio_core/renderer/performance/performance_manager.h" |
| 11 | #include "common/common_types.h" | 11 | #include "common/common_types.h" |
| 12 | 12 | ||
| 13 | namespace AudioCore::AudioRenderer { | 13 | namespace AudioCore::Renderer { |
| 14 | struct UpsamplerInfo; | 14 | struct UpsamplerInfo; |
| 15 | struct VoiceState; | 15 | struct VoiceState; |
| 16 | class EffectInfoBase; | 16 | class EffectInfoBase; |
| @@ -465,4 +465,4 @@ private: | |||
| 465 | void GenerateEnd(T& cmd); | 465 | void GenerateEnd(T& cmd); |
| 466 | }; | 466 | }; |
| 467 | 467 | ||
| 468 | } // namespace AudioCore::AudioRenderer | 468 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/command_generator.cpp b/src/audio_core/renderer/command/command_generator.cpp index fba84c7bd..ccb186209 100644 --- a/src/audio_core/renderer/command/command_generator.cpp +++ b/src/audio_core/renderer/command/command_generator.cpp | |||
| @@ -21,7 +21,7 @@ | |||
| 21 | #include "audio_core/renderer/voice/voice_context.h" | 21 | #include "audio_core/renderer/voice/voice_context.h" |
| 22 | #include "common/alignment.h" | 22 | #include "common/alignment.h" |
| 23 | 23 | ||
| 24 | namespace AudioCore::AudioRenderer { | 24 | namespace AudioCore::Renderer { |
| 25 | 25 | ||
| 26 | CommandGenerator::CommandGenerator(CommandBuffer& command_buffer_, | 26 | CommandGenerator::CommandGenerator(CommandBuffer& command_buffer_, |
| 27 | const CommandListHeader& command_list_header_, | 27 | const CommandListHeader& command_list_header_, |
| @@ -793,4 +793,4 @@ void CommandGenerator::GeneratePerformanceCommand( | |||
| 793 | command_buffer.GeneratePerformanceCommand(node_id, state, entry_addresses); | 793 | command_buffer.GeneratePerformanceCommand(node_id, state, entry_addresses); |
| 794 | } | 794 | } |
| 795 | 795 | ||
| 796 | } // namespace AudioCore::AudioRenderer | 796 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/command_generator.h b/src/audio_core/renderer/command/command_generator.h index b3cd7b408..38ee2a64e 100644 --- a/src/audio_core/renderer/command/command_generator.h +++ b/src/audio_core/renderer/command/command_generator.h | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | namespace AudioCore { | 12 | namespace AudioCore { |
| 13 | struct AudioRendererSystemContext; | 13 | struct AudioRendererSystemContext; |
| 14 | 14 | ||
| 15 | namespace AudioRenderer { | 15 | namespace Renderer { |
| 16 | class CommandBuffer; | 16 | class CommandBuffer; |
| 17 | struct CommandListHeader; | 17 | struct CommandListHeader; |
| 18 | class VoiceContext; | 18 | class VoiceContext; |
| @@ -345,5 +345,5 @@ private: | |||
| 345 | PerformanceManager* performance_manager; | 345 | PerformanceManager* performance_manager; |
| 346 | }; | 346 | }; |
| 347 | 347 | ||
| 348 | } // namespace AudioRenderer | 348 | } // namespace Renderer |
| 349 | } // namespace AudioCore | 349 | } // namespace AudioCore |
diff --git a/src/audio_core/renderer/command/command_list_header.h b/src/audio_core/renderer/command/command_list_header.h index 988530b1f..de9ee070b 100644 --- a/src/audio_core/renderer/command/command_list_header.h +++ b/src/audio_core/renderer/command/command_list_header.h | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | #include "audio_core/common/common.h" | 8 | #include "audio_core/common/common.h" |
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | 10 | ||
| 11 | namespace AudioCore::AudioRenderer { | 11 | namespace AudioCore::Renderer { |
| 12 | 12 | ||
| 13 | struct CommandListHeader { | 13 | struct CommandListHeader { |
| 14 | u64 buffer_size; | 14 | u64 buffer_size; |
| @@ -19,4 +19,4 @@ struct CommandListHeader { | |||
| 19 | u32 sample_rate; | 19 | u32 sample_rate; |
| 20 | }; | 20 | }; |
| 21 | 21 | ||
| 22 | } // namespace AudioCore::AudioRenderer | 22 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/command_processing_time_estimator.cpp b/src/audio_core/renderer/command/command_processing_time_estimator.cpp index 3091f587a..a48a016b1 100644 --- a/src/audio_core/renderer/command/command_processing_time_estimator.cpp +++ b/src/audio_core/renderer/command/command_processing_time_estimator.cpp | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include "audio_core/renderer/command/command_processing_time_estimator.h" | 4 | #include "audio_core/renderer/command/command_processing_time_estimator.h" |
| 5 | 5 | ||
| 6 | namespace AudioCore::AudioRenderer { | 6 | namespace AudioCore::Renderer { |
| 7 | 7 | ||
| 8 | u32 CommandProcessingTimeEstimatorVersion1::Estimate( | 8 | u32 CommandProcessingTimeEstimatorVersion1::Estimate( |
| 9 | const PcmInt16DataSourceVersion1Command& command) const { | 9 | const PcmInt16DataSourceVersion1Command& command) const { |
| @@ -3617,4 +3617,4 @@ u32 CommandProcessingTimeEstimatorVersion5::Estimate(const CompressorCommand& co | |||
| 3617 | } | 3617 | } |
| 3618 | } | 3618 | } |
| 3619 | 3619 | ||
| 3620 | } // namespace AudioCore::AudioRenderer | 3620 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/command_processing_time_estimator.h b/src/audio_core/renderer/command/command_processing_time_estimator.h index 452217196..1c76e4ba4 100644 --- a/src/audio_core/renderer/command/command_processing_time_estimator.h +++ b/src/audio_core/renderer/command/command_processing_time_estimator.h | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | #include "audio_core/renderer/command/commands.h" | 6 | #include "audio_core/renderer/command/commands.h" |
| 7 | #include "common/common_types.h" | 7 | #include "common/common_types.h" |
| 8 | 8 | ||
| 9 | namespace AudioCore::AudioRenderer { | 9 | namespace AudioCore::Renderer { |
| 10 | /** | 10 | /** |
| 11 | * Estimate the processing time required for all commands. | 11 | * Estimate the processing time required for all commands. |
| 12 | */ | 12 | */ |
| @@ -251,4 +251,4 @@ private: | |||
| 251 | u32 buffer_count{}; | 251 | u32 buffer_count{}; |
| 252 | }; | 252 | }; |
| 253 | 253 | ||
| 254 | } // namespace AudioCore::AudioRenderer | 254 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/data_source/adpcm.cpp b/src/audio_core/renderer/command/data_source/adpcm.cpp index e66ed2990..28e76fdcc 100644 --- a/src/audio_core/renderer/command/data_source/adpcm.cpp +++ b/src/audio_core/renderer/command/data_source/adpcm.cpp | |||
| @@ -3,20 +3,20 @@ | |||
| 3 | 3 | ||
| 4 | #include <span> | 4 | #include <span> |
| 5 | 5 | ||
| 6 | #include "audio_core/renderer/adsp/command_list_processor.h" | 6 | #include "audio_core/adsp/apps/audio_renderer/command_list_processor.h" |
| 7 | #include "audio_core/renderer/command/data_source/adpcm.h" | 7 | #include "audio_core/renderer/command/data_source/adpcm.h" |
| 8 | #include "audio_core/renderer/command/data_source/decode.h" | 8 | #include "audio_core/renderer/command/data_source/decode.h" |
| 9 | 9 | ||
| 10 | namespace AudioCore::AudioRenderer { | 10 | namespace AudioCore::Renderer { |
| 11 | 11 | ||
| 12 | void AdpcmDataSourceVersion1Command::Dump(const ADSP::CommandListProcessor& processor, | 12 | void AdpcmDataSourceVersion1Command::Dump(const AudioRenderer::CommandListProcessor& processor, |
| 13 | std::string& string) { | 13 | std::string& string) { |
| 14 | string += fmt::format("AdpcmDataSourceVersion1Command\n\toutput_index {:02X} source sample " | 14 | string += fmt::format("AdpcmDataSourceVersion1Command\n\toutput_index {:02X} source sample " |
| 15 | "rate {} target sample rate {} src quality {}\n", | 15 | "rate {} target sample rate {} src quality {}\n", |
| 16 | output_index, sample_rate, processor.target_sample_rate, src_quality); | 16 | output_index, sample_rate, processor.target_sample_rate, src_quality); |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | void AdpcmDataSourceVersion1Command::Process(const ADSP::CommandListProcessor& processor) { | 19 | void AdpcmDataSourceVersion1Command::Process(const AudioRenderer::CommandListProcessor& processor) { |
| 20 | auto out_buffer{processor.mix_buffers.subspan(output_index * processor.sample_count, | 20 | auto out_buffer{processor.mix_buffers.subspan(output_index * processor.sample_count, |
| 21 | processor.sample_count)}; | 21 | processor.sample_count)}; |
| 22 | 22 | ||
| @@ -41,18 +41,18 @@ void AdpcmDataSourceVersion1Command::Process(const ADSP::CommandListProcessor& p | |||
| 41 | DecodeFromWaveBuffers(*processor.memory, args); | 41 | DecodeFromWaveBuffers(*processor.memory, args); |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | bool AdpcmDataSourceVersion1Command::Verify(const ADSP::CommandListProcessor& processor) { | 44 | bool AdpcmDataSourceVersion1Command::Verify(const AudioRenderer::CommandListProcessor& processor) { |
| 45 | return true; | 45 | return true; |
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | void AdpcmDataSourceVersion2Command::Dump(const ADSP::CommandListProcessor& processor, | 48 | void AdpcmDataSourceVersion2Command::Dump(const AudioRenderer::CommandListProcessor& processor, |
| 49 | std::string& string) { | 49 | std::string& string) { |
| 50 | string += fmt::format("AdpcmDataSourceVersion2Command\n\toutput_index {:02X} source sample " | 50 | string += fmt::format("AdpcmDataSourceVersion2Command\n\toutput_index {:02X} source sample " |
| 51 | "rate {} target sample rate {} src quality {}\n", | 51 | "rate {} target sample rate {} src quality {}\n", |
| 52 | output_index, sample_rate, processor.target_sample_rate, src_quality); | 52 | output_index, sample_rate, processor.target_sample_rate, src_quality); |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | void AdpcmDataSourceVersion2Command::Process(const ADSP::CommandListProcessor& processor) { | 55 | void AdpcmDataSourceVersion2Command::Process(const AudioRenderer::CommandListProcessor& processor) { |
| 56 | auto out_buffer{processor.mix_buffers.subspan(output_index * processor.sample_count, | 56 | auto out_buffer{processor.mix_buffers.subspan(output_index * processor.sample_count, |
| 57 | processor.sample_count)}; | 57 | processor.sample_count)}; |
| 58 | 58 | ||
| @@ -77,8 +77,8 @@ void AdpcmDataSourceVersion2Command::Process(const ADSP::CommandListProcessor& p | |||
| 77 | DecodeFromWaveBuffers(*processor.memory, args); | 77 | DecodeFromWaveBuffers(*processor.memory, args); |
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | bool AdpcmDataSourceVersion2Command::Verify(const ADSP::CommandListProcessor& processor) { | 80 | bool AdpcmDataSourceVersion2Command::Verify(const AudioRenderer::CommandListProcessor& processor) { |
| 81 | return true; | 81 | return true; |
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | } // namespace AudioCore::AudioRenderer | 84 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/data_source/adpcm.h b/src/audio_core/renderer/command/data_source/adpcm.h index a9cf9cee4..487846f0c 100644 --- a/src/audio_core/renderer/command/data_source/adpcm.h +++ b/src/audio_core/renderer/command/data_source/adpcm.h | |||
| @@ -11,11 +11,12 @@ | |||
| 11 | #include "audio_core/renderer/command/icommand.h" | 11 | #include "audio_core/renderer/command/icommand.h" |
| 12 | #include "common/common_types.h" | 12 | #include "common/common_types.h" |
| 13 | 13 | ||
| 14 | namespace AudioCore::AudioRenderer { | 14 | namespace AudioCore::ADSP::AudioRenderer { |
| 15 | namespace ADSP { | ||
| 16 | class CommandListProcessor; | 15 | class CommandListProcessor; |
| 17 | } | 16 | } |
| 18 | 17 | ||
| 18 | namespace AudioCore::Renderer { | ||
| 19 | |||
| 19 | /** | 20 | /** |
| 20 | * AudioRenderer command to decode ADPCM-encoded version 1 wavebuffers | 21 | * AudioRenderer command to decode ADPCM-encoded version 1 wavebuffers |
| 21 | * into the output_index mix buffer. | 22 | * into the output_index mix buffer. |
| @@ -27,14 +28,14 @@ struct AdpcmDataSourceVersion1Command : ICommand { | |||
| 27 | * @param processor - The CommandListProcessor processing this command. | 28 | * @param processor - The CommandListProcessor processing this command. |
| 28 | * @param string - The string to print into. | 29 | * @param string - The string to print into. |
| 29 | */ | 30 | */ |
| 30 | void Dump(const ADSP::CommandListProcessor& processor, std::string& string) override; | 31 | void Dump(const AudioRenderer::CommandListProcessor& processor, std::string& string) override; |
| 31 | 32 | ||
| 32 | /** | 33 | /** |
| 33 | * Process this command. | 34 | * Process this command. |
| 34 | * | 35 | * |
| 35 | * @param processor - The CommandListProcessor processing this command. | 36 | * @param processor - The CommandListProcessor processing this command. |
| 36 | */ | 37 | */ |
| 37 | void Process(const ADSP::CommandListProcessor& processor) override; | 38 | void Process(const AudioRenderer::CommandListProcessor& processor) override; |
| 38 | 39 | ||
| 39 | /** | 40 | /** |
| 40 | * Verify this command's data is valid. | 41 | * Verify this command's data is valid. |
| @@ -42,13 +43,13 @@ struct AdpcmDataSourceVersion1Command : ICommand { | |||
| 42 | * @param processor - The CommandListProcessor processing this command. | 43 | * @param processor - The CommandListProcessor processing this command. |
| 43 | * @return True if the command is valid, otherwise false. | 44 | * @return True if the command is valid, otherwise false. |
| 44 | */ | 45 | */ |
| 45 | bool Verify(const ADSP::CommandListProcessor& processor) override; | 46 | bool Verify(const AudioRenderer::CommandListProcessor& processor) override; |
| 46 | 47 | ||
| 47 | /// Quality used for sample rate conversion | 48 | /// Quality used for sample rate conversion |
| 48 | SrcQuality src_quality; | 49 | SrcQuality src_quality; |
| 49 | /// Mix buffer index for decoded samples | 50 | /// Mix buffer index for decoded samples |
| 50 | s16 output_index; | 51 | s16 output_index; |
| 51 | /// Flags to control decoding (see AudioCore::AudioRenderer::VoiceInfo::Flags) | 52 | /// Flags to control decoding (see AudioCore::Renderer::VoiceInfo::Flags) |
| 52 | u16 flags; | 53 | u16 flags; |
| 53 | /// Wavebuffer sample rate | 54 | /// Wavebuffer sample rate |
| 54 | u32 sample_rate; | 55 | u32 sample_rate; |
| @@ -75,14 +76,14 @@ struct AdpcmDataSourceVersion2Command : ICommand { | |||
| 75 | * @param processor - The CommandListProcessor processing this command. | 76 | * @param processor - The CommandListProcessor processing this command. |
| 76 | * @param string - The string to print into. | 77 | * @param string - The string to print into. |
| 77 | */ | 78 | */ |
| 78 | void Dump(const ADSP::CommandListProcessor& processor, std::string& string) override; | 79 | void Dump(const AudioRenderer::CommandListProcessor& processor, std::string& string) override; |
| 79 | 80 | ||
| 80 | /** | 81 | /** |
| 81 | * Process this command. | 82 | * Process this command. |
| 82 | * | 83 | * |
| 83 | * @param processor - The CommandListProcessor processing this command. | 84 | * @param processor - The CommandListProcessor processing this command. |
| 84 | */ | 85 | */ |
| 85 | void Process(const ADSP::CommandListProcessor& processor) override; | 86 | void Process(const AudioRenderer::CommandListProcessor& processor) override; |
| 86 | 87 | ||
| 87 | /** | 88 | /** |
| 88 | * Verify this command's data is valid. | 89 | * Verify this command's data is valid. |
| @@ -90,13 +91,13 @@ struct AdpcmDataSourceVersion2Command : ICommand { | |||
| 90 | * @param processor - The CommandListProcessor processing this command. | 91 | * @param processor - The CommandListProcessor processing this command. |
| 91 | * @return True if the command is valid, otherwise false. | 92 | * @return True if the command is valid, otherwise false. |
| 92 | */ | 93 | */ |
| 93 | bool Verify(const ADSP::CommandListProcessor& processor) override; | 94 | bool Verify(const AudioRenderer::CommandListProcessor& processor) override; |
| 94 | 95 | ||
| 95 | /// Quality used for sample rate conversion | 96 | /// Quality used for sample rate conversion |
| 96 | SrcQuality src_quality; | 97 | SrcQuality src_quality; |
| 97 | /// Mix buffer index for decoded samples | 98 | /// Mix buffer index for decoded samples |
| 98 | s16 output_index; | 99 | s16 output_index; |
| 99 | /// Flags to control decoding (see AudioCore::AudioRenderer::VoiceInfo::Flags) | 100 | /// Flags to control decoding (see AudioCore::Renderer::VoiceInfo::Flags) |
| 100 | u16 flags; | 101 | u16 flags; |
| 101 | /// Wavebuffer sample rate | 102 | /// Wavebuffer sample rate |
| 102 | u32 sample_rate; | 103 | u32 sample_rate; |
| @@ -116,4 +117,4 @@ struct AdpcmDataSourceVersion2Command : ICommand { | |||
| 116 | u64 data_size; | 117 | u64 data_size; |
| 117 | }; | 118 | }; |
| 118 | 119 | ||
| 119 | } // namespace AudioCore::AudioRenderer | 120 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/data_source/decode.cpp b/src/audio_core/renderer/command/data_source/decode.cpp index 257aa866e..762aec8ad 100644 --- a/src/audio_core/renderer/command/data_source/decode.cpp +++ b/src/audio_core/renderer/command/data_source/decode.cpp | |||
| @@ -11,7 +11,7 @@ | |||
| 11 | #include "common/scratch_buffer.h" | 11 | #include "common/scratch_buffer.h" |
| 12 | #include "core/memory.h" | 12 | #include "core/memory.h" |
| 13 | 13 | ||
| 14 | namespace AudioCore::AudioRenderer { | 14 | namespace AudioCore::Renderer { |
| 15 | 15 | ||
| 16 | constexpr u32 TempBufferSize = 0x3F00; | 16 | constexpr u32 TempBufferSize = 0x3F00; |
| 17 | constexpr std::array<u8, 3> PitchBySrcQuality = {4, 8, 4}; | 17 | constexpr std::array<u8, 3> PitchBySrcQuality = {4, 8, 4}; |
| @@ -364,7 +364,7 @@ void DecodeFromWaveBuffers(Core::Memory::Memory& memory, const DecodeFromWaveBuf | |||
| 364 | wavebuffers_consumed++; | 364 | wavebuffers_consumed++; |
| 365 | } else { | 365 | } else { |
| 366 | voice_state.loop_count++; | 366 | voice_state.loop_count++; |
| 367 | if (wavebuffer.loop_count > 0 && | 367 | if (wavebuffer.loop_count >= 0 && |
| 368 | (voice_state.loop_count > wavebuffer.loop_count || samples_decoded == 0)) { | 368 | (voice_state.loop_count > wavebuffer.loop_count || samples_decoded == 0)) { |
| 369 | voice_state.wave_buffer_valid[wavebuffer_index] = false; | 369 | voice_state.wave_buffer_valid[wavebuffer_index] = false; |
| 370 | voice_state.loop_count = 0; | 370 | voice_state.loop_count = 0; |
| @@ -423,4 +423,4 @@ void DecodeFromWaveBuffers(Core::Memory::Memory& memory, const DecodeFromWaveBuf | |||
| 423 | voice_state.fraction = fraction; | 423 | voice_state.fraction = fraction; |
| 424 | } | 424 | } |
| 425 | 425 | ||
| 426 | } // namespace AudioCore::AudioRenderer | 426 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/data_source/decode.h b/src/audio_core/renderer/command/data_source/decode.h index 4d63d6fa8..5f52f32f0 100644 --- a/src/audio_core/renderer/command/data_source/decode.h +++ b/src/audio_core/renderer/command/data_source/decode.h | |||
| @@ -15,7 +15,7 @@ namespace Core::Memory { | |||
| 15 | class Memory; | 15 | class Memory; |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | namespace AudioCore::AudioRenderer { | 18 | namespace AudioCore::Renderer { |
| 19 | 19 | ||
| 20 | struct DecodeFromWaveBuffersArgs { | 20 | struct DecodeFromWaveBuffersArgs { |
| 21 | SampleFormat sample_format; | 21 | SampleFormat sample_format; |
| @@ -56,4 +56,4 @@ struct DecodeArg { | |||
| 56 | */ | 56 | */ |
| 57 | void DecodeFromWaveBuffers(Core::Memory::Memory& memory, const DecodeFromWaveBuffersArgs& args); | 57 | void DecodeFromWaveBuffers(Core::Memory::Memory& memory, const DecodeFromWaveBuffersArgs& args); |
| 58 | 58 | ||
| 59 | } // namespace AudioCore::AudioRenderer | 59 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/data_source/pcm_float.cpp b/src/audio_core/renderer/command/data_source/pcm_float.cpp index be77fab69..5cc0797f4 100644 --- a/src/audio_core/renderer/command/data_source/pcm_float.cpp +++ b/src/audio_core/renderer/command/data_source/pcm_float.cpp | |||
| @@ -1,13 +1,13 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include "audio_core/renderer/adsp/command_list_processor.h" | 4 | #include "audio_core/adsp/apps/audio_renderer/command_list_processor.h" |
| 5 | #include "audio_core/renderer/command/data_source/decode.h" | 5 | #include "audio_core/renderer/command/data_source/decode.h" |
| 6 | #include "audio_core/renderer/command/data_source/pcm_float.h" | 6 | #include "audio_core/renderer/command/data_source/pcm_float.h" |
| 7 | 7 | ||
| 8 | namespace AudioCore::AudioRenderer { | 8 | namespace AudioCore::Renderer { |
| 9 | 9 | ||
| 10 | void PcmFloatDataSourceVersion1Command::Dump(const ADSP::CommandListProcessor& processor, | 10 | void PcmFloatDataSourceVersion1Command::Dump(const AudioRenderer::CommandListProcessor& processor, |
| 11 | std::string& string) { | 11 | std::string& string) { |
| 12 | string += | 12 | string += |
| 13 | fmt::format("PcmFloatDataSourceVersion1Command\n\toutput_index {:02X} channel {} " | 13 | fmt::format("PcmFloatDataSourceVersion1Command\n\toutput_index {:02X} channel {} " |
| @@ -16,7 +16,8 @@ void PcmFloatDataSourceVersion1Command::Dump(const ADSP::CommandListProcessor& p | |||
| 16 | processor.target_sample_rate, src_quality); | 16 | processor.target_sample_rate, src_quality); |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | void PcmFloatDataSourceVersion1Command::Process(const ADSP::CommandListProcessor& processor) { | 19 | void PcmFloatDataSourceVersion1Command::Process( |
| 20 | const AudioRenderer::CommandListProcessor& processor) { | ||
| 20 | auto out_buffer = processor.mix_buffers.subspan(output_index * processor.sample_count, | 21 | auto out_buffer = processor.mix_buffers.subspan(output_index * processor.sample_count, |
| 21 | processor.sample_count); | 22 | processor.sample_count); |
| 22 | 23 | ||
| @@ -41,11 +42,12 @@ void PcmFloatDataSourceVersion1Command::Process(const ADSP::CommandListProcessor | |||
| 41 | DecodeFromWaveBuffers(*processor.memory, args); | 42 | DecodeFromWaveBuffers(*processor.memory, args); |
| 42 | } | 43 | } |
| 43 | 44 | ||
| 44 | bool PcmFloatDataSourceVersion1Command::Verify(const ADSP::CommandListProcessor& processor) { | 45 | bool PcmFloatDataSourceVersion1Command::Verify( |
| 46 | const AudioRenderer::CommandListProcessor& processor) { | ||
| 45 | return true; | 47 | return true; |
| 46 | } | 48 | } |
| 47 | 49 | ||
| 48 | void PcmFloatDataSourceVersion2Command::Dump(const ADSP::CommandListProcessor& processor, | 50 | void PcmFloatDataSourceVersion2Command::Dump(const AudioRenderer::CommandListProcessor& processor, |
| 49 | std::string& string) { | 51 | std::string& string) { |
| 50 | string += | 52 | string += |
| 51 | fmt::format("PcmFloatDataSourceVersion2Command\n\toutput_index {:02X} channel {} " | 53 | fmt::format("PcmFloatDataSourceVersion2Command\n\toutput_index {:02X} channel {} " |
| @@ -54,7 +56,8 @@ void PcmFloatDataSourceVersion2Command::Dump(const ADSP::CommandListProcessor& p | |||
| 54 | processor.target_sample_rate, src_quality); | 56 | processor.target_sample_rate, src_quality); |
| 55 | } | 57 | } |
| 56 | 58 | ||
| 57 | void PcmFloatDataSourceVersion2Command::Process(const ADSP::CommandListProcessor& processor) { | 59 | void PcmFloatDataSourceVersion2Command::Process( |
| 60 | const AudioRenderer::CommandListProcessor& processor) { | ||
| 58 | auto out_buffer = processor.mix_buffers.subspan(output_index * processor.sample_count, | 61 | auto out_buffer = processor.mix_buffers.subspan(output_index * processor.sample_count, |
| 59 | processor.sample_count); | 62 | processor.sample_count); |
| 60 | 63 | ||
| @@ -79,8 +82,9 @@ void PcmFloatDataSourceVersion2Command::Process(const ADSP::CommandListProcessor | |||
| 79 | DecodeFromWaveBuffers(*processor.memory, args); | 82 | DecodeFromWaveBuffers(*processor.memory, args); |
| 80 | } | 83 | } |
| 81 | 84 | ||
| 82 | bool PcmFloatDataSourceVersion2Command::Verify(const ADSP::CommandListProcessor& processor) { | 85 | bool PcmFloatDataSourceVersion2Command::Verify( |
| 86 | const AudioRenderer::CommandListProcessor& processor) { | ||
| 83 | return true; | 87 | return true; |
| 84 | } | 88 | } |
| 85 | 89 | ||
| 86 | } // namespace AudioCore::AudioRenderer | 90 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/data_source/pcm_float.h b/src/audio_core/renderer/command/data_source/pcm_float.h index e4af77c20..2c9d1877e 100644 --- a/src/audio_core/renderer/command/data_source/pcm_float.h +++ b/src/audio_core/renderer/command/data_source/pcm_float.h | |||
| @@ -9,11 +9,12 @@ | |||
| 9 | #include "audio_core/renderer/command/icommand.h" | 9 | #include "audio_core/renderer/command/icommand.h" |
| 10 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 11 | 11 | ||
| 12 | namespace AudioCore::AudioRenderer { | 12 | namespace AudioCore::ADSP::AudioRenderer { |
| 13 | namespace ADSP { | ||
| 14 | class CommandListProcessor; | 13 | class CommandListProcessor; |
| 15 | } | 14 | } |
| 16 | 15 | ||
| 16 | namespace AudioCore::Renderer { | ||
| 17 | |||
| 17 | /** | 18 | /** |
| 18 | * AudioRenderer command to decode PCM float-encoded version 1 wavebuffers | 19 | * AudioRenderer command to decode PCM float-encoded version 1 wavebuffers |
| 19 | * into the output_index mix buffer. | 20 | * into the output_index mix buffer. |
| @@ -25,14 +26,14 @@ struct PcmFloatDataSourceVersion1Command : ICommand { | |||
| 25 | * @param processor - The CommandListProcessor processing this command. | 26 | * @param processor - The CommandListProcessor processing this command. |
| 26 | * @param string - The string to print into. | 27 | * @param string - The string to print into. |
| 27 | */ | 28 | */ |
| 28 | void Dump(const ADSP::CommandListProcessor& processor, std::string& string) override; | 29 | void Dump(const AudioRenderer::CommandListProcessor& processor, std::string& string) override; |
| 29 | 30 | ||
| 30 | /** | 31 | /** |
| 31 | * Process this command. | 32 | * Process this command. |
| 32 | * | 33 | * |
| 33 | * @param processor - The CommandListProcessor processing this command. | 34 | * @param processor - The CommandListProcessor processing this command. |
| 34 | */ | 35 | */ |
| 35 | void Process(const ADSP::CommandListProcessor& processor) override; | 36 | void Process(const AudioRenderer::CommandListProcessor& processor) override; |
| 36 | 37 | ||
| 37 | /** | 38 | /** |
| 38 | * Verify this command's data is valid. | 39 | * Verify this command's data is valid. |
| @@ -40,13 +41,13 @@ struct PcmFloatDataSourceVersion1Command : ICommand { | |||
| 40 | * @param processor - The CommandListProcessor processing this command. | 41 | * @param processor - The CommandListProcessor processing this command. |
| 41 | * @return True if the command is valid, otherwise false. | 42 | * @return True if the command is valid, otherwise false. |
| 42 | */ | 43 | */ |
| 43 | bool Verify(const ADSP::CommandListProcessor& processor) override; | 44 | bool Verify(const AudioRenderer::CommandListProcessor& processor) override; |
| 44 | 45 | ||
| 45 | /// Quality used for sample rate conversion | 46 | /// Quality used for sample rate conversion |
| 46 | SrcQuality src_quality; | 47 | SrcQuality src_quality; |
| 47 | /// Mix buffer index for decoded samples | 48 | /// Mix buffer index for decoded samples |
| 48 | s16 output_index; | 49 | s16 output_index; |
| 49 | /// Flags to control decoding (see AudioCore::AudioRenderer::VoiceInfo::Flags) | 50 | /// Flags to control decoding (see AudioCore::Renderer::VoiceInfo::Flags) |
| 50 | u16 flags; | 51 | u16 flags; |
| 51 | /// Wavebuffer sample rate | 52 | /// Wavebuffer sample rate |
| 52 | u32 sample_rate; | 53 | u32 sample_rate; |
| @@ -73,14 +74,14 @@ struct PcmFloatDataSourceVersion2Command : ICommand { | |||
| 73 | * @param processor - The CommandListProcessor processing this command. | 74 | * @param processor - The CommandListProcessor processing this command. |
| 74 | * @param string - The string to print into. | 75 | * @param string - The string to print into. |
| 75 | */ | 76 | */ |
| 76 | void Dump(const ADSP::CommandListProcessor& processor, std::string& string) override; | 77 | void Dump(const AudioRenderer::CommandListProcessor& processor, std::string& string) override; |
| 77 | 78 | ||
| 78 | /** | 79 | /** |
| 79 | * Process this command. | 80 | * Process this command. |
| 80 | * | 81 | * |
| 81 | * @param processor - The CommandListProcessor processing this command. | 82 | * @param processor - The CommandListProcessor processing this command. |
| 82 | */ | 83 | */ |
| 83 | void Process(const ADSP::CommandListProcessor& processor) override; | 84 | void Process(const AudioRenderer::CommandListProcessor& processor) override; |
| 84 | 85 | ||
| 85 | /** | 86 | /** |
| 86 | * Verify this command's data is valid. | 87 | * Verify this command's data is valid. |
| @@ -88,13 +89,13 @@ struct PcmFloatDataSourceVersion2Command : ICommand { | |||
| 88 | * @param processor - The CommandListProcessor processing this command. | 89 | * @param processor - The CommandListProcessor processing this command. |
| 89 | * @return True if the command is valid, otherwise false. | 90 | * @return True if the command is valid, otherwise false. |
| 90 | */ | 91 | */ |
| 91 | bool Verify(const ADSP::CommandListProcessor& processor) override; | 92 | bool Verify(const AudioRenderer::CommandListProcessor& processor) override; |
| 92 | 93 | ||
| 93 | /// Quality used for sample rate conversion | 94 | /// Quality used for sample rate conversion |
| 94 | SrcQuality src_quality; | 95 | SrcQuality src_quality; |
| 95 | /// Mix buffer index for decoded samples | 96 | /// Mix buffer index for decoded samples |
| 96 | s16 output_index; | 97 | s16 output_index; |
| 97 | /// Flags to control decoding (see AudioCore::AudioRenderer::VoiceInfo::Flags) | 98 | /// Flags to control decoding (see AudioCore::Renderer::VoiceInfo::Flags) |
| 98 | u16 flags; | 99 | u16 flags; |
| 99 | /// Wavebuffer sample rate | 100 | /// Wavebuffer sample rate |
| 100 | u32 sample_rate; | 101 | u32 sample_rate; |
| @@ -110,4 +111,4 @@ struct PcmFloatDataSourceVersion2Command : ICommand { | |||
| 110 | CpuAddr voice_state; | 111 | CpuAddr voice_state; |
| 111 | }; | 112 | }; |
| 112 | 113 | ||
| 113 | } // namespace AudioCore::AudioRenderer | 114 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/data_source/pcm_int16.cpp b/src/audio_core/renderer/command/data_source/pcm_int16.cpp index 7a27463e4..649993068 100644 --- a/src/audio_core/renderer/command/data_source/pcm_int16.cpp +++ b/src/audio_core/renderer/command/data_source/pcm_int16.cpp | |||
| @@ -3,13 +3,13 @@ | |||
| 3 | 3 | ||
| 4 | #include <span> | 4 | #include <span> |
| 5 | 5 | ||
| 6 | #include "audio_core/renderer/adsp/command_list_processor.h" | 6 | #include "audio_core/adsp/apps/audio_renderer/command_list_processor.h" |
| 7 | #include "audio_core/renderer/command/data_source/decode.h" | 7 | #include "audio_core/renderer/command/data_source/decode.h" |
| 8 | #include "audio_core/renderer/command/data_source/pcm_int16.h" | 8 | #include "audio_core/renderer/command/data_source/pcm_int16.h" |
| 9 | 9 | ||
| 10 | namespace AudioCore::AudioRenderer { | 10 | namespace AudioCore::Renderer { |
| 11 | 11 | ||
| 12 | void PcmInt16DataSourceVersion1Command::Dump(const ADSP::CommandListProcessor& processor, | 12 | void PcmInt16DataSourceVersion1Command::Dump(const AudioRenderer::CommandListProcessor& processor, |
| 13 | std::string& string) { | 13 | std::string& string) { |
| 14 | string += | 14 | string += |
| 15 | fmt::format("PcmInt16DataSourceVersion1Command\n\toutput_index {:02X} channel {} " | 15 | fmt::format("PcmInt16DataSourceVersion1Command\n\toutput_index {:02X} channel {} " |
| @@ -18,7 +18,8 @@ void PcmInt16DataSourceVersion1Command::Dump(const ADSP::CommandListProcessor& p | |||
| 18 | processor.target_sample_rate, src_quality); | 18 | processor.target_sample_rate, src_quality); |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | void PcmInt16DataSourceVersion1Command::Process(const ADSP::CommandListProcessor& processor) { | 21 | void PcmInt16DataSourceVersion1Command::Process( |
| 22 | const AudioRenderer::CommandListProcessor& processor) { | ||
| 22 | auto out_buffer = processor.mix_buffers.subspan(output_index * processor.sample_count, | 23 | auto out_buffer = processor.mix_buffers.subspan(output_index * processor.sample_count, |
| 23 | processor.sample_count); | 24 | processor.sample_count); |
| 24 | 25 | ||
| @@ -43,11 +44,12 @@ void PcmInt16DataSourceVersion1Command::Process(const ADSP::CommandListProcessor | |||
| 43 | DecodeFromWaveBuffers(*processor.memory, args); | 44 | DecodeFromWaveBuffers(*processor.memory, args); |
| 44 | } | 45 | } |
| 45 | 46 | ||
| 46 | bool PcmInt16DataSourceVersion1Command::Verify(const ADSP::CommandListProcessor& processor) { | 47 | bool PcmInt16DataSourceVersion1Command::Verify( |
| 48 | const AudioRenderer::CommandListProcessor& processor) { | ||
| 47 | return true; | 49 | return true; |
| 48 | } | 50 | } |
| 49 | 51 | ||
| 50 | void PcmInt16DataSourceVersion2Command::Dump(const ADSP::CommandListProcessor& processor, | 52 | void PcmInt16DataSourceVersion2Command::Dump(const AudioRenderer::CommandListProcessor& processor, |
| 51 | std::string& string) { | 53 | std::string& string) { |
| 52 | string += | 54 | string += |
| 53 | fmt::format("PcmInt16DataSourceVersion2Command\n\toutput_index {:02X} channel {} " | 55 | fmt::format("PcmInt16DataSourceVersion2Command\n\toutput_index {:02X} channel {} " |
| @@ -56,7 +58,8 @@ void PcmInt16DataSourceVersion2Command::Dump(const ADSP::CommandListProcessor& p | |||
| 56 | processor.target_sample_rate, src_quality); | 58 | processor.target_sample_rate, src_quality); |
| 57 | } | 59 | } |
| 58 | 60 | ||
| 59 | void PcmInt16DataSourceVersion2Command::Process(const ADSP::CommandListProcessor& processor) { | 61 | void PcmInt16DataSourceVersion2Command::Process( |
| 62 | const AudioRenderer::CommandListProcessor& processor) { | ||
| 60 | auto out_buffer = processor.mix_buffers.subspan(output_index * processor.sample_count, | 63 | auto out_buffer = processor.mix_buffers.subspan(output_index * processor.sample_count, |
| 61 | processor.sample_count); | 64 | processor.sample_count); |
| 62 | DecodeFromWaveBuffersArgs args{ | 65 | DecodeFromWaveBuffersArgs args{ |
| @@ -80,8 +83,9 @@ void PcmInt16DataSourceVersion2Command::Process(const ADSP::CommandListProcessor | |||
| 80 | DecodeFromWaveBuffers(*processor.memory, args); | 83 | DecodeFromWaveBuffers(*processor.memory, args); |
| 81 | } | 84 | } |
| 82 | 85 | ||
| 83 | bool PcmInt16DataSourceVersion2Command::Verify(const ADSP::CommandListProcessor& processor) { | 86 | bool PcmInt16DataSourceVersion2Command::Verify( |
| 87 | const AudioRenderer::CommandListProcessor& processor) { | ||
| 84 | return true; | 88 | return true; |
| 85 | } | 89 | } |
| 86 | 90 | ||
| 87 | } // namespace AudioCore::AudioRenderer | 91 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/data_source/pcm_int16.h b/src/audio_core/renderer/command/data_source/pcm_int16.h index 5de1ad60d..2c013f003 100644 --- a/src/audio_core/renderer/command/data_source/pcm_int16.h +++ b/src/audio_core/renderer/command/data_source/pcm_int16.h | |||
| @@ -9,11 +9,12 @@ | |||
| 9 | #include "audio_core/renderer/command/icommand.h" | 9 | #include "audio_core/renderer/command/icommand.h" |
| 10 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 11 | 11 | ||
| 12 | namespace AudioCore::AudioRenderer { | 12 | namespace AudioCore::ADSP::AudioRenderer { |
| 13 | namespace ADSP { | ||
| 14 | class CommandListProcessor; | 13 | class CommandListProcessor; |
| 15 | } | 14 | } |
| 16 | 15 | ||
| 16 | namespace AudioCore::Renderer { | ||
| 17 | |||
| 17 | /** | 18 | /** |
| 18 | * AudioRenderer command to decode PCM s16-encoded version 1 wavebuffers | 19 | * AudioRenderer command to decode PCM s16-encoded version 1 wavebuffers |
| 19 | * into the output_index mix buffer. | 20 | * into the output_index mix buffer. |
| @@ -25,14 +26,14 @@ struct PcmInt16DataSourceVersion1Command : ICommand { | |||
| 25 | * @param processor - The CommandListProcessor processing this command. | 26 | * @param processor - The CommandListProcessor processing this command. |
| 26 | * @param string - The string to print into. | 27 | * @param string - The string to print into. |
| 27 | */ | 28 | */ |
| 28 | void Dump(const ADSP::CommandListProcessor& processor, std::string& string) override; | 29 | void Dump(const AudioRenderer::CommandListProcessor& processor, std::string& string) override; |
| 29 | 30 | ||
| 30 | /** | 31 | /** |
| 31 | * Process this command. | 32 | * Process this command. |
| 32 | * | 33 | * |
| 33 | * @param processor - The CommandListProcessor processing this command. | 34 | * @param processor - The CommandListProcessor processing this command. |
| 34 | */ | 35 | */ |
| 35 | void Process(const ADSP::CommandListProcessor& processor) override; | 36 | void Process(const AudioRenderer::CommandListProcessor& processor) override; |
| 36 | 37 | ||
| 37 | /** | 38 | /** |
| 38 | * Verify this command's data is valid. | 39 | * Verify this command's data is valid. |
| @@ -40,13 +41,13 @@ struct PcmInt16DataSourceVersion1Command : ICommand { | |||
| 40 | * @param processor - The CommandListProcessor processing this command. | 41 | * @param processor - The CommandListProcessor processing this command. |
| 41 | * @return True if the command is valid, otherwise false. | 42 | * @return True if the command is valid, otherwise false. |
| 42 | */ | 43 | */ |
| 43 | bool Verify(const ADSP::CommandListProcessor& processor) override; | 44 | bool Verify(const AudioRenderer::CommandListProcessor& processor) override; |
| 44 | 45 | ||
| 45 | /// Quality used for sample rate conversion | 46 | /// Quality used for sample rate conversion |
| 46 | SrcQuality src_quality; | 47 | SrcQuality src_quality; |
| 47 | /// Mix buffer index for decoded samples | 48 | /// Mix buffer index for decoded samples |
| 48 | s16 output_index; | 49 | s16 output_index; |
| 49 | /// Flags to control decoding (see AudioCore::AudioRenderer::VoiceInfo::Flags) | 50 | /// Flags to control decoding (see AudioCore::Renderer::VoiceInfo::Flags) |
| 50 | u16 flags; | 51 | u16 flags; |
| 51 | /// Wavebuffer sample rate | 52 | /// Wavebuffer sample rate |
| 52 | u32 sample_rate; | 53 | u32 sample_rate; |
| @@ -72,26 +73,26 @@ struct PcmInt16DataSourceVersion2Command : ICommand { | |||
| 72 | * @param processor - The CommandListProcessor processing this command. | 73 | * @param processor - The CommandListProcessor processing this command. |
| 73 | * @param string - The string to print into. | 74 | * @param string - The string to print into. |
| 74 | */ | 75 | */ |
| 75 | void Dump(const ADSP::CommandListProcessor& processor, std::string& string) override; | 76 | void Dump(const AudioRenderer::CommandListProcessor& processor, std::string& string) override; |
| 76 | 77 | ||
| 77 | /** | 78 | /** |
| 78 | * Process this command. | 79 | * Process this command. |
| 79 | * @param processor - The CommandListProcessor processing this command. | 80 | * @param processor - The CommandListProcessor processing this command. |
| 80 | */ | 81 | */ |
| 81 | void Process(const ADSP::CommandListProcessor& processor) override; | 82 | void Process(const AudioRenderer::CommandListProcessor& processor) override; |
| 82 | 83 | ||
| 83 | /** | 84 | /** |
| 84 | * Verify this command's data is valid. | 85 | * Verify this command's data is valid. |
| 85 | * @param processor - The CommandListProcessor processing this command. | 86 | * @param processor - The CommandListProcessor processing this command. |
| 86 | * @return True if the command is valid, otherwise false. | 87 | * @return True if the command is valid, otherwise false. |
| 87 | */ | 88 | */ |
| 88 | bool Verify(const ADSP::CommandListProcessor& processor) override; | 89 | bool Verify(const AudioRenderer::CommandListProcessor& processor) override; |
| 89 | 90 | ||
| 90 | /// Quality used for sample rate conversion | 91 | /// Quality used for sample rate conversion |
| 91 | SrcQuality src_quality; | 92 | SrcQuality src_quality; |
| 92 | /// Mix buffer index for decoded samples | 93 | /// Mix buffer index for decoded samples |
| 93 | s16 output_index; | 94 | s16 output_index; |
| 94 | /// Flags to control decoding (see AudioCore::AudioRenderer::VoiceInfo::Flags) | 95 | /// Flags to control decoding (see AudioCore::Renderer::VoiceInfo::Flags) |
| 95 | u16 flags; | 96 | u16 flags; |
| 96 | /// Wavebuffer sample rate | 97 | /// Wavebuffer sample rate |
| 97 | u32 sample_rate; | 98 | u32 sample_rate; |
| @@ -107,4 +108,4 @@ struct PcmInt16DataSourceVersion2Command : ICommand { | |||
| 107 | CpuAddr voice_state; | 108 | CpuAddr voice_state; |
| 108 | }; | 109 | }; |
| 109 | 110 | ||
| 110 | } // namespace AudioCore::AudioRenderer | 111 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/effect/aux_.cpp b/src/audio_core/renderer/command/effect/aux_.cpp index a3e12b3e7..74d9c229f 100644 --- a/src/audio_core/renderer/command/effect/aux_.cpp +++ b/src/audio_core/renderer/command/effect/aux_.cpp | |||
| @@ -1,13 +1,13 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include "audio_core/renderer/adsp/command_list_processor.h" | 4 | #include "audio_core/adsp/apps/audio_renderer/command_list_processor.h" |
| 5 | #include "audio_core/renderer/command/effect/aux_.h" | 5 | #include "audio_core/renderer/command/effect/aux_.h" |
| 6 | #include "audio_core/renderer/effect/aux_.h" | 6 | #include "audio_core/renderer/effect/aux_.h" |
| 7 | #include "core/core.h" | 7 | #include "core/core.h" |
| 8 | #include "core/memory.h" | 8 | #include "core/memory.h" |
| 9 | 9 | ||
| 10 | namespace AudioCore::AudioRenderer { | 10 | namespace AudioCore::Renderer { |
| 11 | /** | 11 | /** |
| 12 | * Reset an AuxBuffer. | 12 | * Reset an AuxBuffer. |
| 13 | * | 13 | * |
| @@ -175,13 +175,13 @@ static u32 ReadAuxBufferDsp(Core::Memory::Memory& memory, CpuAddr return_info_, | |||
| 175 | return read_count_; | 175 | return read_count_; |
| 176 | } | 176 | } |
| 177 | 177 | ||
| 178 | void AuxCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, | 178 | void AuxCommand::Dump([[maybe_unused]] const AudioRenderer::CommandListProcessor& processor, |
| 179 | std::string& string) { | 179 | std::string& string) { |
| 180 | string += fmt::format("AuxCommand\n\tenabled {} input {:02X} output {:02X}\n", effect_enabled, | 180 | string += fmt::format("AuxCommand\n\tenabled {} input {:02X} output {:02X}\n", effect_enabled, |
| 181 | input, output); | 181 | input, output); |
| 182 | } | 182 | } |
| 183 | 183 | ||
| 184 | void AuxCommand::Process(const ADSP::CommandListProcessor& processor) { | 184 | void AuxCommand::Process(const AudioRenderer::CommandListProcessor& processor) { |
| 185 | auto input_buffer{ | 185 | auto input_buffer{ |
| 186 | processor.mix_buffers.subspan(input * processor.sample_count, processor.sample_count)}; | 186 | processor.mix_buffers.subspan(input * processor.sample_count, processor.sample_count)}; |
| 187 | auto output_buffer{ | 187 | auto output_buffer{ |
| @@ -208,8 +208,8 @@ void AuxCommand::Process(const ADSP::CommandListProcessor& processor) { | |||
| 208 | } | 208 | } |
| 209 | } | 209 | } |
| 210 | 210 | ||
| 211 | bool AuxCommand::Verify(const ADSP::CommandListProcessor& processor) { | 211 | bool AuxCommand::Verify(const AudioRenderer::CommandListProcessor& processor) { |
| 212 | return true; | 212 | return true; |
| 213 | } | 213 | } |
| 214 | 214 | ||
| 215 | } // namespace AudioCore::AudioRenderer | 215 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/effect/aux_.h b/src/audio_core/renderer/command/effect/aux_.h index 825c93732..da1e55261 100644 --- a/src/audio_core/renderer/command/effect/aux_.h +++ b/src/audio_core/renderer/command/effect/aux_.h | |||
| @@ -8,11 +8,12 @@ | |||
| 8 | #include "audio_core/renderer/command/icommand.h" | 8 | #include "audio_core/renderer/command/icommand.h" |
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | 10 | ||
| 11 | namespace AudioCore::AudioRenderer { | 11 | namespace AudioCore::ADSP::AudioRenderer { |
| 12 | namespace ADSP { | ||
| 13 | class CommandListProcessor; | 12 | class CommandListProcessor; |
| 14 | } | 13 | } |
| 15 | 14 | ||
| 15 | namespace AudioCore::Renderer { | ||
| 16 | |||
| 16 | /** | 17 | /** |
| 17 | * AudioRenderer command to read and write an auxiliary buffer, writing the input mix buffer to game | 18 | * AudioRenderer command to read and write an auxiliary buffer, writing the input mix buffer to game |
| 18 | * memory, and reading into the output buffer from game memory. | 19 | * memory, and reading into the output buffer from game memory. |
| @@ -24,14 +25,14 @@ struct AuxCommand : ICommand { | |||
| 24 | * @param processor - The CommandListProcessor processing this command. | 25 | * @param processor - The CommandListProcessor processing this command. |
| 25 | * @param string - The string to print into. | 26 | * @param string - The string to print into. |
| 26 | */ | 27 | */ |
| 27 | void Dump(const ADSP::CommandListProcessor& processor, std::string& string) override; | 28 | void Dump(const AudioRenderer::CommandListProcessor& processor, std::string& string) override; |
| 28 | 29 | ||
| 29 | /** | 30 | /** |
| 30 | * Process this command. | 31 | * Process this command. |
| 31 | * | 32 | * |
| 32 | * @param processor - The CommandListProcessor processing this command. | 33 | * @param processor - The CommandListProcessor processing this command. |
| 33 | */ | 34 | */ |
| 34 | void Process(const ADSP::CommandListProcessor& processor) override; | 35 | void Process(const AudioRenderer::CommandListProcessor& processor) override; |
| 35 | 36 | ||
| 36 | /** | 37 | /** |
| 37 | * Verify this command's data is valid. | 38 | * Verify this command's data is valid. |
| @@ -39,7 +40,7 @@ struct AuxCommand : ICommand { | |||
| 39 | * @param processor - The CommandListProcessor processing this command. | 40 | * @param processor - The CommandListProcessor processing this command. |
| 40 | * @return True if the command is valid, otherwise false. | 41 | * @return True if the command is valid, otherwise false. |
| 41 | */ | 42 | */ |
| 42 | bool Verify(const ADSP::CommandListProcessor& processor) override; | 43 | bool Verify(const AudioRenderer::CommandListProcessor& processor) override; |
| 43 | 44 | ||
| 44 | /// Input mix buffer index | 45 | /// Input mix buffer index |
| 45 | s16 input; | 46 | s16 input; |
| @@ -63,4 +64,4 @@ struct AuxCommand : ICommand { | |||
| 63 | bool effect_enabled; | 64 | bool effect_enabled; |
| 64 | }; | 65 | }; |
| 65 | 66 | ||
| 66 | } // namespace AudioCore::AudioRenderer | 67 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/effect/biquad_filter.cpp b/src/audio_core/renderer/command/effect/biquad_filter.cpp index dea6423dc..3392e7747 100644 --- a/src/audio_core/renderer/command/effect/biquad_filter.cpp +++ b/src/audio_core/renderer/command/effect/biquad_filter.cpp | |||
| @@ -1,12 +1,12 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include "audio_core/renderer/adsp/command_list_processor.h" | 4 | #include "audio_core/adsp/apps/audio_renderer/command_list_processor.h" |
| 5 | #include "audio_core/renderer/command/effect/biquad_filter.h" | 5 | #include "audio_core/renderer/command/effect/biquad_filter.h" |
| 6 | #include "audio_core/renderer/voice/voice_state.h" | 6 | #include "audio_core/renderer/voice/voice_state.h" |
| 7 | #include "common/bit_cast.h" | 7 | #include "common/bit_cast.h" |
| 8 | 8 | ||
| 9 | namespace AudioCore::AudioRenderer { | 9 | namespace AudioCore::Renderer { |
| 10 | /** | 10 | /** |
| 11 | * Biquad filter float implementation. | 11 | * Biquad filter float implementation. |
| 12 | * | 12 | * |
| @@ -76,14 +76,14 @@ static void ApplyBiquadFilterInt(std::span<s32> output, std::span<const s32> inp | |||
| 76 | } | 76 | } |
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | void BiquadFilterCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, | 79 | void BiquadFilterCommand::Dump( |
| 80 | std::string& string) { | 80 | [[maybe_unused]] const AudioRenderer::CommandListProcessor& processor, std::string& string) { |
| 81 | string += fmt::format( | 81 | string += fmt::format( |
| 82 | "BiquadFilterCommand\n\tinput {:02X} output {:02X} needs_init {} use_float_processing {}\n", | 82 | "BiquadFilterCommand\n\tinput {:02X} output {:02X} needs_init {} use_float_processing {}\n", |
| 83 | input, output, needs_init, use_float_processing); | 83 | input, output, needs_init, use_float_processing); |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | void BiquadFilterCommand::Process(const ADSP::CommandListProcessor& processor) { | 86 | void BiquadFilterCommand::Process(const AudioRenderer::CommandListProcessor& processor) { |
| 87 | auto state_{reinterpret_cast<VoiceState::BiquadFilterState*>(state)}; | 87 | auto state_{reinterpret_cast<VoiceState::BiquadFilterState*>(state)}; |
| 88 | if (needs_init) { | 88 | if (needs_init) { |
| 89 | *state_ = {}; | 89 | *state_ = {}; |
| @@ -103,8 +103,8 @@ void BiquadFilterCommand::Process(const ADSP::CommandListProcessor& processor) { | |||
| 103 | } | 103 | } |
| 104 | } | 104 | } |
| 105 | 105 | ||
| 106 | bool BiquadFilterCommand::Verify(const ADSP::CommandListProcessor& processor) { | 106 | bool BiquadFilterCommand::Verify(const AudioRenderer::CommandListProcessor& processor) { |
| 107 | return true; | 107 | return true; |
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | } // namespace AudioCore::AudioRenderer | 110 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/effect/biquad_filter.h b/src/audio_core/renderer/command/effect/biquad_filter.h index 4c9c42d29..0e903930a 100644 --- a/src/audio_core/renderer/command/effect/biquad_filter.h +++ b/src/audio_core/renderer/command/effect/biquad_filter.h | |||
| @@ -10,11 +10,12 @@ | |||
| 10 | #include "audio_core/renderer/voice/voice_state.h" | 10 | #include "audio_core/renderer/voice/voice_state.h" |
| 11 | #include "common/common_types.h" | 11 | #include "common/common_types.h" |
| 12 | 12 | ||
| 13 | namespace AudioCore::AudioRenderer { | 13 | namespace AudioCore::ADSP::AudioRenderer { |
| 14 | namespace ADSP { | ||
| 15 | class CommandListProcessor; | 14 | class CommandListProcessor; |
| 16 | } | 15 | } |
| 17 | 16 | ||
| 17 | namespace AudioCore::Renderer { | ||
| 18 | |||
| 18 | /** | 19 | /** |
| 19 | * AudioRenderer command for applying a biquad filter to the input mix buffer, saving the results to | 20 | * AudioRenderer command for applying a biquad filter to the input mix buffer, saving the results to |
| 20 | * the output mix buffer. | 21 | * the output mix buffer. |
| @@ -26,14 +27,14 @@ struct BiquadFilterCommand : ICommand { | |||
| 26 | * @param processor - The CommandListProcessor processing this command. | 27 | * @param processor - The CommandListProcessor processing this command. |
| 27 | * @param string - The string to print into. | 28 | * @param string - The string to print into. |
| 28 | */ | 29 | */ |
| 29 | void Dump(const ADSP::CommandListProcessor& processor, std::string& string) override; | 30 | void Dump(const AudioRenderer::CommandListProcessor& processor, std::string& string) override; |
| 30 | 31 | ||
| 31 | /** | 32 | /** |
| 32 | * Process this command. | 33 | * Process this command. |
| 33 | * | 34 | * |
| 34 | * @param processor - The CommandListProcessor processing this command. | 35 | * @param processor - The CommandListProcessor processing this command. |
| 35 | */ | 36 | */ |
| 36 | void Process(const ADSP::CommandListProcessor& processor) override; | 37 | void Process(const AudioRenderer::CommandListProcessor& processor) override; |
| 37 | 38 | ||
| 38 | /** | 39 | /** |
| 39 | * Verify this command's data is valid. | 40 | * Verify this command's data is valid. |
| @@ -41,7 +42,7 @@ struct BiquadFilterCommand : ICommand { | |||
| 41 | * @param processor - The CommandListProcessor processing this command. | 42 | * @param processor - The CommandListProcessor processing this command. |
| 42 | * @return True if the command is valid, otherwise false. | 43 | * @return True if the command is valid, otherwise false. |
| 43 | */ | 44 | */ |
| 44 | bool Verify(const ADSP::CommandListProcessor& processor) override; | 45 | bool Verify(const AudioRenderer::CommandListProcessor& processor) override; |
| 45 | 46 | ||
| 46 | /// Input mix buffer index | 47 | /// Input mix buffer index |
| 47 | s16 input; | 48 | s16 input; |
| @@ -71,4 +72,4 @@ void ApplyBiquadFilterFloat(std::span<s32> output, std::span<const s32> input, | |||
| 71 | std::array<s16, 3>& b, std::array<s16, 2>& a, | 72 | std::array<s16, 3>& b, std::array<s16, 2>& a, |
| 72 | VoiceState::BiquadFilterState& state, const u32 sample_count); | 73 | VoiceState::BiquadFilterState& state, const u32 sample_count); |
| 73 | 74 | ||
| 74 | } // namespace AudioCore::AudioRenderer | 75 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/effect/capture.cpp b/src/audio_core/renderer/command/effect/capture.cpp index 042fd286e..f235ce027 100644 --- a/src/audio_core/renderer/command/effect/capture.cpp +++ b/src/audio_core/renderer/command/effect/capture.cpp | |||
| @@ -1,12 +1,12 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include "audio_core/renderer/adsp/command_list_processor.h" | 4 | #include "audio_core/adsp/apps/audio_renderer/command_list_processor.h" |
| 5 | #include "audio_core/renderer/command/effect/capture.h" | 5 | #include "audio_core/renderer/command/effect/capture.h" |
| 6 | #include "audio_core/renderer/effect/aux_.h" | 6 | #include "audio_core/renderer/effect/aux_.h" |
| 7 | #include "core/memory.h" | 7 | #include "core/memory.h" |
| 8 | 8 | ||
| 9 | namespace AudioCore::AudioRenderer { | 9 | namespace AudioCore::Renderer { |
| 10 | /** | 10 | /** |
| 11 | * Reset an AuxBuffer. | 11 | * Reset an AuxBuffer. |
| 12 | * | 12 | * |
| @@ -118,13 +118,13 @@ static u32 WriteAuxBufferDsp(Core::Memory::Memory& memory, const CpuAddr send_in | |||
| 118 | return write_count_; | 118 | return write_count_; |
| 119 | } | 119 | } |
| 120 | 120 | ||
| 121 | void CaptureCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, | 121 | void CaptureCommand::Dump([[maybe_unused]] const AudioRenderer::CommandListProcessor& processor, |
| 122 | std::string& string) { | 122 | std::string& string) { |
| 123 | string += fmt::format("CaptureCommand\n\tenabled {} input {:02X} output {:02X}", effect_enabled, | 123 | string += fmt::format("CaptureCommand\n\tenabled {} input {:02X} output {:02X}", effect_enabled, |
| 124 | input, output); | 124 | input, output); |
| 125 | } | 125 | } |
| 126 | 126 | ||
| 127 | void CaptureCommand::Process(const ADSP::CommandListProcessor& processor) { | 127 | void CaptureCommand::Process(const AudioRenderer::CommandListProcessor& processor) { |
| 128 | if (effect_enabled) { | 128 | if (effect_enabled) { |
| 129 | auto input_buffer{ | 129 | auto input_buffer{ |
| 130 | processor.mix_buffers.subspan(input * processor.sample_count, processor.sample_count)}; | 130 | processor.mix_buffers.subspan(input * processor.sample_count, processor.sample_count)}; |
| @@ -135,8 +135,8 @@ void CaptureCommand::Process(const ADSP::CommandListProcessor& processor) { | |||
| 135 | } | 135 | } |
| 136 | } | 136 | } |
| 137 | 137 | ||
| 138 | bool CaptureCommand::Verify(const ADSP::CommandListProcessor& processor) { | 138 | bool CaptureCommand::Verify(const AudioRenderer::CommandListProcessor& processor) { |
| 139 | return true; | 139 | return true; |
| 140 | } | 140 | } |
| 141 | 141 | ||
| 142 | } // namespace AudioCore::AudioRenderer | 142 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/effect/capture.h b/src/audio_core/renderer/command/effect/capture.h index 8670acb24..a0016c6f6 100644 --- a/src/audio_core/renderer/command/effect/capture.h +++ b/src/audio_core/renderer/command/effect/capture.h | |||
| @@ -8,11 +8,12 @@ | |||
| 8 | #include "audio_core/renderer/command/icommand.h" | 8 | #include "audio_core/renderer/command/icommand.h" |
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | 10 | ||
| 11 | namespace AudioCore::AudioRenderer { | 11 | namespace AudioCore::ADSP::AudioRenderer { |
| 12 | namespace ADSP { | ||
| 13 | class CommandListProcessor; | 12 | class CommandListProcessor; |
| 14 | } | 13 | } |
| 15 | 14 | ||
| 15 | namespace AudioCore::Renderer { | ||
| 16 | |||
| 16 | /** | 17 | /** |
| 17 | * AudioRenderer command for capturing a mix buffer. That is, writing it back to a given game memory | 18 | * AudioRenderer command for capturing a mix buffer. That is, writing it back to a given game memory |
| 18 | * address. | 19 | * address. |
| @@ -24,14 +25,14 @@ struct CaptureCommand : ICommand { | |||
| 24 | * @param processor - The CommandListProcessor processing this command. | 25 | * @param processor - The CommandListProcessor processing this command. |
| 25 | * @param string - The string to print into. | 26 | * @param string - The string to print into. |
| 26 | */ | 27 | */ |
| 27 | void Dump(const ADSP::CommandListProcessor& processor, std::string& string) override; | 28 | void Dump(const AudioRenderer::CommandListProcessor& processor, std::string& string) override; |
| 28 | 29 | ||
| 29 | /** | 30 | /** |
| 30 | * Process this command. | 31 | * Process this command. |
| 31 | * | 32 | * |
| 32 | * @param processor - The CommandListProcessor processing this command. | 33 | * @param processor - The CommandListProcessor processing this command. |
| 33 | */ | 34 | */ |
| 34 | void Process(const ADSP::CommandListProcessor& processor) override; | 35 | void Process(const AudioRenderer::CommandListProcessor& processor) override; |
| 35 | 36 | ||
| 36 | /** | 37 | /** |
| 37 | * Verify this command's data is valid. | 38 | * Verify this command's data is valid. |
| @@ -39,7 +40,7 @@ struct CaptureCommand : ICommand { | |||
| 39 | * @param processor - The CommandListProcessor processing this command. | 40 | * @param processor - The CommandListProcessor processing this command. |
| 40 | * @return True if the command is valid, otherwise false. | 41 | * @return True if the command is valid, otherwise false. |
| 41 | */ | 42 | */ |
| 42 | bool Verify(const ADSP::CommandListProcessor& processor) override; | 43 | bool Verify(const AudioRenderer::CommandListProcessor& processor) override; |
| 43 | 44 | ||
| 44 | /// Input mix buffer index | 45 | /// Input mix buffer index |
| 45 | s16 input; | 46 | s16 input; |
| @@ -59,4 +60,4 @@ struct CaptureCommand : ICommand { | |||
| 59 | bool effect_enabled; | 60 | bool effect_enabled; |
| 60 | }; | 61 | }; |
| 61 | 62 | ||
| 62 | } // namespace AudioCore::AudioRenderer | 63 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/effect/compressor.cpp b/src/audio_core/renderer/command/effect/compressor.cpp index ee9b68d5b..7ff707f4e 100644 --- a/src/audio_core/renderer/command/effect/compressor.cpp +++ b/src/audio_core/renderer/command/effect/compressor.cpp | |||
| @@ -5,11 +5,11 @@ | |||
| 5 | #include <span> | 5 | #include <span> |
| 6 | #include <vector> | 6 | #include <vector> |
| 7 | 7 | ||
| 8 | #include "audio_core/renderer/adsp/command_list_processor.h" | 8 | #include "audio_core/adsp/apps/audio_renderer/command_list_processor.h" |
| 9 | #include "audio_core/renderer/command/effect/compressor.h" | 9 | #include "audio_core/renderer/command/effect/compressor.h" |
| 10 | #include "audio_core/renderer/effect/compressor.h" | 10 | #include "audio_core/renderer/effect/compressor.h" |
| 11 | 11 | ||
| 12 | namespace AudioCore::AudioRenderer { | 12 | namespace AudioCore::Renderer { |
| 13 | 13 | ||
| 14 | static void SetCompressorEffectParameter(const CompressorInfo::ParameterVersion2& params, | 14 | static void SetCompressorEffectParameter(const CompressorInfo::ParameterVersion2& params, |
| 15 | CompressorInfo::State& state) { | 15 | CompressorInfo::State& state) { |
| @@ -110,7 +110,7 @@ static void ApplyCompressorEffect(const CompressorInfo::ParameterVersion2& param | |||
| 110 | } | 110 | } |
| 111 | } | 111 | } |
| 112 | 112 | ||
| 113 | void CompressorCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, | 113 | void CompressorCommand::Dump([[maybe_unused]] const AudioRenderer::CommandListProcessor& processor, |
| 114 | std::string& string) { | 114 | std::string& string) { |
| 115 | string += fmt::format("CompressorCommand\n\tenabled {} \n\tinputs: ", effect_enabled); | 115 | string += fmt::format("CompressorCommand\n\tenabled {} \n\tinputs: ", effect_enabled); |
| 116 | for (s16 i = 0; i < parameter.channel_count; i++) { | 116 | for (s16 i = 0; i < parameter.channel_count; i++) { |
| @@ -123,7 +123,7 @@ void CompressorCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& | |||
| 123 | string += "\n"; | 123 | string += "\n"; |
| 124 | } | 124 | } |
| 125 | 125 | ||
| 126 | void CompressorCommand::Process(const ADSP::CommandListProcessor& processor) { | 126 | void CompressorCommand::Process(const AudioRenderer::CommandListProcessor& processor) { |
| 127 | std::array<std::span<const s32>, MaxChannels> input_buffers{}; | 127 | std::array<std::span<const s32>, MaxChannels> input_buffers{}; |
| 128 | std::array<std::span<s32>, MaxChannels> output_buffers{}; | 128 | std::array<std::span<s32>, MaxChannels> output_buffers{}; |
| 129 | 129 | ||
| @@ -148,8 +148,8 @@ void CompressorCommand::Process(const ADSP::CommandListProcessor& processor) { | |||
| 148 | processor.sample_count); | 148 | processor.sample_count); |
| 149 | } | 149 | } |
| 150 | 150 | ||
| 151 | bool CompressorCommand::Verify(const ADSP::CommandListProcessor& processor) { | 151 | bool CompressorCommand::Verify(const AudioRenderer::CommandListProcessor& processor) { |
| 152 | return true; | 152 | return true; |
| 153 | } | 153 | } |
| 154 | 154 | ||
| 155 | } // namespace AudioCore::AudioRenderer | 155 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/effect/compressor.h b/src/audio_core/renderer/command/effect/compressor.h index f8e96cb43..c011aa927 100644 --- a/src/audio_core/renderer/command/effect/compressor.h +++ b/src/audio_core/renderer/command/effect/compressor.h | |||
| @@ -10,11 +10,12 @@ | |||
| 10 | #include "audio_core/renderer/effect/compressor.h" | 10 | #include "audio_core/renderer/effect/compressor.h" |
| 11 | #include "common/common_types.h" | 11 | #include "common/common_types.h" |
| 12 | 12 | ||
| 13 | namespace AudioCore::AudioRenderer { | 13 | namespace AudioCore::ADSP::AudioRenderer { |
| 14 | namespace ADSP { | ||
| 15 | class CommandListProcessor; | 14 | class CommandListProcessor; |
| 16 | } | 15 | } |
| 17 | 16 | ||
| 17 | namespace AudioCore::Renderer { | ||
| 18 | |||
| 18 | /** | 19 | /** |
| 19 | * AudioRenderer command for limiting volume between a high and low threshold. | 20 | * AudioRenderer command for limiting volume between a high and low threshold. |
| 20 | * Version 1. | 21 | * Version 1. |
| @@ -26,14 +27,14 @@ struct CompressorCommand : ICommand { | |||
| 26 | * @param processor - The CommandListProcessor processing this command. | 27 | * @param processor - The CommandListProcessor processing this command. |
| 27 | * @param string - The string to print into. | 28 | * @param string - The string to print into. |
| 28 | */ | 29 | */ |
| 29 | void Dump(const ADSP::CommandListProcessor& processor, std::string& string) override; | 30 | void Dump(const AudioRenderer::CommandListProcessor& processor, std::string& string) override; |
| 30 | 31 | ||
| 31 | /** | 32 | /** |
| 32 | * Process this command. | 33 | * Process this command. |
| 33 | * | 34 | * |
| 34 | * @param processor - The CommandListProcessor processing this command. | 35 | * @param processor - The CommandListProcessor processing this command. |
| 35 | */ | 36 | */ |
| 36 | void Process(const ADSP::CommandListProcessor& processor) override; | 37 | void Process(const AudioRenderer::CommandListProcessor& processor) override; |
| 37 | 38 | ||
| 38 | /** | 39 | /** |
| 39 | * Verify this command's data is valid. | 40 | * Verify this command's data is valid. |
| @@ -41,7 +42,7 @@ struct CompressorCommand : ICommand { | |||
| 41 | * @param processor - The CommandListProcessor processing this command. | 42 | * @param processor - The CommandListProcessor processing this command. |
| 42 | * @return True if the command is valid, otherwise false. | 43 | * @return True if the command is valid, otherwise false. |
| 43 | */ | 44 | */ |
| 44 | bool Verify(const ADSP::CommandListProcessor& processor) override; | 45 | bool Verify(const AudioRenderer::CommandListProcessor& processor) override; |
| 45 | 46 | ||
| 46 | /// Input mix buffer offsets for each channel | 47 | /// Input mix buffer offsets for each channel |
| 47 | std::array<s16, MaxChannels> inputs; | 48 | std::array<s16, MaxChannels> inputs; |
| @@ -57,4 +58,4 @@ struct CompressorCommand : ICommand { | |||
| 57 | bool effect_enabled; | 58 | bool effect_enabled; |
| 58 | }; | 59 | }; |
| 59 | 60 | ||
| 60 | } // namespace AudioCore::AudioRenderer | 61 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/effect/delay.cpp b/src/audio_core/renderer/command/effect/delay.cpp index e536cbb1e..ffb298c07 100644 --- a/src/audio_core/renderer/command/effect/delay.cpp +++ b/src/audio_core/renderer/command/effect/delay.cpp | |||
| @@ -1,10 +1,10 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include "audio_core/renderer/adsp/command_list_processor.h" | 4 | #include "audio_core/adsp/apps/audio_renderer/command_list_processor.h" |
| 5 | #include "audio_core/renderer/command/effect/delay.h" | 5 | #include "audio_core/renderer/command/effect/delay.h" |
| 6 | 6 | ||
| 7 | namespace AudioCore::AudioRenderer { | 7 | namespace AudioCore::Renderer { |
| 8 | /** | 8 | /** |
| 9 | * Update the DelayInfo state according to the given parameters. | 9 | * Update the DelayInfo state according to the given parameters. |
| 10 | * | 10 | * |
| @@ -194,7 +194,7 @@ static void ApplyDelayEffect(const DelayInfo::ParameterVersion1& params, DelayIn | |||
| 194 | } | 194 | } |
| 195 | } | 195 | } |
| 196 | 196 | ||
| 197 | void DelayCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, | 197 | void DelayCommand::Dump([[maybe_unused]] const AudioRenderer::CommandListProcessor& processor, |
| 198 | std::string& string) { | 198 | std::string& string) { |
| 199 | string += fmt::format("DelayCommand\n\tenabled {} \n\tinputs: ", effect_enabled); | 199 | string += fmt::format("DelayCommand\n\tenabled {} \n\tinputs: ", effect_enabled); |
| 200 | for (u32 i = 0; i < MaxChannels; i++) { | 200 | for (u32 i = 0; i < MaxChannels; i++) { |
| @@ -207,7 +207,7 @@ void DelayCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& proce | |||
| 207 | string += "\n"; | 207 | string += "\n"; |
| 208 | } | 208 | } |
| 209 | 209 | ||
| 210 | void DelayCommand::Process(const ADSP::CommandListProcessor& processor) { | 210 | void DelayCommand::Process(const AudioRenderer::CommandListProcessor& processor) { |
| 211 | std::array<std::span<const s32>, MaxChannels> input_buffers{}; | 211 | std::array<std::span<const s32>, MaxChannels> input_buffers{}; |
| 212 | std::array<std::span<s32>, MaxChannels> output_buffers{}; | 212 | std::array<std::span<s32>, MaxChannels> output_buffers{}; |
| 213 | 213 | ||
| @@ -231,8 +231,8 @@ void DelayCommand::Process(const ADSP::CommandListProcessor& processor) { | |||
| 231 | processor.sample_count); | 231 | processor.sample_count); |
| 232 | } | 232 | } |
| 233 | 233 | ||
| 234 | bool DelayCommand::Verify(const ADSP::CommandListProcessor& processor) { | 234 | bool DelayCommand::Verify(const AudioRenderer::CommandListProcessor& processor) { |
| 235 | return true; | 235 | return true; |
| 236 | } | 236 | } |
| 237 | 237 | ||
| 238 | } // namespace AudioCore::AudioRenderer | 238 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/effect/delay.h b/src/audio_core/renderer/command/effect/delay.h index b7a15ae6b..bfeac7af4 100644 --- a/src/audio_core/renderer/command/effect/delay.h +++ b/src/audio_core/renderer/command/effect/delay.h | |||
| @@ -10,11 +10,12 @@ | |||
| 10 | #include "audio_core/renderer/effect/delay.h" | 10 | #include "audio_core/renderer/effect/delay.h" |
| 11 | #include "common/common_types.h" | 11 | #include "common/common_types.h" |
| 12 | 12 | ||
| 13 | namespace AudioCore::AudioRenderer { | 13 | namespace AudioCore::ADSP::AudioRenderer { |
| 14 | namespace ADSP { | ||
| 15 | class CommandListProcessor; | 14 | class CommandListProcessor; |
| 16 | } | 15 | } |
| 17 | 16 | ||
| 17 | namespace AudioCore::Renderer { | ||
| 18 | |||
| 18 | /** | 19 | /** |
| 19 | * AudioRenderer command for a delay effect. Delays inputs mix buffers according to the parameters | 20 | * AudioRenderer command for a delay effect. Delays inputs mix buffers according to the parameters |
| 20 | * and state, outputs receives the delayed samples. | 21 | * and state, outputs receives the delayed samples. |
| @@ -26,14 +27,14 @@ struct DelayCommand : ICommand { | |||
| 26 | * @param processor - The CommandListProcessor processing this command. | 27 | * @param processor - The CommandListProcessor processing this command. |
| 27 | * @param string - The string to print into. | 28 | * @param string - The string to print into. |
| 28 | */ | 29 | */ |
| 29 | void Dump(const ADSP::CommandListProcessor& processor, std::string& string) override; | 30 | void Dump(const AudioRenderer::CommandListProcessor& processor, std::string& string) override; |
| 30 | 31 | ||
| 31 | /** | 32 | /** |
| 32 | * Process this command. | 33 | * Process this command. |
| 33 | * | 34 | * |
| 34 | * @param processor - The CommandListProcessor processing this command. | 35 | * @param processor - The CommandListProcessor processing this command. |
| 35 | */ | 36 | */ |
| 36 | void Process(const ADSP::CommandListProcessor& processor) override; | 37 | void Process(const AudioRenderer::CommandListProcessor& processor) override; |
| 37 | 38 | ||
| 38 | /** | 39 | /** |
| 39 | * Verify this command's data is valid. | 40 | * Verify this command's data is valid. |
| @@ -41,7 +42,7 @@ struct DelayCommand : ICommand { | |||
| 41 | * @param processor - The CommandListProcessor processing this command. | 42 | * @param processor - The CommandListProcessor processing this command. |
| 42 | * @return True if the command is valid, otherwise false. | 43 | * @return True if the command is valid, otherwise false. |
| 43 | */ | 44 | */ |
| 44 | bool Verify(const ADSP::CommandListProcessor& processor) override; | 45 | bool Verify(const AudioRenderer::CommandListProcessor& processor) override; |
| 45 | 46 | ||
| 46 | /// Input mix buffer offsets for each channel | 47 | /// Input mix buffer offsets for each channel |
| 47 | std::array<s16, MaxChannels> inputs; | 48 | std::array<s16, MaxChannels> inputs; |
| @@ -57,4 +58,4 @@ struct DelayCommand : ICommand { | |||
| 57 | bool effect_enabled; | 58 | bool effect_enabled; |
| 58 | }; | 59 | }; |
| 59 | 60 | ||
| 60 | } // namespace AudioCore::AudioRenderer | 61 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/effect/i3dl2_reverb.cpp b/src/audio_core/renderer/command/effect/i3dl2_reverb.cpp index d2bfb67cc..ecfdfabc6 100644 --- a/src/audio_core/renderer/command/effect/i3dl2_reverb.cpp +++ b/src/audio_core/renderer/command/effect/i3dl2_reverb.cpp | |||
| @@ -3,11 +3,11 @@ | |||
| 3 | 3 | ||
| 4 | #include <numbers> | 4 | #include <numbers> |
| 5 | 5 | ||
| 6 | #include "audio_core/renderer/adsp/command_list_processor.h" | 6 | #include "audio_core/adsp/apps/audio_renderer/command_list_processor.h" |
| 7 | #include "audio_core/renderer/command/effect/i3dl2_reverb.h" | 7 | #include "audio_core/renderer/command/effect/i3dl2_reverb.h" |
| 8 | #include "common/polyfill_ranges.h" | 8 | #include "common/polyfill_ranges.h" |
| 9 | 9 | ||
| 10 | namespace AudioCore::AudioRenderer { | 10 | namespace AudioCore::Renderer { |
| 11 | 11 | ||
| 12 | constexpr std::array<f32, I3dl2ReverbInfo::MaxDelayLines> MinDelayLineTimes{ | 12 | constexpr std::array<f32, I3dl2ReverbInfo::MaxDelayLines> MinDelayLineTimes{ |
| 13 | 5.0f, | 13 | 5.0f, |
| @@ -394,7 +394,7 @@ static void ApplyI3dl2ReverbEffect(const I3dl2ReverbInfo::ParameterVersion1& par | |||
| 394 | } | 394 | } |
| 395 | } | 395 | } |
| 396 | 396 | ||
| 397 | void I3dl2ReverbCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, | 397 | void I3dl2ReverbCommand::Dump([[maybe_unused]] const AudioRenderer::CommandListProcessor& processor, |
| 398 | std::string& string) { | 398 | std::string& string) { |
| 399 | string += fmt::format("I3dl2ReverbCommand\n\tenabled {} \n\tinputs: ", effect_enabled); | 399 | string += fmt::format("I3dl2ReverbCommand\n\tenabled {} \n\tinputs: ", effect_enabled); |
| 400 | for (u32 i = 0; i < parameter.channel_count; i++) { | 400 | for (u32 i = 0; i < parameter.channel_count; i++) { |
| @@ -407,7 +407,7 @@ void I3dl2ReverbCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& | |||
| 407 | string += "\n"; | 407 | string += "\n"; |
| 408 | } | 408 | } |
| 409 | 409 | ||
| 410 | void I3dl2ReverbCommand::Process(const ADSP::CommandListProcessor& processor) { | 410 | void I3dl2ReverbCommand::Process(const AudioRenderer::CommandListProcessor& processor) { |
| 411 | std::array<std::span<const s32>, MaxChannels> input_buffers{}; | 411 | std::array<std::span<const s32>, MaxChannels> input_buffers{}; |
| 412 | std::array<std::span<s32>, MaxChannels> output_buffers{}; | 412 | std::array<std::span<s32>, MaxChannels> output_buffers{}; |
| 413 | 413 | ||
| @@ -431,8 +431,8 @@ void I3dl2ReverbCommand::Process(const ADSP::CommandListProcessor& processor) { | |||
| 431 | processor.sample_count); | 431 | processor.sample_count); |
| 432 | } | 432 | } |
| 433 | 433 | ||
| 434 | bool I3dl2ReverbCommand::Verify(const ADSP::CommandListProcessor& processor) { | 434 | bool I3dl2ReverbCommand::Verify(const AudioRenderer::CommandListProcessor& processor) { |
| 435 | return true; | 435 | return true; |
| 436 | } | 436 | } |
| 437 | 437 | ||
| 438 | } // namespace AudioCore::AudioRenderer | 438 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/effect/i3dl2_reverb.h b/src/audio_core/renderer/command/effect/i3dl2_reverb.h index 243877056..e4c538ae8 100644 --- a/src/audio_core/renderer/command/effect/i3dl2_reverb.h +++ b/src/audio_core/renderer/command/effect/i3dl2_reverb.h | |||
| @@ -10,11 +10,12 @@ | |||
| 10 | #include "audio_core/renderer/effect/i3dl2.h" | 10 | #include "audio_core/renderer/effect/i3dl2.h" |
| 11 | #include "common/common_types.h" | 11 | #include "common/common_types.h" |
| 12 | 12 | ||
| 13 | namespace AudioCore::AudioRenderer { | 13 | namespace AudioCore::ADSP::AudioRenderer { |
| 14 | namespace ADSP { | ||
| 15 | class CommandListProcessor; | 14 | class CommandListProcessor; |
| 16 | } | 15 | } |
| 17 | 16 | ||
| 17 | namespace AudioCore::Renderer { | ||
| 18 | |||
| 18 | /** | 19 | /** |
| 19 | * AudioRenderer command for a I3DL2Reverb effect. Apply a reverb to inputs mix buffer according to | 20 | * AudioRenderer command for a I3DL2Reverb effect. Apply a reverb to inputs mix buffer according to |
| 20 | * the I3DL2 spec, outputs receives the results. | 21 | * the I3DL2 spec, outputs receives the results. |
| @@ -26,14 +27,14 @@ struct I3dl2ReverbCommand : ICommand { | |||
| 26 | * @param processor - The CommandListProcessor processing this command. | 27 | * @param processor - The CommandListProcessor processing this command. |
| 27 | * @param string - The string to print into. | 28 | * @param string - The string to print into. |
| 28 | */ | 29 | */ |
| 29 | void Dump(const ADSP::CommandListProcessor& processor, std::string& string) override; | 30 | void Dump(const AudioRenderer::CommandListProcessor& processor, std::string& string) override; |
| 30 | 31 | ||
| 31 | /** | 32 | /** |
| 32 | * Process this command. | 33 | * Process this command. |
| 33 | * | 34 | * |
| 34 | * @param processor - The CommandListProcessor processing this command. | 35 | * @param processor - The CommandListProcessor processing this command. |
| 35 | */ | 36 | */ |
| 36 | void Process(const ADSP::CommandListProcessor& processor) override; | 37 | void Process(const AudioRenderer::CommandListProcessor& processor) override; |
| 37 | 38 | ||
| 38 | /** | 39 | /** |
| 39 | * Verify this command's data is valid. | 40 | * Verify this command's data is valid. |
| @@ -41,7 +42,7 @@ struct I3dl2ReverbCommand : ICommand { | |||
| 41 | * @param processor - The CommandListProcessor processing this command. | 42 | * @param processor - The CommandListProcessor processing this command. |
| 42 | * @return True if the command is valid, otherwise false. | 43 | * @return True if the command is valid, otherwise false. |
| 43 | */ | 44 | */ |
| 44 | bool Verify(const ADSP::CommandListProcessor& processor) override; | 45 | bool Verify(const AudioRenderer::CommandListProcessor& processor) override; |
| 45 | 46 | ||
| 46 | /// Input mix buffer offsets for each channel | 47 | /// Input mix buffer offsets for each channel |
| 47 | std::array<s16, MaxChannels> inputs; | 48 | std::array<s16, MaxChannels> inputs; |
| @@ -57,4 +58,4 @@ struct I3dl2ReverbCommand : ICommand { | |||
| 57 | bool effect_enabled; | 58 | bool effect_enabled; |
| 58 | }; | 59 | }; |
| 59 | 60 | ||
| 60 | } // namespace AudioCore::AudioRenderer | 61 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/effect/light_limiter.cpp b/src/audio_core/renderer/command/effect/light_limiter.cpp index 4161a9821..63aa06f5c 100644 --- a/src/audio_core/renderer/command/effect/light_limiter.cpp +++ b/src/audio_core/renderer/command/effect/light_limiter.cpp | |||
| @@ -1,10 +1,10 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include "audio_core/renderer/adsp/command_list_processor.h" | 4 | #include "audio_core/adsp/apps/audio_renderer/command_list_processor.h" |
| 5 | #include "audio_core/renderer/command/effect/light_limiter.h" | 5 | #include "audio_core/renderer/command/effect/light_limiter.h" |
| 6 | 6 | ||
| 7 | namespace AudioCore::AudioRenderer { | 7 | namespace AudioCore::Renderer { |
| 8 | /** | 8 | /** |
| 9 | * Update the LightLimiterInfo state according to the given parameters. | 9 | * Update the LightLimiterInfo state according to the given parameters. |
| 10 | * A no-op. | 10 | * A no-op. |
| @@ -133,8 +133,8 @@ static void ApplyLightLimiterEffect(const LightLimiterInfo::ParameterVersion2& p | |||
| 133 | } | 133 | } |
| 134 | } | 134 | } |
| 135 | 135 | ||
| 136 | void LightLimiterVersion1Command::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, | 136 | void LightLimiterVersion1Command::Dump( |
| 137 | std::string& string) { | 137 | [[maybe_unused]] const AudioRenderer::CommandListProcessor& processor, std::string& string) { |
| 138 | string += fmt::format("LightLimiterVersion1Command\n\tinputs: "); | 138 | string += fmt::format("LightLimiterVersion1Command\n\tinputs: "); |
| 139 | for (u32 i = 0; i < MaxChannels; i++) { | 139 | for (u32 i = 0; i < MaxChannels; i++) { |
| 140 | string += fmt::format("{:02X}, ", inputs[i]); | 140 | string += fmt::format("{:02X}, ", inputs[i]); |
| @@ -146,7 +146,7 @@ void LightLimiterVersion1Command::Dump([[maybe_unused]] const ADSP::CommandListP | |||
| 146 | string += "\n"; | 146 | string += "\n"; |
| 147 | } | 147 | } |
| 148 | 148 | ||
| 149 | void LightLimiterVersion1Command::Process(const ADSP::CommandListProcessor& processor) { | 149 | void LightLimiterVersion1Command::Process(const AudioRenderer::CommandListProcessor& processor) { |
| 150 | std::array<std::span<const s32>, MaxChannels> input_buffers{}; | 150 | std::array<std::span<const s32>, MaxChannels> input_buffers{}; |
| 151 | std::array<std::span<s32>, MaxChannels> output_buffers{}; | 151 | std::array<std::span<s32>, MaxChannels> output_buffers{}; |
| 152 | 152 | ||
| @@ -172,12 +172,12 @@ void LightLimiterVersion1Command::Process(const ADSP::CommandListProcessor& proc | |||
| 172 | processor.sample_count, statistics); | 172 | processor.sample_count, statistics); |
| 173 | } | 173 | } |
| 174 | 174 | ||
| 175 | bool LightLimiterVersion1Command::Verify(const ADSP::CommandListProcessor& processor) { | 175 | bool LightLimiterVersion1Command::Verify(const AudioRenderer::CommandListProcessor& processor) { |
| 176 | return true; | 176 | return true; |
| 177 | } | 177 | } |
| 178 | 178 | ||
| 179 | void LightLimiterVersion2Command::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, | 179 | void LightLimiterVersion2Command::Dump( |
| 180 | std::string& string) { | 180 | [[maybe_unused]] const AudioRenderer::CommandListProcessor& processor, std::string& string) { |
| 181 | string += fmt::format("LightLimiterVersion2Command\n\tinputs: \n"); | 181 | string += fmt::format("LightLimiterVersion2Command\n\tinputs: \n"); |
| 182 | for (u32 i = 0; i < MaxChannels; i++) { | 182 | for (u32 i = 0; i < MaxChannels; i++) { |
| 183 | string += fmt::format("{:02X}, ", inputs[i]); | 183 | string += fmt::format("{:02X}, ", inputs[i]); |
| @@ -189,7 +189,7 @@ void LightLimiterVersion2Command::Dump([[maybe_unused]] const ADSP::CommandListP | |||
| 189 | string += "\n"; | 189 | string += "\n"; |
| 190 | } | 190 | } |
| 191 | 191 | ||
| 192 | void LightLimiterVersion2Command::Process(const ADSP::CommandListProcessor& processor) { | 192 | void LightLimiterVersion2Command::Process(const AudioRenderer::CommandListProcessor& processor) { |
| 193 | std::array<std::span<const s32>, MaxChannels> input_buffers{}; | 193 | std::array<std::span<const s32>, MaxChannels> input_buffers{}; |
| 194 | std::array<std::span<s32>, MaxChannels> output_buffers{}; | 194 | std::array<std::span<s32>, MaxChannels> output_buffers{}; |
| 195 | 195 | ||
| @@ -215,8 +215,8 @@ void LightLimiterVersion2Command::Process(const ADSP::CommandListProcessor& proc | |||
| 215 | processor.sample_count, statistics); | 215 | processor.sample_count, statistics); |
| 216 | } | 216 | } |
| 217 | 217 | ||
| 218 | bool LightLimiterVersion2Command::Verify(const ADSP::CommandListProcessor& processor) { | 218 | bool LightLimiterVersion2Command::Verify(const AudioRenderer::CommandListProcessor& processor) { |
| 219 | return true; | 219 | return true; |
| 220 | } | 220 | } |
| 221 | 221 | ||
| 222 | } // namespace AudioCore::AudioRenderer | 222 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/effect/light_limiter.h b/src/audio_core/renderer/command/effect/light_limiter.h index 5d98272c7..6e3ee1b53 100644 --- a/src/audio_core/renderer/command/effect/light_limiter.h +++ b/src/audio_core/renderer/command/effect/light_limiter.h | |||
| @@ -10,11 +10,12 @@ | |||
| 10 | #include "audio_core/renderer/effect/light_limiter.h" | 10 | #include "audio_core/renderer/effect/light_limiter.h" |
| 11 | #include "common/common_types.h" | 11 | #include "common/common_types.h" |
| 12 | 12 | ||
| 13 | namespace AudioCore::AudioRenderer { | 13 | namespace AudioCore::ADSP::AudioRenderer { |
| 14 | namespace ADSP { | ||
| 15 | class CommandListProcessor; | 14 | class CommandListProcessor; |
| 16 | } | 15 | } |
| 17 | 16 | ||
| 17 | namespace AudioCore::Renderer { | ||
| 18 | |||
| 18 | /** | 19 | /** |
| 19 | * AudioRenderer command for limiting volume between a high and low threshold. | 20 | * AudioRenderer command for limiting volume between a high and low threshold. |
| 20 | * Version 1. | 21 | * Version 1. |
| @@ -26,14 +27,14 @@ struct LightLimiterVersion1Command : ICommand { | |||
| 26 | * @param processor - The CommandListProcessor processing this command. | 27 | * @param processor - The CommandListProcessor processing this command. |
| 27 | * @param string - The string to print into. | 28 | * @param string - The string to print into. |
| 28 | */ | 29 | */ |
| 29 | void Dump(const ADSP::CommandListProcessor& processor, std::string& string) override; | 30 | void Dump(const AudioRenderer::CommandListProcessor& processor, std::string& string) override; |
| 30 | 31 | ||
| 31 | /** | 32 | /** |
| 32 | * Process this command. | 33 | * Process this command. |
| 33 | * | 34 | * |
| 34 | * @param processor - The CommandListProcessor processing this command. | 35 | * @param processor - The CommandListProcessor processing this command. |
| 35 | */ | 36 | */ |
| 36 | void Process(const ADSP::CommandListProcessor& processor) override; | 37 | void Process(const AudioRenderer::CommandListProcessor& processor) override; |
| 37 | 38 | ||
| 38 | /** | 39 | /** |
| 39 | * Verify this command's data is valid. | 40 | * Verify this command's data is valid. |
| @@ -41,7 +42,7 @@ struct LightLimiterVersion1Command : ICommand { | |||
| 41 | * @param processor - The CommandListProcessor processing this command. | 42 | * @param processor - The CommandListProcessor processing this command. |
| 42 | * @return True if the command is valid, otherwise false. | 43 | * @return True if the command is valid, otherwise false. |
| 43 | */ | 44 | */ |
| 44 | bool Verify(const ADSP::CommandListProcessor& processor) override; | 45 | bool Verify(const AudioRenderer::CommandListProcessor& processor) override; |
| 45 | 46 | ||
| 46 | /// Input mix buffer offsets for each channel | 47 | /// Input mix buffer offsets for each channel |
| 47 | std::array<s16, MaxChannels> inputs; | 48 | std::array<s16, MaxChannels> inputs; |
| @@ -68,21 +69,21 @@ struct LightLimiterVersion2Command : ICommand { | |||
| 68 | * @param processor - The CommandListProcessor processing this command. | 69 | * @param processor - The CommandListProcessor processing this command. |
| 69 | * @param string - The string to print into. | 70 | * @param string - The string to print into. |
| 70 | */ | 71 | */ |
| 71 | void Dump(const ADSP::CommandListProcessor& processor, std::string& string) override; | 72 | void Dump(const AudioRenderer::CommandListProcessor& processor, std::string& string) override; |
| 72 | 73 | ||
| 73 | /** | 74 | /** |
| 74 | * Process this command. | 75 | * Process this command. |
| 75 | * | 76 | * |
| 76 | * @param processor - The CommandListProcessor processing this command. | 77 | * @param processor - The CommandListProcessor processing this command. |
| 77 | */ | 78 | */ |
| 78 | void Process(const ADSP::CommandListProcessor& processor) override; | 79 | void Process(const AudioRenderer::CommandListProcessor& processor) override; |
| 79 | 80 | ||
| 80 | /** | 81 | /** |
| 81 | * Verify this command's data is valid. | 82 | * Verify this command's data is valid. |
| 82 | * | 83 | * |
| 83 | * @param processor - The CommandListProcessor processing this command. | 84 | * @param processor - The CommandListProcessor processing this command. |
| 84 | */ | 85 | */ |
| 85 | bool Verify(const ADSP::CommandListProcessor& processor) override; | 86 | bool Verify(const AudioRenderer::CommandListProcessor& processor) override; |
| 86 | 87 | ||
| 87 | /// Input mix buffer offsets for each channel | 88 | /// Input mix buffer offsets for each channel |
| 88 | std::array<s16, MaxChannels> inputs; | 89 | std::array<s16, MaxChannels> inputs; |
| @@ -100,4 +101,4 @@ struct LightLimiterVersion2Command : ICommand { | |||
| 100 | bool effect_enabled; | 101 | bool effect_enabled; |
| 101 | }; | 102 | }; |
| 102 | 103 | ||
| 103 | } // namespace AudioCore::AudioRenderer | 104 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/effect/multi_tap_biquad_filter.cpp b/src/audio_core/renderer/command/effect/multi_tap_biquad_filter.cpp index 48a7cba8a..208bbeaf2 100644 --- a/src/audio_core/renderer/command/effect/multi_tap_biquad_filter.cpp +++ b/src/audio_core/renderer/command/effect/multi_tap_biquad_filter.cpp | |||
| @@ -1,20 +1,20 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include "audio_core/renderer/adsp/command_list_processor.h" | 4 | #include "audio_core/adsp/apps/audio_renderer/command_list_processor.h" |
| 5 | #include "audio_core/renderer/command/effect/biquad_filter.h" | 5 | #include "audio_core/renderer/command/effect/biquad_filter.h" |
| 6 | #include "audio_core/renderer/command/effect/multi_tap_biquad_filter.h" | 6 | #include "audio_core/renderer/command/effect/multi_tap_biquad_filter.h" |
| 7 | 7 | ||
| 8 | namespace AudioCore::AudioRenderer { | 8 | namespace AudioCore::Renderer { |
| 9 | 9 | ||
| 10 | void MultiTapBiquadFilterCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, | 10 | void MultiTapBiquadFilterCommand::Dump( |
| 11 | std::string& string) { | 11 | [[maybe_unused]] const AudioRenderer::CommandListProcessor& processor, std::string& string) { |
| 12 | string += fmt::format( | 12 | string += fmt::format( |
| 13 | "MultiTapBiquadFilterCommand\n\tinput {:02X}\n\toutput {:02X}\n\tneeds_init ({}, {})\n", | 13 | "MultiTapBiquadFilterCommand\n\tinput {:02X}\n\toutput {:02X}\n\tneeds_init ({}, {})\n", |
| 14 | input, output, needs_init[0], needs_init[1]); | 14 | input, output, needs_init[0], needs_init[1]); |
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | void MultiTapBiquadFilterCommand::Process(const ADSP::CommandListProcessor& processor) { | 17 | void MultiTapBiquadFilterCommand::Process(const AudioRenderer::CommandListProcessor& processor) { |
| 18 | if (filter_tap_count > MaxBiquadFilters) { | 18 | if (filter_tap_count > MaxBiquadFilters) { |
| 19 | LOG_ERROR(Service_Audio, "Too many filter taps! {}", filter_tap_count); | 19 | LOG_ERROR(Service_Audio, "Too many filter taps! {}", filter_tap_count); |
| 20 | filter_tap_count = MaxBiquadFilters; | 20 | filter_tap_count = MaxBiquadFilters; |
| @@ -38,8 +38,8 @@ void MultiTapBiquadFilterCommand::Process(const ADSP::CommandListProcessor& proc | |||
| 38 | } | 38 | } |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | bool MultiTapBiquadFilterCommand::Verify(const ADSP::CommandListProcessor& processor) { | 41 | bool MultiTapBiquadFilterCommand::Verify(const AudioRenderer::CommandListProcessor& processor) { |
| 42 | return true; | 42 | return true; |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | } // namespace AudioCore::AudioRenderer | 45 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/effect/multi_tap_biquad_filter.h b/src/audio_core/renderer/command/effect/multi_tap_biquad_filter.h index 99c2c0830..50fce80b0 100644 --- a/src/audio_core/renderer/command/effect/multi_tap_biquad_filter.h +++ b/src/audio_core/renderer/command/effect/multi_tap_biquad_filter.h | |||
| @@ -10,11 +10,12 @@ | |||
| 10 | #include "audio_core/renderer/voice/voice_info.h" | 10 | #include "audio_core/renderer/voice/voice_info.h" |
| 11 | #include "common/common_types.h" | 11 | #include "common/common_types.h" |
| 12 | 12 | ||
| 13 | namespace AudioCore::AudioRenderer { | 13 | namespace AudioCore::ADSP::AudioRenderer { |
| 14 | namespace ADSP { | ||
| 15 | class CommandListProcessor; | 14 | class CommandListProcessor; |
| 16 | } | 15 | } |
| 17 | 16 | ||
| 17 | namespace AudioCore::Renderer { | ||
| 18 | |||
| 18 | /** | 19 | /** |
| 19 | * AudioRenderer command for applying multiple biquads at once. | 20 | * AudioRenderer command for applying multiple biquads at once. |
| 20 | */ | 21 | */ |
| @@ -25,14 +26,14 @@ struct MultiTapBiquadFilterCommand : ICommand { | |||
| 25 | * @param processor - The CommandListProcessor processing this command. | 26 | * @param processor - The CommandListProcessor processing this command. |
| 26 | * @param string - The string to print into. | 27 | * @param string - The string to print into. |
| 27 | */ | 28 | */ |
| 28 | void Dump(const ADSP::CommandListProcessor& processor, std::string& string) override; | 29 | void Dump(const AudioRenderer::CommandListProcessor& processor, std::string& string) override; |
| 29 | 30 | ||
| 30 | /** | 31 | /** |
| 31 | * Process this command. | 32 | * Process this command. |
| 32 | * | 33 | * |
| 33 | * @param processor - The CommandListProcessor processing this command. | 34 | * @param processor - The CommandListProcessor processing this command. |
| 34 | */ | 35 | */ |
| 35 | void Process(const ADSP::CommandListProcessor& processor) override; | 36 | void Process(const AudioRenderer::CommandListProcessor& processor) override; |
| 36 | 37 | ||
| 37 | /** | 38 | /** |
| 38 | * Verify this command's data is valid. | 39 | * Verify this command's data is valid. |
| @@ -40,7 +41,7 @@ struct MultiTapBiquadFilterCommand : ICommand { | |||
| 40 | * @param processor - The CommandListProcessor processing this command. | 41 | * @param processor - The CommandListProcessor processing this command. |
| 41 | * @return True if the command is valid, otherwise false. | 42 | * @return True if the command is valid, otherwise false. |
| 42 | */ | 43 | */ |
| 43 | bool Verify(const ADSP::CommandListProcessor& processor) override; | 44 | bool Verify(const AudioRenderer::CommandListProcessor& processor) override; |
| 44 | 45 | ||
| 45 | /// Input mix buffer index | 46 | /// Input mix buffer index |
| 46 | s16 input; | 47 | s16 input; |
| @@ -56,4 +57,4 @@ struct MultiTapBiquadFilterCommand : ICommand { | |||
| 56 | u8 filter_tap_count; | 57 | u8 filter_tap_count; |
| 57 | }; | 58 | }; |
| 58 | 59 | ||
| 59 | } // namespace AudioCore::AudioRenderer | 60 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/effect/reverb.cpp b/src/audio_core/renderer/command/effect/reverb.cpp index fc2f15a5e..7f152a962 100644 --- a/src/audio_core/renderer/command/effect/reverb.cpp +++ b/src/audio_core/renderer/command/effect/reverb.cpp | |||
| @@ -4,11 +4,11 @@ | |||
| 4 | #include <numbers> | 4 | #include <numbers> |
| 5 | #include <ranges> | 5 | #include <ranges> |
| 6 | 6 | ||
| 7 | #include "audio_core/renderer/adsp/command_list_processor.h" | 7 | #include "audio_core/adsp/apps/audio_renderer/command_list_processor.h" |
| 8 | #include "audio_core/renderer/command/effect/reverb.h" | 8 | #include "audio_core/renderer/command/effect/reverb.h" |
| 9 | #include "common/polyfill_ranges.h" | 9 | #include "common/polyfill_ranges.h" |
| 10 | 10 | ||
| 11 | namespace AudioCore::AudioRenderer { | 11 | namespace AudioCore::Renderer { |
| 12 | 12 | ||
| 13 | constexpr std::array<f32, ReverbInfo::MaxDelayLines> FdnMaxDelayLineTimes = { | 13 | constexpr std::array<f32, ReverbInfo::MaxDelayLines> FdnMaxDelayLineTimes = { |
| 14 | 53.9532470703125f, | 14 | 53.9532470703125f, |
| @@ -396,7 +396,7 @@ static void ApplyReverbEffect(const ReverbInfo::ParameterVersion2& params, Rever | |||
| 396 | } | 396 | } |
| 397 | } | 397 | } |
| 398 | 398 | ||
| 399 | void ReverbCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, | 399 | void ReverbCommand::Dump([[maybe_unused]] const AudioRenderer::CommandListProcessor& processor, |
| 400 | std::string& string) { | 400 | std::string& string) { |
| 401 | string += fmt::format( | 401 | string += fmt::format( |
| 402 | "ReverbCommand\n\tenabled {} long_size_pre_delay_supported {}\n\tinputs: ", effect_enabled, | 402 | "ReverbCommand\n\tenabled {} long_size_pre_delay_supported {}\n\tinputs: ", effect_enabled, |
| @@ -411,7 +411,7 @@ void ReverbCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& proc | |||
| 411 | string += "\n"; | 411 | string += "\n"; |
| 412 | } | 412 | } |
| 413 | 413 | ||
| 414 | void ReverbCommand::Process(const ADSP::CommandListProcessor& processor) { | 414 | void ReverbCommand::Process(const AudioRenderer::CommandListProcessor& processor) { |
| 415 | std::array<std::span<const s32>, MaxChannels> input_buffers{}; | 415 | std::array<std::span<const s32>, MaxChannels> input_buffers{}; |
| 416 | std::array<std::span<s32>, MaxChannels> output_buffers{}; | 416 | std::array<std::span<s32>, MaxChannels> output_buffers{}; |
| 417 | 417 | ||
| @@ -435,8 +435,8 @@ void ReverbCommand::Process(const ADSP::CommandListProcessor& processor) { | |||
| 435 | processor.sample_count); | 435 | processor.sample_count); |
| 436 | } | 436 | } |
| 437 | 437 | ||
| 438 | bool ReverbCommand::Verify(const ADSP::CommandListProcessor& processor) { | 438 | bool ReverbCommand::Verify(const AudioRenderer::CommandListProcessor& processor) { |
| 439 | return true; | 439 | return true; |
| 440 | } | 440 | } |
| 441 | 441 | ||
| 442 | } // namespace AudioCore::AudioRenderer | 442 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/effect/reverb.h b/src/audio_core/renderer/command/effect/reverb.h index 328756150..2056c73f2 100644 --- a/src/audio_core/renderer/command/effect/reverb.h +++ b/src/audio_core/renderer/command/effect/reverb.h | |||
| @@ -10,11 +10,12 @@ | |||
| 10 | #include "audio_core/renderer/effect/reverb.h" | 10 | #include "audio_core/renderer/effect/reverb.h" |
| 11 | #include "common/common_types.h" | 11 | #include "common/common_types.h" |
| 12 | 12 | ||
| 13 | namespace AudioCore::AudioRenderer { | 13 | namespace AudioCore::ADSP::AudioRenderer { |
| 14 | namespace ADSP { | ||
| 15 | class CommandListProcessor; | 14 | class CommandListProcessor; |
| 16 | } | 15 | } |
| 17 | 16 | ||
| 17 | namespace AudioCore::Renderer { | ||
| 18 | |||
| 18 | /** | 19 | /** |
| 19 | * AudioRenderer command for a Reverb effect. Apply a reverb to inputs mix buffer, outputs receives | 20 | * AudioRenderer command for a Reverb effect. Apply a reverb to inputs mix buffer, outputs receives |
| 20 | * the results. | 21 | * the results. |
| @@ -26,14 +27,14 @@ struct ReverbCommand : ICommand { | |||
| 26 | * @param processor - The CommandListProcessor processing this command. | 27 | * @param processor - The CommandListProcessor processing this command. |
| 27 | * @param string - The string to print into. | 28 | * @param string - The string to print into. |
| 28 | */ | 29 | */ |
| 29 | void Dump(const ADSP::CommandListProcessor& processor, std::string& string) override; | 30 | void Dump(const AudioRenderer::CommandListProcessor& processor, std::string& string) override; |
| 30 | 31 | ||
| 31 | /** | 32 | /** |
| 32 | * Process this command. | 33 | * Process this command. |
| 33 | * | 34 | * |
| 34 | * @param processor - The CommandListProcessor processing this command. | 35 | * @param processor - The CommandListProcessor processing this command. |
| 35 | */ | 36 | */ |
| 36 | void Process(const ADSP::CommandListProcessor& processor) override; | 37 | void Process(const AudioRenderer::CommandListProcessor& processor) override; |
| 37 | 38 | ||
| 38 | /** | 39 | /** |
| 39 | * Verify this command's data is valid. | 40 | * Verify this command's data is valid. |
| @@ -41,7 +42,7 @@ struct ReverbCommand : ICommand { | |||
| 41 | * @param processor - The CommandListProcessor processing this command. | 42 | * @param processor - The CommandListProcessor processing this command. |
| 42 | * @return True if the command is valid, otherwise false. | 43 | * @return True if the command is valid, otherwise false. |
| 43 | */ | 44 | */ |
| 44 | bool Verify(const ADSP::CommandListProcessor& processor) override; | 45 | bool Verify(const AudioRenderer::CommandListProcessor& processor) override; |
| 45 | 46 | ||
| 46 | /// Input mix buffer offsets for each channel | 47 | /// Input mix buffer offsets for each channel |
| 47 | std::array<s16, MaxChannels> inputs; | 48 | std::array<s16, MaxChannels> inputs; |
| @@ -59,4 +60,4 @@ struct ReverbCommand : ICommand { | |||
| 59 | bool long_size_pre_delay_supported; | 60 | bool long_size_pre_delay_supported; |
| 60 | }; | 61 | }; |
| 61 | 62 | ||
| 62 | } // namespace AudioCore::AudioRenderer | 63 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/icommand.h b/src/audio_core/renderer/command/icommand.h index f2dd41254..10a78ddf2 100644 --- a/src/audio_core/renderer/command/icommand.h +++ b/src/audio_core/renderer/command/icommand.h | |||
| @@ -3,14 +3,18 @@ | |||
| 3 | 3 | ||
| 4 | #pragma once | 4 | #pragma once |
| 5 | 5 | ||
| 6 | #include <string> | ||
| 7 | |||
| 6 | #include "audio_core/common/common.h" | 8 | #include "audio_core/common/common.h" |
| 7 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 8 | 10 | ||
| 9 | namespace AudioCore::AudioRenderer { | 11 | namespace AudioCore::ADSP::AudioRenderer { |
| 10 | namespace ADSP { | ||
| 11 | class CommandListProcessor; | 12 | class CommandListProcessor; |
| 12 | } | 13 | } |
| 13 | 14 | ||
| 15 | namespace AudioCore::Renderer { | ||
| 16 | using namespace ::AudioCore::ADSP; | ||
| 17 | |||
| 14 | enum class CommandId : u8 { | 18 | enum class CommandId : u8 { |
| 15 | /* 0x00 */ Invalid, | 19 | /* 0x00 */ Invalid, |
| 16 | /* 0x01 */ DataSourcePcmInt16Version1, | 20 | /* 0x01 */ DataSourcePcmInt16Version1, |
| @@ -59,14 +63,15 @@ struct ICommand { | |||
| 59 | * @param processor - The CommandListProcessor processing this command. | 63 | * @param processor - The CommandListProcessor processing this command. |
| 60 | * @param string - The string to print into. | 64 | * @param string - The string to print into. |
| 61 | */ | 65 | */ |
| 62 | virtual void Dump(const ADSP::CommandListProcessor& processor, std::string& string) = 0; | 66 | virtual void Dump(const AudioRenderer::CommandListProcessor& processor, |
| 67 | std::string& string) = 0; | ||
| 63 | 68 | ||
| 64 | /** | 69 | /** |
| 65 | * Process this command. | 70 | * Process this command. |
| 66 | * | 71 | * |
| 67 | * @param processor - The CommandListProcessor processing this command. | 72 | * @param processor - The CommandListProcessor processing this command. |
| 68 | */ | 73 | */ |
| 69 | virtual void Process(const ADSP::CommandListProcessor& processor) = 0; | 74 | virtual void Process(const AudioRenderer::CommandListProcessor& processor) = 0; |
| 70 | 75 | ||
| 71 | /** | 76 | /** |
| 72 | * Verify this command's data is valid. | 77 | * Verify this command's data is valid. |
| @@ -74,7 +79,7 @@ struct ICommand { | |||
| 74 | * @param processor - The CommandListProcessor processing this command. | 79 | * @param processor - The CommandListProcessor processing this command. |
| 75 | * @return True if the command is valid, otherwise false. | 80 | * @return True if the command is valid, otherwise false. |
| 76 | */ | 81 | */ |
| 77 | virtual bool Verify(const ADSP::CommandListProcessor& processor) = 0; | 82 | virtual bool Verify(const AudioRenderer::CommandListProcessor& processor) = 0; |
| 78 | 83 | ||
| 79 | /// Command magic 0xCAFEBABE | 84 | /// Command magic 0xCAFEBABE |
| 80 | u32 magic{}; | 85 | u32 magic{}; |
| @@ -90,4 +95,4 @@ struct ICommand { | |||
| 90 | u32 node_id{}; | 95 | u32 node_id{}; |
| 91 | }; | 96 | }; |
| 92 | 97 | ||
| 93 | } // namespace AudioCore::AudioRenderer | 98 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/mix/clear_mix.cpp b/src/audio_core/renderer/command/mix/clear_mix.cpp index 4f649d6a8..060d7cb28 100644 --- a/src/audio_core/renderer/command/mix/clear_mix.cpp +++ b/src/audio_core/renderer/command/mix/clear_mix.cpp | |||
| @@ -3,22 +3,22 @@ | |||
| 3 | 3 | ||
| 4 | #include <string> | 4 | #include <string> |
| 5 | 5 | ||
| 6 | #include "audio_core/renderer/adsp/command_list_processor.h" | 6 | #include "audio_core/adsp/apps/audio_renderer/command_list_processor.h" |
| 7 | #include "audio_core/renderer/command/mix/clear_mix.h" | 7 | #include "audio_core/renderer/command/mix/clear_mix.h" |
| 8 | 8 | ||
| 9 | namespace AudioCore::AudioRenderer { | 9 | namespace AudioCore::Renderer { |
| 10 | 10 | ||
| 11 | void ClearMixBufferCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, | 11 | void ClearMixBufferCommand::Dump( |
| 12 | std::string& string) { | 12 | [[maybe_unused]] const AudioRenderer::CommandListProcessor& processor, std::string& string) { |
| 13 | string += fmt::format("ClearMixBufferCommand\n"); | 13 | string += fmt::format("ClearMixBufferCommand\n"); |
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | void ClearMixBufferCommand::Process(const ADSP::CommandListProcessor& processor) { | 16 | void ClearMixBufferCommand::Process(const AudioRenderer::CommandListProcessor& processor) { |
| 17 | memset(processor.mix_buffers.data(), 0, processor.mix_buffers.size_bytes()); | 17 | memset(processor.mix_buffers.data(), 0, processor.mix_buffers.size_bytes()); |
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | bool ClearMixBufferCommand::Verify(const ADSP::CommandListProcessor& processor) { | 20 | bool ClearMixBufferCommand::Verify(const AudioRenderer::CommandListProcessor& processor) { |
| 21 | return true; | 21 | return true; |
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | } // namespace AudioCore::AudioRenderer | 24 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/mix/clear_mix.h b/src/audio_core/renderer/command/mix/clear_mix.h index 956ec0b65..650fa1a8a 100644 --- a/src/audio_core/renderer/command/mix/clear_mix.h +++ b/src/audio_core/renderer/command/mix/clear_mix.h | |||
| @@ -8,11 +8,12 @@ | |||
| 8 | #include "audio_core/renderer/command/icommand.h" | 8 | #include "audio_core/renderer/command/icommand.h" |
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | 10 | ||
| 11 | namespace AudioCore::AudioRenderer { | 11 | namespace AudioCore::ADSP::AudioRenderer { |
| 12 | namespace ADSP { | ||
| 13 | class CommandListProcessor; | 12 | class CommandListProcessor; |
| 14 | } | 13 | } |
| 15 | 14 | ||
| 15 | namespace AudioCore::Renderer { | ||
| 16 | |||
| 16 | /** | 17 | /** |
| 17 | * AudioRenderer command for a clearing the mix buffers. | 18 | * AudioRenderer command for a clearing the mix buffers. |
| 18 | * Used at the start of each command list. | 19 | * Used at the start of each command list. |
| @@ -24,14 +25,14 @@ struct ClearMixBufferCommand : ICommand { | |||
| 24 | * @param processor - The CommandListProcessor processing this command. | 25 | * @param processor - The CommandListProcessor processing this command. |
| 25 | * @param string - The string to print into. | 26 | * @param string - The string to print into. |
| 26 | */ | 27 | */ |
| 27 | void Dump(const ADSP::CommandListProcessor& processor, std::string& string) override; | 28 | void Dump(const AudioRenderer::CommandListProcessor& processor, std::string& string) override; |
| 28 | 29 | ||
| 29 | /** | 30 | /** |
| 30 | * Process this command. | 31 | * Process this command. |
| 31 | * | 32 | * |
| 32 | * @param processor - The CommandListProcessor processing this command. | 33 | * @param processor - The CommandListProcessor processing this command. |
| 33 | */ | 34 | */ |
| 34 | void Process(const ADSP::CommandListProcessor& processor) override; | 35 | void Process(const AudioRenderer::CommandListProcessor& processor) override; |
| 35 | 36 | ||
| 36 | /** | 37 | /** |
| 37 | * Verify this command's data is valid. | 38 | * Verify this command's data is valid. |
| @@ -39,7 +40,7 @@ struct ClearMixBufferCommand : ICommand { | |||
| 39 | * @param processor - The CommandListProcessor processing this command. | 40 | * @param processor - The CommandListProcessor processing this command. |
| 40 | * @return True if the command is valid, otherwise false. | 41 | * @return True if the command is valid, otherwise false. |
| 41 | */ | 42 | */ |
| 42 | bool Verify(const ADSP::CommandListProcessor& processor) override; | 43 | bool Verify(const AudioRenderer::CommandListProcessor& processor) override; |
| 43 | }; | 44 | }; |
| 44 | 45 | ||
| 45 | } // namespace AudioCore::AudioRenderer | 46 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/mix/copy_mix.cpp b/src/audio_core/renderer/command/mix/copy_mix.cpp index 1d49f1644..5d386f95a 100644 --- a/src/audio_core/renderer/command/mix/copy_mix.cpp +++ b/src/audio_core/renderer/command/mix/copy_mix.cpp | |||
| @@ -1,18 +1,18 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include "audio_core/renderer/adsp/command_list_processor.h" | 4 | #include "audio_core/adsp/apps/audio_renderer/command_list_processor.h" |
| 5 | #include "audio_core/renderer/command/mix/copy_mix.h" | 5 | #include "audio_core/renderer/command/mix/copy_mix.h" |
| 6 | 6 | ||
| 7 | namespace AudioCore::AudioRenderer { | 7 | namespace AudioCore::Renderer { |
| 8 | 8 | ||
| 9 | void CopyMixBufferCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, | 9 | void CopyMixBufferCommand::Dump( |
| 10 | std::string& string) { | 10 | [[maybe_unused]] const AudioRenderer::CommandListProcessor& processor, std::string& string) { |
| 11 | string += fmt::format("CopyMixBufferCommand\n\tinput {:02X} output {:02X}\n", input_index, | 11 | string += fmt::format("CopyMixBufferCommand\n\tinput {:02X} output {:02X}\n", input_index, |
| 12 | output_index); | 12 | output_index); |
| 13 | } | 13 | } |
| 14 | 14 | ||
| 15 | void CopyMixBufferCommand::Process(const ADSP::CommandListProcessor& processor) { | 15 | void CopyMixBufferCommand::Process(const AudioRenderer::CommandListProcessor& processor) { |
| 16 | auto output{processor.mix_buffers.subspan(output_index * processor.sample_count, | 16 | auto output{processor.mix_buffers.subspan(output_index * processor.sample_count, |
| 17 | processor.sample_count)}; | 17 | processor.sample_count)}; |
| 18 | auto input{processor.mix_buffers.subspan(input_index * processor.sample_count, | 18 | auto input{processor.mix_buffers.subspan(input_index * processor.sample_count, |
| @@ -20,8 +20,8 @@ void CopyMixBufferCommand::Process(const ADSP::CommandListProcessor& processor) | |||
| 20 | std::memcpy(output.data(), input.data(), processor.sample_count * sizeof(s32)); | 20 | std::memcpy(output.data(), input.data(), processor.sample_count * sizeof(s32)); |
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | bool CopyMixBufferCommand::Verify(const ADSP::CommandListProcessor& processor) { | 23 | bool CopyMixBufferCommand::Verify(const AudioRenderer::CommandListProcessor& processor) { |
| 24 | return true; | 24 | return true; |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | } // namespace AudioCore::AudioRenderer | 27 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/mix/copy_mix.h b/src/audio_core/renderer/command/mix/copy_mix.h index a59007fb6..ae247c3f8 100644 --- a/src/audio_core/renderer/command/mix/copy_mix.h +++ b/src/audio_core/renderer/command/mix/copy_mix.h | |||
| @@ -8,11 +8,12 @@ | |||
| 8 | #include "audio_core/renderer/command/icommand.h" | 8 | #include "audio_core/renderer/command/icommand.h" |
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | 10 | ||
| 11 | namespace AudioCore::AudioRenderer { | 11 | namespace AudioCore::ADSP::AudioRenderer { |
| 12 | namespace ADSP { | ||
| 13 | class CommandListProcessor; | 12 | class CommandListProcessor; |
| 14 | } | 13 | } |
| 15 | 14 | ||
| 15 | namespace AudioCore::Renderer { | ||
| 16 | |||
| 16 | /** | 17 | /** |
| 17 | * AudioRenderer command for a copying a mix buffer from input to output. | 18 | * AudioRenderer command for a copying a mix buffer from input to output. |
| 18 | */ | 19 | */ |
| @@ -23,14 +24,14 @@ struct CopyMixBufferCommand : ICommand { | |||
| 23 | * @param processor - The CommandListProcessor processing this command. | 24 | * @param processor - The CommandListProcessor processing this command. |
| 24 | * @param string - The string to print into. | 25 | * @param string - The string to print into. |
| 25 | */ | 26 | */ |
| 26 | void Dump(const ADSP::CommandListProcessor& processor, std::string& string) override; | 27 | void Dump(const AudioRenderer::CommandListProcessor& processor, std::string& string) override; |
| 27 | 28 | ||
| 28 | /** | 29 | /** |
| 29 | * Process this command. | 30 | * Process this command. |
| 30 | * | 31 | * |
| 31 | * @param processor - The CommandListProcessor processing this command. | 32 | * @param processor - The CommandListProcessor processing this command. |
| 32 | */ | 33 | */ |
| 33 | void Process(const ADSP::CommandListProcessor& processor) override; | 34 | void Process(const AudioRenderer::CommandListProcessor& processor) override; |
| 34 | 35 | ||
| 35 | /** | 36 | /** |
| 36 | * Verify this command's data is valid. | 37 | * Verify this command's data is valid. |
| @@ -38,7 +39,7 @@ struct CopyMixBufferCommand : ICommand { | |||
| 38 | * @param processor - The CommandListProcessor processing this command. | 39 | * @param processor - The CommandListProcessor processing this command. |
| 39 | * @return True if the command is valid, otherwise false. | 40 | * @return True if the command is valid, otherwise false. |
| 40 | */ | 41 | */ |
| 41 | bool Verify(const ADSP::CommandListProcessor& processor) override; | 42 | bool Verify(const AudioRenderer::CommandListProcessor& processor) override; |
| 42 | 43 | ||
| 43 | /// Input mix buffer index | 44 | /// Input mix buffer index |
| 44 | s16 input_index; | 45 | s16 input_index; |
| @@ -46,4 +47,4 @@ struct CopyMixBufferCommand : ICommand { | |||
| 46 | s16 output_index; | 47 | s16 output_index; |
| 47 | }; | 48 | }; |
| 48 | 49 | ||
| 49 | } // namespace AudioCore::AudioRenderer | 50 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/mix/depop_for_mix_buffers.cpp b/src/audio_core/renderer/command/mix/depop_for_mix_buffers.cpp index c2bc10061..caedb56b7 100644 --- a/src/audio_core/renderer/command/mix/depop_for_mix_buffers.cpp +++ b/src/audio_core/renderer/command/mix/depop_for_mix_buffers.cpp | |||
| @@ -1,11 +1,11 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include "audio_core/adsp/apps/audio_renderer/command_list_processor.h" | ||
| 4 | #include "audio_core/common/common.h" | 5 | #include "audio_core/common/common.h" |
| 5 | #include "audio_core/renderer/adsp/command_list_processor.h" | ||
| 6 | #include "audio_core/renderer/command/mix/depop_for_mix_buffers.h" | 6 | #include "audio_core/renderer/command/mix/depop_for_mix_buffers.h" |
| 7 | 7 | ||
| 8 | namespace AudioCore::AudioRenderer { | 8 | namespace AudioCore::Renderer { |
| 9 | /** | 9 | /** |
| 10 | * Apply depopping. Add the depopped sample to each incoming new sample, decaying it each time | 10 | * Apply depopping. Add the depopped sample to each incoming new sample, decaying it each time |
| 11 | * according to decay. | 11 | * according to decay. |
| @@ -36,13 +36,13 @@ static s32 ApplyDepopMix(std::span<s32> output, const s32 depop_sample, | |||
| 36 | } | 36 | } |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | void DepopForMixBuffersCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, | 39 | void DepopForMixBuffersCommand::Dump( |
| 40 | std::string& string) { | 40 | [[maybe_unused]] const AudioRenderer::CommandListProcessor& processor, std::string& string) { |
| 41 | string += fmt::format("DepopForMixBuffersCommand\n\tinput {:02X} count {} decay {}\n", input, | 41 | string += fmt::format("DepopForMixBuffersCommand\n\tinput {:02X} count {} decay {}\n", input, |
| 42 | count, decay.to_float()); | 42 | count, decay.to_float()); |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | void DepopForMixBuffersCommand::Process(const ADSP::CommandListProcessor& processor) { | 45 | void DepopForMixBuffersCommand::Process(const AudioRenderer::CommandListProcessor& processor) { |
| 46 | auto end_index{std::min(processor.buffer_count, input + count)}; | 46 | auto end_index{std::min(processor.buffer_count, input + count)}; |
| 47 | std::span<s32> depop_buff{reinterpret_cast<s32*>(depop_buffer), end_index}; | 47 | std::span<s32> depop_buff{reinterpret_cast<s32*>(depop_buffer), end_index}; |
| 48 | 48 | ||
| @@ -57,8 +57,8 @@ void DepopForMixBuffersCommand::Process(const ADSP::CommandListProcessor& proces | |||
| 57 | } | 57 | } |
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | bool DepopForMixBuffersCommand::Verify(const ADSP::CommandListProcessor& processor) { | 60 | bool DepopForMixBuffersCommand::Verify(const AudioRenderer::CommandListProcessor& processor) { |
| 61 | return true; | 61 | return true; |
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | } // namespace AudioCore::AudioRenderer | 64 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/mix/depop_for_mix_buffers.h b/src/audio_core/renderer/command/mix/depop_for_mix_buffers.h index e7268ff27..699d38988 100644 --- a/src/audio_core/renderer/command/mix/depop_for_mix_buffers.h +++ b/src/audio_core/renderer/command/mix/depop_for_mix_buffers.h | |||
| @@ -9,11 +9,12 @@ | |||
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | #include "common/fixed_point.h" | 10 | #include "common/fixed_point.h" |
| 11 | 11 | ||
| 12 | namespace AudioCore::AudioRenderer { | 12 | namespace AudioCore::ADSP::AudioRenderer { |
| 13 | namespace ADSP { | ||
| 14 | class CommandListProcessor; | 13 | class CommandListProcessor; |
| 15 | } | 14 | } |
| 16 | 15 | ||
| 16 | namespace AudioCore::Renderer { | ||
| 17 | |||
| 17 | /** | 18 | /** |
| 18 | * AudioRenderer command for depopping a mix buffer. | 19 | * AudioRenderer command for depopping a mix buffer. |
| 19 | * Adds a cumulation of previous samples to the current mix buffer with a decay. | 20 | * Adds a cumulation of previous samples to the current mix buffer with a decay. |
| @@ -25,14 +26,14 @@ struct DepopForMixBuffersCommand : ICommand { | |||
| 25 | * @param processor - The CommandListProcessor processing this command. | 26 | * @param processor - The CommandListProcessor processing this command. |
| 26 | * @param string - The string to print into. | 27 | * @param string - The string to print into. |
| 27 | */ | 28 | */ |
| 28 | void Dump(const ADSP::CommandListProcessor& processor, std::string& string) override; | 29 | void Dump(const AudioRenderer::CommandListProcessor& processor, std::string& string) override; |
| 29 | 30 | ||
| 30 | /** | 31 | /** |
| 31 | * Process this command. | 32 | * Process this command. |
| 32 | * | 33 | * |
| 33 | * @param processor - The CommandListProcessor processing this command. | 34 | * @param processor - The CommandListProcessor processing this command. |
| 34 | */ | 35 | */ |
| 35 | void Process(const ADSP::CommandListProcessor& processor) override; | 36 | void Process(const AudioRenderer::CommandListProcessor& processor) override; |
| 36 | 37 | ||
| 37 | /** | 38 | /** |
| 38 | * Verify this command's data is valid. | 39 | * Verify this command's data is valid. |
| @@ -40,7 +41,7 @@ struct DepopForMixBuffersCommand : ICommand { | |||
| 40 | * @param processor - The CommandListProcessor processing this command. | 41 | * @param processor - The CommandListProcessor processing this command. |
| 41 | * @return True if the command is valid, otherwise false. | 42 | * @return True if the command is valid, otherwise false. |
| 42 | */ | 43 | */ |
| 43 | bool Verify(const ADSP::CommandListProcessor& processor) override; | 44 | bool Verify(const AudioRenderer::CommandListProcessor& processor) override; |
| 44 | 45 | ||
| 45 | /// Starting input mix buffer index | 46 | /// Starting input mix buffer index |
| 46 | u32 input; | 47 | u32 input; |
| @@ -52,4 +53,4 @@ struct DepopForMixBuffersCommand : ICommand { | |||
| 52 | CpuAddr depop_buffer; | 53 | CpuAddr depop_buffer; |
| 53 | }; | 54 | }; |
| 54 | 55 | ||
| 55 | } // namespace AudioCore::AudioRenderer | 56 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/mix/depop_prepare.cpp b/src/audio_core/renderer/command/mix/depop_prepare.cpp index 69bb78ccc..2faf4681a 100644 --- a/src/audio_core/renderer/command/mix/depop_prepare.cpp +++ b/src/audio_core/renderer/command/mix/depop_prepare.cpp | |||
| @@ -1,15 +1,15 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include "audio_core/renderer/adsp/command_list_processor.h" | 4 | #include "audio_core/adsp/apps/audio_renderer/command_list_processor.h" |
| 5 | #include "audio_core/renderer/command/mix/depop_prepare.h" | 5 | #include "audio_core/renderer/command/mix/depop_prepare.h" |
| 6 | #include "audio_core/renderer/voice/voice_state.h" | 6 | #include "audio_core/renderer/voice/voice_state.h" |
| 7 | #include "common/fixed_point.h" | 7 | #include "common/fixed_point.h" |
| 8 | 8 | ||
| 9 | namespace AudioCore::AudioRenderer { | 9 | namespace AudioCore::Renderer { |
| 10 | 10 | ||
| 11 | void DepopPrepareCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, | 11 | void DepopPrepareCommand::Dump( |
| 12 | std::string& string) { | 12 | [[maybe_unused]] const AudioRenderer::CommandListProcessor& processor, std::string& string) { |
| 13 | string += fmt::format("DepopPrepareCommand\n\tinputs: "); | 13 | string += fmt::format("DepopPrepareCommand\n\tinputs: "); |
| 14 | for (u32 i = 0; i < buffer_count; i++) { | 14 | for (u32 i = 0; i < buffer_count; i++) { |
| 15 | string += fmt::format("{:02X}, ", inputs[i]); | 15 | string += fmt::format("{:02X}, ", inputs[i]); |
| @@ -17,7 +17,7 @@ void DepopPrepareCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor | |||
| 17 | string += "\n"; | 17 | string += "\n"; |
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | void DepopPrepareCommand::Process(const ADSP::CommandListProcessor& processor) { | 20 | void DepopPrepareCommand::Process(const AudioRenderer::CommandListProcessor& processor) { |
| 21 | auto samples{reinterpret_cast<s32*>(previous_samples)}; | 21 | auto samples{reinterpret_cast<s32*>(previous_samples)}; |
| 22 | auto buffer{reinterpret_cast<s32*>(depop_buffer)}; | 22 | auto buffer{reinterpret_cast<s32*>(depop_buffer)}; |
| 23 | 23 | ||
| @@ -29,8 +29,8 @@ void DepopPrepareCommand::Process(const ADSP::CommandListProcessor& processor) { | |||
| 29 | } | 29 | } |
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | bool DepopPrepareCommand::Verify(const ADSP::CommandListProcessor& processor) { | 32 | bool DepopPrepareCommand::Verify(const AudioRenderer::CommandListProcessor& processor) { |
| 33 | return true; | 33 | return true; |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | } // namespace AudioCore::AudioRenderer | 36 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/mix/depop_prepare.h b/src/audio_core/renderer/command/mix/depop_prepare.h index a5465da9a..161a94461 100644 --- a/src/audio_core/renderer/command/mix/depop_prepare.h +++ b/src/audio_core/renderer/command/mix/depop_prepare.h | |||
| @@ -8,11 +8,12 @@ | |||
| 8 | #include "audio_core/renderer/command/icommand.h" | 8 | #include "audio_core/renderer/command/icommand.h" |
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | 10 | ||
| 11 | namespace AudioCore::AudioRenderer { | 11 | namespace AudioCore::ADSP::AudioRenderer { |
| 12 | namespace ADSP { | ||
| 13 | class CommandListProcessor; | 12 | class CommandListProcessor; |
| 14 | } | 13 | } |
| 15 | 14 | ||
| 15 | namespace AudioCore::Renderer { | ||
| 16 | |||
| 16 | /** | 17 | /** |
| 17 | * AudioRenderer command for preparing depop. | 18 | * AudioRenderer command for preparing depop. |
| 18 | * Adds the previusly output last samples to the depop buffer. | 19 | * Adds the previusly output last samples to the depop buffer. |
| @@ -24,14 +25,14 @@ struct DepopPrepareCommand : ICommand { | |||
| 24 | * @param processor - The CommandListProcessor processing this command. | 25 | * @param processor - The CommandListProcessor processing this command. |
| 25 | * @param string - The string to print into. | 26 | * @param string - The string to print into. |
| 26 | */ | 27 | */ |
| 27 | void Dump(const ADSP::CommandListProcessor& processor, std::string& string) override; | 28 | void Dump(const AudioRenderer::CommandListProcessor& processor, std::string& string) override; |
| 28 | 29 | ||
| 29 | /** | 30 | /** |
| 30 | * Process this command. | 31 | * Process this command. |
| 31 | * | 32 | * |
| 32 | * @param processor - The CommandListProcessor processing this command. | 33 | * @param processor - The CommandListProcessor processing this command. |
| 33 | */ | 34 | */ |
| 34 | void Process(const ADSP::CommandListProcessor& processor) override; | 35 | void Process(const AudioRenderer::CommandListProcessor& processor) override; |
| 35 | 36 | ||
| 36 | /** | 37 | /** |
| 37 | * Verify this command's data is valid. | 38 | * Verify this command's data is valid. |
| @@ -39,7 +40,7 @@ struct DepopPrepareCommand : ICommand { | |||
| 39 | * @param processor - The CommandListProcessor processing this command. | 40 | * @param processor - The CommandListProcessor processing this command. |
| 40 | * @return True if the command is valid, otherwise false. | 41 | * @return True if the command is valid, otherwise false. |
| 41 | */ | 42 | */ |
| 42 | bool Verify(const ADSP::CommandListProcessor& processor) override; | 43 | bool Verify(const AudioRenderer::CommandListProcessor& processor) override; |
| 43 | 44 | ||
| 44 | /// Depop buffer offset for each mix buffer | 45 | /// Depop buffer offset for each mix buffer |
| 45 | std::array<s16, MaxMixBuffers> inputs; | 46 | std::array<s16, MaxMixBuffers> inputs; |
| @@ -51,4 +52,4 @@ struct DepopPrepareCommand : ICommand { | |||
| 51 | CpuAddr depop_buffer; | 52 | CpuAddr depop_buffer; |
| 52 | }; | 53 | }; |
| 53 | 54 | ||
| 54 | } // namespace AudioCore::AudioRenderer | 55 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/mix/mix.cpp b/src/audio_core/renderer/command/mix/mix.cpp index 8ecf9b05a..8bd689b88 100644 --- a/src/audio_core/renderer/command/mix/mix.cpp +++ b/src/audio_core/renderer/command/mix/mix.cpp | |||
| @@ -5,11 +5,11 @@ | |||
| 5 | #include <limits> | 5 | #include <limits> |
| 6 | #include <span> | 6 | #include <span> |
| 7 | 7 | ||
| 8 | #include "audio_core/renderer/adsp/command_list_processor.h" | 8 | #include "audio_core/adsp/apps/audio_renderer/command_list_processor.h" |
| 9 | #include "audio_core/renderer/command/mix/mix.h" | 9 | #include "audio_core/renderer/command/mix/mix.h" |
| 10 | #include "common/fixed_point.h" | 10 | #include "common/fixed_point.h" |
| 11 | 11 | ||
| 12 | namespace AudioCore::AudioRenderer { | 12 | namespace AudioCore::Renderer { |
| 13 | /** | 13 | /** |
| 14 | * Mix input mix buffer into output mix buffer, with volume applied to the input. | 14 | * Mix input mix buffer into output mix buffer, with volume applied to the input. |
| 15 | * | 15 | * |
| @@ -28,7 +28,7 @@ static void ApplyMix(std::span<s32> output, std::span<const s32> input, const f3 | |||
| 28 | } | 28 | } |
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | void MixCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, | 31 | void MixCommand::Dump([[maybe_unused]] const AudioRenderer::CommandListProcessor& processor, |
| 32 | std::string& string) { | 32 | std::string& string) { |
| 33 | string += fmt::format("MixCommand"); | 33 | string += fmt::format("MixCommand"); |
| 34 | string += fmt::format("\n\tinput {:02X}", input_index); | 34 | string += fmt::format("\n\tinput {:02X}", input_index); |
| @@ -37,7 +37,7 @@ void MixCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& process | |||
| 37 | string += "\n"; | 37 | string += "\n"; |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | void MixCommand::Process(const ADSP::CommandListProcessor& processor) { | 40 | void MixCommand::Process(const AudioRenderer::CommandListProcessor& processor) { |
| 41 | auto output{processor.mix_buffers.subspan(output_index * processor.sample_count, | 41 | auto output{processor.mix_buffers.subspan(output_index * processor.sample_count, |
| 42 | processor.sample_count)}; | 42 | processor.sample_count)}; |
| 43 | auto input{processor.mix_buffers.subspan(input_index * processor.sample_count, | 43 | auto input{processor.mix_buffers.subspan(input_index * processor.sample_count, |
| @@ -63,8 +63,8 @@ void MixCommand::Process(const ADSP::CommandListProcessor& processor) { | |||
| 63 | } | 63 | } |
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | bool MixCommand::Verify(const ADSP::CommandListProcessor& processor) { | 66 | bool MixCommand::Verify(const AudioRenderer::CommandListProcessor& processor) { |
| 67 | return true; | 67 | return true; |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | } // namespace AudioCore::AudioRenderer | 70 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/mix/mix.h b/src/audio_core/renderer/command/mix/mix.h index 0201cf171..64c812382 100644 --- a/src/audio_core/renderer/command/mix/mix.h +++ b/src/audio_core/renderer/command/mix/mix.h | |||
| @@ -8,11 +8,12 @@ | |||
| 8 | #include "audio_core/renderer/command/icommand.h" | 8 | #include "audio_core/renderer/command/icommand.h" |
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | 10 | ||
| 11 | namespace AudioCore::AudioRenderer { | 11 | namespace AudioCore::ADSP::AudioRenderer { |
| 12 | namespace ADSP { | ||
| 13 | class CommandListProcessor; | 12 | class CommandListProcessor; |
| 14 | } | 13 | } |
| 15 | 14 | ||
| 15 | namespace AudioCore::Renderer { | ||
| 16 | |||
| 16 | /** | 17 | /** |
| 17 | * AudioRenderer command for mixing an input mix buffer to an output mix buffer, with a volume | 18 | * AudioRenderer command for mixing an input mix buffer to an output mix buffer, with a volume |
| 18 | * applied to the input. | 19 | * applied to the input. |
| @@ -24,14 +25,14 @@ struct MixCommand : ICommand { | |||
| 24 | * @param processor - The CommandListProcessor processing this command. | 25 | * @param processor - The CommandListProcessor processing this command. |
| 25 | * @param string - The string to print into. | 26 | * @param string - The string to print into. |
| 26 | */ | 27 | */ |
| 27 | void Dump(const ADSP::CommandListProcessor& processor, std::string& string) override; | 28 | void Dump(const AudioRenderer::CommandListProcessor& processor, std::string& string) override; |
| 28 | 29 | ||
| 29 | /** | 30 | /** |
| 30 | * Process this command. | 31 | * Process this command. |
| 31 | * | 32 | * |
| 32 | * @param processor - The CommandListProcessor processing this command. | 33 | * @param processor - The CommandListProcessor processing this command. |
| 33 | */ | 34 | */ |
| 34 | void Process(const ADSP::CommandListProcessor& processor) override; | 35 | void Process(const AudioRenderer::CommandListProcessor& processor) override; |
| 35 | 36 | ||
| 36 | /** | 37 | /** |
| 37 | * Verify this command's data is valid. | 38 | * Verify this command's data is valid. |
| @@ -39,7 +40,7 @@ struct MixCommand : ICommand { | |||
| 39 | * @param processor - The CommandListProcessor processing this command. | 40 | * @param processor - The CommandListProcessor processing this command. |
| 40 | * @return True if the command is valid, otherwise false. | 41 | * @return True if the command is valid, otherwise false. |
| 41 | */ | 42 | */ |
| 42 | bool Verify(const ADSP::CommandListProcessor& processor) override; | 43 | bool Verify(const AudioRenderer::CommandListProcessor& processor) override; |
| 43 | 44 | ||
| 44 | /// Fixed point precision | 45 | /// Fixed point precision |
| 45 | u8 precision; | 46 | u8 precision; |
| @@ -51,4 +52,4 @@ struct MixCommand : ICommand { | |||
| 51 | f32 volume; | 52 | f32 volume; |
| 52 | }; | 53 | }; |
| 53 | 54 | ||
| 54 | } // namespace AudioCore::AudioRenderer | 55 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/mix/mix_ramp.cpp b/src/audio_core/renderer/command/mix/mix_ramp.cpp index d67123cd8..2f6500da5 100644 --- a/src/audio_core/renderer/command/mix/mix_ramp.cpp +++ b/src/audio_core/renderer/command/mix/mix_ramp.cpp | |||
| @@ -1,12 +1,12 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include "audio_core/renderer/adsp/command_list_processor.h" | 4 | #include "audio_core/adsp/apps/audio_renderer/command_list_processor.h" |
| 5 | #include "audio_core/renderer/command/mix/mix_ramp.h" | 5 | #include "audio_core/renderer/command/mix/mix_ramp.h" |
| 6 | #include "common/fixed_point.h" | 6 | #include "common/fixed_point.h" |
| 7 | #include "common/logging/log.h" | 7 | #include "common/logging/log.h" |
| 8 | 8 | ||
| 9 | namespace AudioCore::AudioRenderer { | 9 | namespace AudioCore::Renderer { |
| 10 | 10 | ||
| 11 | template <size_t Q> | 11 | template <size_t Q> |
| 12 | s32 ApplyMixRamp(std::span<s32> output, std::span<const s32> input, const f32 volume_, | 12 | s32 ApplyMixRamp(std::span<s32> output, std::span<const s32> input, const f32 volume_, |
| @@ -33,7 +33,8 @@ s32 ApplyMixRamp(std::span<s32> output, std::span<const s32> input, const f32 vo | |||
| 33 | template s32 ApplyMixRamp<15>(std::span<s32>, std::span<const s32>, f32, f32, u32); | 33 | template s32 ApplyMixRamp<15>(std::span<s32>, std::span<const s32>, f32, f32, u32); |
| 34 | template s32 ApplyMixRamp<23>(std::span<s32>, std::span<const s32>, f32, f32, u32); | 34 | template s32 ApplyMixRamp<23>(std::span<s32>, std::span<const s32>, f32, f32, u32); |
| 35 | 35 | ||
| 36 | void MixRampCommand::Dump(const ADSP::CommandListProcessor& processor, std::string& string) { | 36 | void MixRampCommand::Dump(const AudioRenderer::CommandListProcessor& processor, |
| 37 | std::string& string) { | ||
| 37 | const auto ramp{(volume - prev_volume) / static_cast<f32>(processor.sample_count)}; | 38 | const auto ramp{(volume - prev_volume) / static_cast<f32>(processor.sample_count)}; |
| 38 | string += fmt::format("MixRampCommand"); | 39 | string += fmt::format("MixRampCommand"); |
| 39 | string += fmt::format("\n\tinput {:02X}", input_index); | 40 | string += fmt::format("\n\tinput {:02X}", input_index); |
| @@ -44,7 +45,7 @@ void MixRampCommand::Dump(const ADSP::CommandListProcessor& processor, std::stri | |||
| 44 | string += "\n"; | 45 | string += "\n"; |
| 45 | } | 46 | } |
| 46 | 47 | ||
| 47 | void MixRampCommand::Process(const ADSP::CommandListProcessor& processor) { | 48 | void MixRampCommand::Process(const AudioRenderer::CommandListProcessor& processor) { |
| 48 | auto output{processor.mix_buffers.subspan(output_index * processor.sample_count, | 49 | auto output{processor.mix_buffers.subspan(output_index * processor.sample_count, |
| 49 | processor.sample_count)}; | 50 | processor.sample_count)}; |
| 50 | auto input{processor.mix_buffers.subspan(input_index * processor.sample_count, | 51 | auto input{processor.mix_buffers.subspan(input_index * processor.sample_count, |
| @@ -75,8 +76,8 @@ void MixRampCommand::Process(const ADSP::CommandListProcessor& processor) { | |||
| 75 | } | 76 | } |
| 76 | } | 77 | } |
| 77 | 78 | ||
| 78 | bool MixRampCommand::Verify(const ADSP::CommandListProcessor& processor) { | 79 | bool MixRampCommand::Verify(const AudioRenderer::CommandListProcessor& processor) { |
| 79 | return true; | 80 | return true; |
| 80 | } | 81 | } |
| 81 | 82 | ||
| 82 | } // namespace AudioCore::AudioRenderer | 83 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/mix/mix_ramp.h b/src/audio_core/renderer/command/mix/mix_ramp.h index 52f74a273..92209b53a 100644 --- a/src/audio_core/renderer/command/mix/mix_ramp.h +++ b/src/audio_core/renderer/command/mix/mix_ramp.h | |||
| @@ -9,11 +9,12 @@ | |||
| 9 | #include "audio_core/renderer/command/icommand.h" | 9 | #include "audio_core/renderer/command/icommand.h" |
| 10 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 11 | 11 | ||
| 12 | namespace AudioCore::AudioRenderer { | 12 | namespace AudioCore::ADSP::AudioRenderer { |
| 13 | namespace ADSP { | ||
| 14 | class CommandListProcessor; | 13 | class CommandListProcessor; |
| 15 | } | 14 | } |
| 16 | 15 | ||
| 16 | namespace AudioCore::Renderer { | ||
| 17 | |||
| 17 | /** | 18 | /** |
| 18 | * AudioRenderer command for mixing an input mix buffer to an output mix buffer, with a volume | 19 | * AudioRenderer command for mixing an input mix buffer to an output mix buffer, with a volume |
| 19 | * applied to the input, and volume ramping to smooth out the transition. | 20 | * applied to the input, and volume ramping to smooth out the transition. |
| @@ -25,14 +26,14 @@ struct MixRampCommand : ICommand { | |||
| 25 | * @param processor - The CommandListProcessor processing this command. | 26 | * @param processor - The CommandListProcessor processing this command. |
| 26 | * @param string - The string to print into. | 27 | * @param string - The string to print into. |
| 27 | */ | 28 | */ |
| 28 | void Dump(const ADSP::CommandListProcessor& processor, std::string& string) override; | 29 | void Dump(const AudioRenderer::CommandListProcessor& processor, std::string& string) override; |
| 29 | 30 | ||
| 30 | /** | 31 | /** |
| 31 | * Process this command. | 32 | * Process this command. |
| 32 | * | 33 | * |
| 33 | * @param processor - The CommandListProcessor processing this command. | 34 | * @param processor - The CommandListProcessor processing this command. |
| 34 | */ | 35 | */ |
| 35 | void Process(const ADSP::CommandListProcessor& processor) override; | 36 | void Process(const AudioRenderer::CommandListProcessor& processor) override; |
| 36 | 37 | ||
| 37 | /** | 38 | /** |
| 38 | * Verify this command's data is valid. | 39 | * Verify this command's data is valid. |
| @@ -40,7 +41,7 @@ struct MixRampCommand : ICommand { | |||
| 40 | * @param processor - The CommandListProcessor processing this command. | 41 | * @param processor - The CommandListProcessor processing this command. |
| 41 | * @return True if the command is valid, otherwise false. | 42 | * @return True if the command is valid, otherwise false. |
| 42 | */ | 43 | */ |
| 43 | bool Verify(const ADSP::CommandListProcessor& processor) override; | 44 | bool Verify(const AudioRenderer::CommandListProcessor& processor) override; |
| 44 | 45 | ||
| 45 | /// Fixed point precision | 46 | /// Fixed point precision |
| 46 | u8 precision; | 47 | u8 precision; |
| @@ -70,4 +71,4 @@ template <size_t Q> | |||
| 70 | s32 ApplyMixRamp(std::span<s32> output, std::span<const s32> input, f32 volume_, f32 ramp_, | 71 | s32 ApplyMixRamp(std::span<s32> output, std::span<const s32> input, f32 volume_, f32 ramp_, |
| 71 | u32 sample_count); | 72 | u32 sample_count); |
| 72 | 73 | ||
| 73 | } // namespace AudioCore::AudioRenderer | 74 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/mix/mix_ramp_grouped.cpp b/src/audio_core/renderer/command/mix/mix_ramp_grouped.cpp index 43dbef9fc..64138a9bf 100644 --- a/src/audio_core/renderer/command/mix/mix_ramp_grouped.cpp +++ b/src/audio_core/renderer/command/mix/mix_ramp_grouped.cpp | |||
| @@ -1,13 +1,14 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include "audio_core/renderer/adsp/command_list_processor.h" | 4 | #include "audio_core/adsp/apps/audio_renderer/command_list_processor.h" |
| 5 | #include "audio_core/renderer/command/mix/mix_ramp.h" | 5 | #include "audio_core/renderer/command/mix/mix_ramp.h" |
| 6 | #include "audio_core/renderer/command/mix/mix_ramp_grouped.h" | 6 | #include "audio_core/renderer/command/mix/mix_ramp_grouped.h" |
| 7 | 7 | ||
| 8 | namespace AudioCore::AudioRenderer { | 8 | namespace AudioCore::Renderer { |
| 9 | 9 | ||
| 10 | void MixRampGroupedCommand::Dump(const ADSP::CommandListProcessor& processor, std::string& string) { | 10 | void MixRampGroupedCommand::Dump(const AudioRenderer::CommandListProcessor& processor, |
| 11 | std::string& string) { | ||
| 11 | string += "MixRampGroupedCommand"; | 12 | string += "MixRampGroupedCommand"; |
| 12 | for (u32 i = 0; i < buffer_count; i++) { | 13 | for (u32 i = 0; i < buffer_count; i++) { |
| 13 | string += fmt::format("\n\t{}", i); | 14 | string += fmt::format("\n\t{}", i); |
| @@ -21,7 +22,7 @@ void MixRampGroupedCommand::Dump(const ADSP::CommandListProcessor& processor, st | |||
| 21 | } | 22 | } |
| 22 | } | 23 | } |
| 23 | 24 | ||
| 24 | void MixRampGroupedCommand::Process(const ADSP::CommandListProcessor& processor) { | 25 | void MixRampGroupedCommand::Process(const AudioRenderer::CommandListProcessor& processor) { |
| 25 | std::span<s32> prev_samples = {reinterpret_cast<s32*>(previous_samples), MaxMixBuffers}; | 26 | std::span<s32> prev_samples = {reinterpret_cast<s32*>(previous_samples), MaxMixBuffers}; |
| 26 | 27 | ||
| 27 | for (u32 i = 0; i < buffer_count; i++) { | 28 | for (u32 i = 0; i < buffer_count; i++) { |
| @@ -58,8 +59,8 @@ void MixRampGroupedCommand::Process(const ADSP::CommandListProcessor& processor) | |||
| 58 | } | 59 | } |
| 59 | } | 60 | } |
| 60 | 61 | ||
| 61 | bool MixRampGroupedCommand::Verify(const ADSP::CommandListProcessor& processor) { | 62 | bool MixRampGroupedCommand::Verify(const AudioRenderer::CommandListProcessor& processor) { |
| 62 | return true; | 63 | return true; |
| 63 | } | 64 | } |
| 64 | 65 | ||
| 65 | } // namespace AudioCore::AudioRenderer | 66 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/mix/mix_ramp_grouped.h b/src/audio_core/renderer/command/mix/mix_ramp_grouped.h index 3b0ce67ef..9621e42a3 100644 --- a/src/audio_core/renderer/command/mix/mix_ramp_grouped.h +++ b/src/audio_core/renderer/command/mix/mix_ramp_grouped.h | |||
| @@ -9,11 +9,12 @@ | |||
| 9 | #include "audio_core/renderer/command/icommand.h" | 9 | #include "audio_core/renderer/command/icommand.h" |
| 10 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 11 | 11 | ||
| 12 | namespace AudioCore::AudioRenderer { | 12 | namespace AudioCore::ADSP::AudioRenderer { |
| 13 | namespace ADSP { | ||
| 14 | class CommandListProcessor; | 13 | class CommandListProcessor; |
| 15 | } | 14 | } |
| 16 | 15 | ||
| 16 | namespace AudioCore::Renderer { | ||
| 17 | |||
| 17 | /** | 18 | /** |
| 18 | * AudioRenderer command for mixing multiple input mix buffers to multiple output mix buffers, with | 19 | * AudioRenderer command for mixing multiple input mix buffers to multiple output mix buffers, with |
| 19 | * a volume applied to the input, and volume ramping to smooth out the transition. | 20 | * a volume applied to the input, and volume ramping to smooth out the transition. |
| @@ -25,14 +26,14 @@ struct MixRampGroupedCommand : ICommand { | |||
| 25 | * @param processor - The CommandListProcessor processing this command. | 26 | * @param processor - The CommandListProcessor processing this command. |
| 26 | * @param string - The string to print into. | 27 | * @param string - The string to print into. |
| 27 | */ | 28 | */ |
| 28 | void Dump(const ADSP::CommandListProcessor& processor, std::string& string) override; | 29 | void Dump(const AudioRenderer::CommandListProcessor& processor, std::string& string) override; |
| 29 | 30 | ||
| 30 | /** | 31 | /** |
| 31 | * Process this command. | 32 | * Process this command. |
| 32 | * | 33 | * |
| 33 | * @param processor - The CommandListProcessor processing this command. | 34 | * @param processor - The CommandListProcessor processing this command. |
| 34 | */ | 35 | */ |
| 35 | void Process(const ADSP::CommandListProcessor& processor) override; | 36 | void Process(const AudioRenderer::CommandListProcessor& processor) override; |
| 36 | 37 | ||
| 37 | /** | 38 | /** |
| 38 | * Verify this command's data is valid. | 39 | * Verify this command's data is valid. |
| @@ -40,7 +41,7 @@ struct MixRampGroupedCommand : ICommand { | |||
| 40 | * @param processor - The CommandListProcessor processing this command. | 41 | * @param processor - The CommandListProcessor processing this command. |
| 41 | * @return True if the command is valid, otherwise false. | 42 | * @return True if the command is valid, otherwise false. |
| 42 | */ | 43 | */ |
| 43 | bool Verify(const ADSP::CommandListProcessor& processor) override; | 44 | bool Verify(const AudioRenderer::CommandListProcessor& processor) override; |
| 44 | 45 | ||
| 45 | /// Fixed point precision | 46 | /// Fixed point precision |
| 46 | u8 precision; | 47 | u8 precision; |
| @@ -58,4 +59,4 @@ struct MixRampGroupedCommand : ICommand { | |||
| 58 | CpuAddr previous_samples; | 59 | CpuAddr previous_samples; |
| 59 | }; | 60 | }; |
| 60 | 61 | ||
| 61 | } // namespace AudioCore::AudioRenderer | 62 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/mix/volume.cpp b/src/audio_core/renderer/command/mix/volume.cpp index b045fb062..92baf6cc3 100644 --- a/src/audio_core/renderer/command/mix/volume.cpp +++ b/src/audio_core/renderer/command/mix/volume.cpp | |||
| @@ -1,12 +1,12 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include "audio_core/renderer/adsp/command_list_processor.h" | 4 | #include "audio_core/adsp/apps/audio_renderer/command_list_processor.h" |
| 5 | #include "audio_core/renderer/command/mix/volume.h" | 5 | #include "audio_core/renderer/command/mix/volume.h" |
| 6 | #include "common/fixed_point.h" | 6 | #include "common/fixed_point.h" |
| 7 | #include "common/logging/log.h" | 7 | #include "common/logging/log.h" |
| 8 | 8 | ||
| 9 | namespace AudioCore::AudioRenderer { | 9 | namespace AudioCore::Renderer { |
| 10 | /** | 10 | /** |
| 11 | * Apply volume to the input mix buffer, saving to the output buffer. | 11 | * Apply volume to the input mix buffer, saving to the output buffer. |
| 12 | * | 12 | * |
| @@ -29,7 +29,7 @@ static void ApplyUniformGain(std::span<s32> output, std::span<const s32> input, | |||
| 29 | } | 29 | } |
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | void VolumeCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, | 32 | void VolumeCommand::Dump([[maybe_unused]] const AudioRenderer::CommandListProcessor& processor, |
| 33 | std::string& string) { | 33 | std::string& string) { |
| 34 | string += fmt::format("VolumeCommand"); | 34 | string += fmt::format("VolumeCommand"); |
| 35 | string += fmt::format("\n\tinput {:02X}", input_index); | 35 | string += fmt::format("\n\tinput {:02X}", input_index); |
| @@ -38,7 +38,7 @@ void VolumeCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& proc | |||
| 38 | string += "\n"; | 38 | string += "\n"; |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | void VolumeCommand::Process(const ADSP::CommandListProcessor& processor) { | 41 | void VolumeCommand::Process(const AudioRenderer::CommandListProcessor& processor) { |
| 42 | // If input and output buffers are the same, and the volume is 1.0f, this won't do | 42 | // If input and output buffers are the same, and the volume is 1.0f, this won't do |
| 43 | // anything, so just skip. | 43 | // anything, so just skip. |
| 44 | if (input_index == output_index && volume == 1.0f) { | 44 | if (input_index == output_index && volume == 1.0f) { |
| @@ -65,8 +65,8 @@ void VolumeCommand::Process(const ADSP::CommandListProcessor& processor) { | |||
| 65 | } | 65 | } |
| 66 | } | 66 | } |
| 67 | 67 | ||
| 68 | bool VolumeCommand::Verify(const ADSP::CommandListProcessor& processor) { | 68 | bool VolumeCommand::Verify(const AudioRenderer::CommandListProcessor& processor) { |
| 69 | return true; | 69 | return true; |
| 70 | } | 70 | } |
| 71 | 71 | ||
| 72 | } // namespace AudioCore::AudioRenderer | 72 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/mix/volume.h b/src/audio_core/renderer/command/mix/volume.h index 6ae9fb794..fbb8156ca 100644 --- a/src/audio_core/renderer/command/mix/volume.h +++ b/src/audio_core/renderer/command/mix/volume.h | |||
| @@ -8,11 +8,12 @@ | |||
| 8 | #include "audio_core/renderer/command/icommand.h" | 8 | #include "audio_core/renderer/command/icommand.h" |
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | 10 | ||
| 11 | namespace AudioCore::AudioRenderer { | 11 | namespace AudioCore::ADSP::AudioRenderer { |
| 12 | namespace ADSP { | ||
| 13 | class CommandListProcessor; | 12 | class CommandListProcessor; |
| 14 | } | 13 | } |
| 15 | 14 | ||
| 15 | namespace AudioCore::Renderer { | ||
| 16 | |||
| 16 | /** | 17 | /** |
| 17 | * AudioRenderer command for applying volume to a mix buffer. | 18 | * AudioRenderer command for applying volume to a mix buffer. |
| 18 | */ | 19 | */ |
| @@ -23,14 +24,14 @@ struct VolumeCommand : ICommand { | |||
| 23 | * @param processor - The CommandListProcessor processing this command. | 24 | * @param processor - The CommandListProcessor processing this command. |
| 24 | * @param string - The string to print into. | 25 | * @param string - The string to print into. |
| 25 | */ | 26 | */ |
| 26 | void Dump(const ADSP::CommandListProcessor& processor, std::string& string) override; | 27 | void Dump(const AudioRenderer::CommandListProcessor& processor, std::string& string) override; |
| 27 | 28 | ||
| 28 | /** | 29 | /** |
| 29 | * Process this command. | 30 | * Process this command. |
| 30 | * | 31 | * |
| 31 | * @param processor - The CommandListProcessor processing this command. | 32 | * @param processor - The CommandListProcessor processing this command. |
| 32 | */ | 33 | */ |
| 33 | void Process(const ADSP::CommandListProcessor& processor) override; | 34 | void Process(const AudioRenderer::CommandListProcessor& processor) override; |
| 34 | 35 | ||
| 35 | /** | 36 | /** |
| 36 | * Verify this command's data is valid. | 37 | * Verify this command's data is valid. |
| @@ -38,7 +39,7 @@ struct VolumeCommand : ICommand { | |||
| 38 | * @param processor - The CommandListProcessor processing this command. | 39 | * @param processor - The CommandListProcessor processing this command. |
| 39 | * @return True if the command is valid, otherwise false. | 40 | * @return True if the command is valid, otherwise false. |
| 40 | */ | 41 | */ |
| 41 | bool Verify(const ADSP::CommandListProcessor& processor) override; | 42 | bool Verify(const AudioRenderer::CommandListProcessor& processor) override; |
| 42 | 43 | ||
| 43 | /// Fixed point precision | 44 | /// Fixed point precision |
| 44 | u8 precision; | 45 | u8 precision; |
| @@ -50,4 +51,4 @@ struct VolumeCommand : ICommand { | |||
| 50 | f32 volume; | 51 | f32 volume; |
| 51 | }; | 52 | }; |
| 52 | 53 | ||
| 53 | } // namespace AudioCore::AudioRenderer | 54 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/mix/volume_ramp.cpp b/src/audio_core/renderer/command/mix/volume_ramp.cpp index 424307148..fdc751957 100644 --- a/src/audio_core/renderer/command/mix/volume_ramp.cpp +++ b/src/audio_core/renderer/command/mix/volume_ramp.cpp | |||
| @@ -1,11 +1,11 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include "audio_core/renderer/adsp/command_list_processor.h" | 4 | #include "audio_core/adsp/apps/audio_renderer/command_list_processor.h" |
| 5 | #include "audio_core/renderer/command/mix/volume_ramp.h" | 5 | #include "audio_core/renderer/command/mix/volume_ramp.h" |
| 6 | #include "common/fixed_point.h" | 6 | #include "common/fixed_point.h" |
| 7 | 7 | ||
| 8 | namespace AudioCore::AudioRenderer { | 8 | namespace AudioCore::Renderer { |
| 9 | /** | 9 | /** |
| 10 | * Apply volume with ramping to the input mix buffer, saving to the output buffer. | 10 | * Apply volume with ramping to the input mix buffer, saving to the output buffer. |
| 11 | * | 11 | * |
| @@ -38,7 +38,8 @@ static void ApplyLinearEnvelopeGain(std::span<s32> output, std::span<const s32> | |||
| 38 | } | 38 | } |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | void VolumeRampCommand::Dump(const ADSP::CommandListProcessor& processor, std::string& string) { | 41 | void VolumeRampCommand::Dump(const AudioRenderer::CommandListProcessor& processor, |
| 42 | std::string& string) { | ||
| 42 | const auto ramp{(volume - prev_volume) / static_cast<f32>(processor.sample_count)}; | 43 | const auto ramp{(volume - prev_volume) / static_cast<f32>(processor.sample_count)}; |
| 43 | string += fmt::format("VolumeRampCommand"); | 44 | string += fmt::format("VolumeRampCommand"); |
| 44 | string += fmt::format("\n\tinput {:02X}", input_index); | 45 | string += fmt::format("\n\tinput {:02X}", input_index); |
| @@ -49,7 +50,7 @@ void VolumeRampCommand::Dump(const ADSP::CommandListProcessor& processor, std::s | |||
| 49 | string += "\n"; | 50 | string += "\n"; |
| 50 | } | 51 | } |
| 51 | 52 | ||
| 52 | void VolumeRampCommand::Process(const ADSP::CommandListProcessor& processor) { | 53 | void VolumeRampCommand::Process(const AudioRenderer::CommandListProcessor& processor) { |
| 53 | auto output{processor.mix_buffers.subspan(output_index * processor.sample_count, | 54 | auto output{processor.mix_buffers.subspan(output_index * processor.sample_count, |
| 54 | processor.sample_count)}; | 55 | processor.sample_count)}; |
| 55 | auto input{processor.mix_buffers.subspan(input_index * processor.sample_count, | 56 | auto input{processor.mix_buffers.subspan(input_index * processor.sample_count, |
| @@ -77,8 +78,8 @@ void VolumeRampCommand::Process(const ADSP::CommandListProcessor& processor) { | |||
| 77 | } | 78 | } |
| 78 | } | 79 | } |
| 79 | 80 | ||
| 80 | bool VolumeRampCommand::Verify(const ADSP::CommandListProcessor& processor) { | 81 | bool VolumeRampCommand::Verify(const AudioRenderer::CommandListProcessor& processor) { |
| 81 | return true; | 82 | return true; |
| 82 | } | 83 | } |
| 83 | 84 | ||
| 84 | } // namespace AudioCore::AudioRenderer | 85 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/mix/volume_ramp.h b/src/audio_core/renderer/command/mix/volume_ramp.h index 77b61547e..d9794fb95 100644 --- a/src/audio_core/renderer/command/mix/volume_ramp.h +++ b/src/audio_core/renderer/command/mix/volume_ramp.h | |||
| @@ -8,11 +8,12 @@ | |||
| 8 | #include "audio_core/renderer/command/icommand.h" | 8 | #include "audio_core/renderer/command/icommand.h" |
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | 10 | ||
| 11 | namespace AudioCore::AudioRenderer { | 11 | namespace AudioCore::ADSP::AudioRenderer { |
| 12 | namespace ADSP { | ||
| 13 | class CommandListProcessor; | 12 | class CommandListProcessor; |
| 14 | } | 13 | } |
| 15 | 14 | ||
| 15 | namespace AudioCore::Renderer { | ||
| 16 | |||
| 16 | /** | 17 | /** |
| 17 | * AudioRenderer command for applying volume to a mix buffer, with ramping for the volume to smooth | 18 | * AudioRenderer command for applying volume to a mix buffer, with ramping for the volume to smooth |
| 18 | * out the transition. | 19 | * out the transition. |
| @@ -24,14 +25,14 @@ struct VolumeRampCommand : ICommand { | |||
| 24 | * @param processor - The CommandListProcessor processing this command. | 25 | * @param processor - The CommandListProcessor processing this command. |
| 25 | * @param string - The string to print into. | 26 | * @param string - The string to print into. |
| 26 | */ | 27 | */ |
| 27 | void Dump(const ADSP::CommandListProcessor& processor, std::string& string) override; | 28 | void Dump(const AudioRenderer::CommandListProcessor& processor, std::string& string) override; |
| 28 | 29 | ||
| 29 | /** | 30 | /** |
| 30 | * Process this command. | 31 | * Process this command. |
| 31 | * | 32 | * |
| 32 | * @param processor - The CommandListProcessor processing this command. | 33 | * @param processor - The CommandListProcessor processing this command. |
| 33 | */ | 34 | */ |
| 34 | void Process(const ADSP::CommandListProcessor& processor) override; | 35 | void Process(const AudioRenderer::CommandListProcessor& processor) override; |
| 35 | 36 | ||
| 36 | /** | 37 | /** |
| 37 | * Verify this command's data is valid. | 38 | * Verify this command's data is valid. |
| @@ -39,7 +40,7 @@ struct VolumeRampCommand : ICommand { | |||
| 39 | * @param processor - The CommandListProcessor processing this command. | 40 | * @param processor - The CommandListProcessor processing this command. |
| 40 | * @return True if the command is valid, otherwise false. | 41 | * @return True if the command is valid, otherwise false. |
| 41 | */ | 42 | */ |
| 42 | bool Verify(const ADSP::CommandListProcessor& processor) override; | 43 | bool Verify(const AudioRenderer::CommandListProcessor& processor) override; |
| 43 | 44 | ||
| 44 | /// Fixed point precision | 45 | /// Fixed point precision |
| 45 | u8 precision; | 46 | u8 precision; |
| @@ -53,4 +54,4 @@ struct VolumeRampCommand : ICommand { | |||
| 53 | f32 volume; | 54 | f32 volume; |
| 54 | }; | 55 | }; |
| 55 | 56 | ||
| 56 | } // namespace AudioCore::AudioRenderer | 57 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/performance/performance.cpp b/src/audio_core/renderer/command/performance/performance.cpp index 4a881547f..f0cfcc9fd 100644 --- a/src/audio_core/renderer/command/performance/performance.cpp +++ b/src/audio_core/renderer/command/performance/performance.cpp | |||
| @@ -1,25 +1,25 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include "audio_core/renderer/adsp/command_list_processor.h" | 4 | #include "audio_core/adsp/apps/audio_renderer/command_list_processor.h" |
| 5 | #include "audio_core/renderer/command/performance/performance.h" | 5 | #include "audio_core/renderer/command/performance/performance.h" |
| 6 | #include "core/core.h" | 6 | #include "core/core.h" |
| 7 | #include "core/core_timing.h" | 7 | #include "core/core_timing.h" |
| 8 | 8 | ||
| 9 | namespace AudioCore::AudioRenderer { | 9 | namespace AudioCore::Renderer { |
| 10 | 10 | ||
| 11 | void PerformanceCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, | 11 | void PerformanceCommand::Dump([[maybe_unused]] const AudioRenderer::CommandListProcessor& processor, |
| 12 | std::string& string) { | 12 | std::string& string) { |
| 13 | string += fmt::format("PerformanceCommand\n\tstate {}\n", static_cast<u32>(state)); | 13 | string += fmt::format("PerformanceCommand\n\tstate {}\n", static_cast<u32>(state)); |
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | void PerformanceCommand::Process(const ADSP::CommandListProcessor& processor) { | 16 | void PerformanceCommand::Process(const AudioRenderer::CommandListProcessor& processor) { |
| 17 | auto base{entry_address.translated_address}; | 17 | auto base{entry_address.translated_address}; |
| 18 | if (state == PerformanceState::Start) { | 18 | if (state == PerformanceState::Start) { |
| 19 | auto start_time_ptr{reinterpret_cast<u32*>(base + entry_address.entry_start_time_offset)}; | 19 | auto start_time_ptr{reinterpret_cast<u32*>(base + entry_address.entry_start_time_offset)}; |
| 20 | *start_time_ptr = | 20 | *start_time_ptr = |
| 21 | static_cast<u32>(processor.system->CoreTiming().GetClockTicks() - processor.start_time - | 21 | static_cast<u32>(processor.system->CoreTiming().GetGlobalTimeUs().count() - |
| 22 | processor.current_processing_time); | 22 | processor.start_time - processor.current_processing_time); |
| 23 | } else if (state == PerformanceState::Stop) { | 23 | } else if (state == PerformanceState::Stop) { |
| 24 | auto processed_time_ptr{ | 24 | auto processed_time_ptr{ |
| 25 | reinterpret_cast<u32*>(base + entry_address.entry_processed_time_offset)}; | 25 | reinterpret_cast<u32*>(base + entry_address.entry_processed_time_offset)}; |
| @@ -27,14 +27,14 @@ void PerformanceCommand::Process(const ADSP::CommandListProcessor& processor) { | |||
| 27 | reinterpret_cast<u32*>(base + entry_address.header_entry_count_offset)}; | 27 | reinterpret_cast<u32*>(base + entry_address.header_entry_count_offset)}; |
| 28 | 28 | ||
| 29 | *processed_time_ptr = | 29 | *processed_time_ptr = |
| 30 | static_cast<u32>(processor.system->CoreTiming().GetClockTicks() - processor.start_time - | 30 | static_cast<u32>(processor.system->CoreTiming().GetGlobalTimeUs().count() - |
| 31 | processor.current_processing_time); | 31 | processor.start_time - processor.current_processing_time); |
| 32 | (*entry_count_ptr)++; | 32 | (*entry_count_ptr)++; |
| 33 | } | 33 | } |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | bool PerformanceCommand::Verify(const ADSP::CommandListProcessor& processor) { | 36 | bool PerformanceCommand::Verify(const AudioRenderer::CommandListProcessor& processor) { |
| 37 | return true; | 37 | return true; |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | } // namespace AudioCore::AudioRenderer | 40 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/performance/performance.h b/src/audio_core/renderer/command/performance/performance.h index 11a7d6c08..522e51e34 100644 --- a/src/audio_core/renderer/command/performance/performance.h +++ b/src/audio_core/renderer/command/performance/performance.h | |||
| @@ -10,11 +10,12 @@ | |||
| 10 | #include "audio_core/renderer/performance/performance_manager.h" | 10 | #include "audio_core/renderer/performance/performance_manager.h" |
| 11 | #include "common/common_types.h" | 11 | #include "common/common_types.h" |
| 12 | 12 | ||
| 13 | namespace AudioCore::AudioRenderer { | 13 | namespace AudioCore::ADSP::AudioRenderer { |
| 14 | namespace ADSP { | ||
| 15 | class CommandListProcessor; | 14 | class CommandListProcessor; |
| 16 | } | 15 | } |
| 17 | 16 | ||
| 17 | namespace AudioCore::Renderer { | ||
| 18 | |||
| 18 | /** | 19 | /** |
| 19 | * AudioRenderer command for writing AudioRenderer performance metrics back to the sysmodule. | 20 | * AudioRenderer command for writing AudioRenderer performance metrics back to the sysmodule. |
| 20 | */ | 21 | */ |
| @@ -25,14 +26,14 @@ struct PerformanceCommand : ICommand { | |||
| 25 | * @param processor - The CommandListProcessor processing this command. | 26 | * @param processor - The CommandListProcessor processing this command. |
| 26 | * @param string - The string to print into. | 27 | * @param string - The string to print into. |
| 27 | */ | 28 | */ |
| 28 | void Dump(const ADSP::CommandListProcessor& processor, std::string& string) override; | 29 | void Dump(const AudioRenderer::CommandListProcessor& processor, std::string& string) override; |
| 29 | 30 | ||
| 30 | /** | 31 | /** |
| 31 | * Process this command. | 32 | * Process this command. |
| 32 | * | 33 | * |
| 33 | * @param processor - The CommandListProcessor processing this command. | 34 | * @param processor - The CommandListProcessor processing this command. |
| 34 | */ | 35 | */ |
| 35 | void Process(const ADSP::CommandListProcessor& processor) override; | 36 | void Process(const AudioRenderer::CommandListProcessor& processor) override; |
| 36 | 37 | ||
| 37 | /** | 38 | /** |
| 38 | * Verify this command's data is valid. | 39 | * Verify this command's data is valid. |
| @@ -40,7 +41,7 @@ struct PerformanceCommand : ICommand { | |||
| 40 | * @param processor - The CommandListProcessor processing this command. | 41 | * @param processor - The CommandListProcessor processing this command. |
| 41 | * @return True if the command is valid, otherwise false. | 42 | * @return True if the command is valid, otherwise false. |
| 42 | */ | 43 | */ |
| 43 | bool Verify(const ADSP::CommandListProcessor& processor) override; | 44 | bool Verify(const AudioRenderer::CommandListProcessor& processor) override; |
| 44 | 45 | ||
| 45 | /// State of the performance | 46 | /// State of the performance |
| 46 | PerformanceState state; | 47 | PerformanceState state; |
| @@ -48,4 +49,4 @@ struct PerformanceCommand : ICommand { | |||
| 48 | PerformanceEntryAddresses entry_address; | 49 | PerformanceEntryAddresses entry_address; |
| 49 | }; | 50 | }; |
| 50 | 51 | ||
| 51 | } // namespace AudioCore::AudioRenderer | 52 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/resample/downmix_6ch_to_2ch.cpp b/src/audio_core/renderer/command/resample/downmix_6ch_to_2ch.cpp index 1fd90308a..f9b289887 100644 --- a/src/audio_core/renderer/command/resample/downmix_6ch_to_2ch.cpp +++ b/src/audio_core/renderer/command/resample/downmix_6ch_to_2ch.cpp | |||
| @@ -1,13 +1,13 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include "audio_core/renderer/adsp/command_list_processor.h" | 4 | #include "audio_core/adsp/apps/audio_renderer/command_list_processor.h" |
| 5 | #include "audio_core/renderer/command/resample/downmix_6ch_to_2ch.h" | 5 | #include "audio_core/renderer/command/resample/downmix_6ch_to_2ch.h" |
| 6 | 6 | ||
| 7 | namespace AudioCore::AudioRenderer { | 7 | namespace AudioCore::Renderer { |
| 8 | 8 | ||
| 9 | void DownMix6chTo2chCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, | 9 | void DownMix6chTo2chCommand::Dump( |
| 10 | std::string& string) { | 10 | [[maybe_unused]] const AudioRenderer::CommandListProcessor& processor, std::string& string) { |
| 11 | string += fmt::format("DownMix6chTo2chCommand\n\tinputs: "); | 11 | string += fmt::format("DownMix6chTo2chCommand\n\tinputs: "); |
| 12 | for (u32 i = 0; i < MaxChannels; i++) { | 12 | for (u32 i = 0; i < MaxChannels; i++) { |
| 13 | string += fmt::format("{:02X}, ", inputs[i]); | 13 | string += fmt::format("{:02X}, ", inputs[i]); |
| @@ -19,7 +19,7 @@ void DownMix6chTo2chCommand::Dump([[maybe_unused]] const ADSP::CommandListProces | |||
| 19 | string += "\n"; | 19 | string += "\n"; |
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | void DownMix6chTo2chCommand::Process(const ADSP::CommandListProcessor& processor) { | 22 | void DownMix6chTo2chCommand::Process(const AudioRenderer::CommandListProcessor& processor) { |
| 23 | auto in_front_left{ | 23 | auto in_front_left{ |
| 24 | processor.mix_buffers.subspan(inputs[0] * processor.sample_count, processor.sample_count)}; | 24 | processor.mix_buffers.subspan(inputs[0] * processor.sample_count, processor.sample_count)}; |
| 25 | auto in_front_right{ | 25 | auto in_front_right{ |
| @@ -67,8 +67,8 @@ void DownMix6chTo2chCommand::Process(const ADSP::CommandListProcessor& processor | |||
| 67 | std::memset(out_back_right.data(), 0, out_back_right.size_bytes()); | 67 | std::memset(out_back_right.data(), 0, out_back_right.size_bytes()); |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | bool DownMix6chTo2chCommand::Verify(const ADSP::CommandListProcessor& processor) { | 70 | bool DownMix6chTo2chCommand::Verify(const AudioRenderer::CommandListProcessor& processor) { |
| 71 | return true; | 71 | return true; |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | } // namespace AudioCore::AudioRenderer | 74 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/resample/downmix_6ch_to_2ch.h b/src/audio_core/renderer/command/resample/downmix_6ch_to_2ch.h index dc133a73b..96cbc5506 100644 --- a/src/audio_core/renderer/command/resample/downmix_6ch_to_2ch.h +++ b/src/audio_core/renderer/command/resample/downmix_6ch_to_2ch.h | |||
| @@ -9,11 +9,12 @@ | |||
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | #include "common/fixed_point.h" | 10 | #include "common/fixed_point.h" |
| 11 | 11 | ||
| 12 | namespace AudioCore::AudioRenderer { | 12 | namespace AudioCore::ADSP::AudioRenderer { |
| 13 | namespace ADSP { | ||
| 14 | class CommandListProcessor; | 13 | class CommandListProcessor; |
| 15 | } | 14 | } |
| 16 | 15 | ||
| 16 | namespace AudioCore::Renderer { | ||
| 17 | |||
| 17 | /** | 18 | /** |
| 18 | * AudioRenderer command for downmixing 6 channels to 2. | 19 | * AudioRenderer command for downmixing 6 channels to 2. |
| 19 | * Channel layout (SMPTE): | 20 | * Channel layout (SMPTE): |
| @@ -31,14 +32,14 @@ struct DownMix6chTo2chCommand : ICommand { | |||
| 31 | * @param processor - The CommandListProcessor processing this command. | 32 | * @param processor - The CommandListProcessor processing this command. |
| 32 | * @param string - The string to print into. | 33 | * @param string - The string to print into. |
| 33 | */ | 34 | */ |
| 34 | void Dump(const ADSP::CommandListProcessor& processor, std::string& string) override; | 35 | void Dump(const AudioRenderer::CommandListProcessor& processor, std::string& string) override; |
| 35 | 36 | ||
| 36 | /** | 37 | /** |
| 37 | * Process this command. | 38 | * Process this command. |
| 38 | * | 39 | * |
| 39 | * @param processor - The CommandListProcessor processing this command. | 40 | * @param processor - The CommandListProcessor processing this command. |
| 40 | */ | 41 | */ |
| 41 | void Process(const ADSP::CommandListProcessor& processor) override; | 42 | void Process(const AudioRenderer::CommandListProcessor& processor) override; |
| 42 | 43 | ||
| 43 | /** | 44 | /** |
| 44 | * Verify this command's data is valid. | 45 | * Verify this command's data is valid. |
| @@ -46,7 +47,7 @@ struct DownMix6chTo2chCommand : ICommand { | |||
| 46 | * @param processor - The CommandListProcessor processing this command. | 47 | * @param processor - The CommandListProcessor processing this command. |
| 47 | * @return True if the command is valid, otherwise false. | 48 | * @return True if the command is valid, otherwise false. |
| 48 | */ | 49 | */ |
| 49 | bool Verify(const ADSP::CommandListProcessor& processor) override; | 50 | bool Verify(const AudioRenderer::CommandListProcessor& processor) override; |
| 50 | 51 | ||
| 51 | /// Input mix buffer offsets for each channel | 52 | /// Input mix buffer offsets for each channel |
| 52 | std::array<s16, MaxChannels> inputs; | 53 | std::array<s16, MaxChannels> inputs; |
| @@ -56,4 +57,4 @@ struct DownMix6chTo2chCommand : ICommand { | |||
| 56 | std::array<Common::FixedPoint<48, 16>, 4> down_mix_coeff; | 57 | std::array<Common::FixedPoint<48, 16>, 4> down_mix_coeff; |
| 57 | }; | 58 | }; |
| 58 | 59 | ||
| 59 | } // namespace AudioCore::AudioRenderer | 60 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/resample/resample.cpp b/src/audio_core/renderer/command/resample/resample.cpp index 070c9d2b8..51f4ba39e 100644 --- a/src/audio_core/renderer/command/resample/resample.cpp +++ b/src/audio_core/renderer/command/resample/resample.cpp | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include "audio_core/renderer/command/resample/resample.h" | 4 | #include "audio_core/renderer/command/resample/resample.h" |
| 5 | 5 | ||
| 6 | namespace AudioCore::AudioRenderer { | 6 | namespace AudioCore::Renderer { |
| 7 | 7 | ||
| 8 | static void ResampleLowQuality(std::span<s32> output, std::span<const s16> input, | 8 | static void ResampleLowQuality(std::span<s32> output, std::span<const s16> input, |
| 9 | const Common::FixedPoint<49, 15>& sample_rate_ratio, | 9 | const Common::FixedPoint<49, 15>& sample_rate_ratio, |
| @@ -880,4 +880,4 @@ void Resample(std::span<s32> output, std::span<const s16> input, | |||
| 880 | } | 880 | } |
| 881 | } | 881 | } |
| 882 | 882 | ||
| 883 | } // namespace AudioCore::AudioRenderer | 883 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/resample/resample.h b/src/audio_core/renderer/command/resample/resample.h index ba9209b82..134aff0c9 100644 --- a/src/audio_core/renderer/command/resample/resample.h +++ b/src/audio_core/renderer/command/resample/resample.h | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | #include "common/fixed_point.h" | 10 | #include "common/fixed_point.h" |
| 11 | 11 | ||
| 12 | namespace AudioCore::AudioRenderer { | 12 | namespace AudioCore::Renderer { |
| 13 | /** | 13 | /** |
| 14 | * Resample an input buffer into an output buffer, according to the sample_rate_ratio. | 14 | * Resample an input buffer into an output buffer, according to the sample_rate_ratio. |
| 15 | * | 15 | * |
| @@ -26,4 +26,4 @@ void Resample(std::span<s32> output, std::span<const s16> input, | |||
| 26 | const Common::FixedPoint<49, 15>& sample_rate_ratio, | 26 | const Common::FixedPoint<49, 15>& sample_rate_ratio, |
| 27 | Common::FixedPoint<49, 15>& fraction, u32 samples_to_write, SrcQuality src_quality); | 27 | Common::FixedPoint<49, 15>& fraction, u32 samples_to_write, SrcQuality src_quality); |
| 28 | 28 | ||
| 29 | } // namespace AudioCore::AudioRenderer | 29 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/resample/upsample.cpp b/src/audio_core/renderer/command/resample/upsample.cpp index 86ddee1a4..691d70390 100644 --- a/src/audio_core/renderer/command/resample/upsample.cpp +++ b/src/audio_core/renderer/command/resample/upsample.cpp | |||
| @@ -3,11 +3,11 @@ | |||
| 3 | 3 | ||
| 4 | #include <array> | 4 | #include <array> |
| 5 | 5 | ||
| 6 | #include "audio_core/renderer/adsp/command_list_processor.h" | 6 | #include "audio_core/adsp/apps/audio_renderer/command_list_processor.h" |
| 7 | #include "audio_core/renderer/command/resample/upsample.h" | 7 | #include "audio_core/renderer/command/resample/upsample.h" |
| 8 | #include "audio_core/renderer/upsampler/upsampler_info.h" | 8 | #include "audio_core/renderer/upsampler/upsampler_info.h" |
| 9 | 9 | ||
| 10 | namespace AudioCore::AudioRenderer { | 10 | namespace AudioCore::Renderer { |
| 11 | /** | 11 | /** |
| 12 | * Upsampling impl. Input must be 8K, 16K or 32K, output is 48K. | 12 | * Upsampling impl. Input must be 8K, 16K or 32K, output is 48K. |
| 13 | * | 13 | * |
| @@ -198,7 +198,7 @@ static void SrcProcessFrame(std::span<s32> output, std::span<const s32> input, | |||
| 198 | } | 198 | } |
| 199 | } | 199 | } |
| 200 | 200 | ||
| 201 | auto UpsampleCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, | 201 | auto UpsampleCommand::Dump([[maybe_unused]] const AudioRenderer::CommandListProcessor& processor, |
| 202 | std::string& string) -> void { | 202 | std::string& string) -> void { |
| 203 | string += fmt::format("UpsampleCommand\n\tsource_sample_count {} source_sample_rate {}", | 203 | string += fmt::format("UpsampleCommand\n\tsource_sample_count {} source_sample_rate {}", |
| 204 | source_sample_count, source_sample_rate); | 204 | source_sample_count, source_sample_rate); |
| @@ -213,7 +213,7 @@ auto UpsampleCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& pr | |||
| 213 | string += "\n"; | 213 | string += "\n"; |
| 214 | } | 214 | } |
| 215 | 215 | ||
| 216 | void UpsampleCommand::Process(const ADSP::CommandListProcessor& processor) { | 216 | void UpsampleCommand::Process(const AudioRenderer::CommandListProcessor& processor) { |
| 217 | const auto info{reinterpret_cast<UpsamplerInfo*>(upsampler_info)}; | 217 | const auto info{reinterpret_cast<UpsamplerInfo*>(upsampler_info)}; |
| 218 | const auto input_count{std::min(info->input_count, buffer_count)}; | 218 | const auto input_count{std::min(info->input_count, buffer_count)}; |
| 219 | const std::span<const s16> inputs_{reinterpret_cast<const s16*>(inputs), input_count}; | 219 | const std::span<const s16> inputs_{reinterpret_cast<const s16*>(inputs), input_count}; |
| @@ -234,8 +234,8 @@ void UpsampleCommand::Process(const ADSP::CommandListProcessor& processor) { | |||
| 234 | } | 234 | } |
| 235 | } | 235 | } |
| 236 | 236 | ||
| 237 | bool UpsampleCommand::Verify(const ADSP::CommandListProcessor& processor) { | 237 | bool UpsampleCommand::Verify(const AudioRenderer::CommandListProcessor& processor) { |
| 238 | return true; | 238 | return true; |
| 239 | } | 239 | } |
| 240 | 240 | ||
| 241 | } // namespace AudioCore::AudioRenderer | 241 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/resample/upsample.h b/src/audio_core/renderer/command/resample/upsample.h index bfc94e8af..877271ba9 100644 --- a/src/audio_core/renderer/command/resample/upsample.h +++ b/src/audio_core/renderer/command/resample/upsample.h | |||
| @@ -8,11 +8,12 @@ | |||
| 8 | #include "audio_core/renderer/command/icommand.h" | 8 | #include "audio_core/renderer/command/icommand.h" |
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | 10 | ||
| 11 | namespace AudioCore::AudioRenderer { | 11 | namespace AudioCore::ADSP::AudioRenderer { |
| 12 | namespace ADSP { | ||
| 13 | class CommandListProcessor; | 12 | class CommandListProcessor; |
| 14 | } | 13 | } |
| 15 | 14 | ||
| 15 | namespace AudioCore::Renderer { | ||
| 16 | |||
| 16 | /** | 17 | /** |
| 17 | * AudioRenderer command for upsampling a mix buffer to 48Khz. | 18 | * AudioRenderer command for upsampling a mix buffer to 48Khz. |
| 18 | * Input must be 8Khz, 16Khz or 32Khz, and output will be 48Khz. | 19 | * Input must be 8Khz, 16Khz or 32Khz, and output will be 48Khz. |
| @@ -24,14 +25,14 @@ struct UpsampleCommand : ICommand { | |||
| 24 | * @param processor - The CommandListProcessor processing this command. | 25 | * @param processor - The CommandListProcessor processing this command. |
| 25 | * @param string - The string to print into. | 26 | * @param string - The string to print into. |
| 26 | */ | 27 | */ |
| 27 | void Dump(const ADSP::CommandListProcessor& processor, std::string& string) override; | 28 | void Dump(const AudioRenderer::CommandListProcessor& processor, std::string& string) override; |
| 28 | 29 | ||
| 29 | /** | 30 | /** |
| 30 | * Process this command. | 31 | * Process this command. |
| 31 | * | 32 | * |
| 32 | * @param processor - The CommandListProcessor processing this command. | 33 | * @param processor - The CommandListProcessor processing this command. |
| 33 | */ | 34 | */ |
| 34 | void Process(const ADSP::CommandListProcessor& processor) override; | 35 | void Process(const AudioRenderer::CommandListProcessor& processor) override; |
| 35 | 36 | ||
| 36 | /** | 37 | /** |
| 37 | * Verify this command's data is valid. | 38 | * Verify this command's data is valid. |
| @@ -39,7 +40,7 @@ struct UpsampleCommand : ICommand { | |||
| 39 | * @param processor - The CommandListProcessor processing this command. | 40 | * @param processor - The CommandListProcessor processing this command. |
| 40 | * @return True if the command is valid, otherwise false. | 41 | * @return True if the command is valid, otherwise false. |
| 41 | */ | 42 | */ |
| 42 | bool Verify(const ADSP::CommandListProcessor& processor) override; | 43 | bool Verify(const AudioRenderer::CommandListProcessor& processor) override; |
| 43 | 44 | ||
| 44 | /// Pointer to the output samples buffer. | 45 | /// Pointer to the output samples buffer. |
| 45 | CpuAddr samples_buffer; | 46 | CpuAddr samples_buffer; |
| @@ -57,4 +58,4 @@ struct UpsampleCommand : ICommand { | |||
| 57 | CpuAddr upsampler_info; | 58 | CpuAddr upsampler_info; |
| 58 | }; | 59 | }; |
| 59 | 60 | ||
| 60 | } // namespace AudioCore::AudioRenderer | 61 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/sink/circular_buffer.cpp b/src/audio_core/renderer/command/sink/circular_buffer.cpp index e2ce59792..e056d15a6 100644 --- a/src/audio_core/renderer/command/sink/circular_buffer.cpp +++ b/src/audio_core/renderer/command/sink/circular_buffer.cpp | |||
| @@ -3,14 +3,14 @@ | |||
| 3 | 3 | ||
| 4 | #include <vector> | 4 | #include <vector> |
| 5 | 5 | ||
| 6 | #include "audio_core/renderer/adsp/command_list_processor.h" | 6 | #include "audio_core/adsp/apps/audio_renderer/command_list_processor.h" |
| 7 | #include "audio_core/renderer/command/sink/circular_buffer.h" | 7 | #include "audio_core/renderer/command/sink/circular_buffer.h" |
| 8 | #include "core/memory.h" | 8 | #include "core/memory.h" |
| 9 | 9 | ||
| 10 | namespace AudioCore::AudioRenderer { | 10 | namespace AudioCore::Renderer { |
| 11 | 11 | ||
| 12 | void CircularBufferSinkCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, | 12 | void CircularBufferSinkCommand::Dump( |
| 13 | std::string& string) { | 13 | [[maybe_unused]] const AudioRenderer::CommandListProcessor& processor, std::string& string) { |
| 14 | string += fmt::format( | 14 | string += fmt::format( |
| 15 | "CircularBufferSinkCommand\n\tinput_count {} ring size {:04X} ring pos {:04X}\n\tinputs: ", | 15 | "CircularBufferSinkCommand\n\tinput_count {} ring size {:04X} ring pos {:04X}\n\tinputs: ", |
| 16 | input_count, size, pos); | 16 | input_count, size, pos); |
| @@ -20,7 +20,7 @@ void CircularBufferSinkCommand::Dump([[maybe_unused]] const ADSP::CommandListPro | |||
| 20 | string += "\n"; | 20 | string += "\n"; |
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | void CircularBufferSinkCommand::Process(const ADSP::CommandListProcessor& processor) { | 23 | void CircularBufferSinkCommand::Process(const AudioRenderer::CommandListProcessor& processor) { |
| 24 | constexpr s32 min{std::numeric_limits<s16>::min()}; | 24 | constexpr s32 min{std::numeric_limits<s16>::min()}; |
| 25 | constexpr s32 max{std::numeric_limits<s16>::max()}; | 25 | constexpr s32 max{std::numeric_limits<s16>::max()}; |
| 26 | 26 | ||
| @@ -41,8 +41,8 @@ void CircularBufferSinkCommand::Process(const ADSP::CommandListProcessor& proces | |||
| 41 | } | 41 | } |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | bool CircularBufferSinkCommand::Verify(const ADSP::CommandListProcessor& processor) { | 44 | bool CircularBufferSinkCommand::Verify(const AudioRenderer::CommandListProcessor& processor) { |
| 45 | return true; | 45 | return true; |
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | } // namespace AudioCore::AudioRenderer | 48 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/sink/circular_buffer.h b/src/audio_core/renderer/command/sink/circular_buffer.h index e7d5be26e..a3234a406 100644 --- a/src/audio_core/renderer/command/sink/circular_buffer.h +++ b/src/audio_core/renderer/command/sink/circular_buffer.h | |||
| @@ -8,11 +8,12 @@ | |||
| 8 | #include "audio_core/renderer/command/icommand.h" | 8 | #include "audio_core/renderer/command/icommand.h" |
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | 10 | ||
| 11 | namespace AudioCore::AudioRenderer { | 11 | namespace AudioCore::ADSP::AudioRenderer { |
| 12 | namespace ADSP { | ||
| 13 | class CommandListProcessor; | 12 | class CommandListProcessor; |
| 14 | } | 13 | } |
| 15 | 14 | ||
| 15 | namespace AudioCore::Renderer { | ||
| 16 | |||
| 16 | /** | 17 | /** |
| 17 | * AudioRenderer command for sinking samples to a circular buffer. | 18 | * AudioRenderer command for sinking samples to a circular buffer. |
| 18 | */ | 19 | */ |
| @@ -23,14 +24,14 @@ struct CircularBufferSinkCommand : ICommand { | |||
| 23 | * @param processor - The CommandListProcessor processing this command. | 24 | * @param processor - The CommandListProcessor processing this command. |
| 24 | * @param string - The string to print into. | 25 | * @param string - The string to print into. |
| 25 | */ | 26 | */ |
| 26 | void Dump(const ADSP::CommandListProcessor& processor, std::string& string) override; | 27 | void Dump(const AudioRenderer::CommandListProcessor& processor, std::string& string) override; |
| 27 | 28 | ||
| 28 | /** | 29 | /** |
| 29 | * Process this command. | 30 | * Process this command. |
| 30 | * | 31 | * |
| 31 | * @param processor - The CommandListProcessor processing this command. | 32 | * @param processor - The CommandListProcessor processing this command. |
| 32 | */ | 33 | */ |
| 33 | void Process(const ADSP::CommandListProcessor& processor) override; | 34 | void Process(const AudioRenderer::CommandListProcessor& processor) override; |
| 34 | 35 | ||
| 35 | /** | 36 | /** |
| 36 | * Verify this command's data is valid. | 37 | * Verify this command's data is valid. |
| @@ -38,7 +39,7 @@ struct CircularBufferSinkCommand : ICommand { | |||
| 38 | * @param processor - The CommandListProcessor processing this command. | 39 | * @param processor - The CommandListProcessor processing this command. |
| 39 | * @return True if the command is valid, otherwise false. | 40 | * @return True if the command is valid, otherwise false. |
| 40 | */ | 41 | */ |
| 41 | bool Verify(const ADSP::CommandListProcessor& processor) override; | 42 | bool Verify(const AudioRenderer::CommandListProcessor& processor) override; |
| 42 | 43 | ||
| 43 | /// Number of input mix buffers | 44 | /// Number of input mix buffers |
| 44 | u32 input_count; | 45 | u32 input_count; |
| @@ -52,4 +53,4 @@ struct CircularBufferSinkCommand : ICommand { | |||
| 52 | u32 pos; | 53 | u32 pos; |
| 53 | }; | 54 | }; |
| 54 | 55 | ||
| 55 | } // namespace AudioCore::AudioRenderer | 56 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/sink/device.cpp b/src/audio_core/renderer/command/sink/device.cpp index 5f74dd7ad..3480ed475 100644 --- a/src/audio_core/renderer/command/sink/device.cpp +++ b/src/audio_core/renderer/command/sink/device.cpp | |||
| @@ -3,13 +3,13 @@ | |||
| 3 | 3 | ||
| 4 | #include <algorithm> | 4 | #include <algorithm> |
| 5 | 5 | ||
| 6 | #include "audio_core/renderer/adsp/command_list_processor.h" | 6 | #include "audio_core/adsp/apps/audio_renderer/command_list_processor.h" |
| 7 | #include "audio_core/renderer/command/sink/device.h" | 7 | #include "audio_core/renderer/command/sink/device.h" |
| 8 | #include "audio_core/sink/sink.h" | 8 | #include "audio_core/sink/sink.h" |
| 9 | 9 | ||
| 10 | namespace AudioCore::AudioRenderer { | 10 | namespace AudioCore::Renderer { |
| 11 | 11 | ||
| 12 | void DeviceSinkCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, | 12 | void DeviceSinkCommand::Dump([[maybe_unused]] const AudioRenderer::CommandListProcessor& processor, |
| 13 | std::string& string) { | 13 | std::string& string) { |
| 14 | string += fmt::format("DeviceSinkCommand\n\t{} session {} input_count {}\n\tinputs: ", | 14 | string += fmt::format("DeviceSinkCommand\n\t{} session {} input_count {}\n\tinputs: ", |
| 15 | std::string_view(name), session_id, input_count); | 15 | std::string_view(name), session_id, input_count); |
| @@ -19,7 +19,7 @@ void DeviceSinkCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& | |||
| 19 | string += "\n"; | 19 | string += "\n"; |
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | void DeviceSinkCommand::Process(const ADSP::CommandListProcessor& processor) { | 22 | void DeviceSinkCommand::Process(const AudioRenderer::CommandListProcessor& processor) { |
| 23 | constexpr s32 min = std::numeric_limits<s16>::min(); | 23 | constexpr s32 min = std::numeric_limits<s16>::min(); |
| 24 | constexpr s32 max = std::numeric_limits<s16>::max(); | 24 | constexpr s32 max = std::numeric_limits<s16>::max(); |
| 25 | 25 | ||
| @@ -51,8 +51,8 @@ void DeviceSinkCommand::Process(const ADSP::CommandListProcessor& processor) { | |||
| 51 | } | 51 | } |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | bool DeviceSinkCommand::Verify(const ADSP::CommandListProcessor& processor) { | 54 | bool DeviceSinkCommand::Verify(const AudioRenderer::CommandListProcessor& processor) { |
| 55 | return true; | 55 | return true; |
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | } // namespace AudioCore::AudioRenderer | 58 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/command/sink/device.h b/src/audio_core/renderer/command/sink/device.h index 1099bcf8c..385b51ecc 100644 --- a/src/audio_core/renderer/command/sink/device.h +++ b/src/audio_core/renderer/command/sink/device.h | |||
| @@ -10,11 +10,12 @@ | |||
| 10 | #include "audio_core/renderer/command/icommand.h" | 10 | #include "audio_core/renderer/command/icommand.h" |
| 11 | #include "common/common_types.h" | 11 | #include "common/common_types.h" |
| 12 | 12 | ||
| 13 | namespace AudioCore::AudioRenderer { | 13 | namespace AudioCore::ADSP::AudioRenderer { |
| 14 | namespace ADSP { | ||
| 15 | class CommandListProcessor; | 14 | class CommandListProcessor; |
| 16 | } | 15 | } |
| 17 | 16 | ||
| 17 | namespace AudioCore::Renderer { | ||
| 18 | |||
| 18 | /** | 19 | /** |
| 19 | * AudioRenderer command for sinking samples to an output device. | 20 | * AudioRenderer command for sinking samples to an output device. |
| 20 | */ | 21 | */ |
| @@ -25,14 +26,14 @@ struct DeviceSinkCommand : ICommand { | |||
| 25 | * @param processor - The CommandListProcessor processing this command. | 26 | * @param processor - The CommandListProcessor processing this command. |
| 26 | * @param string - The string to print into. | 27 | * @param string - The string to print into. |
| 27 | */ | 28 | */ |
| 28 | void Dump(const ADSP::CommandListProcessor& processor, std::string& string) override; | 29 | void Dump(const AudioRenderer::CommandListProcessor& processor, std::string& string) override; |
| 29 | 30 | ||
| 30 | /** | 31 | /** |
| 31 | * Process this command. | 32 | * Process this command. |
| 32 | * | 33 | * |
| 33 | * @param processor - The CommandListProcessor processing this command. | 34 | * @param processor - The CommandListProcessor processing this command. |
| 34 | */ | 35 | */ |
| 35 | void Process(const ADSP::CommandListProcessor& processor) override; | 36 | void Process(const AudioRenderer::CommandListProcessor& processor) override; |
| 36 | 37 | ||
| 37 | /** | 38 | /** |
| 38 | * Verify this command's data is valid. | 39 | * Verify this command's data is valid. |
| @@ -40,7 +41,7 @@ struct DeviceSinkCommand : ICommand { | |||
| 40 | * @param processor - The CommandListProcessor processing this command. | 41 | * @param processor - The CommandListProcessor processing this command. |
| 41 | * @return True if the command is valid, otherwise false. | 42 | * @return True if the command is valid, otherwise false. |
| 42 | */ | 43 | */ |
| 43 | bool Verify(const ADSP::CommandListProcessor& processor) override; | 44 | bool Verify(const AudioRenderer::CommandListProcessor& processor) override; |
| 44 | 45 | ||
| 45 | /// Device name | 46 | /// Device name |
| 46 | char name[0x100]; | 47 | char name[0x100]; |
| @@ -54,4 +55,4 @@ struct DeviceSinkCommand : ICommand { | |||
| 54 | std::array<s16, MaxChannels> inputs; | 55 | std::array<s16, MaxChannels> inputs; |
| 55 | }; | 56 | }; |
| 56 | 57 | ||
| 57 | } // namespace AudioCore::AudioRenderer | 58 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/effect/aux_.cpp b/src/audio_core/renderer/effect/aux_.cpp index 51e780ef1..1c1411eff 100644 --- a/src/audio_core/renderer/effect/aux_.cpp +++ b/src/audio_core/renderer/effect/aux_.cpp | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include "audio_core/renderer/effect/aux_.h" | 4 | #include "audio_core/renderer/effect/aux_.h" |
| 5 | 5 | ||
| 6 | namespace AudioCore::AudioRenderer { | 6 | namespace AudioCore::Renderer { |
| 7 | 7 | ||
| 8 | void AuxInfo::Update(BehaviorInfo::ErrorInfo& error_info, const InParameterVersion1& in_params, | 8 | void AuxInfo::Update(BehaviorInfo::ErrorInfo& error_info, const InParameterVersion1& in_params, |
| 9 | const PoolMapper& pool_mapper) { | 9 | const PoolMapper& pool_mapper) { |
| @@ -90,4 +90,4 @@ CpuAddr AuxInfo::GetWorkbuffer(s32 index) { | |||
| 90 | return workbuffers[index].GetReference(true); | 90 | return workbuffers[index].GetReference(true); |
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | } // namespace AudioCore::AudioRenderer | 93 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/effect/aux_.h b/src/audio_core/renderer/effect/aux_.h index 4d3d9e3d9..c5b3058da 100644 --- a/src/audio_core/renderer/effect/aux_.h +++ b/src/audio_core/renderer/effect/aux_.h | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | #include "audio_core/renderer/effect/effect_info_base.h" | 9 | #include "audio_core/renderer/effect/effect_info_base.h" |
| 10 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 11 | 11 | ||
| 12 | namespace AudioCore::AudioRenderer { | 12 | namespace AudioCore::Renderer { |
| 13 | /** | 13 | /** |
| 14 | * Auxiliary Buffer used for Aux commands. | 14 | * Auxiliary Buffer used for Aux commands. |
| 15 | * Send and return buffers are available (names from the game's perspective). | 15 | * Send and return buffers are available (names from the game's perspective). |
| @@ -120,4 +120,4 @@ public: | |||
| 120 | CpuAddr GetWorkbuffer(s32 index) override; | 120 | CpuAddr GetWorkbuffer(s32 index) override; |
| 121 | }; | 121 | }; |
| 122 | 122 | ||
| 123 | } // namespace AudioCore::AudioRenderer | 123 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/effect/biquad_filter.cpp b/src/audio_core/renderer/effect/biquad_filter.cpp index a1efb3231..08161d840 100644 --- a/src/audio_core/renderer/effect/biquad_filter.cpp +++ b/src/audio_core/renderer/effect/biquad_filter.cpp | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include "audio_core/renderer/effect/biquad_filter.h" | 4 | #include "audio_core/renderer/effect/biquad_filter.h" |
| 5 | 5 | ||
| 6 | namespace AudioCore::AudioRenderer { | 6 | namespace AudioCore::Renderer { |
| 7 | 7 | ||
| 8 | void BiquadFilterInfo::Update(BehaviorInfo::ErrorInfo& error_info, | 8 | void BiquadFilterInfo::Update(BehaviorInfo::ErrorInfo& error_info, |
| 9 | const InParameterVersion1& in_params, const PoolMapper& pool_mapper) { | 9 | const InParameterVersion1& in_params, const PoolMapper& pool_mapper) { |
| @@ -49,4 +49,4 @@ void BiquadFilterInfo::InitializeResultState(EffectResultState& result_state) {} | |||
| 49 | void BiquadFilterInfo::UpdateResultState(EffectResultState& cpu_state, | 49 | void BiquadFilterInfo::UpdateResultState(EffectResultState& cpu_state, |
| 50 | EffectResultState& dsp_state) {} | 50 | EffectResultState& dsp_state) {} |
| 51 | 51 | ||
| 52 | } // namespace AudioCore::AudioRenderer | 52 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/effect/biquad_filter.h b/src/audio_core/renderer/effect/biquad_filter.h index f53fd5bab..5a22899ab 100644 --- a/src/audio_core/renderer/effect/biquad_filter.h +++ b/src/audio_core/renderer/effect/biquad_filter.h | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | #include "audio_core/renderer/effect/effect_info_base.h" | 9 | #include "audio_core/renderer/effect/effect_info_base.h" |
| 10 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 11 | 11 | ||
| 12 | namespace AudioCore::AudioRenderer { | 12 | namespace AudioCore::Renderer { |
| 13 | 13 | ||
| 14 | class BiquadFilterInfo : public EffectInfoBase { | 14 | class BiquadFilterInfo : public EffectInfoBase { |
| 15 | public: | 15 | public: |
| @@ -76,4 +76,4 @@ public: | |||
| 76 | void UpdateResultState(EffectResultState& cpu_state, EffectResultState& dsp_state) override; | 76 | void UpdateResultState(EffectResultState& cpu_state, EffectResultState& dsp_state) override; |
| 77 | }; | 77 | }; |
| 78 | 78 | ||
| 79 | } // namespace AudioCore::AudioRenderer | 79 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/effect/buffer_mixer.cpp b/src/audio_core/renderer/effect/buffer_mixer.cpp index 9c8877f01..826e246ec 100644 --- a/src/audio_core/renderer/effect/buffer_mixer.cpp +++ b/src/audio_core/renderer/effect/buffer_mixer.cpp | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include "audio_core/renderer/effect/buffer_mixer.h" | 4 | #include "audio_core/renderer/effect/buffer_mixer.h" |
| 5 | 5 | ||
| 6 | namespace AudioCore::AudioRenderer { | 6 | namespace AudioCore::Renderer { |
| 7 | 7 | ||
| 8 | void BufferMixerInfo::Update(BehaviorInfo::ErrorInfo& error_info, | 8 | void BufferMixerInfo::Update(BehaviorInfo::ErrorInfo& error_info, |
| 9 | const InParameterVersion1& in_params, const PoolMapper& pool_mapper) { | 9 | const InParameterVersion1& in_params, const PoolMapper& pool_mapper) { |
| @@ -46,4 +46,4 @@ void BufferMixerInfo::InitializeResultState(EffectResultState& result_state) {} | |||
| 46 | void BufferMixerInfo::UpdateResultState(EffectResultState& cpu_state, | 46 | void BufferMixerInfo::UpdateResultState(EffectResultState& cpu_state, |
| 47 | EffectResultState& dsp_state) {} | 47 | EffectResultState& dsp_state) {} |
| 48 | 48 | ||
| 49 | } // namespace AudioCore::AudioRenderer | 49 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/effect/buffer_mixer.h b/src/audio_core/renderer/effect/buffer_mixer.h index 23eed4a8b..0c01ef38d 100644 --- a/src/audio_core/renderer/effect/buffer_mixer.h +++ b/src/audio_core/renderer/effect/buffer_mixer.h | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | #include "audio_core/renderer/effect/effect_info_base.h" | 9 | #include "audio_core/renderer/effect/effect_info_base.h" |
| 10 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 11 | 11 | ||
| 12 | namespace AudioCore::AudioRenderer { | 12 | namespace AudioCore::Renderer { |
| 13 | 13 | ||
| 14 | class BufferMixerInfo : public EffectInfoBase { | 14 | class BufferMixerInfo : public EffectInfoBase { |
| 15 | public: | 15 | public: |
| @@ -72,4 +72,4 @@ public: | |||
| 72 | void UpdateResultState(EffectResultState& cpu_state, EffectResultState& dsp_state) override; | 72 | void UpdateResultState(EffectResultState& cpu_state, EffectResultState& dsp_state) override; |
| 73 | }; | 73 | }; |
| 74 | 74 | ||
| 75 | } // namespace AudioCore::AudioRenderer | 75 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/effect/capture.cpp b/src/audio_core/renderer/effect/capture.cpp index 3f038efdb..dfa062a59 100644 --- a/src/audio_core/renderer/effect/capture.cpp +++ b/src/audio_core/renderer/effect/capture.cpp | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | #include "audio_core/renderer/effect/aux_.h" | 4 | #include "audio_core/renderer/effect/aux_.h" |
| 5 | #include "audio_core/renderer/effect/capture.h" | 5 | #include "audio_core/renderer/effect/capture.h" |
| 6 | 6 | ||
| 7 | namespace AudioCore::AudioRenderer { | 7 | namespace AudioCore::Renderer { |
| 8 | 8 | ||
| 9 | void CaptureInfo::Update(BehaviorInfo::ErrorInfo& error_info, const InParameterVersion1& in_params, | 9 | void CaptureInfo::Update(BehaviorInfo::ErrorInfo& error_info, const InParameterVersion1& in_params, |
| 10 | const PoolMapper& pool_mapper) { | 10 | const PoolMapper& pool_mapper) { |
| @@ -79,4 +79,4 @@ CpuAddr CaptureInfo::GetWorkbuffer(s32 index) { | |||
| 79 | return workbuffers[index].GetReference(true); | 79 | return workbuffers[index].GetReference(true); |
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | } // namespace AudioCore::AudioRenderer | 82 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/effect/capture.h b/src/audio_core/renderer/effect/capture.h index 6fbed8e6b..cbe71e22a 100644 --- a/src/audio_core/renderer/effect/capture.h +++ b/src/audio_core/renderer/effect/capture.h | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | #include "audio_core/renderer/effect/effect_info_base.h" | 9 | #include "audio_core/renderer/effect/effect_info_base.h" |
| 10 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 11 | 11 | ||
| 12 | namespace AudioCore::AudioRenderer { | 12 | namespace AudioCore::Renderer { |
| 13 | 13 | ||
| 14 | class CaptureInfo : public EffectInfoBase { | 14 | class CaptureInfo : public EffectInfoBase { |
| 15 | public: | 15 | public: |
| @@ -62,4 +62,4 @@ public: | |||
| 62 | CpuAddr GetWorkbuffer(s32 index) override; | 62 | CpuAddr GetWorkbuffer(s32 index) override; |
| 63 | }; | 63 | }; |
| 64 | 64 | ||
| 65 | } // namespace AudioCore::AudioRenderer | 65 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/effect/compressor.cpp b/src/audio_core/renderer/effect/compressor.cpp index 220ae02f9..fea0aefcf 100644 --- a/src/audio_core/renderer/effect/compressor.cpp +++ b/src/audio_core/renderer/effect/compressor.cpp | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include "audio_core/renderer/effect/compressor.h" | 4 | #include "audio_core/renderer/effect/compressor.h" |
| 5 | 5 | ||
| 6 | namespace AudioCore::AudioRenderer { | 6 | namespace AudioCore::Renderer { |
| 7 | 7 | ||
| 8 | void CompressorInfo::Update(BehaviorInfo::ErrorInfo& error_info, | 8 | void CompressorInfo::Update(BehaviorInfo::ErrorInfo& error_info, |
| 9 | const InParameterVersion1& in_params, const PoolMapper& pool_mapper) {} | 9 | const InParameterVersion1& in_params, const PoolMapper& pool_mapper) {} |
| @@ -37,4 +37,4 @@ CpuAddr CompressorInfo::GetWorkbuffer(s32 index) { | |||
| 37 | return GetSingleBuffer(index); | 37 | return GetSingleBuffer(index); |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | } // namespace AudioCore::AudioRenderer | 40 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/effect/compressor.h b/src/audio_core/renderer/effect/compressor.h index 019a5ae58..cda55c284 100644 --- a/src/audio_core/renderer/effect/compressor.h +++ b/src/audio_core/renderer/effect/compressor.h | |||
| @@ -10,7 +10,7 @@ | |||
| 10 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 11 | #include "common/fixed_point.h" | 11 | #include "common/fixed_point.h" |
| 12 | 12 | ||
| 13 | namespace AudioCore::AudioRenderer { | 13 | namespace AudioCore::Renderer { |
| 14 | 14 | ||
| 15 | class CompressorInfo : public EffectInfoBase { | 15 | class CompressorInfo : public EffectInfoBase { |
| 16 | public: | 16 | public: |
| @@ -103,4 +103,4 @@ public: | |||
| 103 | CpuAddr GetWorkbuffer(s32 index) override; | 103 | CpuAddr GetWorkbuffer(s32 index) override; |
| 104 | }; | 104 | }; |
| 105 | 105 | ||
| 106 | } // namespace AudioCore::AudioRenderer | 106 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/effect/delay.cpp b/src/audio_core/renderer/effect/delay.cpp index d9853efd9..e038d4498 100644 --- a/src/audio_core/renderer/effect/delay.cpp +++ b/src/audio_core/renderer/effect/delay.cpp | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include "audio_core/renderer/effect/delay.h" | 4 | #include "audio_core/renderer/effect/delay.h" |
| 5 | 5 | ||
| 6 | namespace AudioCore::AudioRenderer { | 6 | namespace AudioCore::Renderer { |
| 7 | 7 | ||
| 8 | void DelayInfo::Update(BehaviorInfo::ErrorInfo& error_info, const InParameterVersion1& in_params, | 8 | void DelayInfo::Update(BehaviorInfo::ErrorInfo& error_info, const InParameterVersion1& in_params, |
| 9 | const PoolMapper& pool_mapper) { | 9 | const PoolMapper& pool_mapper) { |
| @@ -90,4 +90,4 @@ CpuAddr DelayInfo::GetWorkbuffer(s32 index) { | |||
| 90 | return GetSingleBuffer(index); | 90 | return GetSingleBuffer(index); |
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | } // namespace AudioCore::AudioRenderer | 93 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/effect/delay.h b/src/audio_core/renderer/effect/delay.h index accc42a06..47417fbc6 100644 --- a/src/audio_core/renderer/effect/delay.h +++ b/src/audio_core/renderer/effect/delay.h | |||
| @@ -11,7 +11,7 @@ | |||
| 11 | #include "common/common_types.h" | 11 | #include "common/common_types.h" |
| 12 | #include "common/fixed_point.h" | 12 | #include "common/fixed_point.h" |
| 13 | 13 | ||
| 14 | namespace AudioCore::AudioRenderer { | 14 | namespace AudioCore::Renderer { |
| 15 | 15 | ||
| 16 | class DelayInfo : public EffectInfoBase { | 16 | class DelayInfo : public EffectInfoBase { |
| 17 | public: | 17 | public: |
| @@ -132,4 +132,4 @@ public: | |||
| 132 | CpuAddr GetWorkbuffer(s32 index) override; | 132 | CpuAddr GetWorkbuffer(s32 index) override; |
| 133 | }; | 133 | }; |
| 134 | 134 | ||
| 135 | } // namespace AudioCore::AudioRenderer | 135 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/effect/effect_context.cpp b/src/audio_core/renderer/effect/effect_context.cpp index 74c7801c9..00f6d7822 100644 --- a/src/audio_core/renderer/effect/effect_context.cpp +++ b/src/audio_core/renderer/effect/effect_context.cpp | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include "audio_core/renderer/effect/effect_context.h" | 4 | #include "audio_core/renderer/effect/effect_context.h" |
| 5 | 5 | ||
| 6 | namespace AudioCore::AudioRenderer { | 6 | namespace AudioCore::Renderer { |
| 7 | 7 | ||
| 8 | void EffectContext::Initialize(std::span<EffectInfoBase> effect_infos_, const u32 effect_count_, | 8 | void EffectContext::Initialize(std::span<EffectInfoBase> effect_infos_, const u32 effect_count_, |
| 9 | std::span<EffectResultState> result_states_cpu_, | 9 | std::span<EffectResultState> result_states_cpu_, |
| @@ -38,4 +38,4 @@ void EffectContext::UpdateStateByDspShared() { | |||
| 38 | } | 38 | } |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | } // namespace AudioCore::AudioRenderer | 41 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/effect/effect_context.h b/src/audio_core/renderer/effect/effect_context.h index 8f6d6e7d8..8364c5521 100644 --- a/src/audio_core/renderer/effect/effect_context.h +++ b/src/audio_core/renderer/effect/effect_context.h | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | #include "audio_core/renderer/effect/effect_result_state.h" | 9 | #include "audio_core/renderer/effect/effect_result_state.h" |
| 10 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 11 | 11 | ||
| 12 | namespace AudioCore::AudioRenderer { | 12 | namespace AudioCore::Renderer { |
| 13 | 13 | ||
| 14 | class EffectContext { | 14 | class EffectContext { |
| 15 | public: | 15 | public: |
| @@ -72,4 +72,4 @@ private: | |||
| 72 | size_t dsp_state_count{}; | 72 | size_t dsp_state_count{}; |
| 73 | }; | 73 | }; |
| 74 | 74 | ||
| 75 | } // namespace AudioCore::AudioRenderer | 75 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/effect/effect_info_base.h b/src/audio_core/renderer/effect/effect_info_base.h index dbdccf278..b49503409 100644 --- a/src/audio_core/renderer/effect/effect_info_base.h +++ b/src/audio_core/renderer/effect/effect_info_base.h | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | #include "audio_core/renderer/memory/pool_mapper.h" | 12 | #include "audio_core/renderer/memory/pool_mapper.h" |
| 13 | #include "common/common_types.h" | 13 | #include "common/common_types.h" |
| 14 | 14 | ||
| 15 | namespace AudioCore::AudioRenderer { | 15 | namespace AudioCore::Renderer { |
| 16 | /** | 16 | /** |
| 17 | * Base of all effects. Holds various data and functions used for all derived effects. | 17 | * Base of all effects. Holds various data and functions used for all derived effects. |
| 18 | * Should not be used directly. | 18 | * Should not be used directly. |
| @@ -432,4 +432,4 @@ protected: | |||
| 432 | std::array<u8, sizeof(State)> state{}; | 432 | std::array<u8, sizeof(State)> state{}; |
| 433 | }; | 433 | }; |
| 434 | 434 | ||
| 435 | } // namespace AudioCore::AudioRenderer | 435 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/effect/effect_reset.h b/src/audio_core/renderer/effect/effect_reset.h index 1ea67e334..c9e3b4b78 100644 --- a/src/audio_core/renderer/effect/effect_reset.h +++ b/src/audio_core/renderer/effect/effect_reset.h | |||
| @@ -14,7 +14,7 @@ | |||
| 14 | #include "audio_core/renderer/effect/reverb.h" | 14 | #include "audio_core/renderer/effect/reverb.h" |
| 15 | #include "common/common_types.h" | 15 | #include "common/common_types.h" |
| 16 | 16 | ||
| 17 | namespace AudioCore::AudioRenderer { | 17 | namespace AudioCore::Renderer { |
| 18 | /** | 18 | /** |
| 19 | * Reset an effect, and create a new one of the given type. | 19 | * Reset an effect, and create a new one of the given type. |
| 20 | * | 20 | * |
| @@ -68,4 +68,4 @@ static void ResetEffect(EffectInfoBase* effect, const EffectInfoBase::Type type) | |||
| 68 | } | 68 | } |
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | } // namespace AudioCore::AudioRenderer | 71 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/effect/effect_result_state.h b/src/audio_core/renderer/effect/effect_result_state.h index ae096ad69..f4d4b6086 100644 --- a/src/audio_core/renderer/effect/effect_result_state.h +++ b/src/audio_core/renderer/effect/effect_result_state.h | |||
| @@ -7,10 +7,10 @@ | |||
| 7 | 7 | ||
| 8 | #include "common/common_types.h" | 8 | #include "common/common_types.h" |
| 9 | 9 | ||
| 10 | namespace AudioCore::AudioRenderer { | 10 | namespace AudioCore::Renderer { |
| 11 | 11 | ||
| 12 | struct EffectResultState { | 12 | struct EffectResultState { |
| 13 | std::array<u8, 0x80> state; | 13 | std::array<u8, 0x80> state; |
| 14 | }; | 14 | }; |
| 15 | 15 | ||
| 16 | } // namespace AudioCore::AudioRenderer | 16 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/effect/i3dl2.cpp b/src/audio_core/renderer/effect/i3dl2.cpp index 960b29cfc..a3c324c1e 100644 --- a/src/audio_core/renderer/effect/i3dl2.cpp +++ b/src/audio_core/renderer/effect/i3dl2.cpp | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include "audio_core/renderer/effect/i3dl2.h" | 4 | #include "audio_core/renderer/effect/i3dl2.h" |
| 5 | 5 | ||
| 6 | namespace AudioCore::AudioRenderer { | 6 | namespace AudioCore::Renderer { |
| 7 | 7 | ||
| 8 | void I3dl2ReverbInfo::Update(BehaviorInfo::ErrorInfo& error_info, | 8 | void I3dl2ReverbInfo::Update(BehaviorInfo::ErrorInfo& error_info, |
| 9 | const InParameterVersion1& in_params, const PoolMapper& pool_mapper) { | 9 | const InParameterVersion1& in_params, const PoolMapper& pool_mapper) { |
| @@ -91,4 +91,4 @@ CpuAddr I3dl2ReverbInfo::GetWorkbuffer(s32 index) { | |||
| 91 | return GetSingleBuffer(index); | 91 | return GetSingleBuffer(index); |
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | } // namespace AudioCore::AudioRenderer | 94 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/effect/i3dl2.h b/src/audio_core/renderer/effect/i3dl2.h index 6e3ffd1d4..e0432b4ae 100644 --- a/src/audio_core/renderer/effect/i3dl2.h +++ b/src/audio_core/renderer/effect/i3dl2.h | |||
| @@ -11,7 +11,7 @@ | |||
| 11 | #include "common/common_types.h" | 11 | #include "common/common_types.h" |
| 12 | #include "common/fixed_point.h" | 12 | #include "common/fixed_point.h" |
| 13 | 13 | ||
| 14 | namespace AudioCore::AudioRenderer { | 14 | namespace AudioCore::Renderer { |
| 15 | 15 | ||
| 16 | class I3dl2ReverbInfo : public EffectInfoBase { | 16 | class I3dl2ReverbInfo : public EffectInfoBase { |
| 17 | public: | 17 | public: |
| @@ -198,4 +198,4 @@ public: | |||
| 198 | CpuAddr GetWorkbuffer(s32 index) override; | 198 | CpuAddr GetWorkbuffer(s32 index) override; |
| 199 | }; | 199 | }; |
| 200 | 200 | ||
| 201 | } // namespace AudioCore::AudioRenderer | 201 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/effect/light_limiter.cpp b/src/audio_core/renderer/effect/light_limiter.cpp index 1635a952d..9c8ea3c49 100644 --- a/src/audio_core/renderer/effect/light_limiter.cpp +++ b/src/audio_core/renderer/effect/light_limiter.cpp | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include "audio_core/renderer/effect/light_limiter.h" | 4 | #include "audio_core/renderer/effect/light_limiter.h" |
| 5 | 5 | ||
| 6 | namespace AudioCore::AudioRenderer { | 6 | namespace AudioCore::Renderer { |
| 7 | 7 | ||
| 8 | void LightLimiterInfo::Update(BehaviorInfo::ErrorInfo& error_info, | 8 | void LightLimiterInfo::Update(BehaviorInfo::ErrorInfo& error_info, |
| 9 | const InParameterVersion1& in_params, const PoolMapper& pool_mapper) { | 9 | const InParameterVersion1& in_params, const PoolMapper& pool_mapper) { |
| @@ -78,4 +78,4 @@ CpuAddr LightLimiterInfo::GetWorkbuffer(s32 index) { | |||
| 78 | return GetSingleBuffer(index); | 78 | return GetSingleBuffer(index); |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | } // namespace AudioCore::AudioRenderer | 81 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/effect/light_limiter.h b/src/audio_core/renderer/effect/light_limiter.h index 338d67bbc..7f2ede405 100644 --- a/src/audio_core/renderer/effect/light_limiter.h +++ b/src/audio_core/renderer/effect/light_limiter.h | |||
| @@ -11,7 +11,7 @@ | |||
| 11 | #include "common/common_types.h" | 11 | #include "common/common_types.h" |
| 12 | #include "common/fixed_point.h" | 12 | #include "common/fixed_point.h" |
| 13 | 13 | ||
| 14 | namespace AudioCore::AudioRenderer { | 14 | namespace AudioCore::Renderer { |
| 15 | 15 | ||
| 16 | class LightLimiterInfo : public EffectInfoBase { | 16 | class LightLimiterInfo : public EffectInfoBase { |
| 17 | public: | 17 | public: |
| @@ -135,4 +135,4 @@ public: | |||
| 135 | CpuAddr GetWorkbuffer(s32 index) override; | 135 | CpuAddr GetWorkbuffer(s32 index) override; |
| 136 | }; | 136 | }; |
| 137 | 137 | ||
| 138 | } // namespace AudioCore::AudioRenderer | 138 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/effect/reverb.cpp b/src/audio_core/renderer/effect/reverb.cpp index 2d32383d0..4da72469a 100644 --- a/src/audio_core/renderer/effect/reverb.cpp +++ b/src/audio_core/renderer/effect/reverb.cpp | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include "audio_core/renderer/effect/reverb.h" | 4 | #include "audio_core/renderer/effect/reverb.h" |
| 5 | 5 | ||
| 6 | namespace AudioCore::AudioRenderer { | 6 | namespace AudioCore::Renderer { |
| 7 | 7 | ||
| 8 | void ReverbInfo::Update(BehaviorInfo::ErrorInfo& error_info, const InParameterVersion1& in_params, | 8 | void ReverbInfo::Update(BehaviorInfo::ErrorInfo& error_info, const InParameterVersion1& in_params, |
| 9 | const PoolMapper& pool_mapper) { | 9 | const PoolMapper& pool_mapper) { |
| @@ -90,4 +90,4 @@ CpuAddr ReverbInfo::GetWorkbuffer(s32 index) { | |||
| 90 | return GetSingleBuffer(index); | 90 | return GetSingleBuffer(index); |
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | } // namespace AudioCore::AudioRenderer | 93 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/effect/reverb.h b/src/audio_core/renderer/effect/reverb.h index 6cc345ef6..52a048da6 100644 --- a/src/audio_core/renderer/effect/reverb.h +++ b/src/audio_core/renderer/effect/reverb.h | |||
| @@ -11,7 +11,7 @@ | |||
| 11 | #include "common/common_types.h" | 11 | #include "common/common_types.h" |
| 12 | #include "common/fixed_point.h" | 12 | #include "common/fixed_point.h" |
| 13 | 13 | ||
| 14 | namespace AudioCore::AudioRenderer { | 14 | namespace AudioCore::Renderer { |
| 15 | 15 | ||
| 16 | class ReverbInfo : public EffectInfoBase { | 16 | class ReverbInfo : public EffectInfoBase { |
| 17 | public: | 17 | public: |
| @@ -187,4 +187,4 @@ public: | |||
| 187 | CpuAddr GetWorkbuffer(s32 index) override; | 187 | CpuAddr GetWorkbuffer(s32 index) override; |
| 188 | }; | 188 | }; |
| 189 | 189 | ||
| 190 | } // namespace AudioCore::AudioRenderer | 190 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/memory/address_info.h b/src/audio_core/renderer/memory/address_info.h index bb5c930e1..c81ef1b8a 100644 --- a/src/audio_core/renderer/memory/address_info.h +++ b/src/audio_core/renderer/memory/address_info.h | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | #include "audio_core/renderer/memory/memory_pool_info.h" | 6 | #include "audio_core/renderer/memory/memory_pool_info.h" |
| 7 | #include "common/common_types.h" | 7 | #include "common/common_types.h" |
| 8 | 8 | ||
| 9 | namespace AudioCore::AudioRenderer { | 9 | namespace AudioCore::Renderer { |
| 10 | 10 | ||
| 11 | /** | 11 | /** |
| 12 | * Represents a region of mapped or unmapped memory. | 12 | * Represents a region of mapped or unmapped memory. |
| @@ -121,4 +121,4 @@ private: | |||
| 121 | CpuAddr dsp_address; | 121 | CpuAddr dsp_address; |
| 122 | }; | 122 | }; |
| 123 | 123 | ||
| 124 | } // namespace AudioCore::AudioRenderer | 124 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/memory/memory_pool_info.cpp b/src/audio_core/renderer/memory/memory_pool_info.cpp index 9b7824af1..03b44d5f3 100644 --- a/src/audio_core/renderer/memory/memory_pool_info.cpp +++ b/src/audio_core/renderer/memory/memory_pool_info.cpp | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include "audio_core/renderer/memory/memory_pool_info.h" | 4 | #include "audio_core/renderer/memory/memory_pool_info.h" |
| 5 | 5 | ||
| 6 | namespace AudioCore::AudioRenderer { | 6 | namespace AudioCore::Renderer { |
| 7 | 7 | ||
| 8 | CpuAddr MemoryPoolInfo::GetCpuAddress() const { | 8 | CpuAddr MemoryPoolInfo::GetCpuAddress() const { |
| 9 | return cpu_address; | 9 | return cpu_address; |
| @@ -58,4 +58,4 @@ bool MemoryPoolInfo::IsUsed() const { | |||
| 58 | return in_use; | 58 | return in_use; |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | } // namespace AudioCore::AudioRenderer | 61 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/memory/memory_pool_info.h b/src/audio_core/renderer/memory/memory_pool_info.h index 80c571bc1..2f9c85184 100644 --- a/src/audio_core/renderer/memory/memory_pool_info.h +++ b/src/audio_core/renderer/memory/memory_pool_info.h | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | #include "audio_core/common/common.h" | 8 | #include "audio_core/common/common.h" |
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | 10 | ||
| 11 | namespace AudioCore::AudioRenderer { | 11 | namespace AudioCore::Renderer { |
| 12 | /** | 12 | /** |
| 13 | * CPU pools are mapped in user memory with the supplied process_handle (see PoolMapper). | 13 | * CPU pools are mapped in user memory with the supplied process_handle (see PoolMapper). |
| 14 | */ | 14 | */ |
| @@ -167,4 +167,4 @@ private: | |||
| 167 | bool in_use{}; | 167 | bool in_use{}; |
| 168 | }; | 168 | }; |
| 169 | 169 | ||
| 170 | } // namespace AudioCore::AudioRenderer | 170 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/memory/pool_mapper.cpp b/src/audio_core/renderer/memory/pool_mapper.cpp index 7fd2b5f47..999bb746b 100644 --- a/src/audio_core/renderer/memory/pool_mapper.cpp +++ b/src/audio_core/renderer/memory/pool_mapper.cpp | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | #include "core/hle/kernel/k_process.h" | 6 | #include "core/hle/kernel/k_process.h" |
| 7 | #include "core/hle/kernel/svc.h" | 7 | #include "core/hle/kernel/svc.h" |
| 8 | 8 | ||
| 9 | namespace AudioCore::AudioRenderer { | 9 | namespace AudioCore::Renderer { |
| 10 | 10 | ||
| 11 | PoolMapper::PoolMapper(u32 process_handle_, bool force_map_) | 11 | PoolMapper::PoolMapper(u32 process_handle_, bool force_map_) |
| 12 | : process_handle{process_handle_}, force_map{force_map_} {} | 12 | : process_handle{process_handle_}, force_map{force_map_} {} |
| @@ -240,4 +240,4 @@ bool PoolMapper::InitializeSystemPool(MemoryPoolInfo& pool, const u8* memory, | |||
| 240 | } | 240 | } |
| 241 | } | 241 | } |
| 242 | 242 | ||
| 243 | } // namespace AudioCore::AudioRenderer | 243 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/memory/pool_mapper.h b/src/audio_core/renderer/memory/pool_mapper.h index 9a691da7a..95ae5d8ea 100644 --- a/src/audio_core/renderer/memory/pool_mapper.h +++ b/src/audio_core/renderer/memory/pool_mapper.h | |||
| @@ -10,7 +10,7 @@ | |||
| 10 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 11 | #include "core/hle/service/audio/errors.h" | 11 | #include "core/hle/service/audio/errors.h" |
| 12 | 12 | ||
| 13 | namespace AudioCore::AudioRenderer { | 13 | namespace AudioCore::Renderer { |
| 14 | class AddressInfo; | 14 | class AddressInfo; |
| 15 | 15 | ||
| 16 | /** | 16 | /** |
| @@ -176,4 +176,4 @@ private: | |||
| 176 | bool force_map; | 176 | bool force_map; |
| 177 | }; | 177 | }; |
| 178 | 178 | ||
| 179 | } // namespace AudioCore::AudioRenderer | 179 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/mix/mix_context.cpp b/src/audio_core/renderer/mix/mix_context.cpp index 3a18ae7c2..c712610bb 100644 --- a/src/audio_core/renderer/mix/mix_context.cpp +++ b/src/audio_core/renderer/mix/mix_context.cpp | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | #include "audio_core/renderer/splitter/splitter_context.h" | 7 | #include "audio_core/renderer/splitter/splitter_context.h" |
| 8 | #include "common/polyfill_ranges.h" | 8 | #include "common/polyfill_ranges.h" |
| 9 | 9 | ||
| 10 | namespace AudioCore::AudioRenderer { | 10 | namespace AudioCore::Renderer { |
| 11 | 11 | ||
| 12 | void MixContext::Initialize(std::span<MixInfo*> sorted_mix_infos_, std::span<MixInfo> mix_infos_, | 12 | void MixContext::Initialize(std::span<MixInfo*> sorted_mix_infos_, std::span<MixInfo> mix_infos_, |
| 13 | const u32 count_, std::span<s32> effect_process_order_buffer_, | 13 | const u32 count_, std::span<s32> effect_process_order_buffer_, |
| @@ -139,4 +139,4 @@ EdgeMatrix& MixContext::GetEdgeMatrix() { | |||
| 139 | return edge_matrix; | 139 | return edge_matrix; |
| 140 | } | 140 | } |
| 141 | 141 | ||
| 142 | } // namespace AudioCore::AudioRenderer | 142 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/mix/mix_context.h b/src/audio_core/renderer/mix/mix_context.h index bcd9637da..ce19ec8d6 100644 --- a/src/audio_core/renderer/mix/mix_context.h +++ b/src/audio_core/renderer/mix/mix_context.h | |||
| @@ -10,7 +10,7 @@ | |||
| 10 | #include "audio_core/renderer/nodes/node_states.h" | 10 | #include "audio_core/renderer/nodes/node_states.h" |
| 11 | #include "common/common_types.h" | 11 | #include "common/common_types.h" |
| 12 | 12 | ||
| 13 | namespace AudioCore::AudioRenderer { | 13 | namespace AudioCore::Renderer { |
| 14 | class SplitterContext; | 14 | class SplitterContext; |
| 15 | 15 | ||
| 16 | /* | 16 | /* |
| @@ -121,4 +121,4 @@ private: | |||
| 121 | EdgeMatrix edge_matrix{}; | 121 | EdgeMatrix edge_matrix{}; |
| 122 | }; | 122 | }; |
| 123 | 123 | ||
| 124 | } // namespace AudioCore::AudioRenderer | 124 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/mix/mix_info.cpp b/src/audio_core/renderer/mix/mix_info.cpp index cc18e57ee..5e44bde18 100644 --- a/src/audio_core/renderer/mix/mix_info.cpp +++ b/src/audio_core/renderer/mix/mix_info.cpp | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | #include "audio_core/renderer/nodes/edge_matrix.h" | 7 | #include "audio_core/renderer/nodes/edge_matrix.h" |
| 8 | #include "audio_core/renderer/splitter/splitter_context.h" | 8 | #include "audio_core/renderer/splitter/splitter_context.h" |
| 9 | 9 | ||
| 10 | namespace AudioCore::AudioRenderer { | 10 | namespace AudioCore::Renderer { |
| 11 | 11 | ||
| 12 | MixInfo::MixInfo(std::span<s32> effect_order_buffer_, s32 effect_count_, BehaviorInfo& behavior) | 12 | MixInfo::MixInfo(std::span<s32> effect_order_buffer_, s32 effect_count_, BehaviorInfo& behavior) |
| 13 | : effect_order_buffer{effect_order_buffer_}, effect_count{effect_count_}, | 13 | : effect_order_buffer{effect_order_buffer_}, effect_count{effect_count_}, |
| @@ -117,4 +117,4 @@ bool MixInfo::HasAnyConnection() const { | |||
| 117 | return dst_mix_id != UnusedMixId || dst_splitter_id != UnusedSplitterId; | 117 | return dst_mix_id != UnusedMixId || dst_splitter_id != UnusedSplitterId; |
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | } // namespace AudioCore::AudioRenderer | 120 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/mix/mix_info.h b/src/audio_core/renderer/mix/mix_info.h index b5fa4c0c7..7005daa4f 100644 --- a/src/audio_core/renderer/mix/mix_info.h +++ b/src/audio_core/renderer/mix/mix_info.h | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | #include "audio_core/common/common.h" | 9 | #include "audio_core/common/common.h" |
| 10 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 11 | 11 | ||
| 12 | namespace AudioCore::AudioRenderer { | 12 | namespace AudioCore::Renderer { |
| 13 | class EdgeMatrix; | 13 | class EdgeMatrix; |
| 14 | class SplitterContext; | 14 | class SplitterContext; |
| 15 | class EffectContext; | 15 | class EffectContext; |
| @@ -121,4 +121,4 @@ public: | |||
| 121 | const bool long_size_pre_delay_supported; | 121 | const bool long_size_pre_delay_supported; |
| 122 | }; | 122 | }; |
| 123 | 123 | ||
| 124 | } // namespace AudioCore::AudioRenderer | 124 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/nodes/bit_array.h b/src/audio_core/renderer/nodes/bit_array.h index b0d53cd51..d8a2d09d0 100644 --- a/src/audio_core/renderer/nodes/bit_array.h +++ b/src/audio_core/renderer/nodes/bit_array.h | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | 7 | ||
| 8 | #include "common/common_types.h" | 8 | #include "common/common_types.h" |
| 9 | 9 | ||
| 10 | namespace AudioCore::AudioRenderer { | 10 | namespace AudioCore::Renderer { |
| 11 | /** | 11 | /** |
| 12 | * Represents an array of bits used for nodes and edges for the mixing graph. | 12 | * Represents an array of bits used for nodes and edges for the mixing graph. |
| 13 | */ | 13 | */ |
| @@ -22,4 +22,4 @@ struct BitArray { | |||
| 22 | u32 size{}; | 22 | u32 size{}; |
| 23 | }; | 23 | }; |
| 24 | 24 | ||
| 25 | } // namespace AudioCore::AudioRenderer | 25 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/nodes/edge_matrix.cpp b/src/audio_core/renderer/nodes/edge_matrix.cpp index 5573f33b9..c28773b22 100644 --- a/src/audio_core/renderer/nodes/edge_matrix.cpp +++ b/src/audio_core/renderer/nodes/edge_matrix.cpp | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include "audio_core/renderer/nodes/edge_matrix.h" | 4 | #include "audio_core/renderer/nodes/edge_matrix.h" |
| 5 | 5 | ||
| 6 | namespace AudioCore::AudioRenderer { | 6 | namespace AudioCore::Renderer { |
| 7 | 7 | ||
| 8 | void EdgeMatrix::Initialize([[maybe_unused]] std::span<u8> buffer, | 8 | void EdgeMatrix::Initialize([[maybe_unused]] std::span<u8> buffer, |
| 9 | [[maybe_unused]] const u64 node_buffer_size, const u32 count_) { | 9 | [[maybe_unused]] const u64 node_buffer_size, const u32 count_) { |
| @@ -35,4 +35,4 @@ u32 EdgeMatrix::GetNodeCount() const { | |||
| 35 | return count; | 35 | return count; |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | } // namespace AudioCore::AudioRenderer | 38 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/nodes/edge_matrix.h b/src/audio_core/renderer/nodes/edge_matrix.h index 27a20e43e..0271c23b1 100644 --- a/src/audio_core/renderer/nodes/edge_matrix.h +++ b/src/audio_core/renderer/nodes/edge_matrix.h | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | #include "common/alignment.h" | 9 | #include "common/alignment.h" |
| 10 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 11 | 11 | ||
| 12 | namespace AudioCore::AudioRenderer { | 12 | namespace AudioCore::Renderer { |
| 13 | /** | 13 | /** |
| 14 | * An edge matrix, holding the connections for each node to every other node in the graph. | 14 | * An edge matrix, holding the connections for each node to every other node in the graph. |
| 15 | */ | 15 | */ |
| @@ -79,4 +79,4 @@ private: | |||
| 79 | u32 count; | 79 | u32 count; |
| 80 | }; | 80 | }; |
| 81 | 81 | ||
| 82 | } // namespace AudioCore::AudioRenderer | 82 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/nodes/node_states.cpp b/src/audio_core/renderer/nodes/node_states.cpp index b7a44a54c..028a58041 100644 --- a/src/audio_core/renderer/nodes/node_states.cpp +++ b/src/audio_core/renderer/nodes/node_states.cpp | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | #include "audio_core/renderer/nodes/node_states.h" | 4 | #include "audio_core/renderer/nodes/node_states.h" |
| 5 | #include "common/logging/log.h" | 5 | #include "common/logging/log.h" |
| 6 | 6 | ||
| 7 | namespace AudioCore::AudioRenderer { | 7 | namespace AudioCore::Renderer { |
| 8 | 8 | ||
| 9 | void NodeStates::Initialize(std::span<u8> buffer_, [[maybe_unused]] const u64 node_buffer_size, | 9 | void NodeStates::Initialize(std::span<u8> buffer_, [[maybe_unused]] const u64 node_buffer_size, |
| 10 | const u32 count) { | 10 | const u32 count) { |
| @@ -138,4 +138,4 @@ std::pair<std::span<u32>::reverse_iterator, size_t> NodeStates::GetSortedResuls( | |||
| 138 | return {results.rbegin(), result_pos}; | 138 | return {results.rbegin(), result_pos}; |
| 139 | } | 139 | } |
| 140 | 140 | ||
| 141 | } // namespace AudioCore::AudioRenderer | 141 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/nodes/node_states.h b/src/audio_core/renderer/nodes/node_states.h index e768cd4b5..991a82841 100644 --- a/src/audio_core/renderer/nodes/node_states.h +++ b/src/audio_core/renderer/nodes/node_states.h | |||
| @@ -10,7 +10,7 @@ | |||
| 10 | #include "common/alignment.h" | 10 | #include "common/alignment.h" |
| 11 | #include "common/common_types.h" | 11 | #include "common/common_types.h" |
| 12 | 12 | ||
| 13 | namespace AudioCore::AudioRenderer { | 13 | namespace AudioCore::Renderer { |
| 14 | /** | 14 | /** |
| 15 | * Graph utility functions for sorting and getting results from the DAG. | 15 | * Graph utility functions for sorting and getting results from the DAG. |
| 16 | */ | 16 | */ |
| @@ -192,4 +192,4 @@ private: | |||
| 192 | Stack stack{}; | 192 | Stack stack{}; |
| 193 | }; | 193 | }; |
| 194 | 194 | ||
| 195 | } // namespace AudioCore::AudioRenderer | 195 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/performance/detail_aspect.cpp b/src/audio_core/renderer/performance/detail_aspect.cpp index f6405937f..ef8b47cee 100644 --- a/src/audio_core/renderer/performance/detail_aspect.cpp +++ b/src/audio_core/renderer/performance/detail_aspect.cpp | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | #include "audio_core/renderer/command/command_generator.h" | 5 | #include "audio_core/renderer/command/command_generator.h" |
| 6 | #include "audio_core/renderer/performance/detail_aspect.h" | 6 | #include "audio_core/renderer/performance/detail_aspect.h" |
| 7 | 7 | ||
| 8 | namespace AudioCore::AudioRenderer { | 8 | namespace AudioCore::Renderer { |
| 9 | 9 | ||
| 10 | DetailAspect::DetailAspect(CommandGenerator& command_generator_, | 10 | DetailAspect::DetailAspect(CommandGenerator& command_generator_, |
| 11 | const PerformanceEntryType entry_type, const s32 node_id_, | 11 | const PerformanceEntryType entry_type, const s32 node_id_, |
| @@ -22,4 +22,4 @@ DetailAspect::DetailAspect(CommandGenerator& command_generator_, | |||
| 22 | } | 22 | } |
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | } // namespace AudioCore::AudioRenderer | 25 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/performance/detail_aspect.h b/src/audio_core/renderer/performance/detail_aspect.h index 736c331b9..0bd7f80c8 100644 --- a/src/audio_core/renderer/performance/detail_aspect.h +++ b/src/audio_core/renderer/performance/detail_aspect.h | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | #include "audio_core/renderer/performance/performance_manager.h" | 7 | #include "audio_core/renderer/performance/performance_manager.h" |
| 8 | #include "common/common_types.h" | 8 | #include "common/common_types.h" |
| 9 | 9 | ||
| 10 | namespace AudioCore::AudioRenderer { | 10 | namespace AudioCore::Renderer { |
| 11 | class CommandGenerator; | 11 | class CommandGenerator; |
| 12 | 12 | ||
| 13 | /** | 13 | /** |
| @@ -29,4 +29,4 @@ public: | |||
| 29 | s32 node_id; | 29 | s32 node_id; |
| 30 | }; | 30 | }; |
| 31 | 31 | ||
| 32 | } // namespace AudioCore::AudioRenderer | 32 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/performance/entry_aspect.cpp b/src/audio_core/renderer/performance/entry_aspect.cpp index dd4165803..c9241a639 100644 --- a/src/audio_core/renderer/performance/entry_aspect.cpp +++ b/src/audio_core/renderer/performance/entry_aspect.cpp | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | #include "audio_core/renderer/command/command_generator.h" | 5 | #include "audio_core/renderer/command/command_generator.h" |
| 6 | #include "audio_core/renderer/performance/entry_aspect.h" | 6 | #include "audio_core/renderer/performance/entry_aspect.h" |
| 7 | 7 | ||
| 8 | namespace AudioCore::AudioRenderer { | 8 | namespace AudioCore::Renderer { |
| 9 | 9 | ||
| 10 | EntryAspect::EntryAspect(CommandGenerator& command_generator_, const PerformanceEntryType type, | 10 | EntryAspect::EntryAspect(CommandGenerator& command_generator_, const PerformanceEntryType type, |
| 11 | const s32 node_id_) | 11 | const s32 node_id_) |
| @@ -20,4 +20,4 @@ EntryAspect::EntryAspect(CommandGenerator& command_generator_, const Performance | |||
| 20 | } | 20 | } |
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | } // namespace AudioCore::AudioRenderer | 23 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/performance/entry_aspect.h b/src/audio_core/renderer/performance/entry_aspect.h index 14c9e3baf..f99287d68 100644 --- a/src/audio_core/renderer/performance/entry_aspect.h +++ b/src/audio_core/renderer/performance/entry_aspect.h | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | #include "audio_core/renderer/performance/performance_manager.h" | 7 | #include "audio_core/renderer/performance/performance_manager.h" |
| 8 | #include "common/common_types.h" | 8 | #include "common/common_types.h" |
| 9 | 9 | ||
| 10 | namespace AudioCore::AudioRenderer { | 10 | namespace AudioCore::Renderer { |
| 11 | class CommandGenerator; | 11 | class CommandGenerator; |
| 12 | 12 | ||
| 13 | /** | 13 | /** |
| @@ -28,4 +28,4 @@ public: | |||
| 28 | s32 node_id; | 28 | s32 node_id; |
| 29 | }; | 29 | }; |
| 30 | 30 | ||
| 31 | } // namespace AudioCore::AudioRenderer | 31 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/performance/performance_detail.h b/src/audio_core/renderer/performance/performance_detail.h index f603b9026..2b0cf9422 100644 --- a/src/audio_core/renderer/performance/performance_detail.h +++ b/src/audio_core/renderer/performance/performance_detail.h | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | #include "audio_core/renderer/performance/performance_entry.h" | 6 | #include "audio_core/renderer/performance/performance_entry.h" |
| 7 | #include "common/common_types.h" | 7 | #include "common/common_types.h" |
| 8 | 8 | ||
| 9 | namespace AudioCore::AudioRenderer { | 9 | namespace AudioCore::Renderer { |
| 10 | 10 | ||
| 11 | enum class PerformanceDetailType : u8 { | 11 | enum class PerformanceDetailType : u8 { |
| 12 | Invalid, | 12 | Invalid, |
| @@ -47,4 +47,4 @@ struct PerformanceDetailVersion2 { | |||
| 47 | static_assert(sizeof(PerformanceDetailVersion2) == 0x18, | 47 | static_assert(sizeof(PerformanceDetailVersion2) == 0x18, |
| 48 | "PerformanceDetailVersion2 has the wrong size!"); | 48 | "PerformanceDetailVersion2 has the wrong size!"); |
| 49 | 49 | ||
| 50 | } // namespace AudioCore::AudioRenderer | 50 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/performance/performance_entry.h b/src/audio_core/renderer/performance/performance_entry.h index d6b1158db..dbd6053a5 100644 --- a/src/audio_core/renderer/performance/performance_entry.h +++ b/src/audio_core/renderer/performance/performance_entry.h | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | #include "common/common_types.h" | 6 | #include "common/common_types.h" |
| 7 | 7 | ||
| 8 | namespace AudioCore::AudioRenderer { | 8 | namespace AudioCore::Renderer { |
| 9 | 9 | ||
| 10 | enum class PerformanceEntryType : u8 { | 10 | enum class PerformanceEntryType : u8 { |
| 11 | Invalid, | 11 | Invalid, |
| @@ -34,4 +34,4 @@ struct PerformanceEntryVersion2 { | |||
| 34 | static_assert(sizeof(PerformanceEntryVersion2) == 0x18, | 34 | static_assert(sizeof(PerformanceEntryVersion2) == 0x18, |
| 35 | "PerformanceEntryVersion2 has the wrong size!"); | 35 | "PerformanceEntryVersion2 has the wrong size!"); |
| 36 | 36 | ||
| 37 | } // namespace AudioCore::AudioRenderer | 37 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/performance/performance_entry_addresses.h b/src/audio_core/renderer/performance/performance_entry_addresses.h index e381d765c..51eee975f 100644 --- a/src/audio_core/renderer/performance/performance_entry_addresses.h +++ b/src/audio_core/renderer/performance/performance_entry_addresses.h | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | #include "audio_core/common/common.h" | 6 | #include "audio_core/common/common.h" |
| 7 | 7 | ||
| 8 | namespace AudioCore::AudioRenderer { | 8 | namespace AudioCore::Renderer { |
| 9 | 9 | ||
| 10 | struct PerformanceEntryAddresses { | 10 | struct PerformanceEntryAddresses { |
| 11 | CpuAddr translated_address; | 11 | CpuAddr translated_address; |
| @@ -14,4 +14,4 @@ struct PerformanceEntryAddresses { | |||
| 14 | CpuAddr entry_processed_time_offset; | 14 | CpuAddr entry_processed_time_offset; |
| 15 | }; | 15 | }; |
| 16 | 16 | ||
| 17 | } // namespace AudioCore::AudioRenderer | 17 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/performance/performance_frame_header.h b/src/audio_core/renderer/performance/performance_frame_header.h index b1848284e..24e4989f8 100644 --- a/src/audio_core/renderer/performance/performance_frame_header.h +++ b/src/audio_core/renderer/performance/performance_frame_header.h | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | #include "common/common_types.h" | 6 | #include "common/common_types.h" |
| 7 | 7 | ||
| 8 | namespace AudioCore::AudioRenderer { | 8 | namespace AudioCore::Renderer { |
| 9 | 9 | ||
| 10 | struct PerformanceFrameHeaderVersion1 { | 10 | struct PerformanceFrameHeaderVersion1 { |
| 11 | /* 0x00 */ u32 magic; // "PERF" | 11 | /* 0x00 */ u32 magic; // "PERF" |
| @@ -33,4 +33,4 @@ struct PerformanceFrameHeaderVersion2 { | |||
| 33 | static_assert(sizeof(PerformanceFrameHeaderVersion2) == 0x30, | 33 | static_assert(sizeof(PerformanceFrameHeaderVersion2) == 0x30, |
| 34 | "PerformanceFrameHeaderVersion2 has the wrong size!"); | 34 | "PerformanceFrameHeaderVersion2 has the wrong size!"); |
| 35 | 35 | ||
| 36 | } // namespace AudioCore::AudioRenderer | 36 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/performance/performance_manager.cpp b/src/audio_core/renderer/performance/performance_manager.cpp index 8aa0f5ed0..ce736db71 100644 --- a/src/audio_core/renderer/performance/performance_manager.cpp +++ b/src/audio_core/renderer/performance/performance_manager.cpp | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | #include "audio_core/renderer/performance/performance_manager.h" | 6 | #include "audio_core/renderer/performance/performance_manager.h" |
| 7 | #include "common/common_funcs.h" | 7 | #include "common/common_funcs.h" |
| 8 | 8 | ||
| 9 | namespace AudioCore::AudioRenderer { | 9 | namespace AudioCore::Renderer { |
| 10 | 10 | ||
| 11 | void PerformanceManager::CreateImpl(const size_t version) { | 11 | void PerformanceManager::CreateImpl(const size_t version) { |
| 12 | switch (version) { | 12 | switch (version) { |
| @@ -643,4 +643,4 @@ void PerformanceManagerImpl<PerformanceVersion::Version2, PerformanceFrameHeader | |||
| 643 | target_node_id = target_node_id_; | 643 | target_node_id = target_node_id_; |
| 644 | } | 644 | } |
| 645 | 645 | ||
| 646 | } // namespace AudioCore::AudioRenderer | 646 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/performance/performance_manager.h b/src/audio_core/renderer/performance/performance_manager.h index b65caa9b6..ffd0fa1fb 100644 --- a/src/audio_core/renderer/performance/performance_manager.h +++ b/src/audio_core/renderer/performance/performance_manager.h | |||
| @@ -14,7 +14,7 @@ | |||
| 14 | #include "audio_core/renderer/performance/performance_frame_header.h" | 14 | #include "audio_core/renderer/performance/performance_frame_header.h" |
| 15 | #include "common/common_types.h" | 15 | #include "common/common_types.h" |
| 16 | 16 | ||
| 17 | namespace AudioCore::AudioRenderer { | 17 | namespace AudioCore::Renderer { |
| 18 | class BehaviorInfo; | 18 | class BehaviorInfo; |
| 19 | class MemoryPoolInfo; | 19 | class MemoryPoolInfo; |
| 20 | 20 | ||
| @@ -272,4 +272,4 @@ private: | |||
| 272 | PerformanceVersion version{}; | 272 | PerformanceVersion version{}; |
| 273 | }; | 273 | }; |
| 274 | 274 | ||
| 275 | } // namespace AudioCore::AudioRenderer | 275 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/sink/circular_buffer_sink_info.cpp b/src/audio_core/renderer/sink/circular_buffer_sink_info.cpp index d91f10402..0ede02b6b 100644 --- a/src/audio_core/renderer/sink/circular_buffer_sink_info.cpp +++ b/src/audio_core/renderer/sink/circular_buffer_sink_info.cpp | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | #include "audio_core/renderer/sink/circular_buffer_sink_info.h" | 5 | #include "audio_core/renderer/sink/circular_buffer_sink_info.h" |
| 6 | #include "audio_core/renderer/upsampler/upsampler_manager.h" | 6 | #include "audio_core/renderer/upsampler/upsampler_manager.h" |
| 7 | 7 | ||
| 8 | namespace AudioCore::AudioRenderer { | 8 | namespace AudioCore::Renderer { |
| 9 | 9 | ||
| 10 | CircularBufferSinkInfo::CircularBufferSinkInfo() { | 10 | CircularBufferSinkInfo::CircularBufferSinkInfo() { |
| 11 | state.fill(0); | 11 | state.fill(0); |
| @@ -73,4 +73,4 @@ void CircularBufferSinkInfo::UpdateForCommandGeneration() { | |||
| 73 | } | 73 | } |
| 74 | } | 74 | } |
| 75 | 75 | ||
| 76 | } // namespace AudioCore::AudioRenderer | 76 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/sink/circular_buffer_sink_info.h b/src/audio_core/renderer/sink/circular_buffer_sink_info.h index 3356213ea..d4e61d641 100644 --- a/src/audio_core/renderer/sink/circular_buffer_sink_info.h +++ b/src/audio_core/renderer/sink/circular_buffer_sink_info.h | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | #include "audio_core/renderer/sink/sink_info_base.h" | 6 | #include "audio_core/renderer/sink/sink_info_base.h" |
| 7 | #include "common/common_types.h" | 7 | #include "common/common_types.h" |
| 8 | 8 | ||
| 9 | namespace AudioCore::AudioRenderer { | 9 | namespace AudioCore::Renderer { |
| 10 | /** | 10 | /** |
| 11 | * Info for a circular buffer sink. | 11 | * Info for a circular buffer sink. |
| 12 | */ | 12 | */ |
| @@ -38,4 +38,4 @@ public: | |||
| 38 | static_assert(sizeof(CircularBufferSinkInfo) <= sizeof(SinkInfoBase), | 38 | static_assert(sizeof(CircularBufferSinkInfo) <= sizeof(SinkInfoBase), |
| 39 | "CircularBufferSinkInfo is too large!"); | 39 | "CircularBufferSinkInfo is too large!"); |
| 40 | 40 | ||
| 41 | } // namespace AudioCore::AudioRenderer | 41 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/sink/device_sink_info.cpp b/src/audio_core/renderer/sink/device_sink_info.cpp index b7b3d6f1d..2de05e38e 100644 --- a/src/audio_core/renderer/sink/device_sink_info.cpp +++ b/src/audio_core/renderer/sink/device_sink_info.cpp | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | #include "audio_core/renderer/sink/device_sink_info.h" | 4 | #include "audio_core/renderer/sink/device_sink_info.h" |
| 5 | #include "audio_core/renderer/upsampler/upsampler_manager.h" | 5 | #include "audio_core/renderer/upsampler/upsampler_manager.h" |
| 6 | 6 | ||
| 7 | namespace AudioCore::AudioRenderer { | 7 | namespace AudioCore::Renderer { |
| 8 | 8 | ||
| 9 | DeviceSinkInfo::DeviceSinkInfo() { | 9 | DeviceSinkInfo::DeviceSinkInfo() { |
| 10 | state.fill(0); | 10 | state.fill(0); |
| @@ -54,4 +54,4 @@ void DeviceSinkInfo::Update(BehaviorInfo::ErrorInfo& error_info, OutStatus& out_ | |||
| 54 | 54 | ||
| 55 | void DeviceSinkInfo::UpdateForCommandGeneration() {} | 55 | void DeviceSinkInfo::UpdateForCommandGeneration() {} |
| 56 | 56 | ||
| 57 | } // namespace AudioCore::AudioRenderer | 57 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/sink/device_sink_info.h b/src/audio_core/renderer/sink/device_sink_info.h index a1c441454..7974ae820 100644 --- a/src/audio_core/renderer/sink/device_sink_info.h +++ b/src/audio_core/renderer/sink/device_sink_info.h | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | #include "audio_core/renderer/sink/sink_info_base.h" | 6 | #include "audio_core/renderer/sink/sink_info_base.h" |
| 7 | #include "common/common_types.h" | 7 | #include "common/common_types.h" |
| 8 | 8 | ||
| 9 | namespace AudioCore::AudioRenderer { | 9 | namespace AudioCore::Renderer { |
| 10 | /** | 10 | /** |
| 11 | * Info for a device sink. | 11 | * Info for a device sink. |
| 12 | */ | 12 | */ |
| @@ -37,4 +37,4 @@ public: | |||
| 37 | }; | 37 | }; |
| 38 | static_assert(sizeof(DeviceSinkInfo) <= sizeof(SinkInfoBase), "DeviceSinkInfo is too large!"); | 38 | static_assert(sizeof(DeviceSinkInfo) <= sizeof(SinkInfoBase), "DeviceSinkInfo is too large!"); |
| 39 | 39 | ||
| 40 | } // namespace AudioCore::AudioRenderer | 40 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/sink/sink_context.cpp b/src/audio_core/renderer/sink/sink_context.cpp index 634bc1cf9..a4f9cac21 100644 --- a/src/audio_core/renderer/sink/sink_context.cpp +++ b/src/audio_core/renderer/sink/sink_context.cpp | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include "audio_core/renderer/sink/sink_context.h" | 4 | #include "audio_core/renderer/sink/sink_context.h" |
| 5 | 5 | ||
| 6 | namespace AudioCore::AudioRenderer { | 6 | namespace AudioCore::Renderer { |
| 7 | 7 | ||
| 8 | void SinkContext::Initialize(std::span<SinkInfoBase> sink_infos_, const u32 sink_count_) { | 8 | void SinkContext::Initialize(std::span<SinkInfoBase> sink_infos_, const u32 sink_count_) { |
| 9 | sink_infos = sink_infos_; | 9 | sink_infos = sink_infos_; |
| @@ -18,4 +18,4 @@ u32 SinkContext::GetCount() const { | |||
| 18 | return sink_count; | 18 | return sink_count; |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | } // namespace AudioCore::AudioRenderer | 21 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/sink/sink_context.h b/src/audio_core/renderer/sink/sink_context.h index 185572e29..66925b48e 100644 --- a/src/audio_core/renderer/sink/sink_context.h +++ b/src/audio_core/renderer/sink/sink_context.h | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | #include "audio_core/renderer/sink/sink_info_base.h" | 8 | #include "audio_core/renderer/sink/sink_info_base.h" |
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | 10 | ||
| 11 | namespace AudioCore::AudioRenderer { | 11 | namespace AudioCore::Renderer { |
| 12 | /** | 12 | /** |
| 13 | * Manages output sinks. | 13 | * Manages output sinks. |
| 14 | */ | 14 | */ |
| @@ -44,4 +44,4 @@ private: | |||
| 44 | u32 sink_count{}; | 44 | u32 sink_count{}; |
| 45 | }; | 45 | }; |
| 46 | 46 | ||
| 47 | } // namespace AudioCore::AudioRenderer | 47 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/sink/sink_info_base.cpp b/src/audio_core/renderer/sink/sink_info_base.cpp index 4279beaa0..8a064f15a 100644 --- a/src/audio_core/renderer/sink/sink_info_base.cpp +++ b/src/audio_core/renderer/sink/sink_info_base.cpp | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | #include "audio_core/renderer/memory/pool_mapper.h" | 4 | #include "audio_core/renderer/memory/pool_mapper.h" |
| 5 | #include "audio_core/renderer/sink/sink_info_base.h" | 5 | #include "audio_core/renderer/sink/sink_info_base.h" |
| 6 | 6 | ||
| 7 | namespace AudioCore::AudioRenderer { | 7 | namespace AudioCore::Renderer { |
| 8 | 8 | ||
| 9 | void SinkInfoBase::CleanUp() { | 9 | void SinkInfoBase::CleanUp() { |
| 10 | type = Type::Invalid; | 10 | type = Type::Invalid; |
| @@ -48,4 +48,4 @@ u8* SinkInfoBase::GetParameter() { | |||
| 48 | return parameter.data(); | 48 | return parameter.data(); |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | } // namespace AudioCore::AudioRenderer | 51 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/sink/sink_info_base.h b/src/audio_core/renderer/sink/sink_info_base.h index a1b855f20..e10d1cb38 100644 --- a/src/audio_core/renderer/sink/sink_info_base.h +++ b/src/audio_core/renderer/sink/sink_info_base.h | |||
| @@ -11,7 +11,7 @@ | |||
| 11 | #include "common/common_types.h" | 11 | #include "common/common_types.h" |
| 12 | #include "common/fixed_point.h" | 12 | #include "common/fixed_point.h" |
| 13 | 13 | ||
| 14 | namespace AudioCore::AudioRenderer { | 14 | namespace AudioCore::Renderer { |
| 15 | struct UpsamplerInfo; | 15 | struct UpsamplerInfo; |
| 16 | class PoolMapper; | 16 | class PoolMapper; |
| 17 | 17 | ||
| @@ -174,4 +174,4 @@ protected: | |||
| 174 | parameter{}; | 174 | parameter{}; |
| 175 | }; | 175 | }; |
| 176 | 176 | ||
| 177 | } // namespace AudioCore::AudioRenderer | 177 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/splitter/splitter_context.cpp b/src/audio_core/renderer/splitter/splitter_context.cpp index 7a23ba43f..686150ea6 100644 --- a/src/audio_core/renderer/splitter/splitter_context.cpp +++ b/src/audio_core/renderer/splitter/splitter_context.cpp | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | #include "audio_core/renderer/splitter/splitter_context.h" | 7 | #include "audio_core/renderer/splitter/splitter_context.h" |
| 8 | #include "common/alignment.h" | 8 | #include "common/alignment.h" |
| 9 | 9 | ||
| 10 | namespace AudioCore::AudioRenderer { | 10 | namespace AudioCore::Renderer { |
| 11 | 11 | ||
| 12 | SplitterDestinationData* SplitterContext::GetDesintationData(const s32 splitter_id, | 12 | SplitterDestinationData* SplitterContext::GetDesintationData(const s32 splitter_id, |
| 13 | const s32 destination_id) { | 13 | const s32 destination_id) { |
| @@ -214,4 +214,4 @@ u64 SplitterContext::CalcWorkBufferSize(const BehaviorInfo& behavior, | |||
| 214 | return size; | 214 | return size; |
| 215 | } | 215 | } |
| 216 | 216 | ||
| 217 | } // namespace AudioCore::AudioRenderer | 217 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/splitter/splitter_context.h b/src/audio_core/renderer/splitter/splitter_context.h index 1a63db1d3..556e6dcc3 100644 --- a/src/audio_core/renderer/splitter/splitter_context.h +++ b/src/audio_core/renderer/splitter/splitter_context.h | |||
| @@ -13,7 +13,7 @@ namespace AudioCore { | |||
| 13 | struct AudioRendererParameterInternal; | 13 | struct AudioRendererParameterInternal; |
| 14 | class WorkbufferAllocator; | 14 | class WorkbufferAllocator; |
| 15 | 15 | ||
| 16 | namespace AudioRenderer { | 16 | namespace Renderer { |
| 17 | class BehaviorInfo; | 17 | class BehaviorInfo; |
| 18 | 18 | ||
| 19 | /** | 19 | /** |
| @@ -185,5 +185,5 @@ private: | |||
| 185 | bool splitter_bug_fixed{}; | 185 | bool splitter_bug_fixed{}; |
| 186 | }; | 186 | }; |
| 187 | 187 | ||
| 188 | } // namespace AudioRenderer | 188 | } // namespace Renderer |
| 189 | } // namespace AudioCore | 189 | } // namespace AudioCore |
diff --git a/src/audio_core/renderer/splitter/splitter_destinations_data.cpp b/src/audio_core/renderer/splitter/splitter_destinations_data.cpp index b27d44896..5ec37e48e 100644 --- a/src/audio_core/renderer/splitter/splitter_destinations_data.cpp +++ b/src/audio_core/renderer/splitter/splitter_destinations_data.cpp | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include "audio_core/renderer/splitter/splitter_destinations_data.h" | 4 | #include "audio_core/renderer/splitter/splitter_destinations_data.h" |
| 5 | 5 | ||
| 6 | namespace AudioCore::AudioRenderer { | 6 | namespace AudioCore::Renderer { |
| 7 | 7 | ||
| 8 | SplitterDestinationData::SplitterDestinationData(const s32 id_) : id{id_} {} | 8 | SplitterDestinationData::SplitterDestinationData(const s32 id_) : id{id_} {} |
| 9 | 9 | ||
| @@ -84,4 +84,4 @@ void SplitterDestinationData::SetNext(SplitterDestinationData* next_) { | |||
| 84 | next = next_; | 84 | next = next_; |
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | } // namespace AudioCore::AudioRenderer | 87 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/splitter/splitter_destinations_data.h b/src/audio_core/renderer/splitter/splitter_destinations_data.h index d55ce0ad3..90edfc667 100644 --- a/src/audio_core/renderer/splitter/splitter_destinations_data.h +++ b/src/audio_core/renderer/splitter/splitter_destinations_data.h | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | #include "audio_core/common/common.h" | 9 | #include "audio_core/common/common.h" |
| 10 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 11 | 11 | ||
| 12 | namespace AudioCore::AudioRenderer { | 12 | namespace AudioCore::Renderer { |
| 13 | /** | 13 | /** |
| 14 | * Represents a mixing node, can be connected to a previous and next destination forming a chain | 14 | * Represents a mixing node, can be connected to a previous and next destination forming a chain |
| 15 | * that a certain mix buffer will pass through to output. | 15 | * that a certain mix buffer will pass through to output. |
| @@ -132,4 +132,4 @@ private: | |||
| 132 | bool need_update{}; | 132 | bool need_update{}; |
| 133 | }; | 133 | }; |
| 134 | 134 | ||
| 135 | } // namespace AudioCore::AudioRenderer | 135 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/splitter/splitter_info.cpp b/src/audio_core/renderer/splitter/splitter_info.cpp index 1aee6720b..beb5b7f19 100644 --- a/src/audio_core/renderer/splitter/splitter_info.cpp +++ b/src/audio_core/renderer/splitter/splitter_info.cpp | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include "audio_core/renderer/splitter/splitter_info.h" | 4 | #include "audio_core/renderer/splitter/splitter_info.h" |
| 5 | 5 | ||
| 6 | namespace AudioCore::AudioRenderer { | 6 | namespace AudioCore::Renderer { |
| 7 | 7 | ||
| 8 | SplitterInfo::SplitterInfo(const s32 id_) : id{id_} {} | 8 | SplitterInfo::SplitterInfo(const s32 id_) : id{id_} {} |
| 9 | 9 | ||
| @@ -76,4 +76,4 @@ void SplitterInfo::SetDestinations(SplitterDestinationData* destinations_) { | |||
| 76 | destinations = destinations_; | 76 | destinations = destinations_; |
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | } // namespace AudioCore::AudioRenderer | 79 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/splitter/splitter_info.h b/src/audio_core/renderer/splitter/splitter_info.h index b0ad01fe0..c1e4c2df1 100644 --- a/src/audio_core/renderer/splitter/splitter_info.h +++ b/src/audio_core/renderer/splitter/splitter_info.h | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | #include "audio_core/renderer/splitter/splitter_destinations_data.h" | 6 | #include "audio_core/renderer/splitter/splitter_destinations_data.h" |
| 7 | #include "common/common_types.h" | 7 | #include "common/common_types.h" |
| 8 | 8 | ||
| 9 | namespace AudioCore::AudioRenderer { | 9 | namespace AudioCore::Renderer { |
| 10 | /** | 10 | /** |
| 11 | * Represents a splitter, wraps multiple output destinations to split an input mix into. | 11 | * Represents a splitter, wraps multiple output destinations to split an input mix into. |
| 12 | */ | 12 | */ |
| @@ -104,4 +104,4 @@ private: | |||
| 104 | u32 channel_count{}; | 104 | u32 channel_count{}; |
| 105 | }; | 105 | }; |
| 106 | 106 | ||
| 107 | } // namespace AudioCore::AudioRenderer | 107 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/system.cpp b/src/audio_core/renderer/system.cpp index 6e07baa54..8f02754c5 100644 --- a/src/audio_core/renderer/system.cpp +++ b/src/audio_core/renderer/system.cpp | |||
| @@ -4,12 +4,13 @@ | |||
| 4 | #include <chrono> | 4 | #include <chrono> |
| 5 | #include <span> | 5 | #include <span> |
| 6 | 6 | ||
| 7 | #include "audio_core/adsp/apps/audio_renderer/audio_renderer.h" | ||
| 8 | #include "audio_core/adsp/apps/audio_renderer/command_buffer.h" | ||
| 7 | #include "audio_core/audio_core.h" | 9 | #include "audio_core/audio_core.h" |
| 8 | #include "audio_core/common/audio_renderer_parameter.h" | 10 | #include "audio_core/common/audio_renderer_parameter.h" |
| 9 | #include "audio_core/common/common.h" | 11 | #include "audio_core/common/common.h" |
| 10 | #include "audio_core/common/feature_support.h" | 12 | #include "audio_core/common/feature_support.h" |
| 11 | #include "audio_core/common/workbuffer_allocator.h" | 13 | #include "audio_core/common/workbuffer_allocator.h" |
| 12 | #include "audio_core/renderer/adsp/adsp.h" | ||
| 13 | #include "audio_core/renderer/behavior/info_updater.h" | 14 | #include "audio_core/renderer/behavior/info_updater.h" |
| 14 | #include "audio_core/renderer/command/command_buffer.h" | 15 | #include "audio_core/renderer/command/command_buffer.h" |
| 15 | #include "audio_core/renderer/command/command_generator.h" | 16 | #include "audio_core/renderer/command/command_generator.h" |
| @@ -34,7 +35,7 @@ | |||
| 34 | #include "core/hle/kernel/k_transfer_memory.h" | 35 | #include "core/hle/kernel/k_transfer_memory.h" |
| 35 | #include "core/memory.h" | 36 | #include "core/memory.h" |
| 36 | 37 | ||
| 37 | namespace AudioCore::AudioRenderer { | 38 | namespace AudioCore::Renderer { |
| 38 | 39 | ||
| 39 | u64 System::GetWorkBufferSize(const AudioRendererParameterInternal& params) { | 40 | u64 System::GetWorkBufferSize(const AudioRendererParameterInternal& params) { |
| 40 | BehaviorInfo behavior; | 41 | BehaviorInfo behavior; |
| @@ -95,7 +96,8 @@ u64 System::GetWorkBufferSize(const AudioRendererParameterInternal& params) { | |||
| 95 | } | 96 | } |
| 96 | 97 | ||
| 97 | System::System(Core::System& core_, Kernel::KEvent* adsp_rendered_event_) | 98 | System::System(Core::System& core_, Kernel::KEvent* adsp_rendered_event_) |
| 98 | : core{core_}, adsp{core.AudioCore().GetADSP()}, adsp_rendered_event{adsp_rendered_event_} {} | 99 | : core{core_}, audio_renderer{core.AudioCore().ADSP().AudioRenderer()}, |
| 100 | adsp_rendered_event{adsp_rendered_event_} {} | ||
| 99 | 101 | ||
| 100 | Result System::Initialize(const AudioRendererParameterInternal& params, | 102 | Result System::Initialize(const AudioRendererParameterInternal& params, |
| 101 | Kernel::KTransferMemory* transfer_memory, u64 transfer_memory_size, | 103 | Kernel::KTransferMemory* transfer_memory, u64 transfer_memory_size, |
| @@ -443,7 +445,7 @@ void System::Stop() { | |||
| 443 | Result System::Update(std::span<const u8> input, std::span<u8> performance, std::span<u8> output) { | 445 | Result System::Update(std::span<const u8> input, std::span<u8> performance, std::span<u8> output) { |
| 444 | std::scoped_lock l{lock}; | 446 | std::scoped_lock l{lock}; |
| 445 | 447 | ||
| 446 | const auto start_time{core.CoreTiming().GetClockTicks()}; | 448 | const auto start_time{core.CoreTiming().GetGlobalTimeNs().count()}; |
| 447 | std::memset(output.data(), 0, output.size()); | 449 | std::memset(output.data(), 0, output.size()); |
| 448 | 450 | ||
| 449 | InfoUpdater info_updater(input, output, process_handle, behavior); | 451 | InfoUpdater info_updater(input, output, process_handle, behavior); |
| @@ -535,7 +537,7 @@ Result System::Update(std::span<const u8> input, std::span<u8> performance, std: | |||
| 535 | adsp_rendered_event->Clear(); | 537 | adsp_rendered_event->Clear(); |
| 536 | num_times_updated++; | 538 | num_times_updated++; |
| 537 | 539 | ||
| 538 | const auto end_time{core.CoreTiming().GetClockTicks()}; | 540 | const auto end_time{core.CoreTiming().GetGlobalTimeNs().count()}; |
| 539 | ticks_spent_updating += end_time - start_time; | 541 | ticks_spent_updating += end_time - start_time; |
| 540 | 542 | ||
| 541 | return ResultSuccess; | 543 | return ResultSuccess; |
| @@ -583,7 +585,7 @@ void System::SendCommandToDsp() { | |||
| 583 | if (initialized) { | 585 | if (initialized) { |
| 584 | if (active) { | 586 | if (active) { |
| 585 | terminate_event.Reset(); | 587 | terminate_event.Reset(); |
| 586 | const auto remaining_command_count{adsp.GetRemainCommandCount(session_id)}; | 588 | const auto remaining_command_count{audio_renderer.GetRemainCommandCount(session_id)}; |
| 587 | u64 command_size{0}; | 589 | u64 command_size{0}; |
| 588 | 590 | ||
| 589 | if (remaining_command_count) { | 591 | if (remaining_command_count) { |
| @@ -607,26 +609,24 @@ void System::SendCommandToDsp() { | |||
| 607 | time_limit_percent = 70.0f; | 609 | time_limit_percent = 70.0f; |
| 608 | } | 610 | } |
| 609 | 611 | ||
| 610 | ADSP::CommandBuffer command_buffer{ | 612 | AudioRenderer::CommandBuffer command_buffer{ |
| 611 | .buffer{translated_addr}, | 613 | .buffer{translated_addr}, |
| 612 | .size{command_size}, | 614 | .size{command_size}, |
| 613 | .time_limit{ | 615 | .time_limit{ |
| 614 | static_cast<u64>((time_limit_percent / 100) * 2'880'000.0 * | 616 | static_cast<u64>((time_limit_percent / 100) * 2'880'000.0 * |
| 615 | (static_cast<f32>(render_time_limit_percent) / 100.0f))}, | 617 | (static_cast<f32>(render_time_limit_percent) / 100.0f))}, |
| 616 | .remaining_command_count{remaining_command_count}, | ||
| 617 | .reset_buffers{reset_command_buffers}, | ||
| 618 | .applet_resource_user_id{applet_resource_user_id}, | 618 | .applet_resource_user_id{applet_resource_user_id}, |
| 619 | .render_time_taken{adsp.GetRenderTimeTaken(session_id)}, | 619 | .reset_buffer{reset_command_buffers}, |
| 620 | }; | 620 | }; |
| 621 | 621 | ||
| 622 | adsp.SendCommandBuffer(session_id, command_buffer); | 622 | audio_renderer.SetCommandBuffer(session_id, command_buffer); |
| 623 | reset_command_buffers = false; | 623 | reset_command_buffers = false; |
| 624 | command_buffer_size = command_size; | 624 | command_buffer_size = command_size; |
| 625 | if (remaining_command_count == 0) { | 625 | if (remaining_command_count == 0) { |
| 626 | adsp_rendered_event->Signal(); | 626 | adsp_rendered_event->Signal(); |
| 627 | } | 627 | } |
| 628 | } else { | 628 | } else { |
| 629 | adsp.ClearRemainCount(session_id); | 629 | audio_renderer.ClearRemainCommandCount(session_id); |
| 630 | terminate_event.Set(); | 630 | terminate_event.Set(); |
| 631 | } | 631 | } |
| 632 | } | 632 | } |
| @@ -635,7 +635,7 @@ void System::SendCommandToDsp() { | |||
| 635 | u64 System::GenerateCommand(std::span<u8> in_command_buffer, | 635 | u64 System::GenerateCommand(std::span<u8> in_command_buffer, |
| 636 | [[maybe_unused]] u64 command_buffer_size_) { | 636 | [[maybe_unused]] u64 command_buffer_size_) { |
| 637 | PoolMapper::ClearUseState(memory_pool_workbuffer, memory_pool_count); | 637 | PoolMapper::ClearUseState(memory_pool_workbuffer, memory_pool_count); |
| 638 | const auto start_time{core.CoreTiming().GetClockTicks()}; | 638 | const auto start_time{core.CoreTiming().GetGlobalTimeNs().count()}; |
| 639 | 639 | ||
| 640 | auto command_list_header{reinterpret_cast<CommandListHeader*>(in_command_buffer.data())}; | 640 | auto command_list_header{reinterpret_cast<CommandListHeader*>(in_command_buffer.data())}; |
| 641 | 641 | ||
| @@ -732,10 +732,10 @@ u64 System::GenerateCommand(std::span<u8> in_command_buffer, | |||
| 732 | effect_context.UpdateStateByDspShared(); | 732 | effect_context.UpdateStateByDspShared(); |
| 733 | } | 733 | } |
| 734 | 734 | ||
| 735 | const auto end_time{core.CoreTiming().GetClockTicks()}; | 735 | const auto end_time{core.CoreTiming().GetGlobalTimeNs().count()}; |
| 736 | total_ticks_elapsed += end_time - start_time; | 736 | total_ticks_elapsed += end_time - start_time; |
| 737 | num_command_lists_generated++; | 737 | num_command_lists_generated++; |
| 738 | render_start_tick = adsp.GetRenderingStartTick(session_id); | 738 | render_start_tick = audio_renderer.GetRenderingStartTick(session_id); |
| 739 | frames_elapsed++; | 739 | frames_elapsed++; |
| 740 | 740 | ||
| 741 | return command_buffer.size; | 741 | return command_buffer.size; |
| @@ -819,4 +819,4 @@ u32 System::DropVoices(CommandBuffer& command_buffer, u32 estimated_process_time | |||
| 819 | return voices_dropped; | 819 | return voices_dropped; |
| 820 | } | 820 | } |
| 821 | 821 | ||
| 822 | } // namespace AudioCore::AudioRenderer | 822 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/system.h b/src/audio_core/renderer/system.h index e328783b6..8a8341710 100644 --- a/src/audio_core/renderer/system.h +++ b/src/audio_core/renderer/system.h | |||
| @@ -34,12 +34,16 @@ class KTransferMemory; | |||
| 34 | 34 | ||
| 35 | namespace AudioCore { | 35 | namespace AudioCore { |
| 36 | struct AudioRendererParameterInternal; | 36 | struct AudioRendererParameterInternal; |
| 37 | |||
| 38 | namespace AudioRenderer { | ||
| 39 | class CommandBuffer; | ||
| 40 | namespace ADSP { | 37 | namespace ADSP { |
| 41 | class ADSP; | 38 | class ADSP; |
| 39 | namespace AudioRenderer { | ||
| 40 | class AudioRenderer; | ||
| 42 | } | 41 | } |
| 42 | } // namespace ADSP | ||
| 43 | |||
| 44 | namespace Renderer { | ||
| 45 | using namespace ::AudioCore::ADSP; | ||
| 46 | class CommandBuffer; | ||
| 43 | 47 | ||
| 44 | /** | 48 | /** |
| 45 | * Audio Renderer System, the main worker for audio rendering. | 49 | * Audio Renderer System, the main worker for audio rendering. |
| @@ -213,8 +217,8 @@ public: | |||
| 213 | private: | 217 | private: |
| 214 | /// Core system | 218 | /// Core system |
| 215 | Core::System& core; | 219 | Core::System& core; |
| 216 | /// Reference to the ADSP for communication | 220 | /// Reference to the ADSP's AudioRenderer for communication |
| 217 | ADSP::ADSP& adsp; | 221 | ::AudioCore::ADSP::AudioRenderer::AudioRenderer& audio_renderer; |
| 218 | /// Is this system initialized? | 222 | /// Is this system initialized? |
| 219 | bool initialized{}; | 223 | bool initialized{}; |
| 220 | /// Is this system currently active? | 224 | /// Is this system currently active? |
| @@ -319,5 +323,5 @@ private: | |||
| 319 | f32 drop_voice_param{1.0f}; | 323 | f32 drop_voice_param{1.0f}; |
| 320 | }; | 324 | }; |
| 321 | 325 | ||
| 322 | } // namespace AudioRenderer | 326 | } // namespace Renderer |
| 323 | } // namespace AudioCore | 327 | } // namespace AudioCore |
diff --git a/src/audio_core/renderer/system_manager.cpp b/src/audio_core/renderer/system_manager.cpp index 300ecdbf1..a0b8ef29e 100644 --- a/src/audio_core/renderer/system_manager.cpp +++ b/src/audio_core/renderer/system_manager.cpp | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | 3 | ||
| 4 | #include <chrono> | 4 | #include <chrono> |
| 5 | 5 | ||
| 6 | #include "audio_core/adsp/adsp.h" | ||
| 6 | #include "audio_core/audio_core.h" | 7 | #include "audio_core/audio_core.h" |
| 7 | #include "audio_core/renderer/adsp/adsp.h" | ||
| 8 | #include "audio_core/renderer/system_manager.h" | 8 | #include "audio_core/renderer/system_manager.h" |
| 9 | #include "common/microprofile.h" | 9 | #include "common/microprofile.h" |
| 10 | #include "common/thread.h" | 10 | #include "common/thread.h" |
| @@ -14,24 +14,21 @@ | |||
| 14 | MICROPROFILE_DEFINE(Audio_RenderSystemManager, "Audio", "Render System Manager", | 14 | MICROPROFILE_DEFINE(Audio_RenderSystemManager, "Audio", "Render System Manager", |
| 15 | MP_RGB(60, 19, 97)); | 15 | MP_RGB(60, 19, 97)); |
| 16 | 16 | ||
| 17 | namespace AudioCore::AudioRenderer { | 17 | namespace AudioCore::Renderer { |
| 18 | 18 | ||
| 19 | SystemManager::SystemManager(Core::System& core_) | 19 | SystemManager::SystemManager(Core::System& core_) |
| 20 | : core{core_}, adsp{core.AudioCore().GetADSP()}, mailbox{adsp.GetRenderMailbox()} {} | 20 | : core{core_}, audio_renderer{core.AudioCore().ADSP().AudioRenderer()} {} |
| 21 | 21 | ||
| 22 | SystemManager::~SystemManager() { | 22 | SystemManager::~SystemManager() { |
| 23 | Stop(); | 23 | Stop(); |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | bool SystemManager::InitializeUnsafe() { | 26 | void SystemManager::InitializeUnsafe() { |
| 27 | if (!active) { | 27 | if (!active) { |
| 28 | if (adsp.Start()) { | 28 | active = true; |
| 29 | active = true; | 29 | audio_renderer.Start(); |
| 30 | thread = std::jthread([this](std::stop_token stop_token) { ThreadFunc(stop_token); }); | 30 | thread = std::jthread([this](std::stop_token stop_token) { ThreadFunc(stop_token); }); |
| 31 | } | ||
| 32 | } | 31 | } |
| 33 | |||
| 34 | return adsp.GetState() == ADSP::State::Started; | ||
| 35 | } | 32 | } |
| 36 | 33 | ||
| 37 | void SystemManager::Stop() { | 34 | void SystemManager::Stop() { |
| @@ -41,7 +38,7 @@ void SystemManager::Stop() { | |||
| 41 | active = false; | 38 | active = false; |
| 42 | thread.request_stop(); | 39 | thread.request_stop(); |
| 43 | thread.join(); | 40 | thread.join(); |
| 44 | adsp.Stop(); | 41 | audio_renderer.Stop(); |
| 45 | } | 42 | } |
| 46 | 43 | ||
| 47 | bool SystemManager::Add(System& system_) { | 44 | bool SystemManager::Add(System& system_) { |
| @@ -55,10 +52,7 @@ bool SystemManager::Add(System& system_) { | |||
| 55 | { | 52 | { |
| 56 | std::scoped_lock l{mutex1}; | 53 | std::scoped_lock l{mutex1}; |
| 57 | if (systems.empty()) { | 54 | if (systems.empty()) { |
| 58 | if (!InitializeUnsafe()) { | 55 | InitializeUnsafe(); |
| 59 | LOG_ERROR(Service_Audio, "Failed to start the AudioRenderer SystemManager"); | ||
| 60 | return false; | ||
| 61 | } | ||
| 62 | } | 56 | } |
| 63 | } | 57 | } |
| 64 | 58 | ||
| @@ -100,9 +94,9 @@ void SystemManager::ThreadFunc(std::stop_token stop_token) { | |||
| 100 | } | 94 | } |
| 101 | } | 95 | } |
| 102 | 96 | ||
| 103 | adsp.Signal(); | 97 | audio_renderer.Signal(); |
| 104 | adsp.Wait(); | 98 | audio_renderer.Wait(); |
| 105 | } | 99 | } |
| 106 | } | 100 | } |
| 107 | 101 | ||
| 108 | } // namespace AudioCore::AudioRenderer | 102 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/system_manager.h b/src/audio_core/renderer/system_manager.h index 9681fd121..62e8e5f15 100644 --- a/src/audio_core/renderer/system_manager.h +++ b/src/audio_core/renderer/system_manager.h | |||
| @@ -18,11 +18,14 @@ struct EventType; | |||
| 18 | class System; | 18 | class System; |
| 19 | } // namespace Core | 19 | } // namespace Core |
| 20 | 20 | ||
| 21 | namespace AudioCore::AudioRenderer { | 21 | namespace AudioCore::ADSP { |
| 22 | namespace ADSP { | ||
| 23 | class ADSP; | 22 | class ADSP; |
| 24 | class AudioRenderer_Mailbox; | 23 | namespace AudioRenderer { |
| 25 | } // namespace ADSP | 24 | class AudioRenderer; |
| 25 | } // namespace AudioRenderer | ||
| 26 | } // namespace AudioCore::ADSP | ||
| 27 | |||
| 28 | namespace AudioCore::Renderer { | ||
| 26 | 29 | ||
| 27 | /** | 30 | /** |
| 28 | * Manages all audio renderers, responsible for triggering command list generation and signalling | 31 | * Manages all audio renderers, responsible for triggering command list generation and signalling |
| @@ -38,7 +41,7 @@ public: | |||
| 38 | * | 41 | * |
| 39 | * @return True if successfully initialized, otherwise false. | 42 | * @return True if successfully initialized, otherwise false. |
| 40 | */ | 43 | */ |
| 41 | bool InitializeUnsafe(); | 44 | void InitializeUnsafe(); |
| 42 | 45 | ||
| 43 | /** | 46 | /** |
| 44 | * Stop the system manager. | 47 | * Stop the system manager. |
| @@ -80,10 +83,8 @@ private: | |||
| 80 | std::mutex mutex2{}; | 83 | std::mutex mutex2{}; |
| 81 | /// Is the system manager thread active? | 84 | /// Is the system manager thread active? |
| 82 | std::atomic<bool> active{}; | 85 | std::atomic<bool> active{}; |
| 83 | /// Reference to the ADSP for communication | 86 | /// Reference to the ADSP's AudioRenderer for communication |
| 84 | ADSP::ADSP& adsp; | 87 | ::AudioCore::ADSP::AudioRenderer::AudioRenderer& audio_renderer; |
| 85 | /// AudioRenderer mailbox for communication | ||
| 86 | ADSP::AudioRenderer_Mailbox* mailbox{}; | ||
| 87 | }; | 88 | }; |
| 88 | 89 | ||
| 89 | } // namespace AudioCore::AudioRenderer | 90 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/upsampler/upsampler_info.h b/src/audio_core/renderer/upsampler/upsampler_info.h index a43c15af3..85c87f137 100644 --- a/src/audio_core/renderer/upsampler/upsampler_info.h +++ b/src/audio_core/renderer/upsampler/upsampler_info.h | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | #include "audio_core/renderer/upsampler/upsampler_state.h" | 9 | #include "audio_core/renderer/upsampler/upsampler_state.h" |
| 10 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 11 | 11 | ||
| 12 | namespace AudioCore::AudioRenderer { | 12 | namespace AudioCore::Renderer { |
| 13 | class UpsamplerManager; | 13 | class UpsamplerManager; |
| 14 | 14 | ||
| 15 | /** | 15 | /** |
| @@ -32,4 +32,4 @@ struct UpsamplerInfo { | |||
| 32 | std::array<s16, MaxChannels> inputs{}; | 32 | std::array<s16, MaxChannels> inputs{}; |
| 33 | }; | 33 | }; |
| 34 | 34 | ||
| 35 | } // namespace AudioCore::AudioRenderer | 35 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/upsampler/upsampler_manager.cpp b/src/audio_core/renderer/upsampler/upsampler_manager.cpp index 4c76a5066..ef740f6c9 100644 --- a/src/audio_core/renderer/upsampler/upsampler_manager.cpp +++ b/src/audio_core/renderer/upsampler/upsampler_manager.cpp | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include "audio_core/renderer/upsampler/upsampler_manager.h" | 4 | #include "audio_core/renderer/upsampler/upsampler_manager.h" |
| 5 | 5 | ||
| 6 | namespace AudioCore::AudioRenderer { | 6 | namespace AudioCore::Renderer { |
| 7 | 7 | ||
| 8 | UpsamplerManager::UpsamplerManager(const u32 count_, std::span<UpsamplerInfo> infos_, | 8 | UpsamplerManager::UpsamplerManager(const u32 count_, std::span<UpsamplerInfo> infos_, |
| 9 | std::span<s32> workbuffer_) | 9 | std::span<s32> workbuffer_) |
| @@ -41,4 +41,4 @@ void UpsamplerManager::Free(UpsamplerInfo* info) { | |||
| 41 | info->enabled = false; | 41 | info->enabled = false; |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | } // namespace AudioCore::AudioRenderer | 44 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/upsampler/upsampler_manager.h b/src/audio_core/renderer/upsampler/upsampler_manager.h index 83c697c0c..263e5718b 100644 --- a/src/audio_core/renderer/upsampler/upsampler_manager.h +++ b/src/audio_core/renderer/upsampler/upsampler_manager.h | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | #include "audio_core/renderer/upsampler/upsampler_info.h" | 9 | #include "audio_core/renderer/upsampler/upsampler_info.h" |
| 10 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 11 | 11 | ||
| 12 | namespace AudioCore::AudioRenderer { | 12 | namespace AudioCore::Renderer { |
| 13 | /** | 13 | /** |
| 14 | * Manages and has utility functions for upsampler infos. | 14 | * Manages and has utility functions for upsampler infos. |
| 15 | */ | 15 | */ |
| @@ -42,4 +42,4 @@ private: | |||
| 42 | std::mutex lock{}; | 42 | std::mutex lock{}; |
| 43 | }; | 43 | }; |
| 44 | 44 | ||
| 45 | } // namespace AudioCore::AudioRenderer | 45 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/upsampler/upsampler_state.h b/src/audio_core/renderer/upsampler/upsampler_state.h index 28cebe200..dc7b31d42 100644 --- a/src/audio_core/renderer/upsampler/upsampler_state.h +++ b/src/audio_core/renderer/upsampler/upsampler_state.h | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | #include "common/common_types.h" | 8 | #include "common/common_types.h" |
| 9 | #include "common/fixed_point.h" | 9 | #include "common/fixed_point.h" |
| 10 | 10 | ||
| 11 | namespace AudioCore::AudioRenderer { | 11 | namespace AudioCore::Renderer { |
| 12 | /** | 12 | /** |
| 13 | * Upsampling state used by the AudioRenderer across calls. | 13 | * Upsampling state used by the AudioRenderer across calls. |
| 14 | */ | 14 | */ |
| @@ -37,4 +37,4 @@ struct UpsamplerState { | |||
| 37 | u8 sample_index; | 37 | u8 sample_index; |
| 38 | }; | 38 | }; |
| 39 | 39 | ||
| 40 | } // namespace AudioCore::AudioRenderer | 40 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/voice/voice_channel_resource.h b/src/audio_core/renderer/voice/voice_channel_resource.h index 26ab4ccce..4f19c2fcc 100644 --- a/src/audio_core/renderer/voice/voice_channel_resource.h +++ b/src/audio_core/renderer/voice/voice_channel_resource.h | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | #include "audio_core/common/common.h" | 8 | #include "audio_core/common/common.h" |
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | 10 | ||
| 11 | namespace AudioCore::AudioRenderer { | 11 | namespace AudioCore::Renderer { |
| 12 | /** | 12 | /** |
| 13 | * Represents one channel for mixing a voice. | 13 | * Represents one channel for mixing a voice. |
| 14 | */ | 14 | */ |
| @@ -35,4 +35,4 @@ public: | |||
| 35 | bool in_use{}; | 35 | bool in_use{}; |
| 36 | }; | 36 | }; |
| 37 | 37 | ||
| 38 | } // namespace AudioCore::AudioRenderer | 38 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/voice/voice_context.cpp b/src/audio_core/renderer/voice/voice_context.cpp index 16a3e839d..c3644e38b 100644 --- a/src/audio_core/renderer/voice/voice_context.cpp +++ b/src/audio_core/renderer/voice/voice_context.cpp | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | #include "audio_core/renderer/voice/voice_context.h" | 6 | #include "audio_core/renderer/voice/voice_context.h" |
| 7 | #include "common/polyfill_ranges.h" | 7 | #include "common/polyfill_ranges.h" |
| 8 | 8 | ||
| 9 | namespace AudioCore::AudioRenderer { | 9 | namespace AudioCore::Renderer { |
| 10 | 10 | ||
| 11 | VoiceState& VoiceContext::GetDspSharedState(const u32 index) { | 11 | VoiceState& VoiceContext::GetDspSharedState(const u32 index) { |
| 12 | if (index >= dsp_states.size()) { | 12 | if (index >= dsp_states.size()) { |
| @@ -84,4 +84,4 @@ void VoiceContext::UpdateStateByDspShared() { | |||
| 84 | std::memcpy(cpu_states.data(), dsp_states.data(), voice_count * sizeof(VoiceState)); | 84 | std::memcpy(cpu_states.data(), dsp_states.data(), voice_count * sizeof(VoiceState)); |
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | } // namespace AudioCore::AudioRenderer | 87 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/voice/voice_context.h b/src/audio_core/renderer/voice/voice_context.h index 43b677154..138ab2773 100644 --- a/src/audio_core/renderer/voice/voice_context.h +++ b/src/audio_core/renderer/voice/voice_context.h | |||
| @@ -10,7 +10,7 @@ | |||
| 10 | #include "audio_core/renderer/voice/voice_state.h" | 10 | #include "audio_core/renderer/voice/voice_state.h" |
| 11 | #include "common/common_types.h" | 11 | #include "common/common_types.h" |
| 12 | 12 | ||
| 13 | namespace AudioCore::AudioRenderer { | 13 | namespace AudioCore::Renderer { |
| 14 | /** | 14 | /** |
| 15 | * Contains all voices, with utility functions for managing them. | 15 | * Contains all voices, with utility functions for managing them. |
| 16 | */ | 16 | */ |
| @@ -123,4 +123,4 @@ private: | |||
| 123 | u32 active_count{}; | 123 | u32 active_count{}; |
| 124 | }; | 124 | }; |
| 125 | 125 | ||
| 126 | } // namespace AudioCore::AudioRenderer | 126 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/voice/voice_info.cpp b/src/audio_core/renderer/voice/voice_info.cpp index c0bfb23fc..6239cfab7 100644 --- a/src/audio_core/renderer/voice/voice_info.cpp +++ b/src/audio_core/renderer/voice/voice_info.cpp | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | #include "audio_core/renderer/voice/voice_info.h" | 6 | #include "audio_core/renderer/voice/voice_info.h" |
| 7 | #include "audio_core/renderer/voice/voice_state.h" | 7 | #include "audio_core/renderer/voice/voice_state.h" |
| 8 | 8 | ||
| 9 | namespace AudioCore::AudioRenderer { | 9 | namespace AudioCore::Renderer { |
| 10 | 10 | ||
| 11 | VoiceInfo::VoiceInfo() { | 11 | VoiceInfo::VoiceInfo() { |
| 12 | Initialize(); | 12 | Initialize(); |
| @@ -405,4 +405,4 @@ void VoiceInfo::ResetResources(VoiceContext& voice_context) const { | |||
| 405 | } | 405 | } |
| 406 | } | 406 | } |
| 407 | 407 | ||
| 408 | } // namespace AudioCore::AudioRenderer | 408 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/voice/voice_info.h b/src/audio_core/renderer/voice/voice_info.h index 3c5d3e04f..14a687dcb 100644 --- a/src/audio_core/renderer/voice/voice_info.h +++ b/src/audio_core/renderer/voice/voice_info.h | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | #include "audio_core/renderer/memory/address_info.h" | 12 | #include "audio_core/renderer/memory/address_info.h" |
| 13 | #include "common/common_types.h" | 13 | #include "common/common_types.h" |
| 14 | 14 | ||
| 15 | namespace AudioCore::AudioRenderer { | 15 | namespace AudioCore::Renderer { |
| 16 | class PoolMapper; | 16 | class PoolMapper; |
| 17 | class VoiceContext; | 17 | class VoiceContext; |
| 18 | struct VoiceState; | 18 | struct VoiceState; |
| @@ -377,4 +377,4 @@ public: | |||
| 377 | u8 flush_buffer_count{}; | 377 | u8 flush_buffer_count{}; |
| 378 | }; | 378 | }; |
| 379 | 379 | ||
| 380 | } // namespace AudioCore::AudioRenderer | 380 | } // namespace AudioCore::Renderer |
diff --git a/src/audio_core/renderer/voice/voice_state.h b/src/audio_core/renderer/voice/voice_state.h index ce947233f..c7aee167b 100644 --- a/src/audio_core/renderer/voice/voice_state.h +++ b/src/audio_core/renderer/voice/voice_state.h | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | #include "common/fixed_point.h" | 10 | #include "common/fixed_point.h" |
| 11 | 11 | ||
| 12 | namespace AudioCore::AudioRenderer { | 12 | namespace AudioCore::Renderer { |
| 13 | /** | 13 | /** |
| 14 | * Holds a state for a voice. One is kept host-side, and one is used by the AudioRenderer, | 14 | * Holds a state for a voice. One is kept host-side, and one is used by the AudioRenderer, |
| 15 | * host-side is updated on the next iteration. | 15 | * host-side is updated on the next iteration. |
| @@ -67,4 +67,4 @@ struct VoiceState { | |||
| 67 | s32 loop_count; | 67 | s32 loop_count; |
| 68 | }; | 68 | }; |
| 69 | 69 | ||
| 70 | } // namespace AudioCore::AudioRenderer | 70 | } // namespace AudioCore::Renderer |
diff --git a/src/core/hle/service/audio/audin_u.cpp b/src/core/hle/service/audio/audin_u.cpp index 526a39130..56fee4591 100644 --- a/src/core/hle/service/audio/audin_u.cpp +++ b/src/core/hle/service/audio/audin_u.cpp | |||
| @@ -220,7 +220,7 @@ AudInU::AudInU(Core::System& system_) | |||
| 220 | AudInU::~AudInU() = default; | 220 | AudInU::~AudInU() = default; |
| 221 | 221 | ||
| 222 | void AudInU::ListAudioIns(HLERequestContext& ctx) { | 222 | void AudInU::ListAudioIns(HLERequestContext& ctx) { |
| 223 | using namespace AudioCore::AudioRenderer; | 223 | using namespace AudioCore::Renderer; |
| 224 | 224 | ||
| 225 | LOG_DEBUG(Service_Audio, "called"); | 225 | LOG_DEBUG(Service_Audio, "called"); |
| 226 | 226 | ||
| @@ -240,7 +240,7 @@ void AudInU::ListAudioIns(HLERequestContext& ctx) { | |||
| 240 | } | 240 | } |
| 241 | 241 | ||
| 242 | void AudInU::ListAudioInsAutoFiltered(HLERequestContext& ctx) { | 242 | void AudInU::ListAudioInsAutoFiltered(HLERequestContext& ctx) { |
| 243 | using namespace AudioCore::AudioRenderer; | 243 | using namespace AudioCore::Renderer; |
| 244 | 244 | ||
| 245 | LOG_DEBUG(Service_Audio, "called"); | 245 | LOG_DEBUG(Service_Audio, "called"); |
| 246 | 246 | ||
diff --git a/src/core/hle/service/audio/audout_u.cpp b/src/core/hle/service/audio/audout_u.cpp index 23f84a29f..ca683d72c 100644 --- a/src/core/hle/service/audio/audout_u.cpp +++ b/src/core/hle/service/audio/audout_u.cpp | |||
| @@ -228,7 +228,7 @@ AudOutU::AudOutU(Core::System& system_) | |||
| 228 | AudOutU::~AudOutU() = default; | 228 | AudOutU::~AudOutU() = default; |
| 229 | 229 | ||
| 230 | void AudOutU::ListAudioOuts(HLERequestContext& ctx) { | 230 | void AudOutU::ListAudioOuts(HLERequestContext& ctx) { |
| 231 | using namespace AudioCore::AudioRenderer; | 231 | using namespace AudioCore::Renderer; |
| 232 | 232 | ||
| 233 | std::scoped_lock l{impl->mutex}; | 233 | std::scoped_lock l{impl->mutex}; |
| 234 | 234 | ||
diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp index b723b65c8..2f09cade5 100644 --- a/src/core/hle/service/audio/audren_u.cpp +++ b/src/core/hle/service/audio/audren_u.cpp | |||
| @@ -26,7 +26,7 @@ | |||
| 26 | #include "core/hle/service/ipc_helpers.h" | 26 | #include "core/hle/service/ipc_helpers.h" |
| 27 | #include "core/memory.h" | 27 | #include "core/memory.h" |
| 28 | 28 | ||
| 29 | using namespace AudioCore::AudioRenderer; | 29 | using namespace AudioCore::Renderer; |
| 30 | 30 | ||
| 31 | namespace Service::Audio { | 31 | namespace Service::Audio { |
| 32 | 32 | ||
diff --git a/src/core/hle/service/audio/audren_u.h b/src/core/hle/service/audio/audren_u.h index d8e9c8719..3d7993a16 100644 --- a/src/core/hle/service/audio/audren_u.h +++ b/src/core/hle/service/audio/audren_u.h | |||
| @@ -28,7 +28,7 @@ private: | |||
| 28 | void GetAudioDeviceServiceWithRevisionInfo(HLERequestContext& ctx); | 28 | void GetAudioDeviceServiceWithRevisionInfo(HLERequestContext& ctx); |
| 29 | 29 | ||
| 30 | KernelHelpers::ServiceContext service_context; | 30 | KernelHelpers::ServiceContext service_context; |
| 31 | std::unique_ptr<AudioCore::AudioRenderer::Manager> impl; | 31 | std::unique_ptr<AudioCore::Renderer::Manager> impl; |
| 32 | u32 num_audio_devices{0}; | 32 | u32 num_audio_devices{0}; |
| 33 | }; | 33 | }; |
| 34 | 34 | ||