Skip to content

addpkg(main/oboe) + enhance(main/openal-soft, main/pulseaudio): Oboe audio stack#29319

Open
ferrumclaudepilgrim wants to merge 3 commits into
termux:masterfrom
ferrumclaudepilgrim:add-oboe-and-openal-oboe
Open

addpkg(main/oboe) + enhance(main/openal-soft, main/pulseaudio): Oboe audio stack#29319
ferrumclaudepilgrim wants to merge 3 commits into
termux:masterfrom
ferrumclaudepilgrim:add-oboe-and-openal-oboe

Conversation

@ferrumclaudepilgrim
Copy link
Copy Markdown
Contributor

@ferrumclaudepilgrim ferrumclaudepilgrim commented Apr 12, 2026

Summary

Adds Oboe 1.10.0 as a new package and wires
it into openal-soft and pulseaudio.

Oboe is Google's C++ library for high-performance audio on Android, wrapping
AAudio (API 26+) and OpenSL ES with automatic fallback.

Commit 1: addpkg(main/oboe)

  • Builds shared library only (BUILD_SHARED_LIBS=ON)
  • Includes hand-written pkg-config and CMake config files (upstream does not
    provide install(EXPORT) or .pc templates)

Tested on 2 devices:

  • Samsung S26 Ultra (Android 16): load, unload, find_package, pkg-config,
    linking stress, all PASS
  • Google Pixel 10 Pro (Android 17 Beta): same suite, all PASS

Commit 2: enhance(main/openal-soft)

Three changes to packages/openal-soft/build.sh:

  1. TERMUX_PKG_REVISION=1
  2. oboe added to TERMUX_PKG_DEPENDS
  3. -DALSOFT_REQUIRE_OBOE=ON in TERMUX_PKG_EXTRA_CONFIGURE_ARGS

Upstream's existing Oboe backend (alc/backends/oboe.cpp) compiles in via
find_package(oboe CONFIG). No patches needed.

A/B comparison on both devices:

Commit 3: enhance(main/pulseaudio)

Adds module-oboe-sink and module-oboe-source. TERMUX_PKG_REVISION
bumped from 1 to 2.

Tested on Samsung S26 Ultra (Android 16) and Google Pixel 10 Pro (Android 17
Beta). Multi-arch build clean across aarch64, arm, i686, x86_64.

Relates to #28861, #27978, #27367, #26871.

Copy link
Copy Markdown
Member

@robertkirkman robertkirkman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works for me and it fixes the problem with openal-soft on certain devices.

Comment thread packages/oboe/build.sh Outdated
Comment thread packages/oboe/build.sh
Add Oboe 1.10.0, Google's C++ library for
high-performance audio on Android. Builds shared
library only (no static archive). Includes
hand-written pkg-config and CMake config files
since upstream does not provide them.

Suggested by @twaik in termux#28861 as a replacement
for the PulseAudio SLES backend to resolve
vendor-specific linking failures on newer Android
devices. Also discussed in termux#29074.
Add oboe to TERMUX_PKG_DEPENDS and enable
-DALSOFT_REQUIRE_OBOE=ON. Upstream already has the
Oboe backend (alc/backends/oboe.cpp) which picks
up the oboe package via find_package(oboe CONFIG).

Tested on S26 Ultra (Android 16) and Pixel 10 Pro
(Android 17 Beta). Oboe backend works on both.
OpenSL ES backend fails on both with
"undefined symbol: swift_demangle" (the same
dlopen issue from termux#23149 and kcat/openal-soft#1111).

Closes termux#29318
Add module-oboe-sink and module-oboe-source using Google's Oboe library.
Oboe handles audio backend selection and vendor quirks internally,
addressing vendor-specific SLES breakage affecting Xiaomi, OnePlus,
Samsung, and Redmi devices (termux#28861, termux#27978, termux#27367).

Cross-device verified: Samsung S26 Ultra (Android 16 / API 36) and
Pixel 10 Pro (Android 17 Beta / API 37). Both modules load, record,
play, suspend/resume, and unload cleanly with multi-cycle stress.

Add module-oboe-sink and module-oboe-source as commented-out options
in default.pa. SLES remains the active default. Users experiencing
SLES breakage can uncomment the Oboe modules.

Suggested by twaik in termux#28861 and termux#29074.
@ferrumclaudepilgrim ferrumclaudepilgrim changed the title addpkg(main/oboe): Google Oboe C++ audio library + enable in openal-soft addpkg(main/oboe) + enhance(main/openal-soft, main/pulseaudio): Oboe audio stack Apr 17, 2026
@ferrumclaudepilgrim
Copy link
Copy Markdown
Contributor Author

Landed commit 3 per @robertkirkman's invite on #29074. PR title and body
updated to cover all three commits.

Evidence for commit 3:

  • Samsung S26 Ultra (Android 16 / API 36): sink + source PASS (audio by ear,
    real mic capture, 3-cycle suspend/resume, 5-cycle load/unload)
  • Google Pixel 10 Pro (Android 17 Beta 4 / API 37): same suite, all PASS
  • Multi-arch build in termux-package-builder Docker: aarch64 / arm / i686 /
    x86_64, all exit 0

SLES remains the active default; Oboe modules are commented-out options in
default.pa.

@shiumano
Copy link
Copy Markdown

When Termux is running in the background, plugging in or unplugging headphones causes pulseaudio to freeze.
(Incidentally, aaudio also has the same problem of freezing when headphones are connected or disconnected.)
You'll likely encounter situations where this happens frequently, such as when music is playing in the background or when Termux:X11 is open.

@ferrumclaudepilgrim
Copy link
Copy Markdown
Contributor Author

Sorry for the delay, I've been moving and it's been... fun.

@shiumano thanks for surfacing this. I dug into it pretty heavily. I was able to reproduce the issue in question using BT headphones as that is all I have currently. While definitely a thing it predates this PR based on my research. It is in module-aaudio-sink.c, the existing AAudio sink. The error_callback function calls pa_sink_suspend directly from AAudio's error thread, which is not a thread PulseAudio owns.

I reproduced it on my S26 Ultra by playing a 5 minute sine wave, backgrounding Termux, then disconnecting my headphones. PA went into deadlock almost immediately. pactl info still answered meaning main thread was good.

The new Oboe modules in this PR inherit the same pattern, character for character. So the bug shape is shared across multiple modules.

I see a fix: replace the direct suspend with pa_asyncmsgq_post to the sink (or source) IO thread, handle the suspend on that thread, drop the spin-wait. My brain says that's a different cup of tea for a different day since the already widely scoped PR doesn't get any more ambitious.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Package]: Oboe

3 participants