-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libpulseaudio: add module-aaudio-sink #2734
Conversation
Fails because libaaudio.so isn't available for android 5 toolchain. Easily fixed by copying over aaudio lib at tool chain creation. Do you take requests? |
@its-pointless Might take a look in the future. But to be honest I am not particularly interested in implementing audio capturing, so most likely I would leave it to someone else. It would be a separate module anyway. |
packages/libpulseaudio/build.sh
Outdated
mkdir $TERMUX_PKG_SRCDIR/src/modules/aaudio | ||
cp $TERMUX_PKG_BUILDER_DIR/module-aaudio-sink.c $TERMUX_PKG_SRCDIR/src/modules/aaudio | ||
sed -i "s/define __ANDROID_API__ $TERMUX_PKG_API_LEVEL/define __ANDROID_API__ 21/" \ | ||
$TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/include/android/api-level.h |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think something like
CFLAGS+=" -D__ANDROID_API__=21"
should be enough instead of the sed command, to avoid modifying the toolchain files.
|
||
#include <aaudio/AAudio.h> | ||
|
||
PA_MODULE_AUTHOR("Lennart Poettering, Nathan Martynov, Tom Yan"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be updated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think my name (char *name = "Nathan Martynov";) should be listed in SLES backend source...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry what do you mean? So should I add Nathan Martynov back in module-sles-sink? (Aren't you Twaik Yont btw?)
Nathan Martynov is real name, Twaik Yont is pseudoname. :)
Add a sink module that makes use of the AAudio API, which is available in Oreo or later. The sink will have its sample rate and latency configured based on the info we got with the API. They will also be updated accordingly when the output device is changed.
s32le output is also now allowed
Thanks! The updated package is now available for installation. |
Seems there is something wrong with latency again? However, since applyed the patch xiph/libao#8 libao works fine with |
I don't have libao built here at the moment, but no apparent problem here with mpv. Set Note that by default the AAudio sink module configure the latency based on buffer size info reported by the system/device, while the SLES sink module configure that to a fixed default value, but both modules has the module argument |
OK, this can be fixed manually by set |
I assume you are using Bluetooth audio? I've seen device/ROM reports fast flag and a low buffer size for Bluetooth audio, and I doubt that they are valid. |
Yeah,but I just find my buffer size for none Bluetooth audio is also very low.
I will test it on my other devices later. |
It is normal to get low latency and fast flag with wired audio (including USB). Not sure if it's a problem of your device or libao/pianobar. |
Btw the assertion failure is probably a separate issue. I've seen it occur with both modules. It's pretty random and I don't know what exactly triggers it. Could be some upstream bug as well. |
Both wired audio and Bluetooth audio works fine on my old device without set latency manually. I think it's a problem of my new device. It should be an issue of the ROM. However, I assume that the manufacturer can achieve low latency on some high-end Bluetooth headphones which I don't have :( |
Add a sink module that makes use of the AAudio API, which is
available in Oreo or later.
The sink will have its sample rate and latency configured based on
the info we got with the API. They will also be updated accordingly
when the output device is changed.