FS#71794 - [sdl] Cherry-pick comma-separated SDL_AUDIODRIVER and "pulseaudio" alias

Attached to Project: Community Packages
Opened by Autumn (autumnontape) - Tuesday, 10 August 2021, 23:47 GMT
Last edited by Jan Alexander Steffens (heftig) - Tuesday, 31 August 2021, 23:29 GMT
Task Type Feature Request
Category Packages
Status Closed
Assigned To Evangelos Foutras (foutrelis)
Jan Alexander Steffens (heftig)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
SDL 2.0.16 was recently published with support for PipeWire as an audio driver, as well as support for comma-separated lists in the SDL_AUDIODRIVER environment variable. When a comma-separated list of driver names like "pipewire,pulseaudio,alsa" is given instead of a single driver name, SDL is able to fall back to later ones if earlier ones aren't available.

In order to use the PipeWire driver, currently, an application or user must ask for it, with users using SDL_AUDIODRIVER to do so. SDL 1.2 does not support PipeWire as an audio driver, so using SDL_AUDIODRIVER=pipewire with an SDL 1.2 application will cause SDL_AudioInit to fail (unless the application itself requests a specific audio driver). This makes it impossible to test the PipeWire driver by setting SDL_AUDIODRIVER indiscriminately on a system that includes both SDL 1.2 and SDL 2.0 applications.

The comma-separated list functionality was backported to the SDL 1.2 main branch just a few hours ago. Since SDL 1.2 hasn't had a new release since 2012, it's likely that Arch will have to use a patch if it wants to benefit from this in a timely manner, if at all.

In a much older but still unreleased commit, SDL 1.2 added "pulseaudio" as an alias for its "pulse" audio driver, since that's the name the driver goes by in SDL 2.0. It seems natural to adopt this enhancement as well, partly because the actual commit implementing comma-separated SDL_AUDIODRIVER depends on the commits implementing the "pulseaudio" alias in order to auto-merge.

Additional info:
* sdl-1.2.15-14 is current at the time of writing.
* I've attached a patch with the relevant upstream commits cherry-picked and squashed.
* Commits in question:
* https://github.com/libsdl-org/SDL-1.2/commit/d9514097846381cd30fe08df65dbdd48de92a058
* https://github.com/libsdl-org/SDL-1.2/commit/6bb378c8ff0c4b39ce2867e9c46dd895f09cbdb7
* https://github.com/libsdl-org/SDL-1.2/commit/e23a8932d254bff936aca61bd40ad7e859e97404

Steps to reproduce:
Run an SDL 1.2 application with SDL_AUDIODRIVER=pipewire,pulseaudio
This task depends upon

Closed by  Jan Alexander Steffens (heftig)
Tuesday, 31 August 2021, 23:29 GMT
Reason for closing:  Fixed
Additional comments about closing:  sdl 1.2.15+387+gfbfcca32-1
Comment by Autumn (autumnontape) - Wednesday, 18 August 2021, 23:20 GMT
It may even be a good idea to build the sdl package from the main branch on GitHub, similar to what's done for the qt5 packages. That's what the SDL developers recommend in at least one place, the sdl12-compat readme: https://github.com/libsdl-org/sdl12-compat#readme

Loading...