feature(audio): SDL3 audio backend#6728
Conversation
|
Adding "do not merge" tag because it needs to wait for whatever close crash fix actually makes it to main, in addition to the linked LUS PR. |
8ff4d75 to
5578fb3
Compare
|
Thanks! Happy to keep the do-not-merge tag. Once Kenix3/libultraship#1125 lands on LUS main I'll re-pin this properly. For the close crash: could you link the specific issue/PR you have in mind so I can mark it as a blocker here? FWIW I tested this branch together with #6667 and Kenix3/libultraship#1114 and the crashes are gone, so once those reach main this should be ready to go; but happy to wait on whichever fix you're tracking. |
a541792 to
835e9f7
Compare
|
Latest version added the dependencies to CICD, the backend will exist but will be available in the menu only if libSDL3.so on Linux is found in OS path, I did not package it. I did build the backend for Windows and macOS, but did not package the SDL3.dll / dylib, assuming people will continue using the dedicated WASAPI and CoreAudio backends. |
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The SDL3 audio backend compiles in only when find_package(SDL3) succeeds;
otherwise it is left out. Make SDL3 available at build time everywhere:
- Windows: add sdl3 to the vcpkg package list
- macOS: add the SDL3 MacPorts port (universal)
- Linux: build SDL3 from source (Ubuntu 22.04 has no libsdl3-dev)
- Build SDL3 with -DSDL_VIDEO=OFF on Linux: SoH uses SDL3 for audio only
Also document SDL3 as an optional dependency for local builds. The
library itself is loaded at runtime, so it is an optional runtime
dependency, not linked.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
d1bbf16 to
48ca3f6
Compare
|
Tick the box to add this pull request to the merge queue (same as
|
Resolve conflicts from develop's CI/backend-map refactors: - generate-builds.yml: adopt develop's install-sdl2-net/install-tinyxml2 composite actions, keep the 'Install latest SDL3' step. - MenuTypes.h: drop the backend maps (develop relocated them to BackendTypes.h); add the SDL3 entry to audioBackendsMap there. - libultraship: keep this branch's LUS pin (SDL3 audio backend needs LUS-side support), not develop's. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
It was mistakenly nested as a ##### heading under the openSUSE deps; move it to a proper ### subsection just before Build. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This brings SDL3 as an optional dependency to allow using SDL3 as an audio backend. This is working much better on Linux than the only SDL2 audio backend available.
As discussed in Kenix3/libultraship#1105 and Kenix3/libultraship#1107, currently the SDL audio backend has quite a lot of audio artifacts. On Windows and macOS, the dedicated WASAPI and CoreAudio backends make it less important, as these backends are of good quality (fewer audio artifacts), but Linux only has the SDL2 backend available.
Since fixing SDL2 backend or merging my PipeWire backend (Linux modern audio api) does not seem to have a lot of interest, it was discussed an SDL3 backend would be a better fit for the project.
This PR does not need to migrate the whole project to SDL3, as it loads only the Audio symbols directly from the DLL/so, and is designed to work on all platforms (only tested on Linux so far), while we are waiting for a full migration.
Kenix3/libultraship#1125 is targetting LUS' main branch, while this here pins a version on top of LUS' port-maintenance branch.
Also make sure we merge #6704, as it also adds audio artifacts.
This PR makes #6665 less important, as we now should use the SDL3 backend on Linux.
Build Artifacts