service/audio: implement Unknown5000 and add debug commands

- Add Unknown5000 implementation to create duplicate controller interface
- Add new debug-related command handlers:
  * OverrideDefaultTargetForDebug (50001)
  * SetForceOverrideExternalDeviceNameForDebug (50003)
  * ClearForceOverrideExternalDeviceNameForDebug (50004)
- Add proper debug logging for interface creation
- Update header with new function declaration
- Fix missing commas in function registration array

These changes improve the audio controller implementation by
adding support for interface duplication and debug override
functionality. The implementation maintains proper interface
lifetime management using SharedFrom.
This commit is contained in:
Zephyron 2025-02-08 20:35:38 +10:00
parent 92b70b31e0
commit 268d322d7f
No known key found for this signature in database
2 changed files with 14 additions and 0 deletions

View file

@ -57,6 +57,7 @@ IAudioController::IAudioController(Core::System& system_)
{40, nullptr, "GetSystemInformationForDebug"},
{41, nullptr, "SetVolumeButtonLongPressTime"},
{42, nullptr, "SetNativeVolumeForDebug"},
{5000, D<&IAudioController::Unknown5000>, "Unknown5000"},
{10000, nullptr, "NotifyAudioOutputTargetForPlayReport"},
{10001, nullptr, "NotifyAudioOutputChannelCountForPlayReport"},
{10002, nullptr, "NotifyUnsupportedUsbOutputDeviceAttachedForPlayReport"},
@ -68,6 +69,9 @@ IAudioController::IAudioController(Core::System& system_)
{10105, nullptr, "BindAudioOutputChannelCountUpdateEventForPlayReport"},
{10106, nullptr, "GetDefaultAudioOutputTargetForPlayReport"},
{50000, nullptr, "SetAnalogInputBoostGainForPrototyping"},
{50001, nullptr, "OverrideDefaultTargetForDebug"},
{50003, nullptr, "SetForceOverrideExternalDeviceNameForDebug"},
{50004, nullptr, "ClearForceOverrideExternalDeviceNameForDebug"}
};
// clang-format on
@ -176,4 +180,13 @@ Result IAudioController::AcquireTargetNotification(
R_SUCCEED();
}
Result IAudioController::Unknown5000(Out<SharedPointer<IAudioController>> out_audio_controller) {
LOG_DEBUG(Audio, "Creating duplicate audio controller interface");
// Return a new reference to this controller instance
*out_audio_controller = SharedFrom(this);
R_SUCCEED();
}
} // namespace Service::Audio

View file

@ -49,6 +49,7 @@ private:
Result SetSpeakerAutoMuteEnabled(bool is_speaker_auto_mute_enabled);
Result IsSpeakerAutoMuteEnabled(Out<bool> out_is_speaker_auto_mute_enabled);
Result AcquireTargetNotification(OutCopyHandle<Kernel::KReadableEvent> out_notification_event);
Result Unknown5000(Out<SharedPointer<IAudioController>> out_audio_controller);
KernelHelpers::ServiceContext service_context;