summaryrefslogtreecommitdiff
path: root/src/audio_core/renderer
diff options
context:
space:
mode:
authorGravatar Kelebek12023-08-31 15:09:15 +0100
committerGravatar Kelebek12023-09-04 17:12:16 +0100
commitebd19dec99d9809a669f63294745d7c8facc6d31 (patch)
treecd1f34cac0c091c2ffd16c429ac33b8fe133e06e /src/audio_core/renderer
parentMerge pull request #11420 from t895/long-install-fix (diff)
downloadyuzu-ebd19dec99d9809a669f63294745d7c8facc6d31.tar.gz
yuzu-ebd19dec99d9809a669f63294745d7c8facc6d31.tar.xz
yuzu-ebd19dec99d9809a669f63294745d7c8facc6d31.zip
Rework ADSP into a wrapper for apps
Diffstat (limited to 'src/audio_core/renderer')
-rw-r--r--src/audio_core/renderer/adsp/adsp.cpp117
-rw-r--r--src/audio_core/renderer/adsp/adsp.h171
-rw-r--r--src/audio_core/renderer/adsp/audio_renderer.cpp225
-rw-r--r--src/audio_core/renderer/adsp/audio_renderer.h204
-rw-r--r--src/audio_core/renderer/adsp/command_buffer.h21
-rw-r--r--src/audio_core/renderer/adsp/command_list_processor.cpp108
-rw-r--r--src/audio_core/renderer/adsp/command_list_processor.h119
-rw-r--r--src/audio_core/renderer/audio_device.cpp4
-rw-r--r--src/audio_core/renderer/audio_device.h4
-rw-r--r--src/audio_core/renderer/audio_renderer.cpp4
-rw-r--r--src/audio_core/renderer/audio_renderer.h6
-rw-r--r--src/audio_core/renderer/behavior/behavior_info.cpp4
-rw-r--r--src/audio_core/renderer/behavior/behavior_info.h8
-rw-r--r--src/audio_core/renderer/behavior/info_updater.cpp4
-rw-r--r--src/audio_core/renderer/behavior/info_updater.h4
-rw-r--r--src/audio_core/renderer/command/command_buffer.cpp4
-rw-r--r--src/audio_core/renderer/command/command_buffer.h4
-rw-r--r--src/audio_core/renderer/command/command_generator.cpp4
-rw-r--r--src/audio_core/renderer/command/command_generator.h4
-rw-r--r--src/audio_core/renderer/command/command_list_header.h4
-rw-r--r--src/audio_core/renderer/command/command_processing_time_estimator.cpp4
-rw-r--r--src/audio_core/renderer/command/command_processing_time_estimator.h4
-rw-r--r--src/audio_core/renderer/command/data_source/adpcm.cpp18
-rw-r--r--src/audio_core/renderer/command/data_source/adpcm.h23
-rw-r--r--src/audio_core/renderer/command/data_source/decode.cpp6
-rw-r--r--src/audio_core/renderer/command/data_source/decode.h4
-rw-r--r--src/audio_core/renderer/command/data_source/pcm_float.cpp22
-rw-r--r--src/audio_core/renderer/command/data_source/pcm_float.h23
-rw-r--r--src/audio_core/renderer/command/data_source/pcm_int16.cpp22
-rw-r--r--src/audio_core/renderer/command/data_source/pcm_int16.h23
-rw-r--r--src/audio_core/renderer/command/effect/aux_.cpp12
-rw-r--r--src/audio_core/renderer/command/effect/aux_.h13
-rw-r--r--src/audio_core/renderer/command/effect/biquad_filter.cpp14
-rw-r--r--src/audio_core/renderer/command/effect/biquad_filter.h13
-rw-r--r--src/audio_core/renderer/command/effect/capture.cpp12
-rw-r--r--src/audio_core/renderer/command/effect/capture.h13
-rw-r--r--src/audio_core/renderer/command/effect/compressor.cpp12
-rw-r--r--src/audio_core/renderer/command/effect/compressor.h13
-rw-r--r--src/audio_core/renderer/command/effect/delay.cpp12
-rw-r--r--src/audio_core/renderer/command/effect/delay.h13
-rw-r--r--src/audio_core/renderer/command/effect/i3dl2_reverb.cpp12
-rw-r--r--src/audio_core/renderer/command/effect/i3dl2_reverb.h13
-rw-r--r--src/audio_core/renderer/command/effect/light_limiter.cpp22
-rw-r--r--src/audio_core/renderer/command/effect/light_limiter.h19
-rw-r--r--src/audio_core/renderer/command/effect/multi_tap_biquad_filter.cpp14
-rw-r--r--src/audio_core/renderer/command/effect/multi_tap_biquad_filter.h13
-rw-r--r--src/audio_core/renderer/command/effect/reverb.cpp12
-rw-r--r--src/audio_core/renderer/command/effect/reverb.h13
-rw-r--r--src/audio_core/renderer/command/icommand.h17
-rw-r--r--src/audio_core/renderer/command/mix/clear_mix.cpp14
-rw-r--r--src/audio_core/renderer/command/mix/clear_mix.h13
-rw-r--r--src/audio_core/renderer/command/mix/copy_mix.cpp14
-rw-r--r--src/audio_core/renderer/command/mix/copy_mix.h13
-rw-r--r--src/audio_core/renderer/command/mix/depop_for_mix_buffers.cpp14
-rw-r--r--src/audio_core/renderer/command/mix/depop_for_mix_buffers.h13
-rw-r--r--src/audio_core/renderer/command/mix/depop_prepare.cpp14
-rw-r--r--src/audio_core/renderer/command/mix/depop_prepare.h13
-rw-r--r--src/audio_core/renderer/command/mix/mix.cpp12
-rw-r--r--src/audio_core/renderer/command/mix/mix.h13
-rw-r--r--src/audio_core/renderer/command/mix/mix_ramp.cpp13
-rw-r--r--src/audio_core/renderer/command/mix/mix_ramp.h13
-rw-r--r--src/audio_core/renderer/command/mix/mix_ramp_grouped.cpp13
-rw-r--r--src/audio_core/renderer/command/mix/mix_ramp_grouped.h13
-rw-r--r--src/audio_core/renderer/command/mix/volume.cpp12
-rw-r--r--src/audio_core/renderer/command/mix/volume.h13
-rw-r--r--src/audio_core/renderer/command/mix/volume_ramp.cpp13
-rw-r--r--src/audio_core/renderer/command/mix/volume_ramp.h13
-rw-r--r--src/audio_core/renderer/command/performance/performance.cpp20
-rw-r--r--src/audio_core/renderer/command/performance/performance.h13
-rw-r--r--src/audio_core/renderer/command/resample/downmix_6ch_to_2ch.cpp14
-rw-r--r--src/audio_core/renderer/command/resample/downmix_6ch_to_2ch.h13
-rw-r--r--src/audio_core/renderer/command/resample/resample.cpp4
-rw-r--r--src/audio_core/renderer/command/resample/resample.h4
-rw-r--r--src/audio_core/renderer/command/resample/upsample.cpp12
-rw-r--r--src/audio_core/renderer/command/resample/upsample.h13
-rw-r--r--src/audio_core/renderer/command/sink/circular_buffer.cpp14
-rw-r--r--src/audio_core/renderer/command/sink/circular_buffer.h13
-rw-r--r--src/audio_core/renderer/command/sink/device.cpp12
-rw-r--r--src/audio_core/renderer/command/sink/device.h13
-rw-r--r--src/audio_core/renderer/effect/aux_.cpp4
-rw-r--r--src/audio_core/renderer/effect/aux_.h4
-rw-r--r--src/audio_core/renderer/effect/biquad_filter.cpp4
-rw-r--r--src/audio_core/renderer/effect/biquad_filter.h4
-rw-r--r--src/audio_core/renderer/effect/buffer_mixer.cpp4
-rw-r--r--src/audio_core/renderer/effect/buffer_mixer.h4
-rw-r--r--src/audio_core/renderer/effect/capture.cpp4
-rw-r--r--src/audio_core/renderer/effect/capture.h4
-rw-r--r--src/audio_core/renderer/effect/compressor.cpp4
-rw-r--r--src/audio_core/renderer/effect/compressor.h4
-rw-r--r--src/audio_core/renderer/effect/delay.cpp4
-rw-r--r--src/audio_core/renderer/effect/delay.h4
-rw-r--r--src/audio_core/renderer/effect/effect_context.cpp4
-rw-r--r--src/audio_core/renderer/effect/effect_context.h4
-rw-r--r--src/audio_core/renderer/effect/effect_info_base.h4
-rw-r--r--src/audio_core/renderer/effect/effect_reset.h4
-rw-r--r--src/audio_core/renderer/effect/effect_result_state.h4
-rw-r--r--src/audio_core/renderer/effect/i3dl2.cpp4
-rw-r--r--src/audio_core/renderer/effect/i3dl2.h4
-rw-r--r--src/audio_core/renderer/effect/light_limiter.cpp4
-rw-r--r--src/audio_core/renderer/effect/light_limiter.h4
-rw-r--r--src/audio_core/renderer/effect/reverb.cpp4
-rw-r--r--src/audio_core/renderer/effect/reverb.h4
-rw-r--r--src/audio_core/renderer/memory/address_info.h4
-rw-r--r--src/audio_core/renderer/memory/memory_pool_info.cpp4
-rw-r--r--src/audio_core/renderer/memory/memory_pool_info.h4
-rw-r--r--src/audio_core/renderer/memory/pool_mapper.cpp4
-rw-r--r--src/audio_core/renderer/memory/pool_mapper.h4
-rw-r--r--src/audio_core/renderer/mix/mix_context.cpp4
-rw-r--r--src/audio_core/renderer/mix/mix_context.h4
-rw-r--r--src/audio_core/renderer/mix/mix_info.cpp4
-rw-r--r--src/audio_core/renderer/mix/mix_info.h4
-rw-r--r--src/audio_core/renderer/nodes/bit_array.h4
-rw-r--r--src/audio_core/renderer/nodes/edge_matrix.cpp4
-rw-r--r--src/audio_core/renderer/nodes/edge_matrix.h4
-rw-r--r--src/audio_core/renderer/nodes/node_states.cpp4
-rw-r--r--src/audio_core/renderer/nodes/node_states.h4
-rw-r--r--src/audio_core/renderer/performance/detail_aspect.cpp4
-rw-r--r--src/audio_core/renderer/performance/detail_aspect.h4
-rw-r--r--src/audio_core/renderer/performance/entry_aspect.cpp4
-rw-r--r--src/audio_core/renderer/performance/entry_aspect.h4
-rw-r--r--src/audio_core/renderer/performance/performance_detail.h4
-rw-r--r--src/audio_core/renderer/performance/performance_entry.h4
-rw-r--r--src/audio_core/renderer/performance/performance_entry_addresses.h4
-rw-r--r--src/audio_core/renderer/performance/performance_frame_header.h4
-rw-r--r--src/audio_core/renderer/performance/performance_manager.cpp4
-rw-r--r--src/audio_core/renderer/performance/performance_manager.h4
-rw-r--r--src/audio_core/renderer/sink/circular_buffer_sink_info.cpp4
-rw-r--r--src/audio_core/renderer/sink/circular_buffer_sink_info.h4
-rw-r--r--src/audio_core/renderer/sink/device_sink_info.cpp4
-rw-r--r--src/audio_core/renderer/sink/device_sink_info.h4
-rw-r--r--src/audio_core/renderer/sink/sink_context.cpp4
-rw-r--r--src/audio_core/renderer/sink/sink_context.h4
-rw-r--r--src/audio_core/renderer/sink/sink_info_base.cpp4
-rw-r--r--src/audio_core/renderer/sink/sink_info_base.h4
-rw-r--r--src/audio_core/renderer/splitter/splitter_context.cpp4
-rw-r--r--src/audio_core/renderer/splitter/splitter_context.h4
-rw-r--r--src/audio_core/renderer/splitter/splitter_destinations_data.cpp4
-rw-r--r--src/audio_core/renderer/splitter/splitter_destinations_data.h4
-rw-r--r--src/audio_core/renderer/splitter/splitter_info.cpp4
-rw-r--r--src/audio_core/renderer/splitter/splitter_info.h4
-rw-r--r--src/audio_core/renderer/system.cpp32
-rw-r--r--src/audio_core/renderer/system.h16
-rw-r--r--src/audio_core/renderer/system_manager.cpp30
-rw-r--r--src/audio_core/renderer/system_manager.h21
-rw-r--r--src/audio_core/renderer/upsampler/upsampler_info.h4
-rw-r--r--src/audio_core/renderer/upsampler/upsampler_manager.cpp4
-rw-r--r--src/audio_core/renderer/upsampler/upsampler_manager.h4
-rw-r--r--src/audio_core/renderer/upsampler/upsampler_state.h4
-rw-r--r--src/audio_core/renderer/voice/voice_channel_resource.h4
-rw-r--r--src/audio_core/renderer/voice/voice_context.cpp4
-rw-r--r--src/audio_core/renderer/voice/voice_context.h4
-rw-r--r--src/audio_core/renderer/voice/voice_info.cpp4
-rw-r--r--src/audio_core/renderer/voice/voice_info.h4
-rw-r--r--src/audio_core/renderer/voice/voice_state.h4
154 files changed, 637 insertions, 1561 deletions
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
12namespace AudioCore::AudioRenderer::ADSP {
13
14ADSP::ADSP(Core::System& system_, Sink::Sink& sink_)
15 : system{system_}, memory{system.ApplicationMemory()}, sink{sink_} {}
16
17ADSP::~ADSP() {
18 ClearCommandBuffers();
19}
20
21State ADSP::GetState() const {
22 if (running) {
23 return State::Started;
24 }
25 return State::Stopped;
26}
27
28AudioRenderer_Mailbox* ADSP::GetRenderMailbox() {
29 return &render_mailbox;
30}
31
32void ADSP::ClearRemainCount(const u32 session_id) {
33 render_mailbox.ClearRemainCount(session_id);
34}
35
36u64 ADSP::GetSignalledTick() const {
37 return render_mailbox.GetSignalledTick();
38}
39
40u64 ADSP::GetTimeTaken() const {
41 return render_mailbox.GetRenderTimeTaken();
42}
43
44u64 ADSP::GetRenderTimeTaken(const u32 session_id) {
45 return render_mailbox.GetCommandBuffer(session_id).render_time_taken;
46}
47
48u32 ADSP::GetRemainCommandCount(const u32 session_id) const {
49 return render_mailbox.GetRemainCommandCount(session_id);
50}
51
52void ADSP::SendCommandBuffer(const u32 session_id, const CommandBuffer& command_buffer) {
53 render_mailbox.SetCommandBuffer(session_id, command_buffer);
54}
55
56u64 ADSP::GetRenderingStartTick(const u32 session_id) {
57 return render_mailbox.GetSignalledTick() +
58 render_mailbox.GetCommandBuffer(session_id).render_time_taken;
59}
60
61bool 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
79void 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
95void 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
101void 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
113void 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
12namespace Core {
13namespace Memory {
14class Memory;
15}
16class System;
17} // namespace Core
18
19namespace AudioCore {
20namespace Sink {
21class Sink;
22}
23
24namespace AudioRenderer::ADSP {
25struct CommandBuffer;
26
27enum 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 */
52class ADSP {
53public:
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
151private:
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.cpp b/src/audio_core/renderer/adsp/audio_renderer.cpp
deleted file mode 100644
index 9ca716b60..000000000
--- a/src/audio_core/renderer/adsp/audio_renderer.cpp
+++ /dev/null
@@ -1,225 +0,0 @@
1// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#include <array>
5#include <chrono>
6
7#include "audio_core/audio_core.h"
8#include "audio_core/common/common.h"
9#include "audio_core/renderer/adsp/audio_renderer.h"
10#include "audio_core/sink/sink.h"
11#include "common/logging/log.h"
12#include "common/microprofile.h"
13#include "common/thread.h"
14#include "core/core.h"
15#include "core/core_timing.h"
16
17MICROPROFILE_DEFINE(Audio_Renderer, "Audio", "DSP", MP_RGB(60, 19, 97));
18
19namespace AudioCore::AudioRenderer::ADSP {
20
21void AudioRenderer_Mailbox::HostSendMessage(RenderMessage message_) {
22 adsp_messages.enqueue(message_);
23 adsp_event.Set();
24}
25
26RenderMessage AudioRenderer_Mailbox::HostWaitMessage() {
27 host_event.Wait();
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}
34
35void AudioRenderer_Mailbox::ADSPSendMessage(const RenderMessage message_) {
36 host_messages.enqueue(message_);
37 host_event.Set();
38}
39
40RenderMessage AudioRenderer_Mailbox::ADSPWaitMessage() {
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
49CommandBuffer& AudioRenderer_Mailbox::GetCommandBuffer(const u32 session_id) {
50 return command_buffers[session_id];
51}
52
53void AudioRenderer_Mailbox::SetCommandBuffer(const u32 session_id, const CommandBuffer& buffer) {
54 command_buffers[session_id] = buffer;
55}
56
57u64 AudioRenderer_Mailbox::GetRenderTimeTaken() const {
58 return command_buffers[0].render_time_taken + command_buffers[1].render_time_taken;
59}
60
61u64 AudioRenderer_Mailbox::GetSignalledTick() const {
62 return signalled_tick;
63}
64
65void AudioRenderer_Mailbox::SetSignalledTick(const u64 tick) {
66 signalled_tick = tick;
67}
68
69void AudioRenderer_Mailbox::ClearRemainCount(const u32 session_id) {
70 command_buffers[session_id].remaining_command_count = 0;
71}
72
73u32 AudioRenderer_Mailbox::GetRemainCommandCount(const u32 session_id) const {
74 return command_buffers[session_id].remaining_command_count;
75}
76
77void AudioRenderer_Mailbox::ClearCommandBuffers() {
78 command_buffers[0].buffer = 0;
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
86AudioRenderer::AudioRenderer(Core::System& system_)
87 : system{system_}, sink{system.AudioCore().GetOutputSink()} {
88 CreateSinkStreams();
89}
90
91AudioRenderer::~AudioRenderer() {
92 Stop();
93 for (auto& stream : streams) {
94 if (stream) {
95 sink.CloseStream(stream);
96 }
97 stream = nullptr;
98 }
99}
100
101void AudioRenderer::Start(AudioRenderer_Mailbox* mailbox_) {
102 if (running) {
103 return;
104 }
105
106 mailbox = mailbox_;
107 thread = std::jthread([this](std::stop_token stop_token) { ThreadFunc(stop_token); });
108 running = true;
109}
110
111void AudioRenderer::Stop() {
112 if (!running) {
113 return;
114 }
115
116 for (auto& stream : streams) {
117 stream->Stop();
118 }
119 thread.join();
120 running = false;
121}
122
123void AudioRenderer::CreateSinkStreams() {
124 u32 channels{sink.GetDeviceChannels()};
125 for (u32 i = 0; i < MaxRendererSessions; i++) {
126 std::string name{fmt::format("ADSP_RenderStream-{}", i)};
127 streams[i] =
128 sink.AcquireSinkStream(system, channels, name, ::AudioCore::Sink::StreamType::Render);
129 streams[i]->SetRingSize(4);
130 }
131}
132
133void AudioRenderer::ThreadFunc(std::stop_token stop_token) {
134 static constexpr char name[]{"AudioRenderer"};
135 MicroProfileOnThreadCreate(name);
136 Common::SetCurrentThreadName(name);
137 Common::SetCurrentThreadPriority(Common::ThreadPriority::High);
138 if (mailbox->ADSPWaitMessage() != RenderMessage::AudioRenderer_InitializeOK) {
139 LOG_ERROR(Service_Audio,
140 "ADSP Audio Renderer -- Failed to receive initialize message from host!");
141 return;
142 }
143
144 mailbox->ADSPSendMessage(RenderMessage::AudioRenderer_InitializeOK);
145
146 // 0.12 seconds (2304000 / 19200000)
147 constexpr u64 max_process_time{2'304'000ULL};
148
149 while (!stop_token.stop_requested()) {
150 auto message{mailbox->ADSPWaitMessage()};
151 switch (message) {
152 case RenderMessage::AudioRenderer_Shutdown:
153 mailbox->ADSPSendMessage(RenderMessage::AudioRenderer_Shutdown);
154 return;
155
156 case RenderMessage::AudioRenderer_Render: {
157 if (system.IsShuttingDown()) [[unlikely]] {
158 std::this_thread::sleep_for(std::chrono::milliseconds(5));
159 mailbox->ADSPSendMessage(RenderMessage::AudioRenderer_RenderResponse);
160 continue;
161 }
162 std::array<bool, MaxRendererSessions> buffers_reset{};
163 std::array<u64, MaxRendererSessions> render_times_taken{};
164 const auto start_time{system.CoreTiming().GetClockTicks()};
165
166 for (u32 index = 0; index < 2; index++) {
167 auto& command_buffer{mailbox->GetCommandBuffer(index)};
168 auto& command_list_processor{command_list_processors[index]};
169
170 // Check this buffer is valid, as it may not be used.
171 if (command_buffer.buffer != 0) {
172 // If there are no remaining commands (from the previous list),
173 // this is a new command list, initialize it.
174 if (command_buffer.remaining_command_count == 0) {
175 command_list_processor.Initialize(system, command_buffer.buffer,
176 command_buffer.size, streams[index]);
177 }
178
179 if (command_buffer.reset_buffers && !buffers_reset[index]) {
180 streams[index]->ClearQueue();
181 buffers_reset[index] = true;
182 }
183
184 u64 max_time{max_process_time};
185 if (index == 1 && command_buffer.applet_resource_user_id ==
186 mailbox->GetCommandBuffer(0).applet_resource_user_id) {
187 max_time = max_process_time - render_times_taken[0];
188 if (render_times_taken[0] > max_process_time) {
189 max_time = 0;
190 }
191 }
192
193 max_time = std::min(command_buffer.time_limit, max_time);
194 command_list_processor.SetProcessTimeMax(max_time);
195
196 streams[index]->WaitFreeSpace(stop_token);
197
198 // Process the command list
199 {
200 MICROPROFILE_SCOPE(Audio_Renderer);
201 render_times_taken[index] =
202 command_list_processor.Process(index) - start_time;
203 }
204
205 const auto end_time{system.CoreTiming().GetClockTicks()};
206
207 command_buffer.remaining_command_count =
208 command_list_processor.GetRemainingCommandCount();
209 command_buffer.render_time_taken = end_time - start_time;
210 }
211 }
212
213 mailbox->ADSPSendMessage(RenderMessage::AudioRenderer_RenderResponse);
214 } break;
215
216 default:
217 LOG_WARNING(Service_Audio,
218 "ADSP AudioRenderer received an invalid message, msg={:02X}!",
219 static_cast<u32>(message));
220 break;
221 }
222 }
223}
224
225} // namespace AudioCore::AudioRenderer::ADSP
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
17namespace Core {
18namespace Timing {
19struct EventType;
20}
21class System;
22} // namespace Core
23
24namespace AudioCore {
25namespace Sink {
26class Sink;
27}
28
29namespace AudioRenderer::ADSP {
30
31enum 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 */
51class AudioRenderer_Mailbox {
52public:
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
138private:
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 */
159class AudioRenderer {
160public:
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
176private:
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
9namespace AudioCore::AudioRenderer::ADSP {
10
11struct 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/adsp/command_list_processor.cpp b/src/audio_core/renderer/adsp/command_list_processor.cpp
deleted file mode 100644
index 3a0f1ae38..000000000
--- a/src/audio_core/renderer/adsp/command_list_processor.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
1// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#include <string>
5
6#include "audio_core/renderer/adsp/command_list_processor.h"
7#include "audio_core/renderer/command/command_list_header.h"
8#include "audio_core/renderer/command/commands.h"
9#include "common/settings.h"
10#include "core/core.h"
11#include "core/core_timing.h"
12#include "core/memory.h"
13
14namespace AudioCore::AudioRenderer::ADSP {
15
16void CommandListProcessor::Initialize(Core::System& system_, CpuAddr buffer, u64 size,
17 Sink::SinkStream* stream_) {
18 system = &system_;
19 memory = &system->ApplicationMemory();
20 stream = stream_;
21 header = reinterpret_cast<CommandListHeader*>(buffer);
22 commands = reinterpret_cast<u8*>(buffer + sizeof(CommandListHeader));
23 commands_buffer_size = size;
24 command_count = header->command_count;
25 sample_count = header->sample_count;
26 target_sample_rate = header->sample_rate;
27 mix_buffers = header->samples_buffer;
28 buffer_count = header->buffer_count;
29 processed_command_count = 0;
30}
31
32void CommandListProcessor::SetProcessTimeMax(const u64 time) {
33 max_process_time = time;
34}
35
36u32 CommandListProcessor::GetRemainingCommandCount() const {
37 return command_count - processed_command_count;
38}
39
40void CommandListProcessor::SetBuffer(const CpuAddr buffer, const u64 size) {
41 commands = reinterpret_cast<u8*>(buffer + sizeof(CommandListHeader));
42 commands_buffer_size = size;
43}
44
45Sink::SinkStream* CommandListProcessor::GetOutputSinkStream() const {
46 return stream;
47}
48
49u64 CommandListProcessor::Process(u32 session_id) {
50 const auto start_time_{system->CoreTiming().GetClockTicks()};
51 const auto command_base{CpuAddr(commands)};
52
53 if (processed_command_count > 0) {
54 current_processing_time += start_time_ - end_time;
55 } else {
56 start_time = start_time_;
57 current_processing_time = 0;
58 }
59
60 std::string dump{fmt::format("\nSession {}\n", session_id)};
61
62 for (u32 index = 0; index < command_count; index++) {
63 auto& command{*reinterpret_cast<ICommand*>(commands)};
64
65 if (command.magic != 0xCAFEBABE) {
66 LOG_ERROR(Service_Audio, "Command has invalid magic! Expected 0xCAFEBABE, got {:08X}",
67 command.magic);
68 return system->CoreTiming().GetClockTicks() - start_time_;
69 }
70
71 auto current_offset{CpuAddr(commands) - command_base};
72
73 if (current_offset + command.size > commands_buffer_size) {
74 LOG_ERROR(Service_Audio,
75 "Command exceeded command buffer, buffer size {:08X}, command ends at {:08X}",
76 commands_buffer_size,
77 CpuAddr(commands) + command.size - sizeof(CommandListHeader));
78 return system->CoreTiming().GetClockTicks() - start_time_;
79 }
80
81 if (Settings::values.dump_audio_commands) {
82 command.Dump(*this, dump);
83 }
84
85 if (!command.Verify(*this)) {
86 break;
87 }
88
89 if (command.enabled) {
90 command.Process(*this);
91 } else {
92 dump += fmt::format("\tDisabled!\n");
93 }
94
95 processed_command_count++;
96 commands += command.size;
97 }
98
99 if (Settings::values.dump_audio_commands && dump != last_dump) {
100 LOG_WARNING(Service_Audio, "{}", dump);
101 last_dump = dump;
102 }
103
104 end_time = system->CoreTiming().GetClockTicks();
105 return end_time - start_time_;
106}
107
108} // namespace AudioCore::AudioRenderer::ADSP
diff --git a/src/audio_core/renderer/adsp/command_list_processor.h b/src/audio_core/renderer/adsp/command_list_processor.h
deleted file mode 100644
index d78269e1d..000000000
--- a/src/audio_core/renderer/adsp/command_list_processor.h
+++ /dev/null
@@ -1,119 +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 <span>
7
8#include "audio_core/common/common.h"
9#include "common/common_types.h"
10
11namespace Core {
12namespace Memory {
13class Memory;
14}
15class System;
16} // namespace Core
17
18namespace AudioCore {
19namespace Sink {
20class SinkStream;
21}
22
23namespace AudioRenderer {
24struct CommandListHeader;
25
26namespace ADSP {
27
28/**
29 * A processor for command lists given to the AudioRenderer.
30 */
31class CommandListProcessor {
32public:
33 /**
34 * Initialize the processor.
35 *
36 * @param system - The core system.
37 * @param buffer - The command buffer to process.
38 * @param size - The size of the buffer.
39 * @param stream - The stream to be used for sending the samples.
40 */
41 void Initialize(Core::System& system, CpuAddr buffer, u64 size, Sink::SinkStream* stream);
42
43 /**
44 * Set the maximum processing time for this command list.
45 *
46 * @param time - The maximum process time.
47 */
48 void SetProcessTimeMax(u64 time);
49
50 /**
51 * Get the remaining command count for this list.
52 *
53 * @return The remaining command count.
54 */
55 u32 GetRemainingCommandCount() const;
56
57 /**
58 * Set the command buffer.
59 *
60 * @param buffer - The buffer to use.
61 * @param size - The size of the buffer.
62 */
63 void SetBuffer(CpuAddr buffer, u64 size);
64
65 /**
66 * Get the stream for this command list.
67 *
68 * @return The stream associated with this command list.
69 */
70 Sink::SinkStream* GetOutputSinkStream() const;
71
72 /**
73 * Process the command list.
74 *
75 * @param session_id - Session ID for the commands being processed.
76 *
77 * @return The time taken to process.
78 */
79 u64 Process(u32 session_id);
80
81 /// Core system
82 Core::System* system{};
83 /// Core memory
84 Core::Memory::Memory* memory{};
85 /// Stream for the processed samples
86 Sink::SinkStream* stream{};
87 /// Header info for this command list
88 CommandListHeader* header{};
89 /// The command buffer
90 u8* commands{};
91 /// The command buffer size
92 u64 commands_buffer_size{};
93 /// The maximum processing time allotted
94 u64 max_process_time{};
95 /// The number of commands in the buffer
96 u32 command_count{};
97 /// The target sample count for output
98 u32 sample_count{};
99 /// The target sample rate for output
100 u32 target_sample_rate{};
101 /// The mixing buffers used by the commands
102 std::span<s32> mix_buffers{};
103 /// The number of mix buffers
104 u32 buffer_count{};
105 /// The number of processed commands so far
106 u32 processed_command_count{};
107 /// The processing start time of this list
108 u64 start_time{};
109 /// The current processing time for this list
110 u64 current_processing_time{};
111 /// The end processing time for this list
112 u64 end_time{};
113 /// Last command list string generated, used for dumping audio commands to console
114 std::string last_dump{};
115};
116
117} // namespace ADSP
118} // namespace AudioRenderer
119} // namespace AudioCore
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
13namespace AudioCore::AudioRenderer { 13namespace AudioCore::Renderer {
14 14
15constexpr std::array usb_device_names{ 15constexpr 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 {
16class Sink; 16class Sink;
17} 17}
18 18
19namespace AudioRenderer { 19namespace 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
12namespace AudioCore::AudioRenderer { 12namespace AudioCore::Renderer {
13 13
14Renderer::Renderer(Core::System& system_, Manager& manager_, Kernel::KEvent* rendered_event) 14Renderer::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;
19namespace AudioCore { 19namespace AudioCore {
20struct AudioRendererParameterInternal; 20struct AudioRendererParameterInternal;
21 21
22namespace AudioRenderer { 22namespace Renderer {
23class Manager; 23class 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
7namespace AudioCore::AudioRenderer { 7namespace AudioCore::Renderer {
8 8
9BehaviorInfo::BehaviorInfo() : process_revision{CurrentRevision} {} 9BehaviorInfo::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
13namespace AudioCore::AudioRenderer { 13namespace 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
18namespace AudioCore::AudioRenderer { 18namespace AudioCore::Renderer {
19 19
20InfoUpdater::InfoUpdater(std::span<const u8> input_, std::span<u8> output_, 20InfoUpdater::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
11namespace AudioCore::AudioRenderer { 11namespace AudioCore::Renderer {
12class BehaviorInfo; 12class BehaviorInfo;
13class VoiceContext; 13class VoiceContext;
14class MixContext; 14class 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
19namespace AudioCore::AudioRenderer { 19namespace AudioCore::Renderer {
20 20
21template <typename T, CommandId Id> 21template <typename T, CommandId Id>
22T& CommandBuffer::GenerateStart(const s32 node_id) { 22T& 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
13namespace AudioCore::AudioRenderer { 13namespace AudioCore::Renderer {
14struct UpsamplerInfo; 14struct UpsamplerInfo;
15struct VoiceState; 15struct VoiceState;
16class EffectInfoBase; 16class 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
24namespace AudioCore::AudioRenderer { 24namespace AudioCore::Renderer {
25 25
26CommandGenerator::CommandGenerator(CommandBuffer& command_buffer_, 26CommandGenerator::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 @@
12namespace AudioCore { 12namespace AudioCore {
13struct AudioRendererSystemContext; 13struct AudioRendererSystemContext;
14 14
15namespace AudioRenderer { 15namespace Renderer {
16class CommandBuffer; 16class CommandBuffer;
17struct CommandListHeader; 17struct CommandListHeader;
18class VoiceContext; 18class 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
11namespace AudioCore::AudioRenderer { 11namespace AudioCore::Renderer {
12 12
13struct CommandListHeader { 13struct 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
6namespace AudioCore::AudioRenderer { 6namespace AudioCore::Renderer {
7 7
8u32 CommandProcessingTimeEstimatorVersion1::Estimate( 8u32 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
9namespace AudioCore::AudioRenderer { 9namespace 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
10namespace AudioCore::AudioRenderer { 10namespace AudioCore::Renderer {
11 11
12void AdpcmDataSourceVersion1Command::Dump(const ADSP::CommandListProcessor& processor, 12void 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
19void AdpcmDataSourceVersion1Command::Process(const ADSP::CommandListProcessor& processor) { 19void 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
44bool AdpcmDataSourceVersion1Command::Verify(const ADSP::CommandListProcessor& processor) { 44bool AdpcmDataSourceVersion1Command::Verify(const AudioRenderer::CommandListProcessor& processor) {
45 return true; 45 return true;
46} 46}
47 47
48void AdpcmDataSourceVersion2Command::Dump(const ADSP::CommandListProcessor& processor, 48void 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
55void AdpcmDataSourceVersion2Command::Process(const ADSP::CommandListProcessor& processor) { 55void 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
80bool AdpcmDataSourceVersion2Command::Verify(const ADSP::CommandListProcessor& processor) { 80bool 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
14namespace AudioCore::AudioRenderer { 14namespace AudioCore::ADSP::AudioRenderer {
15namespace ADSP {
16class CommandListProcessor; 15class CommandListProcessor;
17} 16}
18 17
18namespace 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
14namespace AudioCore::AudioRenderer { 14namespace AudioCore::Renderer {
15 15
16constexpr u32 TempBufferSize = 0x3F00; 16constexpr u32 TempBufferSize = 0x3F00;
17constexpr std::array<u8, 3> PitchBySrcQuality = {4, 8, 4}; 17constexpr 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 {
15class Memory; 15class Memory;
16} 16}
17 17
18namespace AudioCore::AudioRenderer { 18namespace AudioCore::Renderer {
19 19
20struct DecodeFromWaveBuffersArgs { 20struct DecodeFromWaveBuffersArgs {
21 SampleFormat sample_format; 21 SampleFormat sample_format;
@@ -56,4 +56,4 @@ struct DecodeArg {
56 */ 56 */
57void DecodeFromWaveBuffers(Core::Memory::Memory& memory, const DecodeFromWaveBuffersArgs& args); 57void 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
8namespace AudioCore::AudioRenderer { 8namespace AudioCore::Renderer {
9 9
10void PcmFloatDataSourceVersion1Command::Dump(const ADSP::CommandListProcessor& processor, 10void 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
19void PcmFloatDataSourceVersion1Command::Process(const ADSP::CommandListProcessor& processor) { 19void 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
44bool PcmFloatDataSourceVersion1Command::Verify(const ADSP::CommandListProcessor& processor) { 45bool PcmFloatDataSourceVersion1Command::Verify(
46 const AudioRenderer::CommandListProcessor& processor) {
45 return true; 47 return true;
46} 48}
47 49
48void PcmFloatDataSourceVersion2Command::Dump(const ADSP::CommandListProcessor& processor, 50void 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
57void PcmFloatDataSourceVersion2Command::Process(const ADSP::CommandListProcessor& processor) { 59void 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
82bool PcmFloatDataSourceVersion2Command::Verify(const ADSP::CommandListProcessor& processor) { 85bool 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
12namespace AudioCore::AudioRenderer { 12namespace AudioCore::ADSP::AudioRenderer {
13namespace ADSP {
14class CommandListProcessor; 13class CommandListProcessor;
15} 14}
16 15
16namespace 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
10namespace AudioCore::AudioRenderer { 10namespace AudioCore::Renderer {
11 11
12void PcmInt16DataSourceVersion1Command::Dump(const ADSP::CommandListProcessor& processor, 12void 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
21void PcmInt16DataSourceVersion1Command::Process(const ADSP::CommandListProcessor& processor) { 21void 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
46bool PcmInt16DataSourceVersion1Command::Verify(const ADSP::CommandListProcessor& processor) { 47bool PcmInt16DataSourceVersion1Command::Verify(
48 const AudioRenderer::CommandListProcessor& processor) {
47 return true; 49 return true;
48} 50}
49 51
50void PcmInt16DataSourceVersion2Command::Dump(const ADSP::CommandListProcessor& processor, 52void 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
59void PcmInt16DataSourceVersion2Command::Process(const ADSP::CommandListProcessor& processor) { 61void 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
83bool PcmInt16DataSourceVersion2Command::Verify(const ADSP::CommandListProcessor& processor) { 86bool 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
12namespace AudioCore::AudioRenderer { 12namespace AudioCore::ADSP::AudioRenderer {
13namespace ADSP {
14class CommandListProcessor; 13class CommandListProcessor;
15} 14}
16 15
16namespace 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
10namespace AudioCore::AudioRenderer { 10namespace 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
178void AuxCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, 178void 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
184void AuxCommand::Process(const ADSP::CommandListProcessor& processor) { 184void 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
211bool AuxCommand::Verify(const ADSP::CommandListProcessor& processor) { 211bool 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
11namespace AudioCore::AudioRenderer { 11namespace AudioCore::ADSP::AudioRenderer {
12namespace ADSP {
13class CommandListProcessor; 12class CommandListProcessor;
14} 13}
15 14
15namespace 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
9namespace AudioCore::AudioRenderer { 9namespace 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
79void BiquadFilterCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, 79void 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
86void BiquadFilterCommand::Process(const ADSP::CommandListProcessor& processor) { 86void 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
106bool BiquadFilterCommand::Verify(const ADSP::CommandListProcessor& processor) { 106bool 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
13namespace AudioCore::AudioRenderer { 13namespace AudioCore::ADSP::AudioRenderer {
14namespace ADSP {
15class CommandListProcessor; 14class CommandListProcessor;
16} 15}
17 16
17namespace 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
9namespace AudioCore::AudioRenderer { 9namespace 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
121void CaptureCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, 121void 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
127void CaptureCommand::Process(const ADSP::CommandListProcessor& processor) { 127void 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
138bool CaptureCommand::Verify(const ADSP::CommandListProcessor& processor) { 138bool 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
11namespace AudioCore::AudioRenderer { 11namespace AudioCore::ADSP::AudioRenderer {
12namespace ADSP {
13class CommandListProcessor; 12class CommandListProcessor;
14} 13}
15 14
15namespace 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
12namespace AudioCore::AudioRenderer { 12namespace AudioCore::Renderer {
13 13
14static void SetCompressorEffectParameter(const CompressorInfo::ParameterVersion2& params, 14static 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
113void CompressorCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, 113void 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
126void CompressorCommand::Process(const ADSP::CommandListProcessor& processor) { 126void 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
151bool CompressorCommand::Verify(const ADSP::CommandListProcessor& processor) { 151bool 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
13namespace AudioCore::AudioRenderer { 13namespace AudioCore::ADSP::AudioRenderer {
14namespace ADSP {
15class CommandListProcessor; 14class CommandListProcessor;
16} 15}
17 16
17namespace 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
7namespace AudioCore::AudioRenderer { 7namespace 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
197void DelayCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, 197void 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
210void DelayCommand::Process(const ADSP::CommandListProcessor& processor) { 210void 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
234bool DelayCommand::Verify(const ADSP::CommandListProcessor& processor) { 234bool 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
13namespace AudioCore::AudioRenderer { 13namespace AudioCore::ADSP::AudioRenderer {
14namespace ADSP {
15class CommandListProcessor; 14class CommandListProcessor;
16} 15}
17 16
17namespace 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
10namespace AudioCore::AudioRenderer { 10namespace AudioCore::Renderer {
11 11
12constexpr std::array<f32, I3dl2ReverbInfo::MaxDelayLines> MinDelayLineTimes{ 12constexpr 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
397void I3dl2ReverbCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, 397void 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
410void I3dl2ReverbCommand::Process(const ADSP::CommandListProcessor& processor) { 410void 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
434bool I3dl2ReverbCommand::Verify(const ADSP::CommandListProcessor& processor) { 434bool 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
13namespace AudioCore::AudioRenderer { 13namespace AudioCore::ADSP::AudioRenderer {
14namespace ADSP {
15class CommandListProcessor; 14class CommandListProcessor;
16} 15}
17 16
17namespace 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
7namespace AudioCore::AudioRenderer { 7namespace 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
136void LightLimiterVersion1Command::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, 136void 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
149void LightLimiterVersion1Command::Process(const ADSP::CommandListProcessor& processor) { 149void 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
175bool LightLimiterVersion1Command::Verify(const ADSP::CommandListProcessor& processor) { 175bool LightLimiterVersion1Command::Verify(const AudioRenderer::CommandListProcessor& processor) {
176 return true; 176 return true;
177} 177}
178 178
179void LightLimiterVersion2Command::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, 179void 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
192void LightLimiterVersion2Command::Process(const ADSP::CommandListProcessor& processor) { 192void 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
218bool LightLimiterVersion2Command::Verify(const ADSP::CommandListProcessor& processor) { 218bool 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
13namespace AudioCore::AudioRenderer { 13namespace AudioCore::ADSP::AudioRenderer {
14namespace ADSP {
15class CommandListProcessor; 14class CommandListProcessor;
16} 15}
17 16
17namespace 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
8namespace AudioCore::AudioRenderer { 8namespace AudioCore::Renderer {
9 9
10void MultiTapBiquadFilterCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, 10void 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
17void MultiTapBiquadFilterCommand::Process(const ADSP::CommandListProcessor& processor) { 17void 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
41bool MultiTapBiquadFilterCommand::Verify(const ADSP::CommandListProcessor& processor) { 41bool 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
13namespace AudioCore::AudioRenderer { 13namespace AudioCore::ADSP::AudioRenderer {
14namespace ADSP {
15class CommandListProcessor; 14class CommandListProcessor;
16} 15}
17 16
17namespace 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
11namespace AudioCore::AudioRenderer { 11namespace AudioCore::Renderer {
12 12
13constexpr std::array<f32, ReverbInfo::MaxDelayLines> FdnMaxDelayLineTimes = { 13constexpr 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
399void ReverbCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, 399void 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
414void ReverbCommand::Process(const ADSP::CommandListProcessor& processor) { 414void 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
438bool ReverbCommand::Verify(const ADSP::CommandListProcessor& processor) { 438bool 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
13namespace AudioCore::AudioRenderer { 13namespace AudioCore::ADSP::AudioRenderer {
14namespace ADSP {
15class CommandListProcessor; 14class CommandListProcessor;
16} 15}
17 16
17namespace 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
9namespace AudioCore::AudioRenderer { 11namespace AudioCore::ADSP::AudioRenderer {
10namespace ADSP {
11class CommandListProcessor; 12class CommandListProcessor;
12} 13}
13 14
15namespace AudioCore::Renderer {
16using namespace ::AudioCore::ADSP;
17
14enum class CommandId : u8 { 18enum 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
9namespace AudioCore::AudioRenderer { 9namespace AudioCore::Renderer {
10 10
11void ClearMixBufferCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, 11void 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
16void ClearMixBufferCommand::Process(const ADSP::CommandListProcessor& processor) { 16void 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
20bool ClearMixBufferCommand::Verify(const ADSP::CommandListProcessor& processor) { 20bool 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
11namespace AudioCore::AudioRenderer { 11namespace AudioCore::ADSP::AudioRenderer {
12namespace ADSP {
13class CommandListProcessor; 12class CommandListProcessor;
14} 13}
15 14
15namespace 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
7namespace AudioCore::AudioRenderer { 7namespace AudioCore::Renderer {
8 8
9void CopyMixBufferCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, 9void 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
15void CopyMixBufferCommand::Process(const ADSP::CommandListProcessor& processor) { 15void 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
23bool CopyMixBufferCommand::Verify(const ADSP::CommandListProcessor& processor) { 23bool 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
11namespace AudioCore::AudioRenderer { 11namespace AudioCore::ADSP::AudioRenderer {
12namespace ADSP {
13class CommandListProcessor; 12class CommandListProcessor;
14} 13}
15 14
15namespace 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
8namespace AudioCore::AudioRenderer { 8namespace 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
39void DepopForMixBuffersCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, 39void 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
45void DepopForMixBuffersCommand::Process(const ADSP::CommandListProcessor& processor) { 45void 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
60bool DepopForMixBuffersCommand::Verify(const ADSP::CommandListProcessor& processor) { 60bool 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
12namespace AudioCore::AudioRenderer { 12namespace AudioCore::ADSP::AudioRenderer {
13namespace ADSP {
14class CommandListProcessor; 13class CommandListProcessor;
15} 14}
16 15
16namespace 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
9namespace AudioCore::AudioRenderer { 9namespace AudioCore::Renderer {
10 10
11void DepopPrepareCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, 11void 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
20void DepopPrepareCommand::Process(const ADSP::CommandListProcessor& processor) { 20void 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
32bool DepopPrepareCommand::Verify(const ADSP::CommandListProcessor& processor) { 32bool 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
11namespace AudioCore::AudioRenderer { 11namespace AudioCore::ADSP::AudioRenderer {
12namespace ADSP {
13class CommandListProcessor; 12class CommandListProcessor;
14} 13}
15 14
15namespace 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
12namespace AudioCore::AudioRenderer { 12namespace 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
31void MixCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, 31void 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
40void MixCommand::Process(const ADSP::CommandListProcessor& processor) { 40void 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
66bool MixCommand::Verify(const ADSP::CommandListProcessor& processor) { 66bool 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
11namespace AudioCore::AudioRenderer { 11namespace AudioCore::ADSP::AudioRenderer {
12namespace ADSP {
13class CommandListProcessor; 12class CommandListProcessor;
14} 13}
15 14
15namespace 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
9namespace AudioCore::AudioRenderer { 9namespace AudioCore::Renderer {
10 10
11template <size_t Q> 11template <size_t Q>
12s32 ApplyMixRamp(std::span<s32> output, std::span<const s32> input, const f32 volume_, 12s32 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
33template s32 ApplyMixRamp<15>(std::span<s32>, std::span<const s32>, f32, f32, u32); 33template s32 ApplyMixRamp<15>(std::span<s32>, std::span<const s32>, f32, f32, u32);
34template s32 ApplyMixRamp<23>(std::span<s32>, std::span<const s32>, f32, f32, u32); 34template s32 ApplyMixRamp<23>(std::span<s32>, std::span<const s32>, f32, f32, u32);
35 35
36void MixRampCommand::Dump(const ADSP::CommandListProcessor& processor, std::string& string) { 36void 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
47void MixRampCommand::Process(const ADSP::CommandListProcessor& processor) { 48void 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
78bool MixRampCommand::Verify(const ADSP::CommandListProcessor& processor) { 79bool 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
12namespace AudioCore::AudioRenderer { 12namespace AudioCore::ADSP::AudioRenderer {
13namespace ADSP {
14class CommandListProcessor; 13class CommandListProcessor;
15} 14}
16 15
16namespace 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>
70s32 ApplyMixRamp(std::span<s32> output, std::span<const s32> input, f32 volume_, f32 ramp_, 71s32 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
8namespace AudioCore::AudioRenderer { 8namespace AudioCore::Renderer {
9 9
10void MixRampGroupedCommand::Dump(const ADSP::CommandListProcessor& processor, std::string& string) { 10void 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
24void MixRampGroupedCommand::Process(const ADSP::CommandListProcessor& processor) { 25void 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
61bool MixRampGroupedCommand::Verify(const ADSP::CommandListProcessor& processor) { 62bool 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
12namespace AudioCore::AudioRenderer { 12namespace AudioCore::ADSP::AudioRenderer {
13namespace ADSP {
14class CommandListProcessor; 13class CommandListProcessor;
15} 14}
16 15
16namespace 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
9namespace AudioCore::AudioRenderer { 9namespace 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
32void VolumeCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, 32void 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
41void VolumeCommand::Process(const ADSP::CommandListProcessor& processor) { 41void 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
68bool VolumeCommand::Verify(const ADSP::CommandListProcessor& processor) { 68bool 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
11namespace AudioCore::AudioRenderer { 11namespace AudioCore::ADSP::AudioRenderer {
12namespace ADSP {
13class CommandListProcessor; 12class CommandListProcessor;
14} 13}
15 14
15namespace 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
8namespace AudioCore::AudioRenderer { 8namespace 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
41void VolumeRampCommand::Dump(const ADSP::CommandListProcessor& processor, std::string& string) { 41void 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
52void VolumeRampCommand::Process(const ADSP::CommandListProcessor& processor) { 53void 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
80bool VolumeRampCommand::Verify(const ADSP::CommandListProcessor& processor) { 81bool 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
11namespace AudioCore::AudioRenderer { 11namespace AudioCore::ADSP::AudioRenderer {
12namespace ADSP {
13class CommandListProcessor; 12class CommandListProcessor;
14} 13}
15 14
15namespace 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
9namespace AudioCore::AudioRenderer { 9namespace AudioCore::Renderer {
10 10
11void PerformanceCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, 11void 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
16void PerformanceCommand::Process(const ADSP::CommandListProcessor& processor) { 16void 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
36bool PerformanceCommand::Verify(const ADSP::CommandListProcessor& processor) { 36bool 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
13namespace AudioCore::AudioRenderer { 13namespace AudioCore::ADSP::AudioRenderer {
14namespace ADSP {
15class CommandListProcessor; 14class CommandListProcessor;
16} 15}
17 16
17namespace 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
7namespace AudioCore::AudioRenderer { 7namespace AudioCore::Renderer {
8 8
9void DownMix6chTo2chCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, 9void 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
22void DownMix6chTo2chCommand::Process(const ADSP::CommandListProcessor& processor) { 22void 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
70bool DownMix6chTo2chCommand::Verify(const ADSP::CommandListProcessor& processor) { 70bool 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
12namespace AudioCore::AudioRenderer { 12namespace AudioCore::ADSP::AudioRenderer {
13namespace ADSP {
14class CommandListProcessor; 13class CommandListProcessor;
15} 14}
16 15
16namespace 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
6namespace AudioCore::AudioRenderer { 6namespace AudioCore::Renderer {
7 7
8static void ResampleLowQuality(std::span<s32> output, std::span<const s16> input, 8static 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
12namespace AudioCore::AudioRenderer { 12namespace 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
10namespace AudioCore::AudioRenderer { 10namespace 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
201auto UpsampleCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, 201auto 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
216void UpsampleCommand::Process(const ADSP::CommandListProcessor& processor) { 216void 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
237bool UpsampleCommand::Verify(const ADSP::CommandListProcessor& processor) { 237bool 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
11namespace AudioCore::AudioRenderer { 11namespace AudioCore::ADSP::AudioRenderer {
12namespace ADSP {
13class CommandListProcessor; 12class CommandListProcessor;
14} 13}
15 14
15namespace 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
10namespace AudioCore::AudioRenderer { 10namespace AudioCore::Renderer {
11 11
12void CircularBufferSinkCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, 12void 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
23void CircularBufferSinkCommand::Process(const ADSP::CommandListProcessor& processor) { 23void 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
44bool CircularBufferSinkCommand::Verify(const ADSP::CommandListProcessor& processor) { 44bool 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
11namespace AudioCore::AudioRenderer { 11namespace AudioCore::ADSP::AudioRenderer {
12namespace ADSP {
13class CommandListProcessor; 12class CommandListProcessor;
14} 13}
15 14
15namespace 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
10namespace AudioCore::AudioRenderer { 10namespace AudioCore::Renderer {
11 11
12void DeviceSinkCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& processor, 12void 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
22void DeviceSinkCommand::Process(const ADSP::CommandListProcessor& processor) { 22void 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
54bool DeviceSinkCommand::Verify(const ADSP::CommandListProcessor& processor) { 54bool 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
13namespace AudioCore::AudioRenderer { 13namespace AudioCore::ADSP::AudioRenderer {
14namespace ADSP {
15class CommandListProcessor; 14class CommandListProcessor;
16} 15}
17 16
17namespace 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
6namespace AudioCore::AudioRenderer { 6namespace AudioCore::Renderer {
7 7
8void AuxInfo::Update(BehaviorInfo::ErrorInfo& error_info, const InParameterVersion1& in_params, 8void 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
12namespace AudioCore::AudioRenderer { 12namespace 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
6namespace AudioCore::AudioRenderer { 6namespace AudioCore::Renderer {
7 7
8void BiquadFilterInfo::Update(BehaviorInfo::ErrorInfo& error_info, 8void 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) {}
49void BiquadFilterInfo::UpdateResultState(EffectResultState& cpu_state, 49void 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
12namespace AudioCore::AudioRenderer { 12namespace AudioCore::Renderer {
13 13
14class BiquadFilterInfo : public EffectInfoBase { 14class BiquadFilterInfo : public EffectInfoBase {
15public: 15public:
@@ -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
6namespace AudioCore::AudioRenderer { 6namespace AudioCore::Renderer {
7 7
8void BufferMixerInfo::Update(BehaviorInfo::ErrorInfo& error_info, 8void 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) {}
46void BufferMixerInfo::UpdateResultState(EffectResultState& cpu_state, 46void 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
12namespace AudioCore::AudioRenderer { 12namespace AudioCore::Renderer {
13 13
14class BufferMixerInfo : public EffectInfoBase { 14class BufferMixerInfo : public EffectInfoBase {
15public: 15public:
@@ -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
7namespace AudioCore::AudioRenderer { 7namespace AudioCore::Renderer {
8 8
9void CaptureInfo::Update(BehaviorInfo::ErrorInfo& error_info, const InParameterVersion1& in_params, 9void 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
12namespace AudioCore::AudioRenderer { 12namespace AudioCore::Renderer {
13 13
14class CaptureInfo : public EffectInfoBase { 14class CaptureInfo : public EffectInfoBase {
15public: 15public:
@@ -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
6namespace AudioCore::AudioRenderer { 6namespace AudioCore::Renderer {
7 7
8void CompressorInfo::Update(BehaviorInfo::ErrorInfo& error_info, 8void 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
13namespace AudioCore::AudioRenderer { 13namespace AudioCore::Renderer {
14 14
15class CompressorInfo : public EffectInfoBase { 15class CompressorInfo : public EffectInfoBase {
16public: 16public:
@@ -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
6namespace AudioCore::AudioRenderer { 6namespace AudioCore::Renderer {
7 7
8void DelayInfo::Update(BehaviorInfo::ErrorInfo& error_info, const InParameterVersion1& in_params, 8void 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
14namespace AudioCore::AudioRenderer { 14namespace AudioCore::Renderer {
15 15
16class DelayInfo : public EffectInfoBase { 16class DelayInfo : public EffectInfoBase {
17public: 17public:
@@ -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
6namespace AudioCore::AudioRenderer { 6namespace AudioCore::Renderer {
7 7
8void EffectContext::Initialize(std::span<EffectInfoBase> effect_infos_, const u32 effect_count_, 8void 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
12namespace AudioCore::AudioRenderer { 12namespace AudioCore::Renderer {
13 13
14class EffectContext { 14class EffectContext {
15public: 15public:
@@ -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
15namespace AudioCore::AudioRenderer { 15namespace 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
17namespace AudioCore::AudioRenderer { 17namespace 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
10namespace AudioCore::AudioRenderer { 10namespace AudioCore::Renderer {
11 11
12struct EffectResultState { 12struct 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
6namespace AudioCore::AudioRenderer { 6namespace AudioCore::Renderer {
7 7
8void I3dl2ReverbInfo::Update(BehaviorInfo::ErrorInfo& error_info, 8void 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
14namespace AudioCore::AudioRenderer { 14namespace AudioCore::Renderer {
15 15
16class I3dl2ReverbInfo : public EffectInfoBase { 16class I3dl2ReverbInfo : public EffectInfoBase {
17public: 17public:
@@ -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
6namespace AudioCore::AudioRenderer { 6namespace AudioCore::Renderer {
7 7
8void LightLimiterInfo::Update(BehaviorInfo::ErrorInfo& error_info, 8void 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
14namespace AudioCore::AudioRenderer { 14namespace AudioCore::Renderer {
15 15
16class LightLimiterInfo : public EffectInfoBase { 16class LightLimiterInfo : public EffectInfoBase {
17public: 17public:
@@ -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
6namespace AudioCore::AudioRenderer { 6namespace AudioCore::Renderer {
7 7
8void ReverbInfo::Update(BehaviorInfo::ErrorInfo& error_info, const InParameterVersion1& in_params, 8void 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
14namespace AudioCore::AudioRenderer { 14namespace AudioCore::Renderer {
15 15
16class ReverbInfo : public EffectInfoBase { 16class ReverbInfo : public EffectInfoBase {
17public: 17public:
@@ -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
9namespace AudioCore::AudioRenderer { 9namespace 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
6namespace AudioCore::AudioRenderer { 6namespace AudioCore::Renderer {
7 7
8CpuAddr MemoryPoolInfo::GetCpuAddress() const { 8CpuAddr 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
11namespace AudioCore::AudioRenderer { 11namespace 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
9namespace AudioCore::AudioRenderer { 9namespace AudioCore::Renderer {
10 10
11PoolMapper::PoolMapper(u32 process_handle_, bool force_map_) 11PoolMapper::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
13namespace AudioCore::AudioRenderer { 13namespace AudioCore::Renderer {
14class AddressInfo; 14class 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
10namespace AudioCore::AudioRenderer { 10namespace AudioCore::Renderer {
11 11
12void MixContext::Initialize(std::span<MixInfo*> sorted_mix_infos_, std::span<MixInfo> mix_infos_, 12void 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
13namespace AudioCore::AudioRenderer { 13namespace AudioCore::Renderer {
14class SplitterContext; 14class 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
10namespace AudioCore::AudioRenderer { 10namespace AudioCore::Renderer {
11 11
12MixInfo::MixInfo(std::span<s32> effect_order_buffer_, s32 effect_count_, BehaviorInfo& behavior) 12MixInfo::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
12namespace AudioCore::AudioRenderer { 12namespace AudioCore::Renderer {
13class EdgeMatrix; 13class EdgeMatrix;
14class SplitterContext; 14class SplitterContext;
15class EffectContext; 15class 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
10namespace AudioCore::AudioRenderer { 10namespace 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
6namespace AudioCore::AudioRenderer { 6namespace AudioCore::Renderer {
7 7
8void EdgeMatrix::Initialize([[maybe_unused]] std::span<u8> buffer, 8void 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
12namespace AudioCore::AudioRenderer { 12namespace 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
7namespace AudioCore::AudioRenderer { 7namespace AudioCore::Renderer {
8 8
9void NodeStates::Initialize(std::span<u8> buffer_, [[maybe_unused]] const u64 node_buffer_size, 9void 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
13namespace AudioCore::AudioRenderer { 13namespace 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
8namespace AudioCore::AudioRenderer { 8namespace AudioCore::Renderer {
9 9
10DetailAspect::DetailAspect(CommandGenerator& command_generator_, 10DetailAspect::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
10namespace AudioCore::AudioRenderer { 10namespace AudioCore::Renderer {
11class CommandGenerator; 11class 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
8namespace AudioCore::AudioRenderer { 8namespace AudioCore::Renderer {
9 9
10EntryAspect::EntryAspect(CommandGenerator& command_generator_, const PerformanceEntryType type, 10EntryAspect::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
10namespace AudioCore::AudioRenderer { 10namespace AudioCore::Renderer {
11class CommandGenerator; 11class 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
9namespace AudioCore::AudioRenderer { 9namespace AudioCore::Renderer {
10 10
11enum class PerformanceDetailType : u8 { 11enum class PerformanceDetailType : u8 {
12 Invalid, 12 Invalid,
@@ -47,4 +47,4 @@ struct PerformanceDetailVersion2 {
47static_assert(sizeof(PerformanceDetailVersion2) == 0x18, 47static_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
8namespace AudioCore::AudioRenderer { 8namespace AudioCore::Renderer {
9 9
10enum class PerformanceEntryType : u8 { 10enum class PerformanceEntryType : u8 {
11 Invalid, 11 Invalid,
@@ -34,4 +34,4 @@ struct PerformanceEntryVersion2 {
34static_assert(sizeof(PerformanceEntryVersion2) == 0x18, 34static_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
8namespace AudioCore::AudioRenderer { 8namespace AudioCore::Renderer {
9 9
10struct PerformanceEntryAddresses { 10struct 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
8namespace AudioCore::AudioRenderer { 8namespace AudioCore::Renderer {
9 9
10struct PerformanceFrameHeaderVersion1 { 10struct PerformanceFrameHeaderVersion1 {
11 /* 0x00 */ u32 magic; // "PERF" 11 /* 0x00 */ u32 magic; // "PERF"
@@ -33,4 +33,4 @@ struct PerformanceFrameHeaderVersion2 {
33static_assert(sizeof(PerformanceFrameHeaderVersion2) == 0x30, 33static_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
9namespace AudioCore::AudioRenderer { 9namespace AudioCore::Renderer {
10 10
11void PerformanceManager::CreateImpl(const size_t version) { 11void 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
17namespace AudioCore::AudioRenderer { 17namespace AudioCore::Renderer {
18class BehaviorInfo; 18class BehaviorInfo;
19class MemoryPoolInfo; 19class 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
8namespace AudioCore::AudioRenderer { 8namespace AudioCore::Renderer {
9 9
10CircularBufferSinkInfo::CircularBufferSinkInfo() { 10CircularBufferSinkInfo::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
9namespace AudioCore::AudioRenderer { 9namespace 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:
38static_assert(sizeof(CircularBufferSinkInfo) <= sizeof(SinkInfoBase), 38static_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
7namespace AudioCore::AudioRenderer { 7namespace AudioCore::Renderer {
8 8
9DeviceSinkInfo::DeviceSinkInfo() { 9DeviceSinkInfo::DeviceSinkInfo() {
10 state.fill(0); 10 state.fill(0);
@@ -54,4 +54,4 @@ void DeviceSinkInfo::Update(BehaviorInfo::ErrorInfo& error_info, OutStatus& out_
54 54
55void DeviceSinkInfo::UpdateForCommandGeneration() {} 55void 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
9namespace AudioCore::AudioRenderer { 9namespace 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};
38static_assert(sizeof(DeviceSinkInfo) <= sizeof(SinkInfoBase), "DeviceSinkInfo is too large!"); 38static_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
6namespace AudioCore::AudioRenderer { 6namespace AudioCore::Renderer {
7 7
8void SinkContext::Initialize(std::span<SinkInfoBase> sink_infos_, const u32 sink_count_) { 8void 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
11namespace AudioCore::AudioRenderer { 11namespace 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
7namespace AudioCore::AudioRenderer { 7namespace AudioCore::Renderer {
8 8
9void SinkInfoBase::CleanUp() { 9void 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
14namespace AudioCore::AudioRenderer { 14namespace AudioCore::Renderer {
15struct UpsamplerInfo; 15struct UpsamplerInfo;
16class PoolMapper; 16class 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
10namespace AudioCore::AudioRenderer { 10namespace AudioCore::Renderer {
11 11
12SplitterDestinationData* SplitterContext::GetDesintationData(const s32 splitter_id, 12SplitterDestinationData* 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 {
13struct AudioRendererParameterInternal; 13struct AudioRendererParameterInternal;
14class WorkbufferAllocator; 14class WorkbufferAllocator;
15 15
16namespace AudioRenderer { 16namespace Renderer {
17class BehaviorInfo; 17class 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
6namespace AudioCore::AudioRenderer { 6namespace AudioCore::Renderer {
7 7
8SplitterDestinationData::SplitterDestinationData(const s32 id_) : id{id_} {} 8SplitterDestinationData::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
12namespace AudioCore::AudioRenderer { 12namespace 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
6namespace AudioCore::AudioRenderer { 6namespace AudioCore::Renderer {
7 7
8SplitterInfo::SplitterInfo(const s32 id_) : id{id_} {} 8SplitterInfo::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
9namespace AudioCore::AudioRenderer { 9namespace 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
37namespace AudioCore::AudioRenderer { 38namespace AudioCore::Renderer {
38 39
39u64 System::GetWorkBufferSize(const AudioRendererParameterInternal& params) { 40u64 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
97System::System(Core::System& core_, Kernel::KEvent* adsp_rendered_event_) 98System::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
100Result System::Initialize(const AudioRendererParameterInternal& params, 102Result 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() {
443Result System::Update(std::span<const u8> input, std::span<u8> performance, std::span<u8> output) { 445Result 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() {
635u64 System::GenerateCommand(std::span<u8> in_command_buffer, 635u64 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
35namespace AudioCore { 35namespace AudioCore {
36struct AudioRendererParameterInternal; 36struct AudioRendererParameterInternal;
37
38namespace AudioRenderer {
39class CommandBuffer;
40namespace ADSP { 37namespace ADSP {
41class ADSP; 38class ADSP;
39namespace AudioRenderer {
40class AudioRenderer;
42} 41}
42} // namespace ADSP
43
44namespace Renderer {
45using namespace ::AudioCore::ADSP;
46class 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:
213private: 217private:
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 @@
14MICROPROFILE_DEFINE(Audio_RenderSystemManager, "Audio", "Render System Manager", 14MICROPROFILE_DEFINE(Audio_RenderSystemManager, "Audio", "Render System Manager",
15 MP_RGB(60, 19, 97)); 15 MP_RGB(60, 19, 97));
16 16
17namespace AudioCore::AudioRenderer { 17namespace AudioCore::Renderer {
18 18
19SystemManager::SystemManager(Core::System& core_) 19SystemManager::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
22SystemManager::~SystemManager() { 22SystemManager::~SystemManager() {
23 Stop(); 23 Stop();
24} 24}
25 25
26bool SystemManager::InitializeUnsafe() { 26void 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
37void SystemManager::Stop() { 34void 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
47bool SystemManager::Add(System& system_) { 44bool 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;
18class System; 18class System;
19} // namespace Core 19} // namespace Core
20 20
21namespace AudioCore::AudioRenderer { 21namespace AudioCore::ADSP {
22namespace ADSP {
23class ADSP; 22class ADSP;
24class AudioRenderer_Mailbox; 23namespace AudioRenderer {
25} // namespace ADSP 24class AudioRenderer;
25} // namespace AudioRenderer
26} // namespace AudioCore::ADSP
27
28namespace 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
12namespace AudioCore::AudioRenderer { 12namespace AudioCore::Renderer {
13class UpsamplerManager; 13class 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
6namespace AudioCore::AudioRenderer { 6namespace AudioCore::Renderer {
7 7
8UpsamplerManager::UpsamplerManager(const u32 count_, std::span<UpsamplerInfo> infos_, 8UpsamplerManager::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
12namespace AudioCore::AudioRenderer { 12namespace 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
11namespace AudioCore::AudioRenderer { 11namespace 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
11namespace AudioCore::AudioRenderer { 11namespace 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
9namespace AudioCore::AudioRenderer { 9namespace AudioCore::Renderer {
10 10
11VoiceState& VoiceContext::GetDspSharedState(const u32 index) { 11VoiceState& 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
13namespace AudioCore::AudioRenderer { 13namespace 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
9namespace AudioCore::AudioRenderer { 9namespace AudioCore::Renderer {
10 10
11VoiceInfo::VoiceInfo() { 11VoiceInfo::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
15namespace AudioCore::AudioRenderer { 15namespace AudioCore::Renderer {
16class PoolMapper; 16class PoolMapper;
17class VoiceContext; 17class VoiceContext;
18struct VoiceState; 18struct 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
12namespace AudioCore::AudioRenderer { 12namespace 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