diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eda114b0f4..39900ae177 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -199,6 +199,36 @@ jobs: install -Dm644 tools/linuxfs/desktop/firefox-steamdeck.js "$D/usr/lib/firefox/defaults/pref/steamdeck.js" ls -lR "$D" + # The daemon's AAudio sink (tools/aaudio-sink), compiled here against upstream PulseAudio 13 + # headers and the app's own libpulse*, then put into the audio bundle the apk carries. The + # committed bundle holds every other module and no sink, so a build without this step would + # have no audio - the unpack check in PulseAudioComponent would then fail loudly, not quietly. + - name: Cache PulseAudio 13.0 source + id: pa-src + uses: actions/cache@v4 + with: + path: pa13 + key: pulseaudio-src-13.0 + - name: Fetch PulseAudio 13.0 source + if: steps.pa-src.outputs.cache-hit != 'true' + run: | + set -euo pipefail + curl -fsSL -o pa.tar.gz https://github.com/pulseaudio/pulseaudio/archive/refs/tags/v13.0.tar.gz + mkdir -p pa13 && tar -xzf pa.tar.gz -C pa13 --strip-components=1 && rm pa.tar.gz + - name: Build the AAudio sink into the audio bundle + run: | + set -euo pipefail + export NDK="${ANDROID_NDK_LATEST_HOME:-${ANDROID_NDK_HOME:-$ANDROID_NDK_ROOT}}" + tools/aaudio-sink/build.sh "$PWD/pa13" "$PWD/module-aaudio-sink.so" + rm -rf pa-bundle && mkdir -p pa-bundle + tar --use-compress-program=unzstd -xf app/src/main/assets/pulseaudio.tzst -C pa-bundle + test ! -f pa-bundle/modules/arm64/module-aaudio-sink.so + install -m755 module-aaudio-sink.so pa-bundle/modules/arm64/module-aaudio-sink.so + (cd pa-bundle && tar --use-compress-program='zstd -19' -cf ../pulseaudio.tzst .) + mv pulseaudio.tzst app/src/main/assets/pulseaudio.tzst + tar --use-compress-program=unzstd -tf app/src/main/assets/pulseaudio.tzst | grep -c '\.so$' + rm -rf pa-bundle module-aaudio-sink.so + # Runs whether the preloads were built or restored: readelf reads any ELF whatever the host, # so these assertions cost nothing and need no cross toolchain. - name: Check the preloads diff --git a/app/src/main/assets/pulseaudio.tzst b/app/src/main/assets/pulseaudio.tzst index 14fd4b2192..7e2f9e08c8 100644 Binary files a/app/src/main/assets/pulseaudio.tzst and b/app/src/main/assets/pulseaudio.tzst differ diff --git a/app/src/main/java/com/steamdeck/launcher/audio/PulseAudioComponent.java b/app/src/main/java/com/steamdeck/launcher/audio/PulseAudioComponent.java index 458ec32d40..f2cbf71ba4 100644 --- a/app/src/main/java/com/steamdeck/launcher/audio/PulseAudioComponent.java +++ b/app/src/main/java/com/steamdeck/launcher/audio/PulseAudioComponent.java @@ -31,7 +31,7 @@ public class PulseAudioComponent extends SessionPart { /** Where the guest reaches the daemon; the session exports PULSE_SERVER=unix:. */ public static final String SOCKET_NAME = "PS0"; /** Identifies the bundled pulseaudio.tzst; a change here re-unpacks it over what a device has. */ - private static final String BUNDLE_STAMP = "2026-09-21-pa13-pipe-modules"; + private static final String BUNDLE_STAMP = "2026-09-23-pa13-aaudio-sink-r2"; private final File workingDir; /** Where the daemon's own output is kept for this session, or null for logcat only. */ @@ -72,8 +72,8 @@ public class PulseAudioComponent extends SessionPart { workingDir.mkdirs(); FileUtils.chmod(workingDir, 0771); } - // The loadable modules (module-aaudio-sink, the native protocol, the pipe modules) ride in - // the apk; the daemon and its libraries come from the native library directory, the one + // The loadable modules (module-aaudio-sink - the app's own, from tools/aaudio-sink - the + // native protocol, the pipe modules) ride in the apk; the daemon and its libraries come from the native library directory, the one // place an app may execute a file from. The bundle is unpacked once per BUNDLE_STAMP, not // once ever: an installed app kept the modules it unpacked on its first run, so a bundle // fixed in a later build never reached the device - which is how a 17.0 glibc build of