PulseAudio: the 13.0 pipe modules, and a bundle that re-unpacks when it changes

The bundle carried a PulseAudio 17.0 glibc build of module-pipe-source (and
-sink): NEEDED libpulsecore-17.0.so and ld-linux, beside a 13.0 bionic daemon.
It could not dlopen, the DirectAudioMic source never existed, and the Steam
client reported no input device - the first thing the microphone port ran into
on a device. Bannerlator replaced both modules with its own 13.0 builds
(997acba2); this is that bundle, byte for byte, the other 75 files unchanged.

The component also unpacked the bundle only once, ever - a device kept the
modules from its first run whatever a later apk shipped. It now unpacks whenever
BUNDLE_STAMP changes, so this fix and the next one reach an installed app.
This commit is contained in:
The412Banner committed 2026-09-21 10:36:19 -04:00
1 parent 849596facb
commit fbe3737dc4
2 files changed
+21 -5

No files matched your search

@@ -30,6 +30,8 @@ public class PulseAudioComponent extends EnvironmentComponent {
private static final String TAG = "PulseAudio";
/** Where the guest reaches the daemon; the session exports PULSE_SERVER=unix:<this>. */
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 final File workingDir;
/**
@@ -63,11 +65,25 @@ public class PulseAudioComponent extends EnvironmentComponent {
workingDir.mkdirs();
FileUtils.chmod(workingDir, 0771);
}
// The loadable modules (module-aaudio-sink and the native protocol) 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.
if (!new File(workingDir, "modules/arm64/module-aaudio-sink.so").isFile()) {
TarZst.extractAsset(context, "pulseaudio.tzst", workingDir);
// 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
// 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
// module-pipe-source sat beside the 13.0 daemon, failed to dlopen, and the microphone
// never appeared. Bump the stamp whenever pulseaudio.tzst changes.
File modulesDir = new File(workingDir, "modules");
File stamp = new File(modulesDir, ".bundle");
String have = FileUtils.readString(stamp);
if (!new File(modulesDir, "arm64/module-aaudio-sink.so").isFile()
|| have == null || !BUNDLE_STAMP.equals(have.trim())) {
Log.i(TAG, "unpacking pulseaudio.tzst (" + BUNDLE_STAMP + "; had " + have + ")");
FileUtils.delete(modulesDir);
if (TarZst.extractAsset(context, "pulseaudio.tzst", workingDir)) {
FileUtils.writeString(stamp, BUNDLE_STAMP);
} else {
Log.e(TAG, "pulseaudio.tzst did not unpack");
}
}
copyFromLibraryDir();