[svc, audio] Implement REV13 audio renderer support and stub IAudioDevice commands up to 18.0.0+

Fully implements support for the AudioRenderer REV13 interface.
  - Adds SplitterDestinationInParameter with `reset_prev_volume` support.
  - Updates SplitterContext to parse REV13 destination parameters.
  - Handles per-destination volume ramp resets.
  - Verified against Ryujinx commit:
    a2c0035013

Stubs new commands in IAudioDevice introduced in 17.0.0+ and 18.0.0+:
  - Command 15: AcquireAudioInputDeviceNotification()
  - Command 16: ReleaseAudioInputDeviceNotification()
  - Command 17: AcquireAudioOutputDeviceNotification()
  - Command 18: ReleaseAudioOutputDeviceNotification()
  - Command 19: SetAudioDeviceOutputVolumeAutoTuneEnabled()
  - Command 20: IsAudioDeviceOutputVolumeAutoTuneEnabled()
  These were referenced directly from Ryujinx too.

Should fix audio reset issues in The Legend of Zelda: Echoes of Wisdom.
Note: due to minimal documentation on the audio services some guess work has been made and it may not be 100% accuracte to the switch's services.
This commit is contained in:
JPikachu 2025-07-22 15:01:02 +01:00 committed by crueter
parent 1f34d836b4
commit 09deed5048
10 changed files with 167 additions and 11 deletions

View file

@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@ -688,6 +691,7 @@ u64 System::GenerateCommand(std::span<u8> in_command_buffer,
sink_context, splitter_context, perf_manager};
voice_context.SortInfo();
command_generator.GenerateVoiceCommands();
const auto start_estimated_time{drop_voice_param *
@ -697,6 +701,17 @@ u64 System::GenerateCommand(std::span<u8> in_command_buffer,
command_generator.GenerateFinalMixCommands();
command_generator.GenerateSinkCommands();
// REV13: Reset previous volumes for any splitter destinations requesting it
for (auto& destination : splitter_context.GetDestinations()) {
if (destination.ShouldResetPrevVolume()) {
for (auto& volume : destination.GetMixVolumePrev()) {
volume = 0.0f;
}
destination.ClearResetPrevVolume();
}
}
if (drop_voice) {
f32 time_limit_percent{70.0f};
if (render_context.behavior->IsAudioRendererProcessingTimeLimit80PercentSupported()) {