Added stubs for audio services. (#116)

* stubs for audout:u, audin:u, audrec:u, audren:u, codecctl and decoding tables with nullptr for future implementations

* fixing the changes requested (remove private, explicit)
merge-requests/60/head
st4rk 2018-01-21 19:03:36 +07:00 committed by bunnei
parent fdbb039427
commit 07355cf7cc
12 changed files with 309 additions and 5 deletions

@ -95,8 +95,18 @@ add_library(core STATIC
hle/service/apm/apm.h hle/service/apm/apm.h
hle/service/audio/audio.cpp hle/service/audio/audio.cpp
hle/service/audio/audio.h hle/service/audio/audio.h
hle/service/audio/audin_u.cpp
hle/service/audio/audin_u.h
hle/service/audio/audout_u.cpp hle/service/audio/audout_u.cpp
hle/service/audio/audout_u.h hle/service/audio/audout_u.h
hle/service/audio/audrec_u.cpp
hle/service/audio/audrec_u.h
hle/service/audio/audren_u.cpp
hle/service/audio/audren_u.h
hle/service/audio/audren_u.cpp
hle/service/audio/audren_u.h
hle/service/audio/codecctl.cpp
hle/service/audio/codecctl.h
hle/service/filesystem/filesystem.cpp hle/service/filesystem/filesystem.cpp
hle/service/filesystem/filesystem.h hle/service/filesystem/filesystem.h
hle/service/filesystem/fsp_srv.cpp hle/service/filesystem/fsp_srv.cpp

@ -0,0 +1,41 @@
// Copyright 2018 yuzu emulator team
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "common/logging/log.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/service/audio/audin_u.h"
namespace Service {
namespace Audio {
class IAudioIn final : public ServiceFramework<IAudioIn> {
public:
IAudioIn() : ServiceFramework("IAudioIn") {
static const FunctionInfo functions[] = {
{0x0, nullptr, "GetAudioInState"},
{0x1, nullptr, "StartAudioIn"},
{0x2, nullptr, "StopAudioIn"},
{0x3, nullptr, "AppendAudioInBuffer_1"},
{0x4, nullptr, "RegisterBufferEvent"},
{0x5, nullptr, "GetReleasedAudioInBuffer_1"},
{0x6, nullptr, "ContainsAudioInBuffer"},
{0x7, nullptr, "AppendAudioInBuffer_2"},
{0x8, nullptr, "GetReleasedAudioInBuffer_2"},
};
RegisterHandlers(functions);
}
~IAudioIn() = default;
};
AudInU::AudInU() : ServiceFramework("audin:u") {
static const FunctionInfo functions[] = {
{0x00000000, nullptr, "ListAudioIns"},
{0x00000001, nullptr, "OpenAudioIn"},
};
RegisterHandlers(functions);
}
} // namespace Audio
} // namespace Service

@ -0,0 +1,23 @@
// Copyright 2018 yuzu emulator team
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
#include "core/hle/service/service.h"
namespace Kernel {
class HLERequestContext;
}
namespace Service {
namespace Audio {
class AudInU final : public ServiceFramework<AudInU> {
public:
explicit AudInU();
~AudInU() = default;
};
} // namespace Audio
} // namespace Service

@ -2,14 +2,22 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "core/hle/service/audio/audin_u.h"
#include "core/hle/service/audio/audio.h" #include "core/hle/service/audio/audio.h"
#include "core/hle/service/audio/audout_u.h" #include "core/hle/service/audio/audout_u.h"
#include "core/hle/service/audio/audrec_u.h"
#include "core/hle/service/audio/audren_u.h"
#include "core/hle/service/audio/codecctl.h"
namespace Service { namespace Service {
namespace Audio { namespace Audio {
void InstallInterfaces(SM::ServiceManager& service_manager) { void InstallInterfaces(SM::ServiceManager& service_manager) {
std::make_shared<AudOutU>()->InstallAsService(service_manager); std::make_shared<AudOutU>()->InstallAsService(service_manager);
std::make_shared<AudInU>()->InstallAsService(service_manager);
std::make_shared<AudRecU>()->InstallAsService(service_manager);
std::make_shared<AudRenU>()->InstallAsService(service_manager);
std::make_shared<CodecCtl>()->InstallAsService(service_manager);
} }
} // namespace Audio } // namespace Audio

@ -4,21 +4,56 @@
#include "common/logging/log.h" #include "common/logging/log.h"
#include "core/hle/ipc_helpers.h" #include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/service/audio/audout_u.h" #include "core/hle/service/audio/audout_u.h"
namespace Service { namespace Service {
namespace Audio { namespace Audio {
class IAudioOut final : public ServiceFramework<IAudioOut> {
public:
IAudioOut() : ServiceFramework("IAudioOut") {
static const FunctionInfo functions[] = {
{0x0, nullptr, "GetAudioOutState"},
{0x1, nullptr, "StartAudioOut"},
{0x2, nullptr, "StopAudioOut"},
{0x3, nullptr, "AppendAudioOutBuffer_1"},
{0x4, nullptr, "RegisterBufferEvent"},
{0x5, nullptr, "GetReleasedAudioOutBuffer_1"},
{0x6, nullptr, "ContainsAudioOutBuffer"},
{0x7, nullptr, "AppendAudioOutBuffer_2"},
{0x8, nullptr, "GetReleasedAudioOutBuffer_2"},
};
RegisterHandlers(functions);
}
~IAudioOut() = default;
};
void AudOutU::ListAudioOuts(Kernel::HLERequestContext& ctx) { void AudOutU::ListAudioOuts(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called"); LOG_WARNING(Service, "(STUBBED) called");
IPC::RequestBuilder rb{ctx, 2}; IPC::RequestParser rp{ctx};
auto& buffer = ctx.BufferDescriptorB()[0];
const std::string audio_interface = "AudioInterface";
Memory::WriteBlock(buffer.Address(), &audio_interface[0], audio_interface.size());
IPC::RequestBuilder rb = rp.MakeBuilder(3, 0, 0, 0);
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
// TODO(st4rk): we're currently returning only one audio interface
// (stringlist size)
// however, it's highly possible to have more than one interface (despite that
// libtransistor
// requires only one).
rb.Push<u32>(1);
} }
AudOutU::AudOutU() : ServiceFramework("audout:u") { AudOutU::AudOutU() : ServiceFramework("audout:u") {
static const FunctionInfo functions[] = { static const FunctionInfo functions[] = {{0x00000000, &AudOutU::ListAudioOuts, "ListAudioOuts"},
{0x00000000, &AudOutU::ListAudioOuts, "ListAudioOuts"}, {0x00000001, nullptr, "OpenAudioOut"},
}; {0x00000002, nullptr, "Unknown2"},
{0x00000003, nullptr, "Unknown3"}};
RegisterHandlers(functions); RegisterHandlers(functions);
} }

@ -4,9 +4,12 @@
#pragma once #pragma once
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/service/service.h" #include "core/hle/service/service.h"
namespace Kernel {
class HLERequestContext;
}
namespace Service { namespace Service {
namespace Audio { namespace Audio {

@ -0,0 +1,38 @@
// Copyright 2018 yuzu emulator team
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "common/logging/log.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/service/audio/audrec_u.h"
namespace Service {
namespace Audio {
class IFinalOutputRecorder final : public ServiceFramework<IFinalOutputRecorder> {
public:
IFinalOutputRecorder() : ServiceFramework("IFinalOutputRecorder") {
static const FunctionInfo functions[] = {
{0x0, nullptr, "GetFinalOutputRecorderState"},
{0x1, nullptr, "StartFinalOutputRecorder"},
{0x2, nullptr, "StopFinalOutputRecorder"},
{0x3, nullptr, "AppendFinalOutputRecorderBuffer"},
{0x4, nullptr, "RegisterBufferEvent"},
{0x5, nullptr, "GetReleasedFinalOutputRecorderBuffer"},
{0x6, nullptr, "ContainsFinalOutputRecorderBuffer"},
};
RegisterHandlers(functions);
}
~IFinalOutputRecorder() = default;
};
AudRecU::AudRecU() : ServiceFramework("audrec:u") {
static const FunctionInfo functions[] = {
{0x00000000, nullptr, "OpenFinalOutputRecorder"},
};
RegisterHandlers(functions);
}
} // namespace Audio
} // namespace Service

@ -0,0 +1,23 @@
// Copyright 2018 yuzu emulator team
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
#include "core/hle/service/service.h"
namespace Kernel {
class HLERequestContext;
}
namespace Service {
namespace Audio {
class AudRecU final : public ServiceFramework<AudRecU> {
public:
explicit AudRecU();
~AudRecU() = default;
};
} // namespace Audio
} // namespace Service

@ -0,0 +1,44 @@
// Copyright 2018 yuzu emulator team
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "common/logging/log.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/service/audio/audren_u.h"
namespace Service {
namespace Audio {
class IAudioRenderer final : public ServiceFramework<IAudioRenderer> {
public:
IAudioRenderer() : ServiceFramework("IAudioRenderer") {
static const FunctionInfo functions[] = {
{0x0, nullptr, "GetAudioRendererSampleRate"},
{0x1, nullptr, "GetAudioRendererSampleCount"},
{0x2, nullptr, "GetAudioRendererMixBufferCount"},
{0x3, nullptr, "GetAudioRendererState"},
{0x4, nullptr, "RequestUpdateAudioRenderer"},
{0x5, nullptr, "StartAudioRenderer"},
{0x6, nullptr, "StopAudioRenderer"},
{0x7, nullptr, "QuerySystemEvent"},
{0x8, nullptr, "SetAudioRendererRenderingTimeLimit"},
{0x9, nullptr, "GetAudioRendererRenderingTimeLimit"},
};
RegisterHandlers(functions);
}
~IAudioRenderer() = default;
};
AudRenU::AudRenU() : ServiceFramework("audren:u") {
static const FunctionInfo functions[] = {
{0x00000000, nullptr, "OpenAudioRenderer"},
{0x00000001, nullptr, "GetAudioRendererWorkBufferSize"},
{0x00000002, nullptr, "GetAudioRenderersProcessMasterVolume"},
{0x00000003, nullptr, "SetAudioRenderersProcessMasterVolume"},
};
RegisterHandlers(functions);
}
} // namespace Audio
} // namespace Service

@ -0,0 +1,23 @@
// Copyright 2018 yuzu emulator team
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
#include "core/hle/service/service.h"
namespace Kernel {
class HLERequestContext;
}
namespace Service {
namespace Audio {
class AudRenU final : public ServiceFramework<AudRenU> {
public:
explicit AudRenU();
~AudRenU() = default;
};
} // namespace Audio
} // namespace Service

@ -0,0 +1,33 @@
// Copyright 2018 yuzu emulator team
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "common/logging/log.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/service/audio/codecctl.h"
namespace Service {
namespace Audio {
CodecCtl::CodecCtl() : ServiceFramework("codecctl") {
static const FunctionInfo functions[] = {
{0x00000000, nullptr, "InitializeCodecController"},
{0x00000001, nullptr, "FinalizeCodecController"},
{0x00000002, nullptr, "SleepCodecController"},
{0x00000003, nullptr, "WakeCodecController"},
{0x00000004, nullptr, "SetCodecVolume"},
{0x00000005, nullptr, "GetCodecVolumeMax"},
{0x00000006, nullptr, "GetCodecVolumeMin"},
{0x00000007, nullptr, "SetCodecActiveTarget"},
{0x00000008, nullptr, "Unknown"},
{0x00000009, nullptr, "BindCodecHeadphoneMicJackInterrupt"},
{0x0000000A, nullptr, "IsCodecHeadphoneMicJackInserted"},
{0x0000000B, nullptr, "ClearCodecHeadphoneMicJackInterrupt"},
{0x0000000C, nullptr, "IsCodecDeviceRequested"},
};
RegisterHandlers(functions);
}
} // namespace Audio
} // namespace Service

@ -0,0 +1,23 @@
// Copyright 2018 yuzu emulator team
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
#include "core/hle/service/service.h"
namespace Kernel {
class HLERequestContext;
}
namespace Service {
namespace Audio {
class CodecCtl final : public ServiceFramework<CodecCtl> {
public:
explicit CodecCtl();
~CodecCtl() = default;
};
} // namespace Audio
} // namespace Service