diff options
| author | 2023-03-01 10:38:20 -0500 | |
|---|---|---|
| committer | 2023-03-01 10:38:20 -0500 | |
| commit | 97f7a560f3905a1dd6a4e5a0a308ea752004bf08 (patch) | |
| tree | e60a69f96d16d051220b66e90906a7abeacf1064 /src/core/hle/service/audio | |
| parent | Merge pull request #9879 from zhaobot/tx-update-20230301024940 (diff) | |
| parent | sm:: fix lingering session initialization issues (diff) | |
| download | yuzu-97f7a560f3905a1dd6a4e5a0a308ea752004bf08.tar.gz yuzu-97f7a560f3905a1dd6a4e5a0a308ea752004bf08.tar.xz yuzu-97f7a560f3905a1dd6a4e5a0a308ea752004bf08.zip | |
Merge pull request #9832 from liamwhite/hle-mp
service: HLE multiprocess
Diffstat (limited to 'src/core/hle/service/audio')
| -rw-r--r-- | src/core/hle/service/audio/audin_u.cpp | 5 | ||||
| -rw-r--r-- | src/core/hle/service/audio/audio.cpp | 21 | ||||
| -rw-r--r-- | src/core/hle/service/audio/audio.h | 3 | ||||
| -rw-r--r-- | src/core/hle/service/audio/audout_u.cpp | 10 | ||||
| -rw-r--r-- | src/core/hle/service/audio/audren_u.cpp | 15 |
5 files changed, 26 insertions, 28 deletions
diff --git a/src/core/hle/service/audio/audin_u.cpp b/src/core/hle/service/audio/audin_u.cpp index 053e8f9dd..26dec7147 100644 --- a/src/core/hle/service/audio/audin_u.cpp +++ b/src/core/hle/service/audio/audin_u.cpp | |||
| @@ -203,9 +203,8 @@ private: | |||
| 203 | }; | 203 | }; |
| 204 | 204 | ||
| 205 | AudInU::AudInU(Core::System& system_) | 205 | AudInU::AudInU(Core::System& system_) |
| 206 | : ServiceFramework{system_, "audin:u", ServiceThreadType::CreateNew}, | 206 | : ServiceFramework{system_, "audin:u"}, service_context{system_, "AudInU"}, |
| 207 | service_context{system_, "AudInU"}, impl{std::make_unique<AudioCore::AudioIn::Manager>( | 207 | impl{std::make_unique<AudioCore::AudioIn::Manager>(system_)} { |
| 208 | system_)} { | ||
| 209 | // clang-format off | 208 | // clang-format off |
| 210 | static const FunctionInfo functions[] = { | 209 | static const FunctionInfo functions[] = { |
| 211 | {0, &AudInU::ListAudioIns, "ListAudioIns"}, | 210 | {0, &AudInU::ListAudioIns, "ListAudioIns"}, |
diff --git a/src/core/hle/service/audio/audio.cpp b/src/core/hle/service/audio/audio.cpp index ed36e3448..dccd16309 100644 --- a/src/core/hle/service/audio/audio.cpp +++ b/src/core/hle/service/audio/audio.cpp | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2018 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 "core/core.h" | ||
| 4 | #include "core/hle/service/audio/audctl.h" | 5 | #include "core/hle/service/audio/audctl.h" |
| 5 | #include "core/hle/service/audio/audin_u.h" | 6 | #include "core/hle/service/audio/audin_u.h" |
| 6 | #include "core/hle/service/audio/audio.h" | 7 | #include "core/hle/service/audio/audio.h" |
| @@ -9,18 +10,22 @@ | |||
| 9 | #include "core/hle/service/audio/audrec_u.h" | 10 | #include "core/hle/service/audio/audrec_u.h" |
| 10 | #include "core/hle/service/audio/audren_u.h" | 11 | #include "core/hle/service/audio/audren_u.h" |
| 11 | #include "core/hle/service/audio/hwopus.h" | 12 | #include "core/hle/service/audio/hwopus.h" |
| 13 | #include "core/hle/service/server_manager.h" | ||
| 12 | #include "core/hle/service/service.h" | 14 | #include "core/hle/service/service.h" |
| 13 | 15 | ||
| 14 | namespace Service::Audio { | 16 | namespace Service::Audio { |
| 15 | 17 | ||
| 16 | void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system) { | 18 | void LoopProcess(Core::System& system) { |
| 17 | std::make_shared<AudCtl>(system)->InstallAsService(service_manager); | 19 | auto server_manager = std::make_unique<ServerManager>(system); |
| 18 | std::make_shared<AudOutU>(system)->InstallAsService(service_manager); | 20 | |
| 19 | std::make_shared<AudInU>(system)->InstallAsService(service_manager); | 21 | server_manager->RegisterNamedService("audctl", std::make_shared<AudCtl>(system)); |
| 20 | std::make_shared<AudRecA>(system)->InstallAsService(service_manager); | 22 | server_manager->RegisterNamedService("audout:u", std::make_shared<AudOutU>(system)); |
| 21 | std::make_shared<AudRecU>(system)->InstallAsService(service_manager); | 23 | server_manager->RegisterNamedService("audin:u", std::make_shared<AudInU>(system)); |
| 22 | std::make_shared<AudRenU>(system)->InstallAsService(service_manager); | 24 | server_manager->RegisterNamedService("audrec:a", std::make_shared<AudRecA>(system)); |
| 23 | std::make_shared<HwOpus>(system)->InstallAsService(service_manager); | 25 | server_manager->RegisterNamedService("audrec:u", std::make_shared<AudRecU>(system)); |
| 26 | server_manager->RegisterNamedService("audren:u", std::make_shared<AudRenU>(system)); | ||
| 27 | server_manager->RegisterNamedService("hwopus", std::make_shared<HwOpus>(system)); | ||
| 28 | ServerManager::RunServer(std::move(server_manager)); | ||
| 24 | } | 29 | } |
| 25 | 30 | ||
| 26 | } // namespace Service::Audio | 31 | } // namespace Service::Audio |
diff --git a/src/core/hle/service/audio/audio.h b/src/core/hle/service/audio/audio.h index bbb2214e4..d70f022c7 100644 --- a/src/core/hle/service/audio/audio.h +++ b/src/core/hle/service/audio/audio.h | |||
| @@ -13,7 +13,6 @@ class ServiceManager; | |||
| 13 | 13 | ||
| 14 | namespace Service::Audio { | 14 | namespace Service::Audio { |
| 15 | 15 | ||
| 16 | /// Registers all Audio services with the specified service manager. | 16 | void LoopProcess(Core::System& system); |
| 17 | void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system); | ||
| 18 | 17 | ||
| 19 | } // namespace Service::Audio | 18 | } // namespace Service::Audio |
diff --git a/src/core/hle/service/audio/audout_u.cpp b/src/core/hle/service/audio/audout_u.cpp index 29751f075..991e30ba1 100644 --- a/src/core/hle/service/audio/audout_u.cpp +++ b/src/core/hle/service/audio/audout_u.cpp | |||
| @@ -26,9 +26,8 @@ public: | |||
| 26 | explicit IAudioOut(Core::System& system_, AudioCore::AudioOut::Manager& manager, | 26 | explicit IAudioOut(Core::System& system_, AudioCore::AudioOut::Manager& manager, |
| 27 | size_t session_id, const std::string& device_name, | 27 | size_t session_id, const std::string& device_name, |
| 28 | const AudioOutParameter& in_params, u32 handle, u64 applet_resource_user_id) | 28 | const AudioOutParameter& in_params, u32 handle, u64 applet_resource_user_id) |
| 29 | : ServiceFramework{system_, "IAudioOut", ServiceThreadType::CreateNew}, | 29 | : ServiceFramework{system_, "IAudioOut"}, service_context{system_, "IAudioOut"}, |
| 30 | service_context{system_, "IAudioOut"}, event{service_context.CreateEvent( | 30 | event{service_context.CreateEvent("AudioOutEvent")}, |
| 31 | "AudioOutEvent")}, | ||
| 32 | impl{std::make_shared<AudioCore::AudioOut::Out>(system_, manager, event, session_id)} { | 31 | impl{std::make_shared<AudioCore::AudioOut::Out>(system_, manager, event, session_id)} { |
| 33 | 32 | ||
| 34 | // clang-format off | 33 | // clang-format off |
| @@ -221,9 +220,8 @@ private: | |||
| 221 | }; | 220 | }; |
| 222 | 221 | ||
| 223 | AudOutU::AudOutU(Core::System& system_) | 222 | AudOutU::AudOutU(Core::System& system_) |
| 224 | : ServiceFramework{system_, "audout:u", ServiceThreadType::CreateNew}, | 223 | : ServiceFramework{system_, "audout:u"}, service_context{system_, "AudOutU"}, |
| 225 | service_context{system_, "AudOutU"}, impl{std::make_unique<AudioCore::AudioOut::Manager>( | 224 | impl{std::make_unique<AudioCore::AudioOut::Manager>(system_)} { |
| 226 | system_)} { | ||
| 227 | // clang-format off | 225 | // clang-format off |
| 228 | static const FunctionInfo functions[] = { | 226 | static const FunctionInfo functions[] = { |
| 229 | {0, &AudOutU::ListAudioOuts, "ListAudioOuts"}, | 227 | {0, &AudOutU::ListAudioOuts, "ListAudioOuts"}, |
diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp index 7d730421d..6c12f00a1 100644 --- a/src/core/hle/service/audio/audren_u.cpp +++ b/src/core/hle/service/audio/audren_u.cpp | |||
| @@ -35,10 +35,9 @@ public: | |||
| 35 | AudioCore::AudioRendererParameterInternal& params, | 35 | AudioCore::AudioRendererParameterInternal& params, |
| 36 | Kernel::KTransferMemory* transfer_memory, u64 transfer_memory_size, | 36 | Kernel::KTransferMemory* transfer_memory, u64 transfer_memory_size, |
| 37 | u32 process_handle, u64 applet_resource_user_id, s32 session_id) | 37 | u32 process_handle, u64 applet_resource_user_id, s32 session_id) |
| 38 | : ServiceFramework{system_, "IAudioRenderer", ServiceThreadType::CreateNew}, | 38 | : ServiceFramework{system_, "IAudioRenderer"}, service_context{system_, "IAudioRenderer"}, |
| 39 | service_context{system_, "IAudioRenderer"}, rendered_event{service_context.CreateEvent( | 39 | rendered_event{service_context.CreateEvent("IAudioRendererEvent")}, manager{manager_}, |
| 40 | "IAudioRendererEvent")}, | 40 | impl{std::make_unique<Renderer>(system_, manager, rendered_event)} { |
| 41 | manager{manager_}, impl{std::make_unique<Renderer>(system_, manager, rendered_event)} { | ||
| 42 | // clang-format off | 41 | // clang-format off |
| 43 | static const FunctionInfo functions[] = { | 42 | static const FunctionInfo functions[] = { |
| 44 | {0, &IAudioRenderer::GetSampleRate, "GetSampleRate"}, | 43 | {0, &IAudioRenderer::GetSampleRate, "GetSampleRate"}, |
| @@ -243,10 +242,8 @@ class IAudioDevice final : public ServiceFramework<IAudioDevice> { | |||
| 243 | public: | 242 | public: |
| 244 | explicit IAudioDevice(Core::System& system_, u64 applet_resource_user_id, u32 revision, | 243 | explicit IAudioDevice(Core::System& system_, u64 applet_resource_user_id, u32 revision, |
| 245 | u32 device_num) | 244 | u32 device_num) |
| 246 | : ServiceFramework{system_, "IAudioDevice", ServiceThreadType::CreateNew}, | 245 | : ServiceFramework{system_, "IAudioDevice"}, service_context{system_, "IAudioDevice"}, |
| 247 | service_context{system_, "IAudioDevice"}, impl{std::make_unique<AudioDevice>( | 246 | impl{std::make_unique<AudioDevice>(system_, applet_resource_user_id, revision)}, |
| 248 | system_, applet_resource_user_id, | ||
| 249 | revision)}, | ||
| 250 | event{service_context.CreateEvent(fmt::format("IAudioDeviceEvent-{}", device_num))} { | 247 | event{service_context.CreateEvent(fmt::format("IAudioDeviceEvent-{}", device_num))} { |
| 251 | static const FunctionInfo functions[] = { | 248 | static const FunctionInfo functions[] = { |
| 252 | {0, &IAudioDevice::ListAudioDeviceName, "ListAudioDeviceName"}, | 249 | {0, &IAudioDevice::ListAudioDeviceName, "ListAudioDeviceName"}, |
| @@ -421,7 +418,7 @@ private: | |||
| 421 | }; | 418 | }; |
| 422 | 419 | ||
| 423 | AudRenU::AudRenU(Core::System& system_) | 420 | AudRenU::AudRenU(Core::System& system_) |
| 424 | : ServiceFramework{system_, "audren:u", ServiceThreadType::CreateNew}, | 421 | : ServiceFramework{system_, "audren:u"}, |
| 425 | service_context{system_, "audren:u"}, impl{std::make_unique<Manager>(system_)} { | 422 | service_context{system_, "audren:u"}, impl{std::make_unique<Manager>(system_)} { |
| 426 | // clang-format off | 423 | // clang-format off |
| 427 | static const FunctionInfo functions[] = { | 424 | static const FunctionInfo functions[] = { |