From 1449ed9dbf7d968d9db2e5bc04b97c4950086a47 Mon Sep 17 00:00:00 2001 From: Morph1984 <39850852+Morph1984@users.noreply.github.com> Date: Tue, 3 Sep 2019 23:13:32 -0400 Subject: [PATCH 1/2] audren_u: Stub IAudioDevice::QueryAudioDeviceInputEvent --- src/core/hle/service/audio/audren_u.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp index 5b0b7f17e..8e0cd96be 100644 --- a/src/core/hle/service/audio/audren_u.cpp +++ b/src/core/hle/service/audio/audren_u.cpp @@ -173,7 +173,7 @@ public: {7, &IAudioDevice::SetAudioDeviceOutputVolume, "SetAudioDeviceOutputVolumeAuto"}, {8, nullptr, "GetAudioDeviceOutputVolumeAuto"}, {10, &IAudioDevice::GetActiveAudioDeviceName, "GetActiveAudioDeviceNameAuto"}, - {11, nullptr, "QueryAudioDeviceInputEvent"}, + {11, &IAudioDevice::QueryAudioDeviceInputEvent, "QueryAudioDeviceInputEvent"}, {12, &IAudioDevice::QueryAudioDeviceOutputEvent, "QueryAudioDeviceOutputEvent"}, {13, nullptr, "GetAudioSystemMasterVolumeSetting"}, }; @@ -183,6 +183,10 @@ public: buffer_event = Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::Automatic, "IAudioOutBufferReleasedEvent"); + // Should be similar to audio_output_device_switch_event + audio_input_device_switch_event = Kernel::WritableEvent::CreateEventPair( + kernel, Kernel::ResetType::Automatic, "IAudioDevice:AudioInputDeviceSwitchedEvent"); + // Should only be signalled when an audio output device has been changed, example: speaker // to headset audio_output_device_switch_event = Kernel::WritableEvent::CreateEventPair( @@ -279,6 +283,15 @@ private: rb.Push(1); } + // Should be similar to QueryAudioDeviceOutputEvent + void QueryAudioDeviceInputEvent(Kernel::HLERequestContext& ctx) { + LOG_WARNING(Service_Audio, "(STUBBED) called"); + + IPC::ResponseBuilder rb{ctx, 2, 1}; + rb.Push(RESULT_SUCCESS); + rb.PushCopyObjects(audio_input_device_switch_event.readable); + } + void QueryAudioDeviceOutputEvent(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_Audio, "called"); From 84815fa879aecbec7311385009649fdb721eba45 Mon Sep 17 00:00:00 2001 From: Morph1984 <39850852+Morph1984@users.noreply.github.com> Date: Tue, 3 Sep 2019 23:50:56 -0400 Subject: [PATCH 2/2] Add Kernel::EventPair audio_input_device_switch_event; --- src/core/hle/service/audio/audren_u.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp index 8e0cd96be..96f180613 100644 --- a/src/core/hle/service/audio/audren_u.cpp +++ b/src/core/hle/service/audio/audren_u.cpp @@ -302,6 +302,7 @@ private: u32_le revision = 0; Kernel::EventPair buffer_event; + Kernel::EventPair audio_input_device_switch_event; Kernel::EventPair audio_output_device_switch_event; }; // namespace Audio