mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-14 13:45:59 +00:00
* feat: Audio3d * feat: Audio3d * audio3d: disable output * audio3d: Implement central Audio3d output. * audio3d: Ignore AudioOut already initialized error. * audio3d: Convert and retain sample buffers when queued. * audio3d: Treat object audio as single channel. * audio3d: Clean up. --------- Co-authored-by: auser1337 <154299690+auser1337@users.noreply.github.com>
727 lines
25 KiB
C++
727 lines
25 KiB
C++
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#include <memory>
|
|
#include <mutex>
|
|
#include <stop_token>
|
|
#include <thread>
|
|
#include <magic_enum/magic_enum.hpp>
|
|
|
|
#include "common/assert.h"
|
|
#include "common/config.h"
|
|
#include "common/logging/log.h"
|
|
#include "common/thread.h"
|
|
#include "core/libraries/audio/audioout.h"
|
|
#include "core/libraries/audio/audioout_backend.h"
|
|
#include "core/libraries/audio/audioout_error.h"
|
|
#include "core/libraries/libs.h"
|
|
|
|
namespace Libraries::AudioOut {
|
|
|
|
std::mutex port_open_mutex{};
|
|
std::array<PortOut, SCE_AUDIO_OUT_NUM_PORTS> ports_out{};
|
|
|
|
static std::unique_ptr<AudioOutBackend> audio;
|
|
|
|
static AudioFormatInfo GetFormatInfo(const OrbisAudioOutParamFormat format) {
|
|
static constexpr std::array<AudioFormatInfo, 8> format_infos = {{
|
|
// S16Mono
|
|
{false, 2, 1, {0}},
|
|
// S16Stereo
|
|
{false, 2, 2, {0, 1}},
|
|
// S16_8CH
|
|
{false, 2, 8, {0, 1, 2, 3, 4, 5, 6, 7}},
|
|
// FloatMono
|
|
{true, 4, 1, {0}},
|
|
// FloatStereo
|
|
{true, 4, 2, {0, 1}},
|
|
// Float_8CH
|
|
{true, 4, 8, {0, 1, 2, 3, 4, 5, 6, 7}},
|
|
// S16_8CH_Std
|
|
{false, 2, 8, {0, 1, 2, 3, 6, 7, 4, 5}},
|
|
// Float_8CH_Std
|
|
{true, 4, 8, {0, 1, 2, 3, 6, 7, 4, 5}},
|
|
}};
|
|
const auto index = static_cast<u32>(format);
|
|
ASSERT_MSG(index < format_infos.size(), "Unknown audio format {}", index);
|
|
return format_infos[index];
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutDeviceIdOpen() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioDeviceControlGet() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioDeviceControlSet() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutA3dControl() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutA3dExit() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutA3dInit() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutAttachToApplicationByPid() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutChangeAppModuleState() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutClose(s32 handle) {
|
|
LOG_INFO(Lib_AudioOut, "handle = {}", handle);
|
|
if (audio == nullptr) {
|
|
return ORBIS_AUDIO_OUT_ERROR_NOT_INIT;
|
|
}
|
|
if (handle < 1 || handle > SCE_AUDIO_OUT_NUM_PORTS) {
|
|
return ORBIS_AUDIO_OUT_ERROR_INVALID_PORT;
|
|
}
|
|
|
|
std::unique_lock open_lock{port_open_mutex};
|
|
auto& port = ports_out.at(handle - 1);
|
|
{
|
|
std::unique_lock lock{port.mutex};
|
|
if (!port.IsOpen()) {
|
|
return ORBIS_AUDIO_OUT_ERROR_INVALID_PORT;
|
|
}
|
|
std::free(port.output_buffer);
|
|
port.output_buffer = nullptr;
|
|
port.output_ready = false;
|
|
port.impl = nullptr;
|
|
}
|
|
// Stop outside of port lock scope to prevent deadlocks.
|
|
port.output_thread.Stop();
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutDetachFromApplicationByPid() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutExConfigureOutputMode() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutExGetSystemInfo() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutExPtClose() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutExPtGetLastOutputTime() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutExPtOpen() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutExSystemInfoIsSupportedAudioOutExMode() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutGetFocusEnablePid() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutGetHandleStatusInfo() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutGetInfo() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutGetInfoOpenNum() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutGetLastOutputTime() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutGetPortState(s32 handle, OrbisAudioOutPortState* state) {
|
|
if (audio == nullptr) {
|
|
return ORBIS_AUDIO_OUT_ERROR_NOT_INIT;
|
|
}
|
|
if (handle < 1 || handle > SCE_AUDIO_OUT_NUM_PORTS) {
|
|
return ORBIS_AUDIO_OUT_ERROR_INVALID_PORT;
|
|
}
|
|
|
|
auto& port = ports_out.at(handle - 1);
|
|
{
|
|
std::unique_lock lock{port.mutex};
|
|
if (!port.IsOpen()) {
|
|
return ORBIS_AUDIO_OUT_ERROR_INVALID_PORT;
|
|
}
|
|
switch (port.type) {
|
|
case OrbisAudioOutPort::Main:
|
|
case OrbisAudioOutPort::Bgm:
|
|
case OrbisAudioOutPort::Voice:
|
|
case OrbisAudioOutPort::Audio3d:
|
|
state->output = 1;
|
|
state->channel = port.format_info.num_channels > 2 ? 2 : port.format_info.num_channels;
|
|
break;
|
|
case OrbisAudioOutPort::Personal:
|
|
case OrbisAudioOutPort::Padspk:
|
|
state->output = 4;
|
|
state->channel = 1;
|
|
break;
|
|
case OrbisAudioOutPort::Aux:
|
|
state->output = 0;
|
|
state->channel = 0;
|
|
break;
|
|
default:
|
|
UNREACHABLE();
|
|
}
|
|
state->rerouteCounter = 0;
|
|
state->volume = 127;
|
|
}
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutGetSimulatedBusUsableStatusByBusType() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutGetSimulatedHandleStatusInfo() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutGetSimulatedHandleStatusInfo2() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutGetSparkVss() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutGetSystemState() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutInit() {
|
|
LOG_TRACE(Lib_AudioOut, "called");
|
|
if (audio != nullptr) {
|
|
return ORBIS_AUDIO_OUT_ERROR_ALREADY_INIT;
|
|
}
|
|
audio = std::make_unique<SDLAudioOut>();
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutInitIpmiGetSession() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutMasteringGetState() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutMasteringInit() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutMasteringSetParam() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutMasteringTerm() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutMbusInit() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
static void AudioOutputThread(PortOut* port, const std::stop_token& stop) {
|
|
{
|
|
const auto thread_name = fmt::format("shadPS4:AudioOutputThread:{}", fmt::ptr(port));
|
|
Common::SetCurrentThreadName(thread_name.c_str());
|
|
}
|
|
|
|
Common::AccurateTimer timer(
|
|
std::chrono::nanoseconds(1000000000ULL * port->buffer_frames / port->sample_rate));
|
|
while (true) {
|
|
timer.Start();
|
|
{
|
|
std::unique_lock lock{port->mutex};
|
|
if (port->output_cv.wait(lock, stop, [&] { return port->output_ready; })) {
|
|
port->impl->Output(port->output_buffer);
|
|
port->output_ready = false;
|
|
}
|
|
}
|
|
port->output_cv.notify_one();
|
|
if (stop.stop_requested()) {
|
|
break;
|
|
}
|
|
timer.End();
|
|
}
|
|
}
|
|
|
|
s32 PS4_SYSV_ABI sceAudioOutOpen(UserService::OrbisUserServiceUserId user_id,
|
|
OrbisAudioOutPort port_type, s32 index, u32 length,
|
|
u32 sample_rate,
|
|
OrbisAudioOutParamExtendedInformation param_type) {
|
|
LOG_INFO(Lib_AudioOut,
|
|
"id = {} port_type = {} index = {} length = {} sample_rate = {} "
|
|
"param_type = {} attr = {}",
|
|
user_id, magic_enum::enum_name(port_type), index, length, sample_rate,
|
|
magic_enum::enum_name(param_type.data_format.Value()),
|
|
magic_enum::enum_name(param_type.attributes.Value()));
|
|
if (audio == nullptr) {
|
|
LOG_ERROR(Lib_AudioOut, "Audio out not initialized");
|
|
return ORBIS_AUDIO_OUT_ERROR_NOT_INIT;
|
|
}
|
|
if ((port_type < OrbisAudioOutPort::Main || port_type > OrbisAudioOutPort::Padspk) &&
|
|
(port_type != OrbisAudioOutPort::Audio3d && port_type != OrbisAudioOutPort::Aux)) {
|
|
LOG_ERROR(Lib_AudioOut, "Invalid port type");
|
|
return ORBIS_AUDIO_OUT_ERROR_INVALID_PORT_TYPE;
|
|
}
|
|
if (sample_rate != 48000) {
|
|
LOG_ERROR(Lib_AudioOut, "Invalid sample rate");
|
|
return ORBIS_AUDIO_OUT_ERROR_INVALID_SAMPLE_FREQ;
|
|
}
|
|
if (length != 256 && length != 512 && length != 768 && length != 1024 && length != 1280 &&
|
|
length != 1536 && length != 1792 && length != 2048) {
|
|
LOG_ERROR(Lib_AudioOut, "Invalid length");
|
|
return ORBIS_AUDIO_OUT_ERROR_INVALID_SIZE;
|
|
}
|
|
if (index != 0) {
|
|
LOG_ERROR(Lib_AudioOut, "index is not valid !=0 {}", index);
|
|
}
|
|
const auto format = param_type.data_format.Value();
|
|
if (format < OrbisAudioOutParamFormat::S16Mono ||
|
|
format > OrbisAudioOutParamFormat::Float_8CH_Std) {
|
|
LOG_ERROR(Lib_AudioOut, "Invalid format");
|
|
return ORBIS_AUDIO_OUT_ERROR_INVALID_FORMAT;
|
|
}
|
|
const auto attr = param_type.attributes;
|
|
if (attr < OrbisAudioOutParamAttr::None || attr > OrbisAudioOutParamAttr::MixToMain) {
|
|
// TODO Handle attributes in output audio device
|
|
LOG_ERROR(Lib_AudioOut, "Invalid format attribute");
|
|
return ORBIS_AUDIO_OUT_ERROR_INVALID_FORMAT;
|
|
}
|
|
|
|
std::unique_lock open_lock{port_open_mutex};
|
|
const auto port =
|
|
std::ranges::find_if(ports_out, [&](const PortOut& p) { return !p.IsOpen(); });
|
|
if (port == ports_out.end()) {
|
|
LOG_ERROR(Lib_AudioOut, "Audio ports are full");
|
|
return ORBIS_AUDIO_OUT_ERROR_PORT_FULL;
|
|
}
|
|
|
|
{
|
|
std::unique_lock port_lock(port->mutex);
|
|
|
|
port->type = port_type;
|
|
port->format_info = GetFormatInfo(format);
|
|
port->sample_rate = sample_rate;
|
|
port->buffer_frames = length;
|
|
port->volume.fill(SCE_AUDIO_OUT_VOLUME_0DB);
|
|
|
|
port->impl = audio->Open(*port);
|
|
|
|
port->output_buffer = std::malloc(port->BufferSize());
|
|
port->output_ready = false;
|
|
port->output_thread.Run(
|
|
[port](const std::stop_token& stop) { AudioOutputThread(&*port, stop); });
|
|
}
|
|
return std::distance(ports_out.begin(), port) + 1;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutOpenEx() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
s32 PS4_SYSV_ABI sceAudioOutOutput(s32 handle, void* ptr) {
|
|
if (audio == nullptr) {
|
|
return ORBIS_AUDIO_OUT_ERROR_NOT_INIT;
|
|
}
|
|
if (handle < 1 || handle > SCE_AUDIO_OUT_NUM_PORTS) {
|
|
return ORBIS_AUDIO_OUT_ERROR_INVALID_PORT;
|
|
}
|
|
|
|
auto& port = ports_out.at(handle - 1);
|
|
{
|
|
std::unique_lock lock{port.mutex};
|
|
if (!port.IsOpen()) {
|
|
return ORBIS_AUDIO_OUT_ERROR_INVALID_PORT;
|
|
}
|
|
port.output_cv.wait(lock, [&] { return !port.output_ready; });
|
|
if (ptr != nullptr && port.IsOpen()) {
|
|
std::memcpy(port.output_buffer, ptr, port.BufferSize());
|
|
port.output_ready = true;
|
|
}
|
|
}
|
|
port.output_cv.notify_one();
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutOutputs(OrbisAudioOutOutputParam* param, u32 num) {
|
|
for (u32 i = 0; i < num; i++) {
|
|
const auto [handle, ptr] = param[i];
|
|
if (const auto ret = sceAudioOutOutput(handle, ptr); ret != ORBIS_OK) {
|
|
return ret;
|
|
}
|
|
}
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutPtClose() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutPtGetLastOutputTime() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutPtOpen() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutSetConnections() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutSetConnectionsForUser() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutSetDevConnection() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutSetHeadphoneOutMode() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutSetJediJackVolume() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutSetJediSpkVolume() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutSetMainOutput() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutSetMixLevelPadSpk() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutSetMorpheusParam() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutSetMorpheusWorkingMode() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutSetPortConnections() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutSetPortStatuses() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutSetRecMode() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutSetSparkParam() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutSetUsbVolume() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
s32 PS4_SYSV_ABI sceAudioOutSetVolume(s32 handle, s32 flag, s32* vol) {
|
|
if (audio == nullptr) {
|
|
return ORBIS_AUDIO_OUT_ERROR_NOT_INIT;
|
|
}
|
|
if (handle < 1 || handle > SCE_AUDIO_OUT_NUM_PORTS) {
|
|
return ORBIS_AUDIO_OUT_ERROR_INVALID_PORT;
|
|
}
|
|
|
|
auto& port = ports_out.at(handle - 1);
|
|
{
|
|
std::unique_lock lock{port.mutex};
|
|
if (!port.IsOpen()) {
|
|
return ORBIS_AUDIO_OUT_ERROR_INVALID_PORT;
|
|
}
|
|
for (int i = 0; i < port.format_info.num_channels; i++, flag >>= 1u) {
|
|
if (flag & 0x1u) {
|
|
port.volume[i] = vol[i];
|
|
}
|
|
}
|
|
port.impl->SetVolume(port.volume);
|
|
}
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutSetVolumeDown() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutStartAuxBroadcast() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutStartSharePlay() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutStopAuxBroadcast() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutStopSharePlay() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutSuspendResume() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutSysConfigureOutputMode() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutSysGetHdmiMonitorInfo() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutSysGetSystemInfo() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutSysHdmiMonitorInfoIsSupportedAudioOutMode() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutSystemControlGet() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutSystemControlSet() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutSparkControlSetEqCoef() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceAudioOutSetSystemDebugState() {
|
|
LOG_ERROR(Lib_AudioOut, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
void RegisterlibSceAudioOut(Core::Loader::SymbolsResolver* sym) {
|
|
LIB_FUNCTION("cx2dYFbzIAg", "libSceAudioOutDeviceService", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutDeviceIdOpen);
|
|
LIB_FUNCTION("tKumjQSzhys", "libSceAudioDeviceControl", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioDeviceControlGet);
|
|
LIB_FUNCTION("5ChfcHOf3SM", "libSceAudioDeviceControl", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioDeviceControlSet);
|
|
LIB_FUNCTION("Iz9X7ISldhs", "libSceAudioOut", 1, "libSceAudioOut", 1, 1, sceAudioOutA3dControl);
|
|
LIB_FUNCTION("9RVIoocOVAo", "libSceAudioOut", 1, "libSceAudioOut", 1, 1, sceAudioOutA3dExit);
|
|
LIB_FUNCTION("n7KgxE8rOuE", "libSceAudioOut", 1, "libSceAudioOut", 1, 1, sceAudioOutA3dInit);
|
|
LIB_FUNCTION("WBAO6-n0-4M", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutAttachToApplicationByPid);
|
|
LIB_FUNCTION("O3FM2WXIJaI", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutChangeAppModuleState);
|
|
LIB_FUNCTION("s1--uE9mBFw", "libSceAudioOut", 1, "libSceAudioOut", 1, 1, sceAudioOutClose);
|
|
LIB_FUNCTION("ol4LbeTG8mc", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutDetachFromApplicationByPid);
|
|
LIB_FUNCTION("r1V9IFEE+Ts", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutExConfigureOutputMode);
|
|
LIB_FUNCTION("wZakRQsWGos", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutExGetSystemInfo);
|
|
LIB_FUNCTION("xjjhT5uw08o", "libSceAudioOut", 1, "libSceAudioOut", 1, 1, sceAudioOutExPtClose);
|
|
LIB_FUNCTION("DsST7TNsyfo", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutExPtGetLastOutputTime);
|
|
LIB_FUNCTION("4UlW3CSuCa4", "libSceAudioOut", 1, "libSceAudioOut", 1, 1, sceAudioOutExPtOpen);
|
|
LIB_FUNCTION("Xcj8VTtnZw0", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutExSystemInfoIsSupportedAudioOutExMode);
|
|
LIB_FUNCTION("I3Fwcmkg5Po", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutGetFocusEnablePid);
|
|
LIB_FUNCTION("Y3lXfCFEWFY", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutGetHandleStatusInfo);
|
|
LIB_FUNCTION("-00OAutAw+c", "libSceAudioOut", 1, "libSceAudioOut", 1, 1, sceAudioOutGetInfo);
|
|
LIB_FUNCTION("RqmKxBqB8B4", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutGetInfoOpenNum);
|
|
LIB_FUNCTION("Ptlts326pds", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutGetLastOutputTime);
|
|
LIB_FUNCTION("GrQ9s4IrNaQ", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutGetPortState);
|
|
LIB_FUNCTION("c7mVozxJkPU", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutGetSimulatedBusUsableStatusByBusType);
|
|
LIB_FUNCTION("pWmS7LajYlo", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutGetSimulatedHandleStatusInfo);
|
|
LIB_FUNCTION("oPLghhAWgMM", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutGetSimulatedHandleStatusInfo2);
|
|
LIB_FUNCTION("5+r7JYHpkXg", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutGetSparkVss);
|
|
LIB_FUNCTION("R5hemoKKID8", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutGetSystemState);
|
|
LIB_FUNCTION("JfEPXVxhFqA", "libSceAudioOut", 1, "libSceAudioOut", 1, 1, sceAudioOutInit);
|
|
LIB_FUNCTION("n16Kdoxnvl0", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutInitIpmiGetSession);
|
|
LIB_FUNCTION("r+qKw+ueD+Q", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutMasteringGetState);
|
|
LIB_FUNCTION("xX4RLegarbg", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutMasteringInit);
|
|
LIB_FUNCTION("4055yaUg3EY", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutMasteringSetParam);
|
|
LIB_FUNCTION("RVWtUgoif5o", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutMasteringTerm);
|
|
LIB_FUNCTION("-LXhcGARw3k", "libSceAudioOut", 1, "libSceAudioOut", 1, 1, sceAudioOutMbusInit);
|
|
LIB_FUNCTION("ekNvsT22rsY", "libSceAudioOut", 1, "libSceAudioOut", 1, 1, sceAudioOutOpen);
|
|
LIB_FUNCTION("qLpSK75lXI4", "libSceAudioOut", 1, "libSceAudioOut", 1, 1, sceAudioOutOpenEx);
|
|
LIB_FUNCTION("QOQtbeDqsT4", "libSceAudioOut", 1, "libSceAudioOut", 1, 1, sceAudioOutOutput);
|
|
LIB_FUNCTION("w3PdaSTSwGE", "libSceAudioOut", 1, "libSceAudioOut", 1, 1, sceAudioOutOutputs);
|
|
LIB_FUNCTION("MapHTgeogbk", "libSceAudioOut", 1, "libSceAudioOut", 1, 1, sceAudioOutPtClose);
|
|
LIB_FUNCTION("YZaq+UKbriQ", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutPtGetLastOutputTime);
|
|
LIB_FUNCTION("xyT8IUCL3CI", "libSceAudioOut", 1, "libSceAudioOut", 1, 1, sceAudioOutPtOpen);
|
|
LIB_FUNCTION("o4OLQQqqA90", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutSetConnections);
|
|
LIB_FUNCTION("QHq2ylFOZ0k", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutSetConnectionsForUser);
|
|
LIB_FUNCTION("r9KGqGpwTpg", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutSetDevConnection);
|
|
LIB_FUNCTION("08MKi2E-RcE", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutSetHeadphoneOutMode);
|
|
LIB_FUNCTION("18IVGrIQDU4", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutSetJediJackVolume);
|
|
LIB_FUNCTION("h0o+D4YYr1k", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutSetJediSpkVolume);
|
|
LIB_FUNCTION("KI9cl22to7E", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutSetMainOutput);
|
|
LIB_FUNCTION("wVwPU50pS1c", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutSetMixLevelPadSpk);
|
|
LIB_FUNCTION("eeRsbeGYe20", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutSetMorpheusParam);
|
|
LIB_FUNCTION("IZrItPnflBM", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutSetMorpheusWorkingMode);
|
|
LIB_FUNCTION("Gy0ReOgXW00", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutSetPortConnections);
|
|
LIB_FUNCTION("oRBFflIrCg0", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutSetPortStatuses);
|
|
LIB_FUNCTION("ae-IVPMSWjU", "libSceAudioOut", 1, "libSceAudioOut", 1, 1, sceAudioOutSetRecMode);
|
|
LIB_FUNCTION("d3WL2uPE1eE", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutSetSparkParam);
|
|
LIB_FUNCTION("X7Cfsiujm8Y", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutSetUsbVolume);
|
|
LIB_FUNCTION("b+uAV89IlxE", "libSceAudioOut", 1, "libSceAudioOut", 1, 1, sceAudioOutSetVolume);
|
|
LIB_FUNCTION("rho9DH-0ehs", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutSetVolumeDown);
|
|
LIB_FUNCTION("I91P0HAPpjw", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutStartAuxBroadcast);
|
|
LIB_FUNCTION("uo+eoPzdQ-s", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutStartSharePlay);
|
|
LIB_FUNCTION("AImiaYFrKdc", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutStopAuxBroadcast);
|
|
LIB_FUNCTION("teCyKKZPjME", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutStopSharePlay);
|
|
LIB_FUNCTION("95bdtHdNUic", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutSuspendResume);
|
|
LIB_FUNCTION("oRJZnXxok-M", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutSysConfigureOutputMode);
|
|
LIB_FUNCTION("Tf9-yOJwF-A", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutSysGetHdmiMonitorInfo);
|
|
LIB_FUNCTION("y2-hP-KoTMI", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutSysGetSystemInfo);
|
|
LIB_FUNCTION("YV+bnMvMfYg", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutSysHdmiMonitorInfoIsSupportedAudioOutMode);
|
|
LIB_FUNCTION("JEHhANREcLs", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutSystemControlGet);
|
|
LIB_FUNCTION("9CHWVv6r3Dg", "libSceAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutSystemControlSet);
|
|
LIB_FUNCTION("Mt7JB3lOyJk", "libSceAudioOutSparkControl", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutSparkControlSetEqCoef);
|
|
LIB_FUNCTION("7UsdDOEvjlk", "libSceDbgAudioOut", 1, "libSceAudioOut", 1, 1,
|
|
sceAudioOutSetSystemDebugState);
|
|
};
|
|
|
|
} // namespace Libraries::AudioOut
|