Skip to content

Commit 48c51bd

Browse files
authored
audio: Accurate audio output timing. (#1986)
* audio: Accurate audio output timing. * audio: Handle SDL audio queue stalls. * audio: Format info cleanup.
1 parent 927dc6d commit 48c51bd

File tree

15 files changed

+170
-821
lines changed

15 files changed

+170
-821
lines changed

.gitmodules

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,3 @@
119119
path = externals/MoltenVK/cereal
120120
url = https://github.com/USCiLab/cereal
121121
shallow = true
122-
[submodule "externals/cubeb"]
123-
path = externals/cubeb
124-
url = https://github.com/mozilla/cubeb
125-
shallow = true

CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ find_package(xxHash 0.8.2 MODULE)
127127
find_package(ZLIB 1.3 MODULE)
128128
find_package(Zydis 5.0.0 CONFIG)
129129
find_package(pugixml 1.14 CONFIG)
130-
find_package(cubeb CONFIG)
131130

132131
if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR NOT MSVC)
133132
find_package(cryptopp 8.9.0 MODULE)
@@ -203,7 +202,6 @@ set(AUDIO_LIB src/core/libraries/audio/audioin.cpp
203202
src/core/libraries/audio/audioout.h
204203
src/core/libraries/audio/audioout_backend.h
205204
src/core/libraries/audio/audioout_error.h
206-
src/core/libraries/audio/cubeb_audio.cpp
207205
src/core/libraries/audio/sdl_audio.cpp
208206
src/core/libraries/ngs2/ngs2.cpp
209207
src/core/libraries/ngs2/ngs2.h
@@ -499,7 +497,6 @@ set(COMMON src/common/logging/backend.cpp
499497
src/common/polyfill_thread.h
500498
src/common/rdtsc.cpp
501499
src/common/rdtsc.h
502-
src/common/ringbuffer.h
503500
src/common/signal_context.h
504501
src/common/signal_context.cpp
505502
src/common/singleton.h
@@ -892,7 +889,7 @@ endif()
892889
create_target_directory_groups(shadps4)
893890

894891
target_link_libraries(shadps4 PRIVATE magic_enum::magic_enum fmt::fmt toml11::toml11 tsl::robin_map xbyak::xbyak Tracy::TracyClient RenderDoc::API FFmpeg::ffmpeg Dear_ImGui gcn half::half ZLIB::ZLIB PNG::PNG)
895-
target_link_libraries(shadps4 PRIVATE Boost::headers GPUOpen::VulkanMemoryAllocator LibAtrac9 sirit Vulkan::Headers xxHash::xxhash Zydis::Zydis glslang::glslang SDL3::SDL3 pugixml::pugixml stb::headers cubeb::cubeb)
892+
target_link_libraries(shadps4 PRIVATE Boost::headers GPUOpen::VulkanMemoryAllocator LibAtrac9 sirit Vulkan::Headers xxHash::xxhash Zydis::Zydis glslang::glslang SDL3::SDL3 pugixml::pugixml stb::headers)
896893

897894
target_compile_definitions(shadps4 PRIVATE IMGUI_USER_CONFIG="imgui/imgui_config.h")
898895
target_compile_definitions(Dear_ImGui PRIVATE IMGUI_USER_CONFIG="${PROJECT_SOURCE_DIR}/src/imgui/imgui_config.h")

LICENSES/ISC.txt

Lines changed: 0 additions & 7 deletions
This file was deleted.

externals/CMakeLists.txt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -228,16 +228,6 @@ if (NOT TARGET stb::headers)
228228
add_library(stb::headers ALIAS stb)
229229
endif()
230230

231-
# cubeb
232-
if (NOT TARGET cubeb::cubeb)
233-
option(BUILD_TESTS "" OFF)
234-
option(BUILD_TOOLS "" OFF)
235-
option(BUNDLE_SPEEX "" ON)
236-
option(USE_SANITIZERS "" OFF)
237-
add_subdirectory(cubeb)
238-
add_library(cubeb::cubeb ALIAS cubeb)
239-
endif()
240-
241231
# Apple-only dependencies
242232
if (APPLE)
243233
# date

externals/cubeb

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/common/config.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ static int cursorHideTimeout = 5; // 5 seconds (default)
6767
static bool separateupdatefolder = false;
6868
static bool compatibilityData = false;
6969
static bool checkCompatibilityOnStartup = false;
70-
static std::string audioBackend = "cubeb";
7170

7271
// Gui
7372
std::vector<std::filesystem::path> settings_install_dirs = {};
@@ -240,10 +239,6 @@ bool getCheckCompatibilityOnStartup() {
240239
return checkCompatibilityOnStartup;
241240
}
242241

243-
std::string getAudioBackend() {
244-
return audioBackend;
245-
}
246-
247242
void setGpuId(s32 selectedGpuId) {
248243
gpuId = selectedGpuId;
249244
}
@@ -376,10 +371,6 @@ void setCheckCompatibilityOnStartup(bool use) {
376371
checkCompatibilityOnStartup = use;
377372
}
378373

379-
void setAudioBackend(std::string backend) {
380-
audioBackend = backend;
381-
}
382-
383374
void setMainWindowGeometry(u32 x, u32 y, u32 w, u32 h) {
384375
main_window_geometry_x = x;
385376
main_window_geometry_y = y;
@@ -620,12 +611,6 @@ void load(const std::filesystem::path& path) {
620611
vkCrashDiagnostic = toml::find_or<bool>(vk, "crashDiagnostic", false);
621612
}
622613

623-
if (data.contains("Audio")) {
624-
const toml::value& audio = data.at("Audio");
625-
626-
audioBackend = toml::find_or<std::string>(audio, "backend", "cubeb");
627-
}
628-
629614
if (data.contains("Debug")) {
630615
const toml::value& debug = data.at("Debug");
631616

@@ -724,7 +709,6 @@ void save(const std::filesystem::path& path) {
724709
data["Vulkan"]["rdocEnable"] = rdocEnable;
725710
data["Vulkan"]["rdocMarkersEnable"] = vkMarkers;
726711
data["Vulkan"]["crashDiagnostic"] = vkCrashDiagnostic;
727-
data["Audio"]["backend"] = audioBackend;
728712
data["Debug"]["DebugDump"] = isDebugDump;
729713
data["Debug"]["CollectShader"] = isShaderDebug;
730714

@@ -828,7 +812,6 @@ void setDefaultValues() {
828812
separateupdatefolder = false;
829813
compatibilityData = false;
830814
checkCompatibilityOnStartup = false;
831-
audioBackend = "cubeb";
832815
}
833816

834817
} // namespace Config

src/common/config.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ bool getEnableDiscordRPC();
2424
bool getSeparateUpdateEnabled();
2525
bool getCompatibilityEnabled();
2626
bool getCheckCompatibilityOnStartup();
27-
std::string getAudioBackend();
2827

2928
std::string getLogFilter();
3029
std::string getLogType();
@@ -76,7 +75,6 @@ void setSeparateUpdateEnabled(bool use);
7675
void setGameInstallDirs(const std::vector<std::filesystem::path>& settings_install_dirs_config);
7776
void setCompatibilityEnabled(bool use);
7877
void setCheckCompatibilityOnStartup(bool use);
79-
void setAudioBackend(std::string backend);
8078

8179
void setCursorState(s16 cursorState);
8280
void setCursorHideTimeout(int newcursorHideTimeout);

0 commit comments

Comments
 (0)