summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/core.cpp2
-rw-r--r--src/core/core.h7
-rw-r--r--src/core/hle/service/audio/audout_u.cpp8
-rw-r--r--src/core/hle/service/audio/audout_u.h2
4 files changed, 6 insertions, 13 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 186fa46df..b7f4b4532 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -177,7 +177,6 @@ System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) {
177 } 177 }
178 178
179 gpu_core = std::make_unique<Tegra::GPU>(); 179 gpu_core = std::make_unique<Tegra::GPU>();
180 audio_core = std::make_unique<AudioCore::AudioOut>();
181 telemetry_session = std::make_unique<Core::TelemetrySession>(); 180 telemetry_session = std::make_unique<Core::TelemetrySession>();
182 service_manager = std::make_shared<Service::SM::ServiceManager>(); 181 service_manager = std::make_shared<Service::SM::ServiceManager>();
183 182
@@ -229,7 +228,6 @@ void System::Shutdown() {
229 service_manager.reset(); 228 service_manager.reset();
230 telemetry_session.reset(); 229 telemetry_session.reset();
231 gpu_core.reset(); 230 gpu_core.reset();
232 audio_core.reset();
233 231
234 // Close all CPU/threading state 232 // Close all CPU/threading state
235 cpu_barrier->NotifyEnd(); 233 cpu_barrier->NotifyEnd();
diff --git a/src/core/core.h b/src/core/core.h
index 6f4df775f..c123fe401 100644
--- a/src/core/core.h
+++ b/src/core/core.h
@@ -8,7 +8,6 @@
8#include <memory> 8#include <memory>
9#include <string> 9#include <string>
10#include <thread> 10#include <thread>
11#include "audio_core/audio_out.h"
12#include "common/common_types.h" 11#include "common/common_types.h"
13#include "core/arm/exclusive_monitor.h" 12#include "core/arm/exclusive_monitor.h"
14#include "core/core_cpu.h" 13#include "core/core_cpu.h"
@@ -132,11 +131,6 @@ public:
132 return *gpu_core; 131 return *gpu_core;
133 } 132 }
134 133
135 /// Gets the AudioCore interface
136 AudioCore::AudioOut& AudioCore() {
137 return *audio_core;
138 }
139
140 /// Gets the scheduler for the CPU core that is currently running 134 /// Gets the scheduler for the CPU core that is currently running
141 Kernel::Scheduler& CurrentScheduler() { 135 Kernel::Scheduler& CurrentScheduler() {
142 return *CurrentCpuCore().Scheduler(); 136 return *CurrentCpuCore().Scheduler();
@@ -201,7 +195,6 @@ private:
201 /// AppLoader used to load the current executing application 195 /// AppLoader used to load the current executing application
202 std::unique_ptr<Loader::AppLoader> app_loader; 196 std::unique_ptr<Loader::AppLoader> app_loader;
203 std::unique_ptr<Tegra::GPU> gpu_core; 197 std::unique_ptr<Tegra::GPU> gpu_core;
204 std::unique_ptr<AudioCore::AudioOut> audio_core;
205 std::shared_ptr<Tegra::DebugContext> debug_context; 198 std::shared_ptr<Tegra::DebugContext> debug_context;
206 Kernel::SharedPtr<Kernel::Process> current_process; 199 Kernel::SharedPtr<Kernel::Process> current_process;
207 std::shared_ptr<ExclusiveMonitor> cpu_exclusive_monitor; 200 std::shared_ptr<ExclusiveMonitor> cpu_exclusive_monitor;
diff --git a/src/core/hle/service/audio/audout_u.cpp b/src/core/hle/service/audio/audout_u.cpp
index a15d53ff8..ab37c2a69 100644
--- a/src/core/hle/service/audio/audout_u.cpp
+++ b/src/core/hle/service/audio/audout_u.cpp
@@ -25,9 +25,8 @@ constexpr int DefaultSampleRate{48000};
25 25
26class IAudioOut final : public ServiceFramework<IAudioOut> { 26class IAudioOut final : public ServiceFramework<IAudioOut> {
27public: 27public:
28 IAudioOut(AudoutParams audio_params) 28 IAudioOut(AudoutParams audio_params, AudioCore::AudioOut& audio_core)
29 : ServiceFramework("IAudioOut"), audio_params(audio_params), 29 : ServiceFramework("IAudioOut"), audio_params(audio_params), audio_core(audio_core) {
30 audio_core(Core::System::GetInstance().AudioCore()) {
31 30
32 static const FunctionInfo functions[] = { 31 static const FunctionInfo functions[] = {
33 {0, &IAudioOut::GetAudioOutState, "GetAudioOutState"}, 32 {0, &IAudioOut::GetAudioOutState, "GetAudioOutState"},
@@ -195,7 +194,7 @@ void AudOutU::OpenAudioOutImpl(Kernel::HLERequestContext& ctx) {
195 // TODO(bunnei): Support more than one IAudioOut interface. When we add this, ListAudioOutsImpl 194 // TODO(bunnei): Support more than one IAudioOut interface. When we add this, ListAudioOutsImpl
196 // will likely need to be updated as well. 195 // will likely need to be updated as well.
197 ASSERT_MSG(!audio_out_interface, "Unimplemented"); 196 ASSERT_MSG(!audio_out_interface, "Unimplemented");
198 audio_out_interface = std::make_shared<IAudioOut>(std::move(params)); 197 audio_out_interface = std::make_shared<IAudioOut>(std::move(params), *audio_core);
199 198
200 IPC::ResponseBuilder rb{ctx, 6, 0, 1}; 199 IPC::ResponseBuilder rb{ctx, 6, 0, 1};
201 rb.Push(RESULT_SUCCESS); 200 rb.Push(RESULT_SUCCESS);
@@ -212,6 +211,7 @@ AudOutU::AudOutU() : ServiceFramework("audout:u") {
212 {2, &AudOutU::ListAudioOutsImpl, "ListAudioOutsAuto"}, 211 {2, &AudOutU::ListAudioOutsImpl, "ListAudioOutsAuto"},
213 {3, &AudOutU::OpenAudioOutImpl, "OpenAudioOutAuto"}}; 212 {3, &AudOutU::OpenAudioOutImpl, "OpenAudioOutAuto"}};
214 RegisterHandlers(functions); 213 RegisterHandlers(functions);
214 audio_core = std::make_unique<AudioCore::AudioOut>();
215} 215}
216 216
217} // namespace Service::Audio 217} // namespace Service::Audio
diff --git a/src/core/hle/service/audio/audout_u.h b/src/core/hle/service/audio/audout_u.h
index bc43f1f44..e5c2184d5 100644
--- a/src/core/hle/service/audio/audout_u.h
+++ b/src/core/hle/service/audio/audout_u.h
@@ -4,6 +4,7 @@
4 4
5#pragma once 5#pragma once
6 6
7#include "audio_core/audio_out.h"
7#include "core/hle/service/service.h" 8#include "core/hle/service/service.h"
8 9
9namespace Kernel { 10namespace Kernel {
@@ -33,6 +34,7 @@ public:
33 34
34private: 35private:
35 std::shared_ptr<IAudioOut> audio_out_interface; 36 std::shared_ptr<IAudioOut> audio_out_interface;
37 std::unique_ptr<AudioCore::AudioOut> audio_core;
36 38
37 void ListAudioOutsImpl(Kernel::HLERequestContext& ctx); 39 void ListAudioOutsImpl(Kernel::HLERequestContext& ctx);
38 void OpenAudioOutImpl(Kernel::HLERequestContext& ctx); 40 void OpenAudioOutImpl(Kernel::HLERequestContext& ctx);