[PR #1895] [MERGED] audio: Implement cubeb audio out backend. #2371

Closed
opened 2026-02-27 21:16:14 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/1895
Author: @squidbus
Created: 12/26/2024
Status: Merged
Merged: 12/27/2024
Merged by: @georgemoralis

Base: mainHead: cubeb


📝 Commits (7)

  • 5f4804c audio: Implement cubeb audio out backend.
  • 01959bd cubeb_audio: Add some additional safety checks.
  • dc0725a cubeb_audio: Add debug logging callback.
  • a7f8aae audioout: Refactor backend ports into class.
  • a4ef777 pthread: Bump minimum stack size to fix cubeb crash.
  • 42fb06d cubeb_audio: Replace output yield loop with condvar.
  • 79ed9f2 common: Rename ring_buffer_base to RingBuffer.

📊 Changes

18 files changed (+731 additions, -88 deletions)

View changed files

📝 .gitmodules (+4 -0)
📝 CMakeLists.txt (+6 -3)
LICENSES/ISC.txt (+7 -0)
📝 externals/CMakeLists.txt (+10 -0)
externals/cubeb (+1 -0)
📝 src/common/config.cpp (+17 -0)
📝 src/common/config.h (+2 -0)
src/common/ringbuffer.h (+374 -0)
📝 src/core/libraries/audio/audioout.cpp (+28 -31)
📝 src/core/libraries/audio/audioout.h (+21 -3)
📝 src/core/libraries/audio/audioout_backend.h (+29 -4)
src/core/libraries/audio/cubeb_audio.cpp (+158 -0)
📝 src/core/libraries/audio/sdl_audio.cpp (+42 -26)
src/core/libraries/audio/sdl_audio.h (+0 -18)
📝 src/core/libraries/kernel/threads/pthread.cpp (+2 -2)
📝 src/emulator.cpp (+1 -1)
📝 src/qt_gui/settings_dialog.cpp (+6 -0)
📝 src/qt_gui/settings_dialog.ui (+23 -0)

📄 Description

Implements a new default audio backend using cubeb, along with a config option to select an audio backend.

This backend does not suffer from https://github.com/shadps4-emu/shadPS4/issues/1717 (at least it fixes it for me), can reduce audio stutter, and implements some extra features like partial support for sceAudioOutSetVolume.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/1895 **Author:** [@squidbus](https://github.com/squidbus) **Created:** 12/26/2024 **Status:** ✅ Merged **Merged:** 12/27/2024 **Merged by:** [@georgemoralis](https://github.com/georgemoralis) **Base:** `main` ← **Head:** `cubeb` --- ### 📝 Commits (7) - [`5f4804c`](https://github.com/shadps4-emu/shadPS4/commit/5f4804cefc42dfe2f4649172ee86eb7638cb286b) audio: Implement cubeb audio out backend. - [`01959bd`](https://github.com/shadps4-emu/shadPS4/commit/01959bdee5a76ea235214f821ecbfcc32381144e) cubeb_audio: Add some additional safety checks. - [`dc0725a`](https://github.com/shadps4-emu/shadPS4/commit/dc0725aa9134729bef3d4c4202a249e34283703f) cubeb_audio: Add debug logging callback. - [`a7f8aae`](https://github.com/shadps4-emu/shadPS4/commit/a7f8aae2bea9cc49bd70efe0e9dabdabb2991413) audioout: Refactor backend ports into class. - [`a4ef777`](https://github.com/shadps4-emu/shadPS4/commit/a4ef7771dfc42318975a4fbc00a6f1b3bd9931cd) pthread: Bump minimum stack size to fix cubeb crash. - [`42fb06d`](https://github.com/shadps4-emu/shadPS4/commit/42fb06d0f1c624d72f98539970117e38025ad50d) cubeb_audio: Replace output yield loop with condvar. - [`79ed9f2`](https://github.com/shadps4-emu/shadPS4/commit/79ed9f203679c7d79471ae09076387621ab460b5) common: Rename ring_buffer_base to RingBuffer. ### 📊 Changes **18 files changed** (+731 additions, -88 deletions) <details> <summary>View changed files</summary> 📝 `.gitmodules` (+4 -0) 📝 `CMakeLists.txt` (+6 -3) ➕ `LICENSES/ISC.txt` (+7 -0) 📝 `externals/CMakeLists.txt` (+10 -0) ➕ `externals/cubeb` (+1 -0) 📝 `src/common/config.cpp` (+17 -0) 📝 `src/common/config.h` (+2 -0) ➕ `src/common/ringbuffer.h` (+374 -0) 📝 `src/core/libraries/audio/audioout.cpp` (+28 -31) 📝 `src/core/libraries/audio/audioout.h` (+21 -3) 📝 `src/core/libraries/audio/audioout_backend.h` (+29 -4) ➕ `src/core/libraries/audio/cubeb_audio.cpp` (+158 -0) 📝 `src/core/libraries/audio/sdl_audio.cpp` (+42 -26) ➖ `src/core/libraries/audio/sdl_audio.h` (+0 -18) 📝 `src/core/libraries/kernel/threads/pthread.cpp` (+2 -2) 📝 `src/emulator.cpp` (+1 -1) 📝 `src/qt_gui/settings_dialog.cpp` (+6 -0) 📝 `src/qt_gui/settings_dialog.ui` (+23 -0) </details> ### 📄 Description Implements a new default audio backend using cubeb, along with a config option to select an audio backend. This backend does not suffer from https://github.com/shadps4-emu/shadPS4/issues/1717 (at least it fixes it for me), can reduce audio stutter, and implements some extra features like partial support for `sceAudioOutSetVolume`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 21:16:14 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#2371
No description provided.