From 3d839993503c0853f26eaaed21e00e8d495b1f0e Mon Sep 17 00:00:00 2001 From: marshmll Date: Sun, 11 Oct 2026 10:34:29 -0300 Subject: [PATCH] fix(build): require an SDL audio backend on Linux The bundled SDL builds its PipeWire, PulseAudio and ALSA drivers only when their development files are found, and otherwise keeps just the silent dummy and disk drivers without an error. The Linux CI and release jobs install none of them, so the v0.1.1 Linux libraries (libSceAudioOut, libSceAgcDriver, libfmod) contain no audible driver. Fail configuration on Linux when SDL found none of the three, install the Debian development packages in the Linux build and release jobs, and list the packages in the build instructions. --- .github/workflows/build.yml | 4 ++-- .github/workflows/release.yml | 4 ++-- CMakeLists.txt | 10 ++++++++++ docs/dev/BUILD.md | 2 +- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e3e9c238d..724a3cfe0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -215,8 +215,8 @@ jobs: key: linux save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} evict-old-files: job - - name: Install lavapipe for the GPU execution tests - run: sudo apt-get update && sudo apt-get install -y --no-install-recommends libvulkan1 mesa-vulkan-drivers + - name: Install lavapipe for the GPU execution tests and the audio development files + run: sudo apt-get update && sudo apt-get install -y --no-install-recommends libvulkan1 mesa-vulkan-drivers libpipewire-0.3-dev libpulse-dev libasound2-dev - run: cmake -S . -B build $CONFIGURE -DANYPS5_ENABLE_SPIRV_TOOLS=ON - name: Check that every test executable is registered with ctest run: python3 tools/check_test_registration.py build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 544be3ea4..f54726afa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -60,9 +60,9 @@ jobs: with: key: ${{ matrix.platform }} save: false - - name: Install lavapipe for the GPU execution tests + - name: Install lavapipe for the GPU execution tests and the audio development files if: matrix.platform == 'linux' - run: sudo apt-get update && sudo apt-get install -y --no-install-recommends libvulkan1 mesa-vulkan-drivers + run: sudo apt-get update && sudo apt-get install -y --no-install-recommends libvulkan1 mesa-vulkan-drivers libpipewire-0.3-dev libpulse-dev libasound2-dev - name: Configure Linux if: matrix.platform == 'linux' run: cmake -S . -B build $CONFIGURE diff --git a/CMakeLists.txt b/CMakeLists.txt index 5cb4fb85c..ac7cf1f17 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,6 +93,16 @@ if(NOT ANYPS5_USE_SYSTEM_DEPS) set(CMAKE_EXE_LINKER_FLAGS "") add_subdirectory(3rdparty/SDL2) set(CMAKE_EXE_LINKER_FLAGS "${ANYPS5_EXE_LINKER_FLAGS}") + if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + get_directory_property(ANYPS5_SDL_PIPEWIRE DIRECTORY 3rdparty/SDL2 DEFINITION HAVE_PIPEWIRE) + get_directory_property(ANYPS5_SDL_PULSEAUDIO DIRECTORY 3rdparty/SDL2 DEFINITION HAVE_PULSEAUDIO) + get_directory_property(ANYPS5_SDL_ALSA DIRECTORY 3rdparty/SDL2 DEFINITION HAVE_ALSA) + if(NOT ANYPS5_SDL_PIPEWIRE AND NOT ANYPS5_SDL_PULSEAUDIO AND NOT ANYPS5_SDL_ALSA) + message(FATAL_ERROR "SDL found no PipeWire, PulseAudio or ALSA development files, so audio output would be silent. " + "Install libpipewire-0.3-dev, libpulse-dev and libasound2-dev (Debian, Ubuntu) " + "or pipewire-devel, pulseaudio-libs-devel and alsa-lib-devel (Fedora), then rerun configuration.") + endif() + endif() endif() set(ARCHITECTURE x86_64) add_subdirectory(3rdparty/ffmpeg-core) diff --git a/docs/dev/BUILD.md b/docs/dev/BUILD.md index 50e7023fe..29bfcddc6 100644 --- a/docs/dev/BUILD.md +++ b/docs/dev/BUILD.md @@ -27,7 +27,7 @@ git submodule update --init --recursive ## Requirements - x86-64, Git, CMake 3.22.1 or newer, Ninja, C++20. -- Linux: GCC, G++, binutils. SDL's X11 backend requires X11 and Xext development headers (`libx11-dev` and `libxext-dev` on Debian/Ubuntu). +- Linux: GCC, G++, binutils. SDL's X11 backend requires X11 and Xext development headers (`libx11-dev` and `libxext-dev` on Debian/Ubuntu). Audio output needs SDL's PipeWire, PulseAudio or ALSA backend, built from their development files (`libpipewire-0.3-dev`, `libpulse-dev` and `libasound2-dev` on Debian/Ubuntu; `pipewire-devel`, `pulseaudio-libs-devel` and `alsa-lib-devel` on Fedora). SDL loads them at run time. Without any of them SDL keeps only its silent dummy and disk drivers, so configuration fails. - Fedora: if CMake reports `Could NOT find Threads`, install `glibc-static` and `libstdc++-static` with `sudo dnf install glibc-static libstdc++-static`, then rerun configuration. The project enables static executable linking, and FFmpeg's thread check needs these libraries. - Windows: only MinGW-w64 GCC 15.2.0 (WinLibs `x86_64-ucrt-posix-seh`, release `15.2.0posix-14.0.0-ucrt-r7`) is currently supported. Add its `mingw64/bin` directory to `PATH` before configuring. - Windows antivirus software can quarantine the executables that the relinker tests create in the temp directory, which fails `optional_plt`, `empty_tls`, `windows_address_space` and `windows_icon`. Set `TEMP` and `TMP` to a directory the scanner excludes before running `ctest`.