summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar David Marcec2019-07-01 18:05:44 +1000
committerGravatar David Marcec2019-07-01 18:05:44 +1000
commit965608e6d16adabd6193605b889e239f4329ac16 (patch)
treed617f624ac40a94f7204cf4ad15162ce9eb3a517 /src
parentMerge pull request #2583 from FernandoS27/core-timing-safe (diff)
downloadyuzu-965608e6d16adabd6193605b889e239f4329ac16.tar.gz
yuzu-965608e6d16adabd6193605b889e239f4329ac16.tar.xz
yuzu-965608e6d16adabd6193605b889e239f4329ac16.zip
IAudioDevice::QueryAudioDeviceOutputEvent
The event should only be signaled when an output audio device gets changed. Example, Speaker to USB headset. We don't identify different devices internally yet so there's no need to signal the event yet.
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/audio/audren_u.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp
index 75db0c2dc..3711e1ea1 100644
--- a/src/core/hle/service/audio/audren_u.cpp
+++ b/src/core/hle/service/audio/audren_u.cpp
@@ -167,13 +167,12 @@ public:
167 {3, &IAudioDevice::GetActiveAudioDeviceName, "GetActiveAudioDeviceName"}, 167 {3, &IAudioDevice::GetActiveAudioDeviceName, "GetActiveAudioDeviceName"},
168 {4, &IAudioDevice::QueryAudioDeviceSystemEvent, "QueryAudioDeviceSystemEvent"}, 168 {4, &IAudioDevice::QueryAudioDeviceSystemEvent, "QueryAudioDeviceSystemEvent"},
169 {5, &IAudioDevice::GetActiveChannelCount, "GetActiveChannelCount"}, 169 {5, &IAudioDevice::GetActiveChannelCount, "GetActiveChannelCount"},
170 {6, &IAudioDevice::ListAudioDeviceName, 170 {6, &IAudioDevice::ListAudioDeviceName, "ListAudioDeviceNameAuto"},
171 "ListAudioDeviceNameAuto"}, // TODO(ogniK): Confirm if autos are identical to non auto
172 {7, &IAudioDevice::SetAudioDeviceOutputVolume, "SetAudioDeviceOutputVolumeAuto"}, 171 {7, &IAudioDevice::SetAudioDeviceOutputVolume, "SetAudioDeviceOutputVolumeAuto"},
173 {8, nullptr, "GetAudioDeviceOutputVolumeAuto"}, 172 {8, nullptr, "GetAudioDeviceOutputVolumeAuto"},
174 {10, &IAudioDevice::GetActiveAudioDeviceName, "GetActiveAudioDeviceNameAuto"}, 173 {10, &IAudioDevice::GetActiveAudioDeviceName, "GetActiveAudioDeviceNameAuto"},
175 {11, nullptr, "QueryAudioDeviceInputEvent"}, 174 {11, nullptr, "QueryAudioDeviceInputEvent"},
176 {12, nullptr, "QueryAudioDeviceOutputEvent"}, 175 {12, &IAudioDevice::QueryAudioDeviceOutputEvent, "QueryAudioDeviceOutputEvent"},
177 {13, nullptr, "GetAudioSystemMasterVolumeSetting"}, 176 {13, nullptr, "GetAudioSystemMasterVolumeSetting"},
178 }; 177 };
179 RegisterHandlers(functions); 178 RegisterHandlers(functions);
@@ -181,6 +180,11 @@ public:
181 auto& kernel = Core::System::GetInstance().Kernel(); 180 auto& kernel = Core::System::GetInstance().Kernel();
182 buffer_event = Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::Automatic, 181 buffer_event = Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::Automatic,
183 "IAudioOutBufferReleasedEvent"); 182 "IAudioOutBufferReleasedEvent");
183
184 // Should only be signalled when an audio output device has been changed, example: speaker
185 // to headset
186 audio_output_device_switch_event = Kernel::WritableEvent::CreateEventPair(
187 kernel, Kernel::ResetType::Automatic, "IAudioDevice:AudioOutputDeviceSwitchedEvent");
184 } 188 }
185 189
186private: 190private:
@@ -237,7 +241,16 @@ private:
237 rb.Push<u32>(1); 241 rb.Push<u32>(1);
238 } 242 }
239 243
244 void QueryAudioDeviceOutputEvent(Kernel::HLERequestContext& ctx) {
245 LOG_DEBUG(Service_Audio, "called");
246
247 IPC::ResponseBuilder rb{ctx, 2, 1};
248 rb.Push(RESULT_SUCCESS);
249 rb.PushCopyObjects(audio_output_device_switch_event.readable);
250 }
251
240 Kernel::EventPair buffer_event; 252 Kernel::EventPair buffer_event;
253 Kernel::EventPair audio_output_device_switch_event;
241 254
242}; // namespace Audio 255}; // namespace Audio
243 256