Skip to content

feature(audio): SDL3 audio backend#6728

Open
bassdr wants to merge 5 commits into
HarbourMasters:developfrom
bassdr:feature/SDL3Backend
Open

feature(audio): SDL3 audio backend#6728
bassdr wants to merge 5 commits into
HarbourMasters:developfrom
bassdr:feature/SDL3Backend

Conversation

@bassdr

@bassdr bassdr commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

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

@Malkierian Malkierian added the do not merge Not ready or not valid changes label Jun 12, 2026
@Malkierian

Copy link
Copy Markdown
Contributor

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.

@bassdr bassdr force-pushed the feature/SDL3Backend branch from 8ff4d75 to 5578fb3 Compare June 12, 2026 00:59
@bassdr

bassdr commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

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.

@bassdr bassdr force-pushed the feature/SDL3Backend branch 2 times, most recently from a541792 to 835e9f7 Compare June 14, 2026 05:25
@bassdr

bassdr commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

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.

bassdr and others added 3 commits June 14, 2026 11:22
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>
@bassdr bassdr force-pushed the feature/SDL3Backend branch from d1bbf16 to 48ca3f6 Compare June 14, 2026 15:24
@bassdr bassdr marked this pull request as draft June 15, 2026 19:59
@bassdr bassdr marked this pull request as ready for review June 15, 2026 19:59
@mergify

mergify Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

bassdr and others added 2 commits June 23, 2026 10:34
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not merge Not ready or not valid changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants