mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-17 00:59:05 +00:00
audio: Implement cubeb audio out backend. (#1895)
* audio: Implement cubeb audio out backend. * cubeb_audio: Add some additional safety checks. * cubeb_audio: Add debug logging callback. * audioout: Refactor backend ports into class. * pthread: Bump minimum stack size to fix cubeb crash. * cubeb_audio: Replace output yield loop with condvar. * common: Rename ring_buffer_base to RingBuffer.
This commit is contained in:
@@ -3,12 +3,15 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/bit_field.h"
|
||||
#include <memory>
|
||||
|
||||
#include "common/bit_field.h"
|
||||
#include "core/libraries/system/userservice.h"
|
||||
|
||||
namespace Libraries::AudioOut {
|
||||
|
||||
class PortBackend;
|
||||
|
||||
// Main up to 8 ports, BGM 1 port, voice up to 4 ports,
|
||||
// personal up to 4 ports, padspk up to 5 ports, aux 1 port
|
||||
constexpr int SCE_AUDIO_OUT_NUM_PORTS = 22;
|
||||
@@ -43,7 +46,7 @@ union OrbisAudioOutParamExtendedInformation {
|
||||
|
||||
struct OrbisAudioOutOutputParam {
|
||||
s32 handle;
|
||||
const void* ptr;
|
||||
void* ptr;
|
||||
};
|
||||
|
||||
struct OrbisAudioOutPortState {
|
||||
@@ -56,6 +59,21 @@ struct OrbisAudioOutPortState {
|
||||
u64 reserved64[2];
|
||||
};
|
||||
|
||||
struct PortOut {
|
||||
std::unique_ptr<PortBackend> impl{};
|
||||
|
||||
OrbisAudioOutPort type;
|
||||
OrbisAudioOutParamFormat format;
|
||||
bool is_float;
|
||||
u8 sample_size;
|
||||
u8 channels_num;
|
||||
u32 samples_num;
|
||||
u32 frame_size;
|
||||
u32 buffer_size;
|
||||
u32 freq;
|
||||
std::array<int, 8> volume;
|
||||
};
|
||||
|
||||
int PS4_SYSV_ABI sceAudioOutDeviceIdOpen();
|
||||
int PS4_SYSV_ABI sceAudioDeviceControlGet();
|
||||
int PS4_SYSV_ABI sceAudioDeviceControlSet();
|
||||
@@ -94,7 +112,7 @@ s32 PS4_SYSV_ABI sceAudioOutOpen(UserService::OrbisUserServiceUserId user_id,
|
||||
OrbisAudioOutPort port_type, s32 index, u32 length,
|
||||
u32 sample_rate, OrbisAudioOutParamExtendedInformation param_type);
|
||||
int PS4_SYSV_ABI sceAudioOutOpenEx();
|
||||
s32 PS4_SYSV_ABI sceAudioOutOutput(s32 handle, const void* ptr);
|
||||
s32 PS4_SYSV_ABI sceAudioOutOutput(s32 handle, void* ptr);
|
||||
s32 PS4_SYSV_ABI sceAudioOutOutputs(OrbisAudioOutOutputParam* param, u32 num);
|
||||
int PS4_SYSV_ABI sceAudioOutPtClose();
|
||||
int PS4_SYSV_ABI sceAudioOutPtGetLastOutputTime();
|
||||
|
||||
Reference in New Issue
Block a user