summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt20
-rw-r--r--src/CMakeLists.txt8
-rw-r--r--src/audio_core/CMakeLists.txt15
-rw-r--r--src/audio_core/adsp/adsp.cpp18
-rw-r--r--src/audio_core/adsp/adsp.h50
-rw-r--r--src/audio_core/adsp/apps/audio_renderer/audio_renderer.cpp220
-rw-r--r--src/audio_core/adsp/apps/audio_renderer/audio_renderer.h116
-rw-r--r--src/audio_core/adsp/apps/audio_renderer/command_buffer.h23
-rw-r--r--src/audio_core/adsp/apps/audio_renderer/command_list_processor.cpp (renamed from src/audio_core/renderer/adsp/command_list_processor.cpp)29
-rw-r--r--src/audio_core/adsp/apps/audio_renderer/command_list_processor.h (renamed from src/audio_core/renderer/adsp/command_list_processor.h)21
-rw-r--r--src/audio_core/adsp/mailbox.h69
-rw-r--r--src/audio_core/audio_core.cpp4
-rw-r--r--src/audio_core/audio_core.h6
-rw-r--r--src/audio_core/audio_event.cpp1
-rw-r--r--src/audio_core/audio_in_manager.cpp2
-rw-r--r--src/audio_core/audio_in_manager.h4
-rw-r--r--src/audio_core/audio_out_manager.cpp2
-rw-r--r--src/audio_core/audio_out_manager.h3
-rw-r--r--src/audio_core/audio_render_manager.cpp4
-rw-r--r--src/audio_core/audio_render_manager.h4
-rw-r--r--src/audio_core/common/audio_renderer_parameter.h6
-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/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.cpp24
-rw-r--r--src/audio_core/renderer/command/data_source/adpcm.h23
-rw-r--r--src/audio_core/renderer/command/data_source/decode.cpp110
-rw-r--r--src/audio_core/renderer/command/data_source/decode.h4
-rw-r--r--src/audio_core/renderer/command/data_source/pcm_float.cpp28
-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.cpp28
-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.cpp42
-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
-rw-r--r--src/common/CMakeLists.txt2
-rw-r--r--src/core/hle/kernel/k_capabilities.cpp1
-rw-r--r--src/core/hle/service/am/applets/applet_mii_edit.cpp2
-rw-r--r--src/core/hle/service/audio/audin_u.cpp4
-rw-r--r--src/core/hle/service/audio/audout_u.cpp2
-rw-r--r--src/core/hle/service/audio/audren_u.cpp2
-rw-r--r--src/core/hle/service/audio/audren_u.h2
-rw-r--r--src/core/hle/service/mii/mii_manager.cpp14
-rw-r--r--src/core/hle/service/mii/mii_manager.h1
-rw-r--r--src/core/hle/service/mii/raw_data.cpp5
-rw-r--r--src/core/hle/service/mii/raw_data.h3
-rw-r--r--src/core/hle/service/nfc/common/device.cpp4
-rw-r--r--src/core/hle/service/nvdrv/core/nvmap.cpp4
-rw-r--r--src/core/hle/service/ssl/ssl_backend_schannel.cpp3
-rw-r--r--src/dedicated_room/yuzu_room.cpp6
-rw-r--r--src/input_common/CMakeLists.txt2
-rw-r--r--src/network/room.cpp2
-rw-r--r--src/shader_recompiler/CMakeLists.txt2
-rw-r--r--src/tests/common/ring_buffer.cpp2
-rw-r--r--src/video_core/renderer_vulkan/renderer_vulkan.cpp18
-rw-r--r--src/video_core/renderer_vulkan/renderer_vulkan.h4
-rw-r--r--src/video_core/renderer_vulkan/vk_buffer_cache.cpp11
-rw-r--r--src/video_core/vulkan_common/vulkan_debug_callback.cpp27
-rw-r--r--src/video_core/vulkan_common/vulkan_debug_callback.h2
-rw-r--r--src/video_core/vulkan_common/vulkan_instance.cpp8
-rw-r--r--src/yuzu/configuration/shared_widget.cpp2
-rw-r--r--src/yuzu/main.cpp76
-rw-r--r--src/yuzu_cmd/yuzu.cpp2
201 files changed, 1374 insertions, 1567 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4039c680e..c6b158985 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -49,6 +49,8 @@ option(YUZU_TESTS "Compile tests" "${BUILD_TESTING}")
49 49
50option(YUZU_USE_PRECOMPILED_HEADERS "Use precompiled headers" ON) 50option(YUZU_USE_PRECOMPILED_HEADERS "Use precompiled headers" ON)
51 51
52option(YUZU_DOWNLOAD_ANDROID_VVL "Download validation layer binary for android" ON)
53
52CMAKE_DEPENDENT_OPTION(YUZU_ROOM "Compile LDN room server" ON "NOT ANDROID" OFF) 54CMAKE_DEPENDENT_OPTION(YUZU_ROOM "Compile LDN room server" ON "NOT ANDROID" OFF)
53 55
54CMAKE_DEPENDENT_OPTION(YUZU_CRASH_DUMPS "Compile Windows crash dump (Minidump) support" OFF "WIN32" OFF) 56CMAKE_DEPENDENT_OPTION(YUZU_CRASH_DUMPS "Compile Windows crash dump (Minidump) support" OFF "WIN32" OFF)
@@ -77,6 +79,24 @@ if (ANDROID OR WIN32 OR APPLE)
77endif() 79endif()
78option(ENABLE_OPENSSL "Enable OpenSSL backend for ISslConnection" ${DEFAULT_ENABLE_OPENSSL}) 80option(ENABLE_OPENSSL "Enable OpenSSL backend for ISslConnection" ${DEFAULT_ENABLE_OPENSSL})
79 81
82if (ANDROID AND YUZU_DOWNLOAD_ANDROID_VVL)
83 set(vvl_version "sdk-1.3.261.1")
84 set(vvl_zip_file "${CMAKE_BINARY_DIR}/externals/vvl-android.zip")
85 if (NOT EXISTS "${vvl_zip_file}")
86 # Download and extract validation layer release to externals directory
87 set(vvl_base_url "https://github.com/KhronosGroup/Vulkan-ValidationLayers/releases/download")
88 file(DOWNLOAD "${vvl_base_url}/${vvl_version}/android-binaries-${vvl_version}-android.zip"
89 "${vvl_zip_file}" SHOW_PROGRESS)
90 execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf "${vvl_zip_file}"
91 WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/externals")
92 endif()
93
94 # Copy the arm64 binary to src/android/app/main/jniLibs
95 set(vvl_lib_path "${CMAKE_CURRENT_SOURCE_DIR}/src/android/app/src/main/jniLibs/arm64-v8a/")
96 file(COPY "${CMAKE_BINARY_DIR}/externals/android-binaries-${vvl_version}/arm64-v8a/libVkLayer_khronos_validation.so"
97 DESTINATION "${vvl_lib_path}")
98endif()
99
80# On Android, fetch and compile libcxx before doing anything else 100# On Android, fetch and compile libcxx before doing anything else
81if (ANDROID) 101if (ANDROID)
82 set(CMAKE_SKIP_INSTALL_RULES ON) 102 set(CMAKE_SKIP_INSTALL_RULES ON)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a9f68a8f2..95d54dadc 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -24,7 +24,7 @@ if (MSVC)
24 # Ensure that projects build with Unicode support. 24 # Ensure that projects build with Unicode support.
25 add_definitions(-DUNICODE -D_UNICODE) 25 add_definitions(-DUNICODE -D_UNICODE)
26 26
27 # /W3 - Level 3 warnings 27 # /W4 - Level 4 warnings
28 # /MP - Multi-threaded compilation 28 # /MP - Multi-threaded compilation
29 # /Zi - Output debugging information 29 # /Zi - Output debugging information
30 # /Zm - Specifies the precompiled header memory allocation limit 30 # /Zm - Specifies the precompiled header memory allocation limit
@@ -61,7 +61,7 @@ if (MSVC)
61 /external:W0 # Sets the default warning level to 0 for external headers, effectively turning off warnings for external headers 61 /external:W0 # Sets the default warning level to 0 for external headers, effectively turning off warnings for external headers
62 62
63 # Warnings 63 # Warnings
64 /W3 64 /W4
65 /WX 65 /WX
66 66
67 /we4062 # Enumerator 'identifier' in a switch of enum 'enumeration' is not handled 67 /we4062 # Enumerator 'identifier' in a switch of enum 'enumeration' is not handled
@@ -84,12 +84,16 @@ if (MSVC)
84 84
85 /wd4100 # 'identifier': unreferenced formal parameter 85 /wd4100 # 'identifier': unreferenced formal parameter
86 /wd4324 # 'struct_name': structure was padded due to __declspec(align()) 86 /wd4324 # 'struct_name': structure was padded due to __declspec(align())
87 /wd4201 # nonstandard extension used : nameless struct/union
87 ) 88 )
88 89
89 if (USE_CCACHE OR YUZU_USE_PRECOMPILED_HEADERS) 90 if (USE_CCACHE OR YUZU_USE_PRECOMPILED_HEADERS)
90 # when caching, we need to use /Z7 to downgrade debug info to use an older but more cacheable format 91 # when caching, we need to use /Z7 to downgrade debug info to use an older but more cacheable format
91 # Precompiled headers are deleted if not using /Z7. See https://github.com/nanoant/CMakePCHCompiler/issues/21 92 # Precompiled headers are deleted if not using /Z7. See https://github.com/nanoant/CMakePCHCompiler/issues/21
92 add_compile_options(/Z7) 93 add_compile_options(/Z7)
94 # Avoid D9025 warning
95 string(REPLACE "/Zi" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
96 string(REPLACE "/Zi" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
93 else() 97 else()
94 add_compile_options(/Zi) 98 add_compile_options(/Zi)
95 endif() 99 endif()
diff --git a/src/audio_core/CMakeLists.txt b/src/audio_core/CMakeLists.txt
index e7b595459..67dfe0290 100644
--- a/src/audio_core/CMakeLists.txt
+++ b/src/audio_core/CMakeLists.txt
@@ -2,6 +2,14 @@
2# SPDX-License-Identifier: GPL-2.0-or-later 2# SPDX-License-Identifier: GPL-2.0-or-later
3 3
4add_library(audio_core STATIC 4add_library(audio_core STATIC
5 adsp/adsp.cpp
6 adsp/adsp.h
7 adsp/mailbox.h
8 adsp/apps/audio_renderer/audio_renderer.cpp
9 adsp/apps/audio_renderer/audio_renderer.h
10 adsp/apps/audio_renderer/command_buffer.h
11 adsp/apps/audio_renderer/command_list_processor.cpp
12 adsp/apps/audio_renderer/command_list_processor.h
5 audio_core.cpp 13 audio_core.cpp
6 audio_core.h 14 audio_core.h
7 audio_event.h 15 audio_event.h
@@ -32,13 +40,6 @@ add_library(audio_core STATIC
32 out/audio_out_system.cpp 40 out/audio_out_system.cpp
33 out/audio_out_system.h 41 out/audio_out_system.h
34 precompiled_headers.h 42 precompiled_headers.h
35 renderer/adsp/adsp.cpp
36 renderer/adsp/adsp.h
37 renderer/adsp/audio_renderer.cpp
38 renderer/adsp/audio_renderer.h
39 renderer/adsp/command_buffer.h
40 renderer/adsp/command_list_processor.cpp
41 renderer/adsp/command_list_processor.h
42 renderer/audio_device.cpp 43 renderer/audio_device.cpp
43 renderer/audio_device.h 44 renderer/audio_device.h
44 renderer/audio_renderer.h 45 renderer/audio_renderer.h
diff --git a/src/audio_core/adsp/adsp.cpp b/src/audio_core/adsp/adsp.cpp
new file mode 100644
index 000000000..0580990f5
--- /dev/null
+++ b/src/audio_core/adsp/adsp.cpp
@@ -0,0 +1,18 @@
1// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#include "audio_core/adsp/adsp.h"
5#include "core/core.h"
6
7namespace AudioCore::ADSP {
8
9ADSP::ADSP(Core::System& system, Sink::Sink& sink) {
10 audio_renderer =
11 std::make_unique<AudioRenderer::AudioRenderer>(system, system.ApplicationMemory(), sink);
12}
13
14AudioRenderer::AudioRenderer& ADSP::AudioRenderer() {
15 return *audio_renderer.get();
16}
17
18} // namespace AudioCore::ADSP
diff --git a/src/audio_core/adsp/adsp.h b/src/audio_core/adsp/adsp.h
new file mode 100644
index 000000000..bd5bcc63b
--- /dev/null
+++ b/src/audio_core/adsp/adsp.h
@@ -0,0 +1,50 @@
1// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#pragma once
5
6#include "audio_core/adsp/apps/audio_renderer/audio_renderer.h"
7#include "common/common_types.h"
8
9namespace Core {
10class System;
11} // namespace Core
12
13namespace AudioCore {
14namespace Sink {
15class Sink;
16}
17
18namespace ADSP {
19
20/**
21 * Represents the ADSP embedded within the audio sysmodule.
22 * This is a 32-bit Linux4Tegra kernel from nVidia, which is launched with the sysmodule on boot.
23 *
24 * The kernel will run the apps you write for it, Nintendo have the following:
25 *
26 * Gmix - Responsible for mixing final audio and sending it out to hardware. This is last place all
27 * audio samples end up, and we skip it entirely, since we have very different backends and
28 * mixing is implicitly handled by the OS (but also due to lack of research/simplicity).
29 *
30 * AudioRenderer - Receives command lists generated by the audio render
31 * system on the host, processes them, and sends the samples to Gmix.
32 *
33 * OpusDecoder - Contains libopus, and decodes Opus audio packets into raw pcm data.
34 *
35 * Communication between the host and ADSP is done through mailboxes, and mapping of shared memory.
36 */
37class ADSP {
38public:
39 explicit ADSP(Core::System& system, Sink::Sink& sink);
40 ~ADSP() = default;
41
42 AudioRenderer::AudioRenderer& AudioRenderer();
43
44private:
45 /// AudioRenderer app
46 std::unique_ptr<AudioRenderer::AudioRenderer> audio_renderer{};
47};
48
49} // namespace ADSP
50} // namespace AudioCore
diff --git a/src/audio_core/adsp/apps/audio_renderer/audio_renderer.cpp b/src/audio_core/adsp/apps/audio_renderer/audio_renderer.cpp
new file mode 100644
index 000000000..2e549bc6f
--- /dev/null
+++ b/src/audio_core/adsp/apps/audio_renderer/audio_renderer.cpp
@@ -0,0 +1,220 @@
1// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#include <array>
5#include <chrono>
6
7#include "audio_core/adsp/apps/audio_renderer/audio_renderer.h"
8#include "audio_core/audio_core.h"
9#include "audio_core/common/common.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::ADSP::AudioRenderer {
20
21AudioRenderer::AudioRenderer(Core::System& system_, Core::Memory::Memory& memory_,
22 Sink::Sink& sink_)
23 : system{system_}, memory{memory_}, sink{sink_} {}
24
25AudioRenderer::~AudioRenderer() {
26 Stop();
27}
28
29void AudioRenderer::Start() {
30 CreateSinkStreams();
31
32 mailbox.Initialize(AppMailboxId::AudioRenderer);
33
34 main_thread = std::jthread([this](std::stop_token stop_token) { Main(stop_token); });
35
36 mailbox.Send(Direction::DSP, {Message::InitializeOK, {}});
37 if (mailbox.Receive(Direction::Host).msg != Message::InitializeOK) {
38 LOG_ERROR(Service_Audio, "Host Audio Renderer -- Failed to receive shutdown "
39 "message response from ADSP!");
40 return;
41 }
42 running = true;
43}
44
45void AudioRenderer::Stop() {
46 if (!running) {
47 return;
48 }
49
50 mailbox.Send(Direction::DSP, {Message::Shutdown, {}});
51 if (mailbox.Receive(Direction::Host).msg != Message::Shutdown) {
52 LOG_ERROR(Service_Audio, "Host Audio Renderer -- Failed to receive shutdown "
53 "message response from ADSP!");
54 }
55 main_thread.request_stop();
56 main_thread.join();
57
58 for (auto& stream : streams) {
59 if (stream) {
60 stream->Stop();
61 sink.CloseStream(stream);
62 stream = nullptr;
63 }
64 }
65 running = false;
66}
67
68void AudioRenderer::Signal() {
69 signalled_tick = system.CoreTiming().GetGlobalTimeNs().count();
70 Send(Direction::DSP, {Message::Render, {}});
71}
72
73void AudioRenderer::Wait() {
74 auto received = Receive(Direction::Host);
75 if (received.msg != Message::RenderResponse) {
76 LOG_ERROR(Service_Audio,
77 "Did not receive the expected render response from the AudioRenderer! Expected "
78 "{}, got {}",
79 Message::RenderResponse, received.msg);
80 }
81}
82
83void AudioRenderer::Send(Direction dir, MailboxMessage message) {
84 mailbox.Send(dir, std::move(message));
85}
86
87MailboxMessage AudioRenderer::Receive(Direction dir, bool block) {
88 return mailbox.Receive(dir, block);
89}
90
91void AudioRenderer::SetCommandBuffer(s32 session_id, CpuAddr buffer, u64 size, u64 time_limit,
92 u64 applet_resource_user_id, bool reset) noexcept {
93 command_buffers[session_id].buffer = buffer;
94 command_buffers[session_id].size = size;
95 command_buffers[session_id].time_limit = time_limit;
96 command_buffers[session_id].applet_resource_user_id = applet_resource_user_id;
97 command_buffers[session_id].reset_buffer = reset;
98}
99
100u32 AudioRenderer::GetRemainCommandCount(s32 session_id) const noexcept {
101 return command_buffers[session_id].remaining_command_count;
102}
103
104void AudioRenderer::ClearRemainCommandCount(s32 session_id) noexcept {
105 command_buffers[session_id].remaining_command_count = 0;
106}
107
108u64 AudioRenderer::GetRenderingStartTick(s32 session_id) const noexcept {
109 return (1000 * command_buffers[session_id].render_time_taken_us) + signalled_tick;
110}
111
112void AudioRenderer::CreateSinkStreams() {
113 u32 channels{sink.GetDeviceChannels()};
114 for (u32 i = 0; i < MaxRendererSessions; i++) {
115 std::string name{fmt::format("ADSP_RenderStream-{}", i)};
116 streams[i] =
117 sink.AcquireSinkStream(system, channels, name, ::AudioCore::Sink::StreamType::Render);
118 streams[i]->SetRingSize(4);
119 }
120}
121
122void AudioRenderer::Main(std::stop_token stop_token) {
123 static constexpr char name[]{"AudioRenderer"};
124 MicroProfileOnThreadCreate(name);
125 Common::SetCurrentThreadName(name);
126 Common::SetCurrentThreadPriority(Common::ThreadPriority::High);
127
128 // TODO: Create buffer map/unmap thread + mailbox
129 // TODO: Create gMix devices, initialize them here
130
131 if (mailbox.Receive(Direction::DSP).msg != Message::InitializeOK) {
132 LOG_ERROR(Service_Audio,
133 "ADSP Audio Renderer -- Failed to receive initialize message from host!");
134 return;
135 }
136
137 mailbox.Send(Direction::Host, {Message::InitializeOK, {}});
138
139 // 0.12 seconds (2,304,000 / 19,200,000)
140 constexpr u64 max_process_time{2'304'000ULL};
141
142 while (!stop_token.stop_requested()) {
143 auto received{mailbox.Receive(Direction::DSP)};
144 switch (received.msg) {
145 case Message::Shutdown:
146 mailbox.Send(Direction::Host, {Message::Shutdown, {}});
147 return;
148
149 case Message::Render: {
150 if (system.IsShuttingDown()) [[unlikely]] {
151 std::this_thread::sleep_for(std::chrono::milliseconds(5));
152 mailbox.Send(Direction::Host, {Message::RenderResponse, {}});
153 continue;
154 }
155 std::array<bool, MaxRendererSessions> buffers_reset{};
156 std::array<u64, MaxRendererSessions> render_times_taken{};
157 const auto start_time{system.CoreTiming().GetGlobalTimeUs().count()};
158
159 for (u32 index = 0; index < MaxRendererSessions; index++) {
160 auto& command_buffer{command_buffers[index]};
161 auto& command_list_processor{command_list_processors[index]};
162
163 // Check this buffer is valid, as it may not be used.
164 if (command_buffer.buffer != 0) {
165 // If there are no remaining commands (from the previous list),
166 // this is a new command list, initialize it.
167 if (command_buffer.remaining_command_count == 0) {
168 command_list_processor.Initialize(system, command_buffer.buffer,
169 command_buffer.size, streams[index]);
170 }
171
172 if (command_buffer.reset_buffer && !buffers_reset[index]) {
173 streams[index]->ClearQueue();
174 buffers_reset[index] = true;
175 }
176
177 u64 max_time{max_process_time};
178 if (index == 1 && command_buffer.applet_resource_user_id ==
179 command_buffers[0].applet_resource_user_id) {
180 max_time = max_process_time - render_times_taken[0];
181 if (render_times_taken[0] > max_process_time) {
182 max_time = 0;
183 }
184 }
185
186 max_time = std::min(command_buffer.time_limit, max_time);
187 command_list_processor.SetProcessTimeMax(max_time);
188
189 if (index == 0) {
190 streams[index]->WaitFreeSpace(stop_token);
191 }
192
193 // Process the command list
194 {
195 MICROPROFILE_SCOPE(Audio_Renderer);
196 render_times_taken[index] =
197 command_list_processor.Process(index) - start_time;
198 }
199
200 const auto end_time{system.CoreTiming().GetGlobalTimeUs().count()};
201
202 command_buffer.remaining_command_count =
203 command_list_processor.GetRemainingCommandCount();
204 command_buffer.render_time_taken_us = end_time - start_time;
205 }
206 }
207
208 mailbox.Send(Direction::Host, {Message::RenderResponse, {}});
209 } break;
210
211 default:
212 LOG_WARNING(Service_Audio,
213 "ADSP AudioRenderer received an invalid message, msg={:02X}!",
214 received.msg);
215 break;
216 }
217 }
218}
219
220} // namespace AudioCore::ADSP::AudioRenderer
diff --git a/src/audio_core/adsp/apps/audio_renderer/audio_renderer.h b/src/audio_core/adsp/apps/audio_renderer/audio_renderer.h
new file mode 100644
index 000000000..3f5b7dca2
--- /dev/null
+++ b/src/audio_core/adsp/apps/audio_renderer/audio_renderer.h
@@ -0,0 +1,116 @@
1// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#pragma once
5
6#include <array>
7#include <memory>
8#include <thread>
9
10#include "audio_core/adsp/apps/audio_renderer/command_buffer.h"
11#include "audio_core/adsp/apps/audio_renderer/command_list_processor.h"
12#include "audio_core/adsp/mailbox.h"
13#include "common/common_types.h"
14#include "common/polyfill_thread.h"
15#include "common/reader_writer_queue.h"
16#include "common/thread.h"
17
18namespace Core {
19class System;
20namespace Timing {
21struct EventType;
22}
23namespace Memory {
24class Memory;
25}
26class System;
27} // namespace Core
28
29namespace AudioCore {
30namespace Sink {
31class Sink;
32}
33
34namespace ADSP::AudioRenderer {
35
36enum Message : u32 {
37 Invalid = 0x00,
38 MapUnmap_Map = 0x01,
39 MapUnmap_MapResponse = 0x02,
40 MapUnmap_Unmap = 0x03,
41 MapUnmap_UnmapResponse = 0x04,
42 MapUnmap_InvalidateCache = 0x05,
43 MapUnmap_InvalidateCacheResponse = 0x06,
44 MapUnmap_Shutdown = 0x07,
45 MapUnmap_ShutdownResponse = 0x08,
46 InitializeOK = 0x16,
47 RenderResponse = 0x20,
48 Render = 0x2A,
49 Shutdown = 0x34,
50};
51
52/**
53 * The AudioRenderer application running on the ADSP.
54 */
55class AudioRenderer {
56public:
57 explicit AudioRenderer(Core::System& system, Core::Memory::Memory& memory, Sink::Sink& sink);
58 ~AudioRenderer();
59
60 /**
61 * Start the AudioRenderer.
62 *
63 * @param mailbox The mailbox to use for this session.
64 */
65 void Start();
66
67 /**
68 * Stop the AudioRenderer.
69 */
70 void Stop();
71
72 void Signal();
73 void Wait();
74
75 void Send(Direction dir, MailboxMessage message);
76 MailboxMessage Receive(Direction dir, bool block = true);
77
78 void SetCommandBuffer(s32 session_id, CpuAddr buffer, u64 size, u64 time_limit,
79 u64 applet_resource_user_id, bool reset) noexcept;
80 u32 GetRemainCommandCount(s32 session_id) const noexcept;
81 void ClearRemainCommandCount(s32 session_id) noexcept;
82 u64 GetRenderingStartTick(s32 session_id) const noexcept;
83
84private:
85 /**
86 * Main AudioRenderer thread, responsible for processing the command lists.
87 */
88 void Main(std::stop_token stop_token);
89
90 /**
91 * Creates the streams which will receive the processed samples.
92 */
93 void CreateSinkStreams();
94
95 /// Core system
96 Core::System& system;
97 /// Memory
98 Core::Memory::Memory& memory;
99 /// The output sink the AudioRenderer will use
100 Sink::Sink& sink;
101 /// The active mailbox
102 Mailbox mailbox;
103 /// Main thread
104 std::jthread main_thread{};
105 /// The current state
106 std::atomic<bool> running{};
107 std::array<CommandBuffer, MaxRendererSessions> command_buffers{};
108 /// The command lists to process
109 std::array<CommandListProcessor, MaxRendererSessions> command_list_processors{};
110 /// The streams which will receive the processed samples
111 std::array<Sink::SinkStream*, MaxRendererSessions> streams{};
112 u64 signalled_tick{0};
113};
114
115} // namespace ADSP::AudioRenderer
116} // namespace AudioCore
diff --git a/src/audio_core/adsp/apps/audio_renderer/command_buffer.h b/src/audio_core/adsp/apps/audio_renderer/command_buffer.h
new file mode 100644
index 000000000..3fd1b09dc
--- /dev/null
+++ b/src/audio_core/adsp/apps/audio_renderer/command_buffer.h
@@ -0,0 +1,23 @@
1// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#pragma once
5
6#include "audio_core/common/common.h"
7#include "common/common_types.h"
8
9namespace AudioCore::ADSP::AudioRenderer {
10
11struct CommandBuffer {
12 // Set by the host
13 CpuAddr buffer{};
14 u64 size{};
15 u64 time_limit{};
16 u64 applet_resource_user_id{};
17 bool reset_buffer{};
18 // Set by the DSP
19 u32 remaining_command_count{};
20 u64 render_time_taken_us{};
21};
22
23} // namespace AudioCore::ADSP::AudioRenderer
diff --git a/src/audio_core/renderer/adsp/command_list_processor.cpp b/src/audio_core/adsp/apps/audio_renderer/command_list_processor.cpp
index 3a0f1ae38..24e4d0496 100644
--- a/src/audio_core/renderer/adsp/command_list_processor.cpp
+++ b/src/audio_core/adsp/apps/audio_renderer/command_list_processor.cpp
@@ -1,9 +1,9 @@
1// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later 2// SPDX-License-Identifier: GPL-2.0-or-later
3 3
4#include <string> 4#include <string>
5 5
6#include "audio_core/renderer/adsp/command_list_processor.h" 6#include "audio_core/adsp/apps/audio_renderer/command_list_processor.h"
7#include "audio_core/renderer/command/command_list_header.h" 7#include "audio_core/renderer/command/command_list_header.h"
8#include "audio_core/renderer/command/commands.h" 8#include "audio_core/renderer/command/commands.h"
9#include "common/settings.h" 9#include "common/settings.h"
@@ -11,15 +11,15 @@
11#include "core/core_timing.h" 11#include "core/core_timing.h"
12#include "core/memory.h" 12#include "core/memory.h"
13 13
14namespace AudioCore::AudioRenderer::ADSP { 14namespace AudioCore::ADSP::AudioRenderer {
15 15
16void CommandListProcessor::Initialize(Core::System& system_, CpuAddr buffer, u64 size, 16void CommandListProcessor::Initialize(Core::System& system_, CpuAddr buffer, u64 size,
17 Sink::SinkStream* stream_) { 17 Sink::SinkStream* stream_) {
18 system = &system_; 18 system = &system_;
19 memory = &system->ApplicationMemory(); 19 memory = &system->ApplicationMemory();
20 stream = stream_; 20 stream = stream_;
21 header = reinterpret_cast<CommandListHeader*>(buffer); 21 header = reinterpret_cast<Renderer::CommandListHeader*>(buffer);
22 commands = reinterpret_cast<u8*>(buffer + sizeof(CommandListHeader)); 22 commands = reinterpret_cast<u8*>(buffer + sizeof(Renderer::CommandListHeader));
23 commands_buffer_size = size; 23 commands_buffer_size = size;
24 command_count = header->command_count; 24 command_count = header->command_count;
25 sample_count = header->sample_count; 25 sample_count = header->sample_count;
@@ -37,17 +37,12 @@ u32 CommandListProcessor::GetRemainingCommandCount() const {
37 return command_count - processed_command_count; 37 return command_count - processed_command_count;
38} 38}
39 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 { 40Sink::SinkStream* CommandListProcessor::GetOutputSinkStream() const {
46 return stream; 41 return stream;
47} 42}
48 43
49u64 CommandListProcessor::Process(u32 session_id) { 44u64 CommandListProcessor::Process(u32 session_id) {
50 const auto start_time_{system->CoreTiming().GetClockTicks()}; 45 const auto start_time_{system->CoreTiming().GetGlobalTimeUs().count()};
51 const auto command_base{CpuAddr(commands)}; 46 const auto command_base{CpuAddr(commands)};
52 47
53 if (processed_command_count > 0) { 48 if (processed_command_count > 0) {
@@ -60,12 +55,12 @@ u64 CommandListProcessor::Process(u32 session_id) {
60 std::string dump{fmt::format("\nSession {}\n", session_id)}; 55 std::string dump{fmt::format("\nSession {}\n", session_id)};
61 56
62 for (u32 index = 0; index < command_count; index++) { 57 for (u32 index = 0; index < command_count; index++) {
63 auto& command{*reinterpret_cast<ICommand*>(commands)}; 58 auto& command{*reinterpret_cast<Renderer::ICommand*>(commands)};
64 59
65 if (command.magic != 0xCAFEBABE) { 60 if (command.magic != 0xCAFEBABE) {
66 LOG_ERROR(Service_Audio, "Command has invalid magic! Expected 0xCAFEBABE, got {:08X}", 61 LOG_ERROR(Service_Audio, "Command has invalid magic! Expected 0xCAFEBABE, got {:08X}",
67 command.magic); 62 command.magic);
68 return system->CoreTiming().GetClockTicks() - start_time_; 63 return system->CoreTiming().GetGlobalTimeUs().count() - start_time_;
69 } 64 }
70 65
71 auto current_offset{CpuAddr(commands) - command_base}; 66 auto current_offset{CpuAddr(commands) - command_base};
@@ -74,8 +69,8 @@ u64 CommandListProcessor::Process(u32 session_id) {
74 LOG_ERROR(Service_Audio, 69 LOG_ERROR(Service_Audio,
75 "Command exceeded command buffer, buffer size {:08X}, command ends at {:08X}", 70 "Command exceeded command buffer, buffer size {:08X}, command ends at {:08X}",
76 commands_buffer_size, 71 commands_buffer_size,
77 CpuAddr(commands) + command.size - sizeof(CommandListHeader)); 72 CpuAddr(commands) + command.size - sizeof(Renderer::CommandListHeader));
78 return system->CoreTiming().GetClockTicks() - start_time_; 73 return system->CoreTiming().GetGlobalTimeUs().count() - start_time_;
79 } 74 }
80 75
81 if (Settings::values.dump_audio_commands) { 76 if (Settings::values.dump_audio_commands) {
@@ -101,8 +96,8 @@ u64 CommandListProcessor::Process(u32 session_id) {
101 last_dump = dump; 96 last_dump = dump;
102 } 97 }
103 98
104 end_time = system->CoreTiming().GetClockTicks(); 99 end_time = system->CoreTiming().GetGlobalTimeUs().count();
105 return end_time - start_time_; 100 return end_time - start_time_;
106} 101}
107 102
108} // namespace AudioCore::AudioRenderer::ADSP 103} // namespace AudioCore::ADSP::AudioRenderer
diff --git a/src/audio_core/renderer/adsp/command_list_processor.h b/src/audio_core/adsp/apps/audio_renderer/command_list_processor.h
index d78269e1d..4e5fb793e 100644
--- a/src/audio_core/renderer/adsp/command_list_processor.h
+++ b/src/audio_core/adsp/apps/audio_renderer/command_list_processor.h
@@ -1,4 +1,4 @@
1// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later 2// SPDX-License-Identifier: GPL-2.0-or-later
3 3
4#pragma once 4#pragma once
@@ -6,6 +6,7 @@
6#include <span> 6#include <span>
7 7
8#include "audio_core/common/common.h" 8#include "audio_core/common/common.h"
9#include "audio_core/renderer/command/command_list_header.h"
9#include "common/common_types.h" 10#include "common/common_types.h"
10 11
11namespace Core { 12namespace Core {
@@ -20,10 +21,11 @@ namespace Sink {
20class SinkStream; 21class SinkStream;
21} 22}
22 23
23namespace AudioRenderer { 24namespace Renderer {
24struct CommandListHeader; 25struct CommandListHeader;
26}
25 27
26namespace ADSP { 28namespace ADSP::AudioRenderer {
27 29
28/** 30/**
29 * A processor for command lists given to the AudioRenderer. 31 * A processor for command lists given to the AudioRenderer.
@@ -55,14 +57,6 @@ public:
55 u32 GetRemainingCommandCount() const; 57 u32 GetRemainingCommandCount() const;
56 58
57 /** 59 /**
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. 60 * Get the stream for this command list.
67 * 61 *
68 * @return The stream associated with this command list. 62 * @return The stream associated with this command list.
@@ -85,7 +79,7 @@ public:
85 /// Stream for the processed samples 79 /// Stream for the processed samples
86 Sink::SinkStream* stream{}; 80 Sink::SinkStream* stream{};
87 /// Header info for this command list 81 /// Header info for this command list
88 CommandListHeader* header{}; 82 Renderer::CommandListHeader* header{};
89 /// The command buffer 83 /// The command buffer
90 u8* commands{}; 84 u8* commands{};
91 /// The command buffer size 85 /// The command buffer size
@@ -114,6 +108,5 @@ public:
114 std::string last_dump{}; 108 std::string last_dump{};
115}; 109};
116 110
117} // namespace ADSP 111} // namespace ADSP::AudioRenderer
118} // namespace AudioRenderer
119} // namespace AudioCore 112} // namespace AudioCore
diff --git a/src/audio_core/adsp/mailbox.h b/src/audio_core/adsp/mailbox.h
new file mode 100644
index 000000000..c31b73717
--- /dev/null
+++ b/src/audio_core/adsp/mailbox.h
@@ -0,0 +1,69 @@
1// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#pragma once
5
6#include "common/bounded_threadsafe_queue.h"
7#include "common/common_types.h"
8
9namespace AudioCore::ADSP {
10
11enum class AppMailboxId : u32 {
12 Invalid = 0,
13 AudioRenderer = 50,
14 AudioRendererMemoryMapUnmap = 51,
15};
16
17enum class Direction : u32 {
18 Host,
19 DSP,
20};
21
22struct MailboxMessage {
23 u32 msg;
24 std::span<u8> data;
25};
26
27class Mailbox {
28public:
29 void Initialize(AppMailboxId id_) {
30 Reset();
31 id = id_;
32 }
33
34 AppMailboxId Id() const noexcept {
35 return id;
36 }
37
38 void Send(Direction dir, MailboxMessage&& message) {
39 auto& queue = dir == Direction::Host ? host_queue : adsp_queue;
40 queue.EmplaceWait(std::move(message));
41 }
42
43 MailboxMessage Receive(Direction dir, bool block = true) {
44 auto& queue = dir == Direction::Host ? host_queue : adsp_queue;
45 MailboxMessage t;
46 if (block) {
47 queue.PopWait(t);
48 } else {
49 queue.TryPop(t);
50 }
51 return t;
52 }
53
54 void Reset() {
55 id = AppMailboxId::Invalid;
56 MailboxMessage t;
57 while (host_queue.TryPop(t)) {
58 }
59 while (adsp_queue.TryPop(t)) {
60 }
61 }
62
63private:
64 AppMailboxId id{0};
65 Common::SPSCQueue<MailboxMessage> host_queue;
66 Common::SPSCQueue<MailboxMessage> adsp_queue;
67};
68
69} // namespace AudioCore::ADSP
diff --git a/src/audio_core/audio_core.cpp b/src/audio_core/audio_core.cpp
index 703ef4494..fcaab2b32 100644
--- a/src/audio_core/audio_core.cpp
+++ b/src/audio_core/audio_core.cpp
@@ -11,7 +11,7 @@ namespace AudioCore {
11AudioCore::AudioCore(Core::System& system) : audio_manager{std::make_unique<AudioManager>()} { 11AudioCore::AudioCore(Core::System& system) : audio_manager{std::make_unique<AudioManager>()} {
12 CreateSinks(); 12 CreateSinks();
13 // Must be created after the sinks 13 // Must be created after the sinks
14 adsp = std::make_unique<AudioRenderer::ADSP::ADSP>(system, *output_sink); 14 adsp = std::make_unique<ADSP::ADSP>(system, *output_sink);
15} 15}
16 16
17AudioCore ::~AudioCore() { 17AudioCore ::~AudioCore() {
@@ -43,7 +43,7 @@ Sink::Sink& AudioCore::GetInputSink() {
43 return *input_sink; 43 return *input_sink;
44} 44}
45 45
46AudioRenderer::ADSP::ADSP& AudioCore::GetADSP() { 46ADSP::ADSP& AudioCore::ADSP() {
47 return *adsp; 47 return *adsp;
48} 48}
49 49
diff --git a/src/audio_core/audio_core.h b/src/audio_core/audio_core.h
index ea047773e..e4e27fc66 100644
--- a/src/audio_core/audio_core.h
+++ b/src/audio_core/audio_core.h
@@ -5,8 +5,8 @@
5 5
6#include <memory> 6#include <memory>
7 7
8#include "audio_core/adsp/adsp.h"
8#include "audio_core/audio_manager.h" 9#include "audio_core/audio_manager.h"
9#include "audio_core/renderer/adsp/adsp.h"
10#include "audio_core/sink/sink.h" 10#include "audio_core/sink/sink.h"
11 11
12namespace Core { 12namespace Core {
@@ -55,7 +55,7 @@ public:
55 * 55 *
56 * @return Ref to the ADSP. 56 * @return Ref to the ADSP.
57 */ 57 */
58 AudioRenderer::ADSP::ADSP& GetADSP(); 58 ADSP::ADSP& ADSP();
59 59
60private: 60private:
61 /** 61 /**
@@ -70,7 +70,7 @@ private:
70 /// Sink used for audio input 70 /// Sink used for audio input
71 std::unique_ptr<Sink::Sink> input_sink; 71 std::unique_ptr<Sink::Sink> input_sink;
72 /// The ADSP in the sysmodule 72 /// The ADSP in the sysmodule
73 std::unique_ptr<AudioRenderer::ADSP::ADSP> adsp; 73 std::unique_ptr<ADSP::ADSP> adsp;
74}; 74};
75 75
76} // namespace AudioCore 76} // namespace AudioCore
diff --git a/src/audio_core/audio_event.cpp b/src/audio_core/audio_event.cpp
index d15568e1f..c23ef0990 100644
--- a/src/audio_core/audio_event.cpp
+++ b/src/audio_core/audio_event.cpp
@@ -20,7 +20,6 @@ size_t Event::GetManagerIndex(const Type type) const {
20 default: 20 default:
21 UNREACHABLE(); 21 UNREACHABLE();
22 } 22 }
23 return 3;
24} 23}
25 24
26void Event::SetAudioEvent(const Type type, const bool signalled) { 25void Event::SetAudioEvent(const Type type, const bool signalled) {
diff --git a/src/audio_core/audio_in_manager.cpp b/src/audio_core/audio_in_manager.cpp
index 3dfb613cb..a3667524f 100644
--- a/src/audio_core/audio_in_manager.cpp
+++ b/src/audio_core/audio_in_manager.cpp
@@ -73,7 +73,7 @@ void Manager::BufferReleaseAndRegister() {
73 } 73 }
74} 74}
75 75
76u32 Manager::GetDeviceNames(std::vector<AudioRenderer::AudioDevice::AudioDeviceName>& names, 76u32 Manager::GetDeviceNames(std::vector<Renderer::AudioDevice::AudioDeviceName>& names,
77 [[maybe_unused]] const u32 max_count, 77 [[maybe_unused]] const u32 max_count,
78 [[maybe_unused]] const bool filter) { 78 [[maybe_unused]] const bool filter) {
79 std::scoped_lock l{mutex}; 79 std::scoped_lock l{mutex};
diff --git a/src/audio_core/audio_in_manager.h b/src/audio_core/audio_in_manager.h
index 8a519df99..5c4614cd1 100644
--- a/src/audio_core/audio_in_manager.h
+++ b/src/audio_core/audio_in_manager.h
@@ -65,8 +65,8 @@ public:
65 * 65 *
66 * @return Number of names written. 66 * @return Number of names written.
67 */ 67 */
68 u32 GetDeviceNames(std::vector<AudioRenderer::AudioDevice::AudioDeviceName>& names, 68 u32 GetDeviceNames(std::vector<Renderer::AudioDevice::AudioDeviceName>& names, u32 max_count,
69 u32 max_count, bool filter); 69 bool filter);
70 70
71 /// Core system 71 /// Core system
72 Core::System& system; 72 Core::System& system;
diff --git a/src/audio_core/audio_out_manager.cpp b/src/audio_core/audio_out_manager.cpp
index f22821360..316ea7c81 100644
--- a/src/audio_core/audio_out_manager.cpp
+++ b/src/audio_core/audio_out_manager.cpp
@@ -73,7 +73,7 @@ void Manager::BufferReleaseAndRegister() {
73} 73}
74 74
75u32 Manager::GetAudioOutDeviceNames( 75u32 Manager::GetAudioOutDeviceNames(
76 std::vector<AudioRenderer::AudioDevice::AudioDeviceName>& names) const { 76 std::vector<Renderer::AudioDevice::AudioDeviceName>& names) const {
77 names.emplace_back("DeviceOut"); 77 names.emplace_back("DeviceOut");
78 return 1; 78 return 1;
79} 79}
diff --git a/src/audio_core/audio_out_manager.h b/src/audio_core/audio_out_manager.h
index 1e05ec5ed..c3e445d5d 100644
--- a/src/audio_core/audio_out_manager.h
+++ b/src/audio_core/audio_out_manager.h
@@ -61,8 +61,7 @@ public:
61 * @param names - Output container to write names to. 61 * @param names - Output container to write names to.
62 * @return Number of names written. 62 * @return Number of names written.
63 */ 63 */
64 u32 GetAudioOutDeviceNames( 64 u32 GetAudioOutDeviceNames(std::vector<Renderer::AudioDevice::AudioDeviceName>& names) const;
65 std::vector<AudioRenderer::AudioDevice::AudioDeviceName>& names) const;
66 65
67 /// Core system 66 /// Core system
68 Core::System& system; 67 Core::System& system;
diff --git a/src/audio_core/audio_render_manager.cpp b/src/audio_core/audio_render_manager.cpp
index 320715727..3c53e3afd 100644
--- a/src/audio_core/audio_render_manager.cpp
+++ b/src/audio_core/audio_render_manager.cpp
@@ -6,7 +6,7 @@
6#include "audio_core/common/feature_support.h" 6#include "audio_core/common/feature_support.h"
7#include "core/core.h" 7#include "core/core.h"
8 8
9namespace AudioCore::AudioRenderer { 9namespace AudioCore::Renderer {
10 10
11Manager::Manager(Core::System& system_) 11Manager::Manager(Core::System& system_)
12 : system{system_}, system_manager{std::make_unique<SystemManager>(system)} { 12 : system{system_}, system_manager{std::make_unique<SystemManager>(system)} {
@@ -67,4 +67,4 @@ bool Manager::RemoveSystem(System& system_) {
67 return system_manager->Remove(system_); 67 return system_manager->Remove(system_);
68} 68}
69 69
70} // namespace AudioCore::AudioRenderer 70} // namespace AudioCore::Renderer
diff --git a/src/audio_core/audio_render_manager.h b/src/audio_core/audio_render_manager.h
index fffa5944d..45537b270 100644
--- a/src/audio_core/audio_render_manager.h
+++ b/src/audio_core/audio_render_manager.h
@@ -20,7 +20,7 @@ class System;
20namespace AudioCore { 20namespace AudioCore {
21struct AudioRendererParameterInternal; 21struct AudioRendererParameterInternal;
22 22
23namespace AudioRenderer { 23namespace Renderer {
24/** 24/**
25 * Wrapper for the audio system manager, handles service calls. 25 * Wrapper for the audio system manager, handles service calls.
26 */ 26 */
@@ -101,5 +101,5 @@ private:
101 std::unique_ptr<SystemManager> system_manager{}; 101 std::unique_ptr<SystemManager> system_manager{};
102}; 102};
103 103
104} // namespace AudioRenderer 104} // namespace Renderer
105} // namespace AudioCore 105} // namespace AudioCore
diff --git a/src/audio_core/common/audio_renderer_parameter.h b/src/audio_core/common/audio_renderer_parameter.h
index 8c7892bcf..6c4e9fdc6 100644
--- a/src/audio_core/common/audio_renderer_parameter.h
+++ b/src/audio_core/common/audio_renderer_parameter.h
@@ -51,10 +51,10 @@ struct AudioRendererSystemContext {
51 s32 session_id; 51 s32 session_id;
52 s8 channels; 52 s8 channels;
53 s16 mix_buffer_count; 53 s16 mix_buffer_count;
54 AudioRenderer::BehaviorInfo* behavior; 54 Renderer::BehaviorInfo* behavior;
55 std::span<s32> depop_buffer; 55 std::span<s32> depop_buffer;
56 AudioRenderer::UpsamplerManager* upsampler_manager; 56 Renderer::UpsamplerManager* upsampler_manager;
57 AudioRenderer::MemoryPoolInfo* memory_pool_info; 57 Renderer::MemoryPoolInfo* memory_pool_info;
58}; 58};
59 59
60} // namespace AudioCore 60} // namespace AudioCore
diff --git a/src/audio_core/renderer/adsp/adsp.cpp b/src/audio_core/renderer/adsp/adsp.cpp
deleted file mode 100644
index b1db31e93..000000000
--- a/src/audio_core/renderer/adsp/adsp.cpp
+++ /dev/null
@@ -1,117 +0,0 @@
1// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#include "audio_core/renderer/adsp/adsp.h"
5#include "audio_core/renderer/adsp/command_buffer.h"
6#include "audio_core/sink/sink.h"
7#include "common/logging/log.h"
8#include "core/core.h"
9#include "core/core_timing.h"
10#include "core/memory.h"
11
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/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..e7f82d3b3 100644
--- a/src/audio_core/renderer/command/data_source/adpcm.cpp
+++ b/src/audio_core/renderer/command/data_source/adpcm.cpp
@@ -3,23 +3,29 @@
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
23 for (auto& wave_buffer : wave_buffers) {
24 wave_buffer.loop_start_offset = wave_buffer.start_offset;
25 wave_buffer.loop_end_offset = wave_buffer.end_offset;
26 wave_buffer.loop_count = wave_buffer.loop ? -1 : 0;
27 }
28
23 DecodeFromWaveBuffersArgs args{ 29 DecodeFromWaveBuffersArgs args{
24 .sample_format{SampleFormat::Adpcm}, 30 .sample_format{SampleFormat::Adpcm},
25 .output{out_buffer}, 31 .output{out_buffer},
@@ -41,18 +47,18 @@ void AdpcmDataSourceVersion1Command::Process(const ADSP::CommandListProcessor& p
41 DecodeFromWaveBuffers(*processor.memory, args); 47 DecodeFromWaveBuffers(*processor.memory, args);
42} 48}
43 49
44bool AdpcmDataSourceVersion1Command::Verify(const ADSP::CommandListProcessor& processor) { 50bool AdpcmDataSourceVersion1Command::Verify(const AudioRenderer::CommandListProcessor& processor) {
45 return true; 51 return true;
46} 52}
47 53
48void AdpcmDataSourceVersion2Command::Dump(const ADSP::CommandListProcessor& processor, 54void AdpcmDataSourceVersion2Command::Dump(const AudioRenderer::CommandListProcessor& processor,
49 std::string& string) { 55 std::string& string) {
50 string += fmt::format("AdpcmDataSourceVersion2Command\n\toutput_index {:02X} source sample " 56 string += fmt::format("AdpcmDataSourceVersion2Command\n\toutput_index {:02X} source sample "
51 "rate {} target sample rate {} src quality {}\n", 57 "rate {} target sample rate {} src quality {}\n",
52 output_index, sample_rate, processor.target_sample_rate, src_quality); 58 output_index, sample_rate, processor.target_sample_rate, src_quality);
53} 59}
54 60
55void AdpcmDataSourceVersion2Command::Process(const ADSP::CommandListProcessor& processor) { 61void AdpcmDataSourceVersion2Command::Process(const AudioRenderer::CommandListProcessor& processor) {
56 auto out_buffer{processor.mix_buffers.subspan(output_index * processor.sample_count, 62 auto out_buffer{processor.mix_buffers.subspan(output_index * processor.sample_count,
57 processor.sample_count)}; 63 processor.sample_count)};
58 64
@@ -77,8 +83,8 @@ void AdpcmDataSourceVersion2Command::Process(const ADSP::CommandListProcessor& p
77 DecodeFromWaveBuffers(*processor.memory, args); 83 DecodeFromWaveBuffers(*processor.memory, args);
78} 84}
79 85
80bool AdpcmDataSourceVersion2Command::Verify(const ADSP::CommandListProcessor& processor) { 86bool AdpcmDataSourceVersion2Command::Verify(const AudioRenderer::CommandListProcessor& processor) {
81 return true; 87 return true;
82} 88}
83 89
84} // namespace AudioCore::AudioRenderer 90} // 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..911dae3c1 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};
@@ -123,11 +123,13 @@ static u32 DecodeAdpcm(Core::Memory::Memory& memory, std::span<s16> out_buffer,
123 return 0; 123 return 0;
124 } 124 }
125 125
126 auto samples_to_process{ 126 auto start_pos{req.start_offset + req.offset};
127 std::min(req.end_offset - req.start_offset - req.offset, req.samples_to_read)}; 127 auto samples_to_process{std::min(req.end_offset - start_pos, req.samples_to_read)};
128 if (samples_to_process == 0) {
129 return 0;
130 }
128 131
129 auto samples_to_read{samples_to_process}; 132 auto samples_to_read{samples_to_process};
130 auto start_pos{req.start_offset + req.offset};
131 auto samples_remaining_in_frame{start_pos % SamplesPerFrame}; 133 auto samples_remaining_in_frame{start_pos % SamplesPerFrame};
132 auto position_in_frame{(start_pos / SamplesPerFrame) * NibblesPerFrame + 134 auto position_in_frame{(start_pos / SamplesPerFrame) * NibblesPerFrame +
133 samples_remaining_in_frame}; 135 samples_remaining_in_frame};
@@ -225,13 +227,24 @@ static u32 DecodeAdpcm(Core::Memory::Memory& memory, std::span<s16> out_buffer,
225 * @param args - The wavebuffer data, and information for how to decode it. 227 * @param args - The wavebuffer data, and information for how to decode it.
226 */ 228 */
227void DecodeFromWaveBuffers(Core::Memory::Memory& memory, const DecodeFromWaveBuffersArgs& args) { 229void DecodeFromWaveBuffers(Core::Memory::Memory& memory, const DecodeFromWaveBuffersArgs& args) {
230 static constexpr auto EndWaveBuffer = [](auto& voice_state, auto& wavebuffer, auto& index,
231 auto& played_samples, auto& consumed) -> void {
232 voice_state.wave_buffer_valid[index] = false;
233 voice_state.loop_count = 0;
234
235 if (wavebuffer.stream_ended) {
236 played_samples = 0;
237 }
238
239 index = (index + 1) % MaxWaveBuffers;
240 consumed++;
241 };
228 auto& voice_state{*args.voice_state}; 242 auto& voice_state{*args.voice_state};
229 auto remaining_sample_count{args.sample_count}; 243 auto remaining_sample_count{args.sample_count};
230 auto fraction{voice_state.fraction}; 244 auto fraction{voice_state.fraction};
231 245
232 const auto sample_rate_ratio{ 246 const auto sample_rate_ratio{Common::FixedPoint<49, 15>(
233 (Common::FixedPoint<49, 15>(args.source_sample_rate) / args.target_sample_rate) * 247 (f32)args.source_sample_rate / (f32)args.target_sample_rate * (f32)args.pitch)};
234 args.pitch};
235 const auto size_required{fraction + remaining_sample_count * sample_rate_ratio}; 248 const auto size_required{fraction + remaining_sample_count * sample_rate_ratio};
236 249
237 if (size_required < 0) { 250 if (size_required < 0) {
@@ -298,22 +311,23 @@ void DecodeFromWaveBuffers(Core::Memory::Memory& memory, const DecodeFromWaveBuf
298 auto end_offset{wavebuffer.end_offset}; 311 auto end_offset{wavebuffer.end_offset};
299 312
300 if (wavebuffer.loop && voice_state.loop_count > 0 && 313 if (wavebuffer.loop && voice_state.loop_count > 0 &&
301 wavebuffer.loop_start_offset != 0 && wavebuffer.loop_end_offset != 0 &&
302 wavebuffer.loop_start_offset <= wavebuffer.loop_end_offset) { 314 wavebuffer.loop_start_offset <= wavebuffer.loop_end_offset) {
303 start_offset = wavebuffer.loop_start_offset; 315 start_offset = wavebuffer.loop_start_offset;
304 end_offset = wavebuffer.loop_end_offset; 316 end_offset = wavebuffer.loop_end_offset;
305 } 317 }
306 318
307 DecodeArg decode_arg{.buffer{wavebuffer.buffer}, 319 DecodeArg decode_arg{
308 .buffer_size{wavebuffer.buffer_size}, 320 .buffer{wavebuffer.buffer},
309 .start_offset{start_offset}, 321 .buffer_size{wavebuffer.buffer_size},
310 .end_offset{end_offset}, 322 .start_offset{start_offset},
311 .channel_count{args.channel_count}, 323 .end_offset{end_offset},
312 .coefficients{}, 324 .channel_count{args.channel_count},
313 .adpcm_context{nullptr}, 325 .coefficients{},
314 .target_channel{args.channel}, 326 .adpcm_context{nullptr},
315 .offset{offset}, 327 .target_channel{args.channel},
316 .samples_to_read{samples_to_read - samples_read}}; 328 .offset{offset},
329 .samples_to_read{samples_to_read - samples_read},
330 };
317 331
318 s32 samples_decoded{0}; 332 s32 samples_decoded{0};
319 333
@@ -350,42 +364,30 @@ void DecodeFromWaveBuffers(Core::Memory::Memory& memory, const DecodeFromWaveBuf
350 temp_buffer_pos += samples_decoded; 364 temp_buffer_pos += samples_decoded;
351 offset += samples_decoded; 365 offset += samples_decoded;
352 366
353 if (samples_decoded == 0 || offset >= end_offset - start_offset) { 367 if (samples_decoded && offset < end_offset - start_offset) {
354 offset = 0; 368 continue;
355 if (!wavebuffer.loop) { 369 }
356 voice_state.wave_buffer_valid[wavebuffer_index] = false; 370
357 voice_state.loop_count = 0; 371 offset = 0;
358 372 if (wavebuffer.loop) {
359 if (wavebuffer.stream_ended) { 373 voice_state.loop_count++;
360 played_sample_count = 0; 374 if (wavebuffer.loop_count >= 0 &&
361 } 375 (voice_state.loop_count > wavebuffer.loop_count || samples_decoded == 0)) {
362 376 EndWaveBuffer(voice_state, wavebuffer, wavebuffer_index, played_sample_count,
363 wavebuffer_index = (wavebuffer_index + 1) % MaxWaveBuffers; 377 wavebuffers_consumed);
364 wavebuffers_consumed++; 378 }
365 } else { 379
366 voice_state.loop_count++; 380 if (samples_decoded == 0) {
367 if (wavebuffer.loop_count > 0 && 381 is_buffer_starved = true;
368 (voice_state.loop_count > wavebuffer.loop_count || samples_decoded == 0)) { 382 break;
369 voice_state.wave_buffer_valid[wavebuffer_index] = false; 383 }
370 voice_state.loop_count = 0; 384
371 385 if (args.IsVoicePlayedSampleCountResetAtLoopPointSupported) {
372 if (wavebuffer.stream_ended) { 386 played_sample_count = 0;
373 played_sample_count = 0;
374 }
375
376 wavebuffer_index = (wavebuffer_index + 1) % MaxWaveBuffers;
377 wavebuffers_consumed++;
378 }
379
380 if (samples_decoded == 0) {
381 is_buffer_starved = true;
382 break;
383 }
384
385 if (args.IsVoicePlayedSampleCountResetAtLoopPointSupported) {
386 played_sample_count = 0;
387 }
388 } 387 }
388 } else {
389 EndWaveBuffer(voice_state, wavebuffer, wavebuffer_index, played_sample_count,
390 wavebuffers_consumed);
389 } 391 }
390 } 392 }
391 393
@@ -423,4 +425,4 @@ void DecodeFromWaveBuffers(Core::Memory::Memory& memory, const DecodeFromWaveBuf
423 voice_state.fraction = fraction; 425 voice_state.fraction = fraction;
424} 426}
425 427
426} // namespace AudioCore::AudioRenderer 428} // 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..d1f685656 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,10 +16,17 @@ 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
24 for (auto& wave_buffer : wave_buffers) {
25 wave_buffer.loop_start_offset = wave_buffer.start_offset;
26 wave_buffer.loop_end_offset = wave_buffer.end_offset;
27 wave_buffer.loop_count = wave_buffer.loop ? -1 : 0;
28 }
29
23 DecodeFromWaveBuffersArgs args{ 30 DecodeFromWaveBuffersArgs args{
24 .sample_format{SampleFormat::PcmFloat}, 31 .sample_format{SampleFormat::PcmFloat},
25 .output{out_buffer}, 32 .output{out_buffer},
@@ -41,11 +48,12 @@ void PcmFloatDataSourceVersion1Command::Process(const ADSP::CommandListProcessor
41 DecodeFromWaveBuffers(*processor.memory, args); 48 DecodeFromWaveBuffers(*processor.memory, args);
42} 49}
43 50
44bool PcmFloatDataSourceVersion1Command::Verify(const ADSP::CommandListProcessor& processor) { 51bool PcmFloatDataSourceVersion1Command::Verify(
52 const AudioRenderer::CommandListProcessor& processor) {
45 return true; 53 return true;
46} 54}
47 55
48void PcmFloatDataSourceVersion2Command::Dump(const ADSP::CommandListProcessor& processor, 56void PcmFloatDataSourceVersion2Command::Dump(const AudioRenderer::CommandListProcessor& processor,
49 std::string& string) { 57 std::string& string) {
50 string += 58 string +=
51 fmt::format("PcmFloatDataSourceVersion2Command\n\toutput_index {:02X} channel {} " 59 fmt::format("PcmFloatDataSourceVersion2Command\n\toutput_index {:02X} channel {} "
@@ -54,7 +62,8 @@ void PcmFloatDataSourceVersion2Command::Dump(const ADSP::CommandListProcessor& p
54 processor.target_sample_rate, src_quality); 62 processor.target_sample_rate, src_quality);
55} 63}
56 64
57void PcmFloatDataSourceVersion2Command::Process(const ADSP::CommandListProcessor& processor) { 65void PcmFloatDataSourceVersion2Command::Process(
66 const AudioRenderer::CommandListProcessor& processor) {
58 auto out_buffer = processor.mix_buffers.subspan(output_index * processor.sample_count, 67 auto out_buffer = processor.mix_buffers.subspan(output_index * processor.sample_count,
59 processor.sample_count); 68 processor.sample_count);
60 69
@@ -79,8 +88,9 @@ void PcmFloatDataSourceVersion2Command::Process(const ADSP::CommandListProcessor
79 DecodeFromWaveBuffers(*processor.memory, args); 88 DecodeFromWaveBuffers(*processor.memory, args);
80} 89}
81 90
82bool PcmFloatDataSourceVersion2Command::Verify(const ADSP::CommandListProcessor& processor) { 91bool PcmFloatDataSourceVersion2Command::Verify(
92 const AudioRenderer::CommandListProcessor& processor) {
83 return true; 93 return true;
84} 94}
85 95
86} // namespace AudioCore::AudioRenderer 96} // 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..c89a5aaac 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,10 +18,17 @@ 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
26 for (auto& wave_buffer : wave_buffers) {
27 wave_buffer.loop_start_offset = wave_buffer.start_offset;
28 wave_buffer.loop_end_offset = wave_buffer.end_offset;
29 wave_buffer.loop_count = wave_buffer.loop ? -1 : 0;
30 }
31
25 DecodeFromWaveBuffersArgs args{ 32 DecodeFromWaveBuffersArgs args{
26 .sample_format{SampleFormat::PcmInt16}, 33 .sample_format{SampleFormat::PcmInt16},
27 .output{out_buffer}, 34 .output{out_buffer},
@@ -43,11 +50,12 @@ void PcmInt16DataSourceVersion1Command::Process(const ADSP::CommandListProcessor
43 DecodeFromWaveBuffers(*processor.memory, args); 50 DecodeFromWaveBuffers(*processor.memory, args);
44} 51}
45 52
46bool PcmInt16DataSourceVersion1Command::Verify(const ADSP::CommandListProcessor& processor) { 53bool PcmInt16DataSourceVersion1Command::Verify(
54 const AudioRenderer::CommandListProcessor& processor) {
47 return true; 55 return true;
48} 56}
49 57
50void PcmInt16DataSourceVersion2Command::Dump(const ADSP::CommandListProcessor& processor, 58void PcmInt16DataSourceVersion2Command::Dump(const AudioRenderer::CommandListProcessor& processor,
51 std::string& string) { 59 std::string& string) {
52 string += 60 string +=
53 fmt::format("PcmInt16DataSourceVersion2Command\n\toutput_index {:02X} channel {} " 61 fmt::format("PcmInt16DataSourceVersion2Command\n\toutput_index {:02X} channel {} "
@@ -56,7 +64,8 @@ void PcmInt16DataSourceVersion2Command::Dump(const ADSP::CommandListProcessor& p
56 processor.target_sample_rate, src_quality); 64 processor.target_sample_rate, src_quality);
57} 65}
58 66
59void PcmInt16DataSourceVersion2Command::Process(const ADSP::CommandListProcessor& processor) { 67void PcmInt16DataSourceVersion2Command::Process(
68 const AudioRenderer::CommandListProcessor& processor) {
60 auto out_buffer = processor.mix_buffers.subspan(output_index * processor.sample_count, 69 auto out_buffer = processor.mix_buffers.subspan(output_index * processor.sample_count,
61 processor.sample_count); 70 processor.sample_count);
62 DecodeFromWaveBuffersArgs args{ 71 DecodeFromWaveBuffersArgs args{
@@ -80,8 +89,9 @@ void PcmInt16DataSourceVersion2Command::Process(const ADSP::CommandListProcessor
80 DecodeFromWaveBuffers(*processor.memory, args); 89 DecodeFromWaveBuffers(*processor.memory, args);
81} 90}
82 91
83bool PcmInt16DataSourceVersion2Command::Verify(const ADSP::CommandListProcessor& processor) { 92bool PcmInt16DataSourceVersion2Command::Verify(
93 const AudioRenderer::CommandListProcessor& processor) {
84 return true; 94 return true;
85} 95}
86 96
87} // namespace AudioCore::AudioRenderer 97} // 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..d29754634 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,18 @@ 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 auto time_limit{
611 .buffer{translated_addr}, 613 static_cast<u64>((time_limit_percent / 100) * 2'880'000.0 *
612 .size{command_size}, 614 (static_cast<f32>(render_time_limit_percent) / 100.0f))};
613 .time_limit{ 615 audio_renderer.SetCommandBuffer(session_id, translated_addr, command_size, time_limit,
614 static_cast<u64>((time_limit_percent / 100) * 2'880'000.0 * 616 applet_resource_user_id, reset_command_buffers);
615 (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},
619 .render_time_taken{adsp.GetRenderTimeTaken(session_id)},
620 };
621
622 adsp.SendCommandBuffer(session_id, command_buffer);
623 reset_command_buffers = false; 617 reset_command_buffers = false;
624 command_buffer_size = command_size; 618 command_buffer_size = command_size;
625 if (remaining_command_count == 0) { 619 if (remaining_command_count == 0) {
626 adsp_rendered_event->Signal(); 620 adsp_rendered_event->Signal();
627 } 621 }
628 } else { 622 } else {
629 adsp.ClearRemainCount(session_id); 623 audio_renderer.ClearRemainCommandCount(session_id);
630 terminate_event.Set(); 624 terminate_event.Set();
631 } 625 }
632 } 626 }
@@ -635,7 +629,7 @@ void System::SendCommandToDsp() {
635u64 System::GenerateCommand(std::span<u8> in_command_buffer, 629u64 System::GenerateCommand(std::span<u8> in_command_buffer,
636 [[maybe_unused]] u64 command_buffer_size_) { 630 [[maybe_unused]] u64 command_buffer_size_) {
637 PoolMapper::ClearUseState(memory_pool_workbuffer, memory_pool_count); 631 PoolMapper::ClearUseState(memory_pool_workbuffer, memory_pool_count);
638 const auto start_time{core.CoreTiming().GetClockTicks()}; 632 const auto start_time{core.CoreTiming().GetGlobalTimeNs().count()};
639 633
640 auto command_list_header{reinterpret_cast<CommandListHeader*>(in_command_buffer.data())}; 634 auto command_list_header{reinterpret_cast<CommandListHeader*>(in_command_buffer.data())};
641 635
@@ -732,10 +726,10 @@ u64 System::GenerateCommand(std::span<u8> in_command_buffer,
732 effect_context.UpdateStateByDspShared(); 726 effect_context.UpdateStateByDspShared();
733 } 727 }
734 728
735 const auto end_time{core.CoreTiming().GetClockTicks()}; 729 const auto end_time{core.CoreTiming().GetGlobalTimeNs().count()};
736 total_ticks_elapsed += end_time - start_time; 730 total_ticks_elapsed += end_time - start_time;
737 num_command_lists_generated++; 731 num_command_lists_generated++;
738 render_start_tick = adsp.GetRenderingStartTick(session_id); 732 render_start_tick = audio_renderer.GetRenderingStartTick(session_id);
739 frames_elapsed++; 733 frames_elapsed++;
740 734
741 return command_buffer.size; 735 return command_buffer.size;
@@ -819,4 +813,4 @@ u32 System::DropVoices(CommandBuffer& command_buffer, u32 estimated_process_time
819 return voices_dropped; 813 return voices_dropped;
820} 814}
821 815
822} // namespace AudioCore::AudioRenderer 816} // 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
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
index bf97d9ba2..6d2badf76 100644
--- a/src/common/CMakeLists.txt
+++ b/src/common/CMakeLists.txt
@@ -191,8 +191,6 @@ if (MSVC)
191 _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING 191 _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING
192 ) 192 )
193 target_compile_options(common PRIVATE 193 target_compile_options(common PRIVATE
194 /W4
195
196 /we4242 # 'identifier': conversion from 'type1' to 'type2', possible loss of data 194 /we4242 # 'identifier': conversion from 'type1' to 'type2', possible loss of data
197 /we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data 195 /we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data
198 /we4800 # Implicit conversion from 'type' to bool. Possible information loss 196 /we4800 # Implicit conversion from 'type' to bool. Possible information loss
diff --git a/src/core/hle/kernel/k_capabilities.cpp b/src/core/hle/kernel/k_capabilities.cpp
index 90e4e8fb0..e7da7a21d 100644
--- a/src/core/hle/kernel/k_capabilities.cpp
+++ b/src/core/hle/kernel/k_capabilities.cpp
@@ -156,7 +156,6 @@ Result KCapabilities::MapIoPage_(const u32 cap, KPageTable* page_table) {
156 const u64 phys_addr = MapIoPage{cap}.address.Value() * PageSize; 156 const u64 phys_addr = MapIoPage{cap}.address.Value() * PageSize;
157 const size_t num_pages = 1; 157 const size_t num_pages = 1;
158 const size_t size = num_pages * PageSize; 158 const size_t size = num_pages * PageSize;
159 R_UNLESS(num_pages != 0, ResultInvalidSize);
160 R_UNLESS(phys_addr < phys_addr + size, ResultInvalidAddress); 159 R_UNLESS(phys_addr < phys_addr + size, ResultInvalidAddress);
161 R_UNLESS(((phys_addr + size - 1) & ~PhysicalMapAllowedMask) == 0, ResultInvalidAddress); 160 R_UNLESS(((phys_addr + size - 1) & ~PhysicalMapAllowedMask) == 0, ResultInvalidAddress);
162 161
diff --git a/src/core/hle/service/am/applets/applet_mii_edit.cpp b/src/core/hle/service/am/applets/applet_mii_edit.cpp
index d1f652c09..f8e2bac32 100644
--- a/src/core/hle/service/am/applets/applet_mii_edit.cpp
+++ b/src/core/hle/service/am/applets/applet_mii_edit.cpp
@@ -90,7 +90,7 @@ void MiiEdit::Execute() {
90 const MiiEditCharInfo char_info{ 90 const MiiEditCharInfo char_info{
91 .mii_info{applet_input_common.applet_mode == MiiEditAppletMode::EditMii 91 .mii_info{applet_input_common.applet_mode == MiiEditAppletMode::EditMii
92 ? applet_input_v4.char_info.mii_info 92 ? applet_input_v4.char_info.mii_info
93 : mii_manager.BuildDefault(0)}, 93 : mii_manager.BuildBase(Mii::Gender::Male)},
94 }; 94 };
95 95
96 MiiEditOutputForCharInfoEditing(MiiEditResult::Success, char_info); 96 MiiEditOutputForCharInfoEditing(MiiEditResult::Success, char_info);
diff --git a/src/core/hle/service/audio/audin_u.cpp b/src/core/hle/service/audio/audin_u.cpp
index 526a39130..56fee4591 100644
--- a/src/core/hle/service/audio/audin_u.cpp
+++ b/src/core/hle/service/audio/audin_u.cpp
@@ -220,7 +220,7 @@ AudInU::AudInU(Core::System& system_)
220AudInU::~AudInU() = default; 220AudInU::~AudInU() = default;
221 221
222void AudInU::ListAudioIns(HLERequestContext& ctx) { 222void AudInU::ListAudioIns(HLERequestContext& ctx) {
223 using namespace AudioCore::AudioRenderer; 223 using namespace AudioCore::Renderer;
224 224
225 LOG_DEBUG(Service_Audio, "called"); 225 LOG_DEBUG(Service_Audio, "called");
226 226
@@ -240,7 +240,7 @@ void AudInU::ListAudioIns(HLERequestContext& ctx) {
240} 240}
241 241
242void AudInU::ListAudioInsAutoFiltered(HLERequestContext& ctx) { 242void AudInU::ListAudioInsAutoFiltered(HLERequestContext& ctx) {
243 using namespace AudioCore::AudioRenderer; 243 using namespace AudioCore::Renderer;
244 244
245 LOG_DEBUG(Service_Audio, "called"); 245 LOG_DEBUG(Service_Audio, "called");
246 246
diff --git a/src/core/hle/service/audio/audout_u.cpp b/src/core/hle/service/audio/audout_u.cpp
index 23f84a29f..ca683d72c 100644
--- a/src/core/hle/service/audio/audout_u.cpp
+++ b/src/core/hle/service/audio/audout_u.cpp
@@ -228,7 +228,7 @@ AudOutU::AudOutU(Core::System& system_)
228AudOutU::~AudOutU() = default; 228AudOutU::~AudOutU() = default;
229 229
230void AudOutU::ListAudioOuts(HLERequestContext& ctx) { 230void AudOutU::ListAudioOuts(HLERequestContext& ctx) {
231 using namespace AudioCore::AudioRenderer; 231 using namespace AudioCore::Renderer;
232 232
233 std::scoped_lock l{impl->mutex}; 233 std::scoped_lock l{impl->mutex};
234 234
diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp
index b723b65c8..2f09cade5 100644
--- a/src/core/hle/service/audio/audren_u.cpp
+++ b/src/core/hle/service/audio/audren_u.cpp
@@ -26,7 +26,7 @@
26#include "core/hle/service/ipc_helpers.h" 26#include "core/hle/service/ipc_helpers.h"
27#include "core/memory.h" 27#include "core/memory.h"
28 28
29using namespace AudioCore::AudioRenderer; 29using namespace AudioCore::Renderer;
30 30
31namespace Service::Audio { 31namespace Service::Audio {
32 32
diff --git a/src/core/hle/service/audio/audren_u.h b/src/core/hle/service/audio/audren_u.h
index d8e9c8719..3d7993a16 100644
--- a/src/core/hle/service/audio/audren_u.h
+++ b/src/core/hle/service/audio/audren_u.h
@@ -28,7 +28,7 @@ private:
28 void GetAudioDeviceServiceWithRevisionInfo(HLERequestContext& ctx); 28 void GetAudioDeviceServiceWithRevisionInfo(HLERequestContext& ctx);
29 29
30 KernelHelpers::ServiceContext service_context; 30 KernelHelpers::ServiceContext service_context;
31 std::unique_ptr<AudioCore::AudioRenderer::Manager> impl; 31 std::unique_ptr<AudioCore::Renderer::Manager> impl;
32 u32 num_audio_devices{0}; 32 u32 num_audio_devices{0};
33}; 33};
34 34
diff --git a/src/core/hle/service/mii/mii_manager.cpp b/src/core/hle/service/mii/mii_manager.cpp
index 46125d473..dd632df50 100644
--- a/src/core/hle/service/mii/mii_manager.cpp
+++ b/src/core/hle/service/mii/mii_manager.cpp
@@ -18,10 +18,9 @@ namespace {
18 18
19constexpr Result ERROR_CANNOT_FIND_ENTRY{ErrorModule::Mii, 4}; 19constexpr Result ERROR_CANNOT_FIND_ENTRY{ErrorModule::Mii, 4};
20 20
21constexpr std::size_t BaseMiiCount{2};
22constexpr std::size_t DefaultMiiCount{RawData::DefaultMii.size()}; 21constexpr std::size_t DefaultMiiCount{RawData::DefaultMii.size()};
23 22
24constexpr MiiStoreData::Name DefaultMiiName{u'y', u'u', u'z', u'u'}; 23constexpr MiiStoreData::Name DefaultMiiName{u'n', u'o', u' ', u'n', u'a', u'm', u'e'};
25constexpr std::array<u8, 8> HairColorLookup{8, 1, 2, 3, 4, 5, 6, 7}; 24constexpr std::array<u8, 8> HairColorLookup{8, 1, 2, 3, 4, 5, 6, 7};
26constexpr std::array<u8, 6> EyeColorLookup{8, 9, 10, 11, 12, 13}; 25constexpr std::array<u8, 6> EyeColorLookup{8, 9, 10, 11, 12, 13};
27constexpr std::array<u8, 5> MouthColorLookup{19, 20, 21, 22, 23}; 26constexpr std::array<u8, 5> MouthColorLookup{19, 20, 21, 22, 23};
@@ -404,7 +403,7 @@ u32 MiiManager::GetCount(SourceFlag source_flag) const {
404 count += 0; 403 count += 0;
405 } 404 }
406 if ((source_flag & SourceFlag::Default) != SourceFlag::None) { 405 if ((source_flag & SourceFlag::Default) != SourceFlag::None) {
407 count += (DefaultMiiCount - BaseMiiCount); 406 count += DefaultMiiCount;
408 } 407 }
409 return static_cast<u32>(count); 408 return static_cast<u32>(count);
410} 409}
@@ -422,13 +421,18 @@ CharInfo MiiManager::BuildRandom(Age age, Gender gender, Race race) {
422 return ConvertStoreDataToInfo(BuildRandomStoreData(age, gender, race, user_id)); 421 return ConvertStoreDataToInfo(BuildRandomStoreData(age, gender, race, user_id));
423} 422}
424 423
424CharInfo MiiManager::BuildBase(Gender gender) {
425 const std::size_t index = gender == Gender::Female ? 1 : 0;
426 return ConvertStoreDataToInfo(BuildDefaultStoreData(RawData::BaseMii.at(index), user_id));
427}
428
425CharInfo MiiManager::BuildDefault(std::size_t index) { 429CharInfo MiiManager::BuildDefault(std::size_t index) {
426 return ConvertStoreDataToInfo(BuildDefaultStoreData(RawData::DefaultMii.at(index), user_id)); 430 return ConvertStoreDataToInfo(BuildDefaultStoreData(RawData::DefaultMii.at(index), user_id));
427} 431}
428 432
429CharInfo MiiManager::ConvertV3ToCharInfo(const Ver3StoreData& mii_v3) const { 433CharInfo MiiManager::ConvertV3ToCharInfo(const Ver3StoreData& mii_v3) const {
430 Service::Mii::MiiManager manager; 434 Service::Mii::MiiManager manager;
431 auto mii = manager.BuildDefault(0); 435 auto mii = manager.BuildBase(Mii::Gender::Male);
432 436
433 if (!ValidateV3Info(mii_v3)) { 437 if (!ValidateV3Info(mii_v3)) {
434 return mii; 438 return mii;
@@ -678,7 +682,7 @@ std::vector<MiiInfoElement> MiiManager::GetDefault(SourceFlag source_flag) {
678 return result; 682 return result;
679 } 683 }
680 684
681 for (std::size_t index = BaseMiiCount; index < DefaultMiiCount; index++) { 685 for (std::size_t index = 0; index < DefaultMiiCount; index++) {
682 result.emplace_back(BuildDefault(index), Source::Default); 686 result.emplace_back(BuildDefault(index), Source::Default);
683 } 687 }
684 688
diff --git a/src/core/hle/service/mii/mii_manager.h b/src/core/hle/service/mii/mii_manager.h
index 45c2be3c8..0c8295ebe 100644
--- a/src/core/hle/service/mii/mii_manager.h
+++ b/src/core/hle/service/mii/mii_manager.h
@@ -21,6 +21,7 @@ public:
21 u32 GetCount(SourceFlag source_flag) const; 21 u32 GetCount(SourceFlag source_flag) const;
22 Result UpdateLatest(CharInfo* out_info, const CharInfo& info, SourceFlag source_flag); 22 Result UpdateLatest(CharInfo* out_info, const CharInfo& info, SourceFlag source_flag);
23 CharInfo BuildRandom(Age age, Gender gender, Race race); 23 CharInfo BuildRandom(Age age, Gender gender, Race race);
24 CharInfo BuildBase(Gender gender);
24 CharInfo BuildDefault(std::size_t index); 25 CharInfo BuildDefault(std::size_t index);
25 CharInfo ConvertV3ToCharInfo(const Ver3StoreData& mii_v3) const; 26 CharInfo ConvertV3ToCharInfo(const Ver3StoreData& mii_v3) const;
26 bool ValidateV3Info(const Ver3StoreData& mii_v3) const; 27 bool ValidateV3Info(const Ver3StoreData& mii_v3) const;
diff --git a/src/core/hle/service/mii/raw_data.cpp b/src/core/hle/service/mii/raw_data.cpp
index 1442280c8..e5245b791 100644
--- a/src/core/hle/service/mii/raw_data.cpp
+++ b/src/core/hle/service/mii/raw_data.cpp
@@ -5,7 +5,7 @@
5 5
6namespace Service::Mii::RawData { 6namespace Service::Mii::RawData {
7 7
8const std::array<Service::Mii::DefaultMii, 8> DefaultMii{ 8const std::array<Service::Mii::DefaultMii, 2> BaseMii{
9 Service::Mii::DefaultMii{ 9 Service::Mii::DefaultMii{
10 .face_type = 0, 10 .face_type = 0,
11 .face_color = 0, 11 .face_color = 0,
@@ -108,6 +108,9 @@ const std::array<Service::Mii::DefaultMii, 8> DefaultMii{
108 .font_region = FontRegion::Standard, 108 .font_region = FontRegion::Standard,
109 .type = 0, 109 .type = 0,
110 }, 110 },
111};
112
113const std::array<Service::Mii::DefaultMii, 6> DefaultMii{
111 Service::Mii::DefaultMii{ 114 Service::Mii::DefaultMii{
112 .face_type = 0, 115 .face_type = 0,
113 .face_color = 4, 116 .face_color = 4,
diff --git a/src/core/hle/service/mii/raw_data.h b/src/core/hle/service/mii/raw_data.h
index c2bec68d4..cdd2337d6 100644
--- a/src/core/hle/service/mii/raw_data.h
+++ b/src/core/hle/service/mii/raw_data.h
@@ -9,7 +9,8 @@
9 9
10namespace Service::Mii::RawData { 10namespace Service::Mii::RawData {
11 11
12extern const std::array<Service::Mii::DefaultMii, 8> DefaultMii; 12extern const std::array<Service::Mii::DefaultMii, 2> BaseMii;
13extern const std::array<Service::Mii::DefaultMii, 6> DefaultMii;
13extern const std::array<Service::Mii::RandomMiiData4, 18> RandomMiiFaceline; 14extern const std::array<Service::Mii::RandomMiiData4, 18> RandomMiiFaceline;
14extern const std::array<Service::Mii::RandomMiiData3, 6> RandomMiiFacelineColor; 15extern const std::array<Service::Mii::RandomMiiData3, 6> RandomMiiFacelineColor;
15extern const std::array<Service::Mii::RandomMiiData4, 18> RandomMiiFacelineWrinkle; 16extern const std::array<Service::Mii::RandomMiiData4, 18> RandomMiiFacelineWrinkle;
diff --git a/src/core/hle/service/nfc/common/device.cpp b/src/core/hle/service/nfc/common/device.cpp
index 49446bc42..5df40f9a0 100644
--- a/src/core/hle/service/nfc/common/device.cpp
+++ b/src/core/hle/service/nfc/common/device.cpp
@@ -826,7 +826,7 @@ Result NfcDevice::SetRegisterInfoPrivate(const NFP::RegisterInfoPrivate& registe
826 } 826 }
827 827
828 Service::Mii::MiiManager manager; 828 Service::Mii::MiiManager manager;
829 const auto mii = manager.BuildDefault(0); 829 const auto mii = manager.BuildBase(Mii::Gender::Male);
830 auto& settings = tag_data.settings; 830 auto& settings = tag_data.settings;
831 831
832 if (tag_data.settings.settings.amiibo_initialized == 0) { 832 if (tag_data.settings.settings.amiibo_initialized == 0) {
@@ -1467,7 +1467,7 @@ void NfcDevice::BuildAmiiboWithoutKeys(NFP::NTAG215File& stubbed_tag_data,
1467 SetAmiiboName(settings, {'y', 'u', 'z', 'u', 'A', 'm', 'i', 'i', 'b', 'o'}); 1467 SetAmiiboName(settings, {'y', 'u', 'z', 'u', 'A', 'm', 'i', 'i', 'b', 'o'});
1468 settings.settings.font_region.Assign(0); 1468 settings.settings.font_region.Assign(0);
1469 settings.init_date = GetAmiiboDate(GetCurrentPosixTime()); 1469 settings.init_date = GetAmiiboDate(GetCurrentPosixTime());
1470 stubbed_tag_data.owner_mii = manager.BuildFromStoreData(manager.BuildDefault(0)); 1470 stubbed_tag_data.owner_mii = manager.BuildFromStoreData(manager.BuildBase(Mii::Gender::Male));
1471 1471
1472 // Admin info 1472 // Admin info
1473 settings.settings.amiibo_initialized.Assign(1); 1473 settings.settings.amiibo_initialized.Assign(1);
diff --git a/src/core/hle/service/nvdrv/core/nvmap.cpp b/src/core/hle/service/nvdrv/core/nvmap.cpp
index a51ca5444..0ca05257e 100644
--- a/src/core/hle/service/nvdrv/core/nvmap.cpp
+++ b/src/core/hle/service/nvdrv/core/nvmap.cpp
@@ -160,8 +160,8 @@ u32 NvMap::PinHandle(NvMap::Handle::Id handle) {
160 u32 address{}; 160 u32 address{};
161 auto& smmu_allocator = host1x.Allocator(); 161 auto& smmu_allocator = host1x.Allocator();
162 auto& smmu_memory_manager = host1x.MemoryManager(); 162 auto& smmu_memory_manager = host1x.MemoryManager();
163 while (!(address = 163 while ((address = smmu_allocator.Allocate(
164 smmu_allocator.Allocate(static_cast<u32>(handle_description->aligned_size)))) { 164 static_cast<u32>(handle_description->aligned_size))) == 0) {
165 // Free handles until the allocation succeeds 165 // Free handles until the allocation succeeds
166 std::scoped_lock queueLock(unmap_queue_lock); 166 std::scoped_lock queueLock(unmap_queue_lock);
167 if (auto freeHandleDesc{unmap_queue.front()}) { 167 if (auto freeHandleDesc{unmap_queue.front()}) {
diff --git a/src/core/hle/service/ssl/ssl_backend_schannel.cpp b/src/core/hle/service/ssl/ssl_backend_schannel.cpp
index d834a0c1f..212057cfc 100644
--- a/src/core/hle/service/ssl/ssl_backend_schannel.cpp
+++ b/src/core/hle/service/ssl/ssl_backend_schannel.cpp
@@ -477,7 +477,8 @@ public:
477 return ResultInternalError; 477 return ResultInternalError;
478 } 478 }
479 PCCERT_CONTEXT some_cert = nullptr; 479 PCCERT_CONTEXT some_cert = nullptr;
480 while ((some_cert = CertEnumCertificatesInStore(returned_cert->hCertStore, some_cert))) { 480 while ((some_cert = CertEnumCertificatesInStore(returned_cert->hCertStore, some_cert)) !=
481 nullptr) {
481 out_certs->emplace_back(static_cast<u8*>(some_cert->pbCertEncoded), 482 out_certs->emplace_back(static_cast<u8*>(some_cert->pbCertEncoded),
482 static_cast<u8*>(some_cert->pbCertEncoded) + 483 static_cast<u8*>(some_cert->pbCertEncoded) +
483 some_cert->cbCertEncoded); 484 some_cert->cbCertEncoded);
diff --git a/src/dedicated_room/yuzu_room.cpp b/src/dedicated_room/yuzu_room.cpp
index d707dabe2..93038f161 100644
--- a/src/dedicated_room/yuzu_room.cpp
+++ b/src/dedicated_room/yuzu_room.cpp
@@ -368,9 +368,9 @@ int main(int argc, char** argv) {
368 if (auto room = network.GetRoom().lock()) { 368 if (auto room = network.GetRoom().lock()) {
369 AnnounceMultiplayerRoom::GameInfo preferred_game_info{.name = preferred_game, 369 AnnounceMultiplayerRoom::GameInfo preferred_game_info{.name = preferred_game,
370 .id = preferred_game_id}; 370 .id = preferred_game_id};
371 if (!room->Create(room_name, room_description, bind_address, port, password, max_members, 371 if (!room->Create(room_name, room_description, bind_address, static_cast<u16>(port),
372 username, preferred_game_info, std::move(verify_backend), ban_list, 372 password, max_members, username, preferred_game_info,
373 enable_yuzu_mods)) { 373 std::move(verify_backend), ban_list, enable_yuzu_mods)) {
374 LOG_INFO(Network, "Failed to create room: "); 374 LOG_INFO(Network, "Failed to create room: ");
375 return -1; 375 return -1;
376 } 376 }
diff --git a/src/input_common/CMakeLists.txt b/src/input_common/CMakeLists.txt
index 322c29065..5c127c8ef 100644
--- a/src/input_common/CMakeLists.txt
+++ b/src/input_common/CMakeLists.txt
@@ -37,8 +37,6 @@ add_library(input_common STATIC
37 37
38if (MSVC) 38if (MSVC)
39 target_compile_options(input_common PRIVATE 39 target_compile_options(input_common PRIVATE
40 /W4
41
42 /we4242 # 'identifier': conversion from 'type1' to 'type2', possible loss of data 40 /we4242 # 'identifier': conversion from 'type1' to 'type2', possible loss of data
43 /we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data 41 /we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data
44 /we4800 # Implicit conversion from 'type' to bool. Possible information loss 42 /we4800 # Implicit conversion from 'type' to bool. Possible information loss
diff --git a/src/network/room.cpp b/src/network/room.cpp
index e456ea09c..d87db37de 100644
--- a/src/network/room.cpp
+++ b/src/network/room.cpp
@@ -805,7 +805,7 @@ IPv4Address Room::RoomImpl::GenerateFakeIPAddress() {
805 std::uniform_int_distribution<> dis(0x01, 0xFE); // Random byte between 1 and 0xFE 805 std::uniform_int_distribution<> dis(0x01, 0xFE); // Random byte between 1 and 0xFE
806 do { 806 do {
807 for (std::size_t i = 2; i < result_ip.size(); ++i) { 807 for (std::size_t i = 2; i < result_ip.size(); ++i) {
808 result_ip[i] = dis(random_gen); 808 result_ip[i] = static_cast<u8>(dis(random_gen));
809 } 809 }
810 } while (!IsValidFakeIPAddress(result_ip)); 810 } while (!IsValidFakeIPAddress(result_ip));
811 811
diff --git a/src/shader_recompiler/CMakeLists.txt b/src/shader_recompiler/CMakeLists.txt
index 07e75f9d8..83b763447 100644
--- a/src/shader_recompiler/CMakeLists.txt
+++ b/src/shader_recompiler/CMakeLists.txt
@@ -245,8 +245,6 @@ target_link_libraries(shader_recompiler PUBLIC common fmt::fmt sirit)
245 245
246if (MSVC) 246if (MSVC)
247 target_compile_options(shader_recompiler PRIVATE 247 target_compile_options(shader_recompiler PRIVATE
248 /W4
249
250 /we4242 # 'identifier': conversion from 'type1' to 'type2', possible loss of data 248 /we4242 # 'identifier': conversion from 'type1' to 'type2', possible loss of data
251 /we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data 249 /we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data
252 /we4800 # Implicit conversion from 'type' to bool. Possible information loss 250 /we4800 # Implicit conversion from 'type' to bool. Possible information loss
diff --git a/src/tests/common/ring_buffer.cpp b/src/tests/common/ring_buffer.cpp
index e85f9977b..b6e3bc875 100644
--- a/src/tests/common/ring_buffer.cpp
+++ b/src/tests/common/ring_buffer.cpp
@@ -55,7 +55,7 @@ TEST_CASE("RingBuffer: Basic Tests", "[common]") {
55 // Pushing more values than space available should partially succeed. 55 // Pushing more values than space available should partially succeed.
56 { 56 {
57 std::vector<char> to_push(6); 57 std::vector<char> to_push(6);
58 std::iota(to_push.begin(), to_push.end(), 88); 58 std::iota(to_push.begin(), to_push.end(), static_cast<char>(88));
59 const std::size_t count = buf.Push(to_push); 59 const std::size_t count = buf.Push(to_push);
60 REQUIRE(count == 3U); 60 REQUIRE(count == 3U);
61 } 61 }
diff --git a/src/video_core/renderer_vulkan/renderer_vulkan.cpp b/src/video_core/renderer_vulkan/renderer_vulkan.cpp
index 454bb66a4..c4c30d807 100644
--- a/src/video_core/renderer_vulkan/renderer_vulkan.cpp
+++ b/src/video_core/renderer_vulkan/renderer_vulkan.cpp
@@ -66,21 +66,6 @@ std::string BuildCommaSeparatedExtensions(
66 return fmt::format("{}", fmt::join(available_extensions, ",")); 66 return fmt::format("{}", fmt::join(available_extensions, ","));
67} 67}
68 68
69DebugCallback MakeDebugCallback(const vk::Instance& instance, const vk::InstanceDispatch& dld) {
70 if (!Settings::values.renderer_debug) {
71 return DebugCallback{};
72 }
73 const std::optional properties = vk::EnumerateInstanceExtensionProperties(dld);
74 const auto it = std::ranges::find_if(*properties, [](const auto& prop) {
75 return std::strcmp(VK_EXT_DEBUG_UTILS_EXTENSION_NAME, prop.extensionName) == 0;
76 });
77 if (it != properties->end()) {
78 return CreateDebugUtilsCallback(instance);
79 } else {
80 return CreateDebugReportCallback(instance);
81 }
82}
83
84} // Anonymous namespace 69} // Anonymous namespace
85 70
86Device CreateDevice(const vk::Instance& instance, const vk::InstanceDispatch& dld, 71Device CreateDevice(const vk::Instance& instance, const vk::InstanceDispatch& dld,
@@ -103,7 +88,8 @@ RendererVulkan::RendererVulkan(Core::TelemetrySession& telemetry_session_,
103 cpu_memory(cpu_memory_), gpu(gpu_), library(OpenLibrary(context.get())), 88 cpu_memory(cpu_memory_), gpu(gpu_), library(OpenLibrary(context.get())),
104 instance(CreateInstance(*library, dld, VK_API_VERSION_1_1, render_window.GetWindowInfo().type, 89 instance(CreateInstance(*library, dld, VK_API_VERSION_1_1, render_window.GetWindowInfo().type,
105 Settings::values.renderer_debug.GetValue())), 90 Settings::values.renderer_debug.GetValue())),
106 debug_callback(MakeDebugCallback(instance, dld)), 91 debug_messenger(Settings::values.renderer_debug ? CreateDebugUtilsCallback(instance)
92 : vk::DebugUtilsMessenger{}),
107 surface(CreateSurface(instance, render_window.GetWindowInfo())), 93 surface(CreateSurface(instance, render_window.GetWindowInfo())),
108 device(CreateDevice(instance, dld, *surface)), memory_allocator(device), state_tracker(), 94 device(CreateDevice(instance, dld, *surface)), memory_allocator(device), state_tracker(),
109 scheduler(device, state_tracker), 95 scheduler(device, state_tracker),
diff --git a/src/video_core/renderer_vulkan/renderer_vulkan.h b/src/video_core/renderer_vulkan/renderer_vulkan.h
index 89e98425e..590bc1c64 100644
--- a/src/video_core/renderer_vulkan/renderer_vulkan.h
+++ b/src/video_core/renderer_vulkan/renderer_vulkan.h
@@ -35,8 +35,6 @@ class GPU;
35 35
36namespace Vulkan { 36namespace Vulkan {
37 37
38using DebugCallback = std::variant<vk::DebugUtilsMessenger, vk::DebugReportCallback>;
39
40Device CreateDevice(const vk::Instance& instance, const vk::InstanceDispatch& dld, 38Device CreateDevice(const vk::Instance& instance, const vk::InstanceDispatch& dld,
41 VkSurfaceKHR surface); 39 VkSurfaceKHR surface);
42 40
@@ -75,7 +73,7 @@ private:
75 vk::InstanceDispatch dld; 73 vk::InstanceDispatch dld;
76 74
77 vk::Instance instance; 75 vk::Instance instance;
78 DebugCallback debug_callback; 76 vk::DebugUtilsMessenger debug_messenger;
79 vk::SurfaceKHR surface; 77 vk::SurfaceKHR surface;
80 78
81 ScreenInfo screen_info; 79 ScreenInfo screen_info;
diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp
index 60a6ac651..e15865d16 100644
--- a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp
@@ -529,17 +529,20 @@ void BufferCacheRuntime::BindVertexBuffers(VideoCommon::HostBindings<Buffer>& bi
529 buffer_handles.push_back(handle); 529 buffer_handles.push_back(handle);
530 } 530 }
531 if (device.IsExtExtendedDynamicStateSupported()) { 531 if (device.IsExtExtendedDynamicStateSupported()) {
532 scheduler.Record([bindings_ = std::move(bindings), 532 scheduler.Record([this, bindings_ = std::move(bindings),
533 buffer_handles_ = std::move(buffer_handles)](vk::CommandBuffer cmdbuf) { 533 buffer_handles_ = std::move(buffer_handles)](vk::CommandBuffer cmdbuf) {
534 cmdbuf.BindVertexBuffers2EXT(bindings_.min_index, 534 cmdbuf.BindVertexBuffers2EXT(bindings_.min_index,
535 bindings_.max_index - bindings_.min_index, 535 std::min(bindings_.max_index - bindings_.min_index,
536 device.GetMaxVertexInputBindings()),
536 buffer_handles_.data(), bindings_.offsets.data(), 537 buffer_handles_.data(), bindings_.offsets.data(),
537 bindings_.sizes.data(), bindings_.strides.data()); 538 bindings_.sizes.data(), bindings_.strides.data());
538 }); 539 });
539 } else { 540 } else {
540 scheduler.Record([bindings_ = std::move(bindings), 541 scheduler.Record([this, bindings_ = std::move(bindings),
541 buffer_handles_ = std::move(buffer_handles)](vk::CommandBuffer cmdbuf) { 542 buffer_handles_ = std::move(buffer_handles)](vk::CommandBuffer cmdbuf) {
542 cmdbuf.BindVertexBuffers(bindings_.min_index, bindings_.max_index - bindings_.min_index, 543 cmdbuf.BindVertexBuffers(bindings_.min_index,
544 std::min(bindings_.max_index - bindings_.min_index,
545 device.GetMaxVertexInputBindings()),
543 buffer_handles_.data(), bindings_.offsets.data()); 546 buffer_handles_.data(), bindings_.offsets.data());
544 }); 547 });
545 } 548 }
diff --git a/src/video_core/vulkan_common/vulkan_debug_callback.cpp b/src/video_core/vulkan_common/vulkan_debug_callback.cpp
index 67e8065a4..448df2d3a 100644
--- a/src/video_core/vulkan_common/vulkan_debug_callback.cpp
+++ b/src/video_core/vulkan_common/vulkan_debug_callback.cpp
@@ -63,22 +63,6 @@ VkBool32 DebugUtilCallback(VkDebugUtilsMessageSeverityFlagBitsEXT severity,
63 return VK_FALSE; 63 return VK_FALSE;
64} 64}
65 65
66VkBool32 DebugReportCallback(VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType,
67 uint64_t object, size_t location, int32_t messageCode,
68 const char* pLayerPrefix, const char* pMessage, void* pUserData) {
69 const VkDebugReportFlagBitsEXT severity = static_cast<VkDebugReportFlagBitsEXT>(flags);
70 const std::string_view message{pMessage};
71 if (severity & VK_DEBUG_REPORT_ERROR_BIT_EXT) {
72 LOG_CRITICAL(Render_Vulkan, "{}", message);
73 } else if (severity & VK_DEBUG_REPORT_WARNING_BIT_EXT) {
74 LOG_WARNING(Render_Vulkan, "{}", message);
75 } else if (severity & VK_DEBUG_REPORT_INFORMATION_BIT_EXT) {
76 LOG_INFO(Render_Vulkan, "{}", message);
77 } else if (severity & VK_DEBUG_REPORT_DEBUG_BIT_EXT) {
78 LOG_DEBUG(Render_Vulkan, "{}", message);
79 }
80 return VK_FALSE;
81}
82} // Anonymous namespace 66} // Anonymous namespace
83 67
84vk::DebugUtilsMessenger CreateDebugUtilsCallback(const vk::Instance& instance) { 68vk::DebugUtilsMessenger CreateDebugUtilsCallback(const vk::Instance& instance) {
@@ -98,15 +82,4 @@ vk::DebugUtilsMessenger CreateDebugUtilsCallback(const vk::Instance& instance) {
98 }); 82 });
99} 83}
100 84
101vk::DebugReportCallback CreateDebugReportCallback(const vk::Instance& instance) {
102 return instance.CreateDebugReportCallback({
103 .sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT,
104 .pNext = nullptr,
105 .flags = VK_DEBUG_REPORT_DEBUG_BIT_EXT | VK_DEBUG_REPORT_INFORMATION_BIT_EXT |
106 VK_DEBUG_REPORT_ERROR_BIT_EXT | VK_DEBUG_REPORT_WARNING_BIT_EXT,
107 .pfnCallback = DebugReportCallback,
108 .pUserData = nullptr,
109 });
110}
111
112} // namespace Vulkan 85} // namespace Vulkan
diff --git a/src/video_core/vulkan_common/vulkan_debug_callback.h b/src/video_core/vulkan_common/vulkan_debug_callback.h
index a8af7b406..5e940782f 100644
--- a/src/video_core/vulkan_common/vulkan_debug_callback.h
+++ b/src/video_core/vulkan_common/vulkan_debug_callback.h
@@ -9,6 +9,4 @@ namespace Vulkan {
9 9
10vk::DebugUtilsMessenger CreateDebugUtilsCallback(const vk::Instance& instance); 10vk::DebugUtilsMessenger CreateDebugUtilsCallback(const vk::Instance& instance);
11 11
12vk::DebugReportCallback CreateDebugReportCallback(const vk::Instance& instance);
13
14} // namespace Vulkan 12} // namespace Vulkan
diff --git a/src/video_core/vulkan_common/vulkan_instance.cpp b/src/video_core/vulkan_common/vulkan_instance.cpp
index bc16145be..180657a75 100644
--- a/src/video_core/vulkan_common/vulkan_instance.cpp
+++ b/src/video_core/vulkan_common/vulkan_instance.cpp
@@ -76,11 +76,9 @@ namespace {
76 extensions.push_back(VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME); 76 extensions.push_back(VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME);
77 } 77 }
78#endif 78#endif
79 if (enable_validation) { 79 if (enable_validation &&
80 const bool debug_utils = 80 AreExtensionsSupported(dld, std::array{VK_EXT_DEBUG_UTILS_EXTENSION_NAME})) {
81 AreExtensionsSupported(dld, std::array{VK_EXT_DEBUG_UTILS_EXTENSION_NAME}); 81 extensions.push_back(VK_EXT_DEBUG_UTILS_EXTENSION_NAME);
82 extensions.push_back(debug_utils ? VK_EXT_DEBUG_UTILS_EXTENSION_NAME
83 : VK_EXT_DEBUG_REPORT_EXTENSION_NAME);
84 } 82 }
85 return extensions; 83 return extensions;
86} 84}
diff --git a/src/yuzu/configuration/shared_widget.cpp b/src/yuzu/configuration/shared_widget.cpp
index 7721e58f9..d63093985 100644
--- a/src/yuzu/configuration/shared_widget.cpp
+++ b/src/yuzu/configuration/shared_widget.cpp
@@ -194,7 +194,7 @@ QWidget* Widget::CreateRadioGroup(std::function<std::string()>& serializer,
194 return group; 194 return group;
195 } 195 }
196 196
197 const auto get_selected = [=]() -> u32 { 197 const auto get_selected = [=]() -> int {
198 for (const auto& [id, button] : radio_buttons) { 198 for (const auto& [id, button] : radio_buttons) {
199 if (button->isChecked()) { 199 if (button->isChecked()) {
200 return id; 200 return id;
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 0bef1ebfe..21df742cb 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -2277,40 +2277,62 @@ void GMainWindow::OnTransferableShaderCacheOpenFile(u64 program_id) {
2277 QDesktopServices::openUrl(QUrl::fromLocalFile(qt_shader_cache_path)); 2277 QDesktopServices::openUrl(QUrl::fromLocalFile(qt_shader_cache_path));
2278} 2278}
2279 2279
2280static std::size_t CalculateRomFSEntrySize(const FileSys::VirtualDir& dir, bool full) { 2280static bool RomFSRawCopy(size_t total_size, size_t& read_size, QProgressDialog& dialog,
2281 std::size_t out = 0; 2281 const FileSys::VirtualDir& src, const FileSys::VirtualDir& dest,
2282 2282 bool full) {
2283 for (const auto& subdir : dir->GetSubdirectories()) {
2284 out += 1 + CalculateRomFSEntrySize(subdir, full);
2285 }
2286
2287 return out + (full ? dir->GetFiles().size() : 0);
2288}
2289
2290static bool RomFSRawCopy(QProgressDialog& dialog, const FileSys::VirtualDir& src,
2291 const FileSys::VirtualDir& dest, std::size_t block_size, bool full) {
2292 if (src == nullptr || dest == nullptr || !src->IsReadable() || !dest->IsWritable()) 2283 if (src == nullptr || dest == nullptr || !src->IsReadable() || !dest->IsWritable())
2293 return false; 2284 return false;
2294 if (dialog.wasCanceled()) 2285 if (dialog.wasCanceled())
2295 return false; 2286 return false;
2296 2287
2288 std::vector<u8> buffer(CopyBufferSize);
2289 auto last_timestamp = std::chrono::steady_clock::now();
2290
2291 const auto QtRawCopy = [&](const FileSys::VirtualFile& src_file,
2292 const FileSys::VirtualFile& dest_file) {
2293 if (src_file == nullptr || dest_file == nullptr) {
2294 return false;
2295 }
2296 if (!dest_file->Resize(src_file->GetSize())) {
2297 return false;
2298 }
2299
2300 for (std::size_t i = 0; i < src_file->GetSize(); i += buffer.size()) {
2301 if (dialog.wasCanceled()) {
2302 dest_file->Resize(0);
2303 return false;
2304 }
2305
2306 using namespace std::literals::chrono_literals;
2307 const auto new_timestamp = std::chrono::steady_clock::now();
2308
2309 if ((new_timestamp - last_timestamp) > 33ms) {
2310 last_timestamp = new_timestamp;
2311 dialog.setValue(
2312 static_cast<int>(std::min(read_size, total_size) * 100 / total_size));
2313 QCoreApplication::processEvents();
2314 }
2315
2316 const auto read = src_file->Read(buffer.data(), buffer.size(), i);
2317 dest_file->Write(buffer.data(), read, i);
2318
2319 read_size += read;
2320 }
2321
2322 return true;
2323 };
2324
2297 if (full) { 2325 if (full) {
2298 for (const auto& file : src->GetFiles()) { 2326 for (const auto& file : src->GetFiles()) {
2299 const auto out = VfsDirectoryCreateFileWrapper(dest, file->GetName()); 2327 const auto out = VfsDirectoryCreateFileWrapper(dest, file->GetName());
2300 if (!FileSys::VfsRawCopy(file, out, block_size)) 2328 if (!QtRawCopy(file, out))
2301 return false;
2302 dialog.setValue(dialog.value() + 1);
2303 if (dialog.wasCanceled())
2304 return false; 2329 return false;
2305 } 2330 }
2306 } 2331 }
2307 2332
2308 for (const auto& dir : src->GetSubdirectories()) { 2333 for (const auto& dir : src->GetSubdirectories()) {
2309 const auto out = dest->CreateSubdirectory(dir->GetName()); 2334 const auto out = dest->CreateSubdirectory(dir->GetName());
2310 if (!RomFSRawCopy(dialog, dir, out, block_size, full)) 2335 if (!RomFSRawCopy(total_size, read_size, dialog, dir, out, full))
2311 return false;
2312 dialog.setValue(dialog.value() + 1);
2313 if (dialog.wasCanceled())
2314 return false; 2336 return false;
2315 } 2337 }
2316 2338
@@ -2655,10 +2677,9 @@ void GMainWindow::OnGameListDumpRomFS(u64 program_id, const std::string& game_pa
2655 } 2677 }
2656 2678
2657 const auto full = res == selections.constFirst(); 2679 const auto full = res == selections.constFirst();
2658 const auto entry_size = CalculateRomFSEntrySize(extracted, full);
2659 2680
2660 // The minimum required space is the size of the extracted RomFS + 1 GiB 2681 // The expected required space is the size of the RomFS + 1 GiB
2661 const auto minimum_free_space = extracted->GetSize() + 0x40000000; 2682 const auto minimum_free_space = romfs->GetSize() + 0x40000000;
2662 2683
2663 if (full && Common::FS::GetFreeSpaceSize(path) < minimum_free_space) { 2684 if (full && Common::FS::GetFreeSpaceSize(path) < minimum_free_space) {
2664 QMessageBox::warning(this, tr("RomFS Extraction Failed!"), 2685 QMessageBox::warning(this, tr("RomFS Extraction Failed!"),
@@ -2669,12 +2690,15 @@ void GMainWindow::OnGameListDumpRomFS(u64 program_id, const std::string& game_pa
2669 return; 2690 return;
2670 } 2691 }
2671 2692
2672 QProgressDialog progress(tr("Extracting RomFS..."), tr("Cancel"), 0, 2693 QProgressDialog progress(tr("Extracting RomFS..."), tr("Cancel"), 0, 100, this);
2673 static_cast<s32>(entry_size), this);
2674 progress.setWindowModality(Qt::WindowModal); 2694 progress.setWindowModality(Qt::WindowModal);
2675 progress.setMinimumDuration(100); 2695 progress.setMinimumDuration(100);
2696 progress.setAutoClose(false);
2697 progress.setAutoReset(false);
2698
2699 size_t read_size = 0;
2676 2700
2677 if (RomFSRawCopy(progress, extracted, out, 0x400000, full)) { 2701 if (RomFSRawCopy(romfs->GetSize(), read_size, progress, extracted, out, full)) {
2678 progress.close(); 2702 progress.close();
2679 QMessageBox::information(this, tr("RomFS Extraction Succeeded!"), 2703 QMessageBox::information(this, tr("RomFS Extraction Succeeded!"),
2680 tr("The operation completed successfully.")); 2704 tr("The operation completed successfully."));
diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp
index d0433ffc6..c1695cc6e 100644
--- a/src/yuzu_cmd/yuzu.cpp
+++ b/src/yuzu_cmd/yuzu.cpp
@@ -265,7 +265,7 @@ int main(int argc, char** argv) {
265 password = match[2]; 265 password = match[2];
266 address = match[3]; 266 address = match[3];
267 if (!match[4].str().empty()) 267 if (!match[4].str().empty())
268 port = std::stoi(match[4]); 268 port = static_cast<u16>(std::stoi(match[4]));
269 std::regex nickname_re("^[a-zA-Z0-9._\\- ]+$"); 269 std::regex nickname_re("^[a-zA-Z0-9._\\- ]+$");
270 if (!std::regex_match(nickname, nickname_re)) { 270 if (!std::regex_match(nickname, nickname_re)) {
271 std::cout 271 std::cout