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:
squidbus 2024-12-27 11:04:49 -08:00 committed by GitHub
parent f95803664b
commit 333f35ef25
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 733 additions and 90 deletions

View file

@ -67,6 +67,7 @@ static int cursorHideTimeout = 5; // 5 seconds (default)
static bool separateupdatefolder = false;
static bool compatibilityData = false;
static bool checkCompatibilityOnStartup = false;
static std::string audioBackend = "cubeb";
// Gui
std::vector<std::filesystem::path> settings_install_dirs = {};
@ -239,6 +240,10 @@ bool getCheckCompatibilityOnStartup() {
return checkCompatibilityOnStartup;
}
std::string getAudioBackend() {
return audioBackend;
}
void setGpuId(s32 selectedGpuId) {
gpuId = selectedGpuId;
}
@ -371,6 +376,10 @@ void setCheckCompatibilityOnStartup(bool use) {
checkCompatibilityOnStartup = use;
}
void setAudioBackend(std::string backend) {
audioBackend = backend;
}
void setMainWindowGeometry(u32 x, u32 y, u32 w, u32 h) {
main_window_geometry_x = x;
main_window_geometry_y = y;
@ -611,6 +620,12 @@ void load(const std::filesystem::path& path) {
vkCrashDiagnostic = toml::find_or<bool>(vk, "crashDiagnostic", false);
}
if (data.contains("Audio")) {
const toml::value& audio = data.at("Audio");
audioBackend = toml::find_or<std::string>(audio, "backend", "cubeb");
}
if (data.contains("Debug")) {
const toml::value& debug = data.at("Debug");
@ -709,6 +724,7 @@ void save(const std::filesystem::path& path) {
data["Vulkan"]["rdocEnable"] = rdocEnable;
data["Vulkan"]["rdocMarkersEnable"] = vkMarkers;
data["Vulkan"]["crashDiagnostic"] = vkCrashDiagnostic;
data["Audio"]["backend"] = audioBackend;
data["Debug"]["DebugDump"] = isDebugDump;
data["Debug"]["CollectShader"] = isShaderDebug;
@ -812,6 +828,7 @@ void setDefaultValues() {
separateupdatefolder = false;
compatibilityData = false;
checkCompatibilityOnStartup = false;
audioBackend = "cubeb";
}
} // namespace Config