roc-streaming / roc-pulse

Roc Toolkit modules for PulseAudio.
https://roc-streaming.org
GNU Lesser General Public License v2.1
8 stars 2 forks source link

modules built using cross-compile to Raspberrypi 64 bit fail to load #29

Closed tomodachi closed 6 months ago

tomodachi commented 6 months ago

OS: Raspberrypi OS (Debian 12) Device: Raspberry PI4

running:

docker run -t --rm -u "${UID}" -v "${PWD}:${PWD}" -w "${PWD}" \
  rocstreaming/toolchain-aarch64-linux-gnu \
    env TOOLCHAIN_PREFIX=aarch64-linux-gnu PULSEAUDIO_VERSION=16.1  make

Successfully builds the modules: module-roc-sink-input.so
module-roc-sink.so

I copy the modules to the appropriate folder on the destination on the pi4 and configure pulseaudio to load the modules.

then running : pulseaudio --verbose

Greets me with the following error message:

Failed to open module /usr/lib/pulse-16.1+dfsg1/modules/module-roc-sink-input.so: /usr/lib/pulse-16.1+dfsg1/modules/module-roc-sink-input.so: undefined symbol: spx_fft

output of ldd:

tomodachi@pi4:/lib/pulse-16.1+dfsg1/modules $ ldd module-roc*
module-roc-sink-input.so:
        linux-vdso.so.1 (0x0000007f99d7b000)
        libstdc++.so.6 => /lib/aarch64-linux-gnu/libstdc++.so.6 (0x0000007f99900000)
        libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x0000007f99750000)
        libm.so.6 => /lib/aarch64-linux-gnu/libm.so.6 (0x0000007f996b0000)
        libgcc_s.so.1 => /lib/aarch64-linux-gnu/libgcc_s.so.1 (0x0000007f99670000)
        /lib/ld-linux-aarch64.so.1 (0x0000007f99d3e000)
module-roc-sink.so:
        linux-vdso.so.1 (0x0000007fb4695000)
        libstdc++.so.6 => /lib/aarch64-linux-gnu/libstdc++.so.6 (0x0000007fb4220000)
        libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x0000007fb4070000)
        libm.so.6 => /lib/aarch64-linux-gnu/libm.so.6 (0x0000007fb3fd0000)
        libgcc_s.so.1 => /lib/aarch64-linux-gnu/libgcc_s.so.1 (0x0000007fb3f90000)
        /lib/ld-linux-aarch64.so.1 (0x0000007fb4658000)

output of nm -a: nm.txt

gavv commented 6 months ago

Thanks, will look into it. Could you also attach output of ldd and nm -a (on target system) for module-roc-sink-input.so and module-roc-sink.so?

tomodachi commented 6 months ago

Thanks for the quick reply. I updated my issue with the additional debug info you requested

gavv commented 6 months ago

I've pushed a fix, could you please check it?

tomodachi commented 6 months ago

Not working unfortunately.

I get this message now: E: [pulseaudio] ltdl-bind-now.c: Failed to open module /usr/lib/pulse-16.1+dfsg1/modules/module-roc-sink-input.so: /usr/lib/pulse-16.1+dfsg1/modules/module-roc-sink-input.so: undefined symbol: pthread_atfork E: [pulseaudio] module.c: Failed to open module "module-roc-sink-input".

Which commit contains your fix?

I build the modules from commit: 680cf2215517e0398d613da417d3ed53349d24cc

gavv commented 6 months ago

I get this message now:

Ah, yes, I remember we already had this problem (#27), and seems the fix stopped working after recent changes.

It's not reproducing on my boxes, but I think it's about messing -pthread vs -lpthread and this should fix it: 2c6384aed5bed3547b923511c81e5aba8850a44b (latest commit in main). Could you check once more?

I build the modules from commit: https://github.com/roc-streaming/roc-pulse/commit/680cf2215517e0398d613da417d3ed53349d24cc

Yep, that was correct commit.

tomodachi commented 6 months ago

Yes it works again Thanks a bunch for the help solving this issue

gavv commented 6 months ago

Thanks for testing!