4

I want to stream audio from my Linux box to an Android device, with smallest delay possible, so I thought about using PulseAudio with module-opensl-sink (found here). I don't want to replace AudioFlinger with PA, because I want to use it's effects API.

I've managed to compile PulseAudio using Google's Android NDK somehow, but everytime I try to start it, it throws an error, no matter which module I try to load.

$ ./pulseaudio -C --loglevel=4
W: [pulseaudio] caps.c: Normally all extra capabilities would be dropped now, but that's impossible because PulseAudio was built without capabilities support.
I: [pulseaudio] main.c: setrlimit(RLIMIT_RTPRIO, (9, 9)) failed: Operation not permitted
D: [pulseaudio] core-util.c: setpriority() worked.
I: [pulseaudio] core-util.c: Successfully gained nice level -11.
I: [pulseaudio] main.c: This is PulseAudio 5.0-121-g38c5d-dirty
D: [pulseaudio] main.c: Compilation host: arm-unknown-linux-androideabi
D: [pulseaudio] main.c: Compilation CFLAGS: -mfpu=neon -mfloat-abi=softfp -Wall -W -Wextra -pipe -Wno-long-long -Wno-overlength-strings -Wunsafe-loop-optimizations -Wundef -Wformat=2 -Wlogical-op -Wsign-compare -Wformat-security -Wmissing-include-dirs -Wformat-nonliteral -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing -Wwrite-strings -Wno-unused-parameter -ffast-math -fno-common -fdiagnostics-show-option
D: [pulseaudio] main.c: Running on host: Linux armv7l 3.4.0-cyanogenmod-g8a32cd7 #1 SMP PREEMPT Sun Jun 8 19:40:15 PDT 2014
D: [pulseaudio] main.c: Found 4 CPUs.
I: [pulseaudio] main.c: Page size is 4096 bytes
D: [pulseaudio] main.c: Compiled with Valgrind support: no
D: [pulseaudio] main.c: Running in valgrind mode: no
D: [pulseaudio] main.c: Running in VM: no
D: [pulseaudio] main.c: Optimized build: no
D: [pulseaudio] main.c: FASTPATH defined, only fast path asserts disabled.
I: [pulseaudio] main.c: Machine ID is localhost.
I: [pulseaudio] main.c: Using runtime directory /data/data/jackpal.androidterm/app_HOME/.config/pulse/localhost-runtime.
I: [pulseaudio] main.c: Using state directory /data/data/jackpal.androidterm/app_HOME/.config/pulse.
I: [pulseaudio] main.c: Using modules directory /data/local/pa/lib/pulse-5.0/modules.
I: [pulseaudio] main.c: Running in system mode: no
I: [pulseaudio] main.c: Fresh high-resolution timers available! Bon appetit!
W: [pulseaudio] core.c: failed to allocate shared memory pool. Falling back to a normal memory pool.
D: [pulseaudio] memblock.c: Using private memory pool with 1024 slots of size 64.0 KiB each, total size is 64.0 MiB, maximum usable slot size is 65496
I: [pulseaudio] cpu-arm.c: CPU flags: V6 V7 VFP EDSP NEON VFPV3 
I: [pulseaudio] sconv_neon.c: Initialising ARM NEON optimized conversions.
I: [pulseaudio] mix_neon.c: Initialising ARM NEON optimized mixing functions.
I: [pulseaudio] remap_neon.c: Initialising ARM NEON optimized remappers.
E: [pulseaudio] module.c: Failed to open module "module-cli".
E: [pulseaudio] main.c: Module load failed.
E: [pulseaudio] main.c: Failed to initialize daemon.
I: [pulseaudio] main.c: Daemon terminated.

I configured PA with these arguments:

./configure --prefix="/data/local/pa" --host arm-linux-androideabi --enable-neon-opt --with-sysroot='/data/local/pa' --without-caps --disable-shared --enable-static --disable-avahi --disable-alsa --disable-jack --disable-gconf --disable-esound --disable-openssl --disable-dbus --disable-glib2 --disable-orc --disable-adrian-aec --disable-rpath --enable-static-bins --disable-ipv6 --enable-force-preopen

Why does it fail to find these modules, even if it reports correct modules directory?

4
  • did you search for "pulseaudio failed to open module module-cli"? Commented Jun 15, 2014 at 0:25
  • @strugee Yes. As I wrote before, it happens with every module, not just with module-cli. Commented Jun 15, 2014 at 0:27
  • ah, sorry. I guess I didn't read your question closely enough. try doing an ls on /data/local/pa/lib/pulse-5.0/modules. Commented Jun 15, 2014 at 1:53
  • @strugee It works, I can even read every file there with cat Commented Jun 15, 2014 at 12:12

2 Answers 2

4

A bug in PulseAudio caused modules to be built incorrectly (as static libraries), so they couldn't be loaded. Reconfiguring without --disable-shared --enable-static --enable-static-bins made it work :)

0

You can use my version of server. https://github.com/twaik/pulseaudio-sles-ndk . It is decided to be built using Android NDK.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.