OboeTester: handle rerouting in the Error Callback test

Starting from Android 17, a stream on the legacy path may be rerouted
instead of disconnected when a headset is plugged or unplugged. In that
case the error callback never fires and the Error Callback test in
OboeTester never reports PASS.

Register a routing callback (when the platform supports it) and run the
same "delete the callback while it is in use" experiment from
onRoutingChanged(). A routing callback that merely reports the initial
devices is ignored so the test still requires a real plug/unplug event.
cleanup() is serialized with a mutex because both the error callback and
the routing callback may fire for the same event on MMAP streams.

Unexpected (non-disconnect) errors are now reported through a separate
getCallbackError() so the UI can show a clear failure message instead of
a bogus magic value.

Library changes:
- Add virtual destructor to AudioStreamRoutingCallback.
- Add OboeExtensions::isRoutingChangedCallbackSupported().

Bug: 560318727
9 files changed
tree: 04d1f4310c40f072b8efd9ae4d3cdf8aad2100e3
  1. .github/
  2. apps/
  3. docs/
  4. include/
  5. prefab/
  6. samples/
  7. src/
  8. tests/
  9. .gitignore
  10. AUTHORS
  11. build_all_android.sh
  12. CMakeLists.txt
  13. CONTRIBUTING.md
  14. CONTRIBUTORS
  15. Doxyfile
  16. LICENSE
  17. MODULE_LICENSE_APACHE2
  18. prefab_build.sh
  19. README.md
README.md

Oboe Build CI

Introduction to Oboe video

Oboe is a C++ library which makes it easy to build high-performance audio apps on Android. It was created primarily to allow developers to target a simplified API that works across multiple API levels back to API level 16 (Jelly Bean).

Features

  • Compatible with API 16 onwards - runs on 99% of Android devices
  • Chooses the audio API (OpenSL ES on API 16+ or AAudio on API 27+) which will give the best audio performance on the target Android device
  • Automatic latency tuning
  • Modern C++ allowing you to write clean, elegant code
  • Workarounds for some known issues
  • Used by popular apps and frameworks

Documentation

Community

Testing

Videos

Sample code and apps

Third party sample code

Contributing

We would love to receive your pull requests. Before we can though, please read the contributing guidelines.

Version history

View the releases page.

License

LICENSE