Uh oh!
There was an error while loading. Please reload this page.
Build fixes: host portability, and 16 KB page alignment for the sink module - #1
Merged
joshuatam merged 4 commits intoAug 10, 2026
Conversation
main-build.sh patched the vendored libtool/libsndfile aclocal.m4 files with `sed -i 's/1.15/1.18/g'`, which only works on a host that has automake 1.18 installed. On anything else autoreconf then demands a version that isn't there and the build stops. Derive the version from `automake --version` instead, so the tree builds regardless of which automake the host provides. Verified on Ubuntu 24.04 (automake 1.16.5). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
configure.ac derives the package version through ./git-version-gen, which needs either a reachable git tag or a .tarball-version file. The pulseaudio fork carries no tags and .tarball-version is listed in .gitignore, so on a fresh clone git-version-gen returns an empty string and configure.ac:34 aborts with "git-version-gen failed". Seed the file with 13.0 when it is absent. bootstrap.sh then rewrites it to 13.0-rebootstrapped, which is the version string the currently shipped binaries report, so this reproduces the existing artifacts rather than changing them. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
main-build.sh exports -Wl,-z,max-page-size=16384 -Wl,-z,common-page-size=16384 globally, and pulseaudio-module/CMakeLists.txt sets them too, but pulseaudio-module/build.sh invokes clang directly without them. create-asset.sh copies from build64/, i.e. build.sh's output, so the module that actually ships is the one built without the flags. The result is that module-aaudio-sink.so has PT_LOAD alignment 0x1000 while every other binary in the same asset (pactl, libprotocol-native.so, module-native-protocol-unix.so) and the jniLibs (libpulsecore-13.0.so) are all 0x4000. On a device booted with 16 KB pages the loader cannot map a 4 KB aligned library, so dlopen of the sink module would fail; with --fail=false the daemon stays up but has no sink at all. This is not covered by Play's 16 KB compliance check, which scans lib/**/*.so inside the APK. The module ships compressed inside assets/*.tzst and is extracted and dlopen'd at runtime, so the scanner never sees it. Building the module both ways from identical source gives 0x1000 without the flags and 0x4000 with them. Not tested on real 16 KB hardware. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
pulseaudio-module/build.sh hardcodes /home/joshua/Android/Sdk/ndk/... while main-build.sh, sitting next to it, already resolves the same NDK through $HOME. On any other machine the module build fails immediately with "aarch64-linux-android26-clang: No such file or directory". Use $HOME so both scripts agree and the module can be rebuilt by anyone with the NDK installed at the documented location. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four small build-script fixes. Three are host-portability issues that stop a fresh clone from building anywhere but the maintainer's machine; one is a page-alignment bug in the artifact that actually ships.
Discussed in the GameNative Discord
#code-changesthread beforehand.1. Derive the automake version from the host
main-build.shpatched the vendoredlibtool/libsndfileaclocal.m4files withsed -i 's/1.15/1.18/g', which assumes automake 1.18 is installed. On any other hostautoreconfthen demands a version that isn't present and the build stops. Now derived fromautomake --version.2. Seed
.tarball-versionso a fresh clone can configureconfigure.acderives the package version through./git-version-gen, which needs either a reachable git tag or a.tarball-versionfile. Thepulseaudiofork carries no tags and.tarball-versionis gitignored, so on a fresh clonegit-version-genreturns empty andconfigure.ac:34aborts withgit-version-gen failed.Seeded with
13.0only when absent.bootstrap.shthen rewrites it to13.0-rebootstrapped, which is the exact version string the currently shipped binaries report — so this reproduces the existing artifacts rather than changing them.3. 16 KB page-size linker flags for the module build
main-build.shexports-Wl,-z,max-page-size=16384 -Wl,-z,common-page-size=16384globally, andpulseaudio-module/CMakeLists.txtsets them too — butpulseaudio-module/build.shinvokes clang directly without them, andcreate-asset.shcopies frombuild64/, i.e.build.sh's output. So the module that actually ships is the one built without the flags.Measured on the current
pulseaudio-gamenative-20260612.tzst:libpulsecore-13.0.soand the rest ofjniLibsare0x4000as well. On a device booted with 16 KB pages the loader cannot map a 4 KB-aligned library, sodlopenof the sink module would fail; because the daemon runs with--fail=falseit would stay up with no sink at all, which presents as "no audio on the pulseaudio driver" rather than an obvious crash.Worth noting this isn't covered by Play's 16 KB compliance check, which scans
lib/**/*.soinside the APK — all 27 of those are already correctly aligned. This module ships compressed insideassets/*.tzstand is extracted anddlopen'd at runtime, so the scanner never sees it.Caveat: I don't have a 16 KB-page device, so I have not observed the
dlopenfailure in the field. What is verified is that building the module both ways from identical source gives0x1000without the flags and0x4000with them.4. Use
$HOMEfor the NDK path in the module buildpulseaudio-module/build.shhardcoded/home/joshua/Android/Sdk/ndk/...whilemain-build.shnext to it already resolves the same NDK through$HOME. Without this, the module build fails immediately withaarch64-linux-android26-clang: No such file or directoryfor anyone else — including anyone trying to verify fix 3.Verification
On Ubuntu 24.04 with NDK r27d (27.3.13750724), from a clean clone with only these four commits applied:
main-build.sh -a arm64completes, banner reportspulseaudio 13.0-rebootstrappedpulseaudio-module/build.shproducesmodule-aaudio-sink.soatLOAD align 0x4000pactl,libprotocol-native.soandmodule-native-protocol-unix.sofrom the.tzst, pluslibpulsecore-13.0.so,libsndfile.soandlibltdl.sofromjniLibsOnly
libpulse.so/libpulseaudio.so/libpulsecommon-13.0.sodiffer, purely because they embed the build prefix path — confirmed by building at two different prefix lengths and seeing the size delta scale accordingly.No functional change to the built binaries beyond the alignment of the sink module.
ac_cv_func_mkfifo=nois deliberately left untouched here — that's a separate discussion.