Repository navigation
Implement AAudio output plugin - #1346
Conversation
311e822 to
f862051
Compare
011d003 to
d9db94d
Compare
pgaskin
left a comment
There was a problem hiding this comment.
Tested this on a Pixel 8 running Android 14, and a few emulators.
Has much lower CPU usage than pulse, and similar latency. Didn't crash or hang while testing various edge cases.
096ca05 to
a876c0a
Compare
pgaskin
left a comment
There was a problem hiding this comment.
Now fully supports multi-channel audio, tested with various multi-channel audio files on Android 14.
e8587fd to
b54ab74
Compare
pgaskin
left a comment
There was a problem hiding this comment.
Fixed an edge case where pause_on_output_change may cause cmus to hang due to cmus getting notified of the stream disconnect and attempting to pause it, and the pause getting stuck waiting for the stream state to change to paused (which never happens since the stream has already disconnected).
pgaskin
left a comment
There was a problem hiding this comment.
Fixed some issues with weak linking not working if the toolchain uses -Wl,--as-needed by default (e.g., Termux package build).
670fc3d to
29e6c04
Compare
pgaskin
left a comment
There was a problem hiding this comment.
Did a bit more refactoring; should be done now.
360425a to
870a7ea
Compare
Support native audio on Android 8.1 and later. - Better battery life. - Configurable latency. - Configurable capture policy. - Configurable sharing mode. - Configurable spatialization. - Full multi-channel audio support. - Supports `pause_on_output_change`. Also includes fix for pause_on_output change with softvol enabled since aaudio doesn't have volume control. cmus/cmus#1346 cmus/cmus#1353
Cherry-pick in support native audio on Android 8.1 and later. Upstream PRs: cmus/cmus#1346, cmus/cmus#1353
Cherry-pick in support native audio on Android 8.1 and later. Upstream PRs: cmus/cmus#1346, cmus/cmus#1353
|
I think this is done, and I've been using it daily for the last week. |
gavtroy
left a comment
There was a problem hiding this comment.
Somewhat lightweight review as it's completely over my head, but it looks okay. I briefly tested it out but only with boring files and a boring phone speaker :)
|
Wow, this is huge, great job! What is the main use case for uploading |
|
Huh? I didn't commit If you mean in GitHub Actions, we ensure it builds with the latest NDK toolchain so we have as much coverage as possible, and we upload it since it'll work as-is for testing (it doesn't depend on any of the config vars). BTW, can you rebase-merge this rather than squashing it? |
|
Sure, I wouldn't squash it, but please rebase the branch, I think I don't have permissions to rebase myself. |
146ddb0 to
9034c10
Compare
Support native audio on Android 8.1 and later. - Better battery life. - Configurable latency. - Configurable capture policy. - Configurable sharing mode. - Configurable spatialization. - Full multi-channel audio support. - Supports `pause_on_output_change`.
9034c10 to
a1a3920
Compare
|
Done! |
Support native audio on Android 8.1 and later.
pause_on_output_change.To test this in Termux, compile and run cmus on the device. You can also compile just the plugin with
$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target aarch64-linux-android26 -shared -o aaudio.so -fPIC -D__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__ -Werror=unguarded-availability -Wall -std=gnu11 op/aaudio.c -laaudio, and copy it to~/../usr/lib/cmus/op.Set the output plugin with
:set output_plugin=aaudio.This plugin has a higher priority than pulse, but will fallback on unsupported devices.