Closed triallax closed 1 year ago
Thanks for the report!
Do you have the ability to run the tests in a debugger? The tests compile to a binary called tests
in the build
directory, so e.g.
$ gdb ./build/tests
GNU gdb (GDB) 13.1
Copyright (C) 2023 Free Software Foundation, Inc.
[etc]
(gdb) run
then wait 20 seconds, hit ^C to interrupt, and type where
to get a backtrace.
It may be worth testing the current repo code as well, as there are a few changes since 3.2.1.
If none of this is practical to do, I could have a go at reproducing it in a container but I would need to have more directions about how to set up the proper environment on that distro. I don't have a 32-bit build environment on my current dev box and the tests pass (for me) on a true 32-bit machine.
Here's the full gdb session output:
I tried with current master (82dab93ecf44c9b1203289c0118760b7331b2156), but no dice. Here's the gdb output for that run:
I'm not sure if this is related, but the ../sysdeps/i386/fpu/s_floor.S:20
thing in the v3.2.1 gdb output caught my attention, as we're running in an i686 environment, not i386. ¯\_(ツ)_/¯
hi, i have the same problem with some more archs on debian, https://buildd.debian.org/status/package.php?p=rubberband
i increased the timeout with --timeout-multiplier 3
and then i got this error on i386:
../src/test/TestStretcher.cpp(951): error: in "TestStretcher/impulses_fast_samepitch_realtime_finer": check peak0 < int(ceil(200 * timeRatio)) has failed [100 >= 100]
https://salsa.debian.org/multimedia-team/rubberband/-/jobs/4352360
Thanks for the further information. I've pushed something to address that last failure.
I initially jumped to the conclusion that the tests timing out meant that something had got totally stuck, so they would never complete at all. The fact that both gdb traces interrupted the same test seemed to support that.
But now I wonder about the simple explanation, i.e. that the tests are just too slow! These are quite intensive tests and they certainly run relatively slowly in 32-bit mode. I've reviewed this locally now in a 32-bit container, and while I haven't managed to reproduce a total hang, I have certainly been surprised by how much slower they are than in 64-bit mode on the same hardware. But note also that the choice of resampler makes a much bigger difference in 32-bit than 64-bit builds - configuring with -Dresampler=libsamplerate
produces a much faster build than the defaults here and is probably a good idea for a platform package.
@mhmdanas if you run the tests directly (via build/tests
as in the gdb case, not through Ninja) and just let them run, do they eventually complete? Perhaps using build/tests --log_level=all
for maximum status reporting so you can see whether they ever totally stall.
@cannam I can support the hypothesis that the test is just too slow. A few days ago I tried what @snd1 did (using --timeout-multiplier 3
), and in around 45 seconds the test did fail with what I recall to be a similar error to theirs, though I don't remember the details.
But note also that the choice of resampler makes a much bigger difference in 32-bit than 64-bit builds - configuring with -Dresampler=libsamplerate produces a much faster build than the defaults here and is probably a good idea for a platform package.
So, just to make sure I'm reading this correctly, it's probably a good idea to configure with -Dresampler=libsamplerate
for ALL archs, right?
Edit: I just noticed that Void's build template for rubberband already installs libsamplerate and fftw as make dependencies, but since -Dresampler=libsamplerate
and -Dfft=fftw
aren't passed to meson in the template, rubberband is built with the built-in implementations instead. facepalm
Anyway, using libsamplerate causes the test to fail much faster, at 9.41s, which is progress I guess. I'll add https://github.com/breakfastquay/rubberband/commit/df596f472e3271ad64ab6c2968920e5e95c17080 as a patch to fix the test and be on my way. Thank you very much @cannam and @snd1.
configuring with -Dresampler=libsamplerate produces a much faster build than the defaults here and is probably a good idea for a platform package.
Also, shouldn't this be mentioned in the documentation somewhere?
So, just to make sure I'm reading this correctly, it's probably a good idea to configure with -Dresampler=libsamplerate for ALL archs, right?
That would generally not be a wrong thing to do - libsamplerate works well and is typically faster, if not always as much as this. There are actually some situations in which the built-in resampler can sound very slightly better, which is why libsamplerate is not always picked by default, and on 64-bit platforms the difference in performance is less, so the penalty for sticking with the built-in resampler is lower. But in general it should be a totally acceptable tradeoff to use libsamplerate and here there is clearly a big advantage to it.
Also, shouldn't this be mentioned in the documentation somewhere?
Yes, probably so. The docs say "If you are proposing to package Rubber Band for a Linux distribution, please select either the built-in FFT or FFTW, and either the built-in resampler or libsamplerate" - but the reason for this was more to suggest avoiding the other options than anything else. I should probably update that wording.
That would generally not be a wrong thing to do - libsamplerate works well and is typically faster, if not always as much as this. There are actually some situations in which the built-in resampler can sound very slightly better, which is why libsamplerate is not always picked by default, and on 64-bit platforms the difference in performance is less, so the penalty for sticking with the built-in resampler is lower. But in general it should be a totally acceptable tradeoff to use libsamplerate and here there is clearly a big advantage to it.
Hmm, so I assume it wouldn't be wrong to use libsamplerate on 32-bit platforms, and the built-in on 64-bit ones?
Yes, probably so. The docs say "If you are proposing to package Rubber Band for a Linux distribution, please select either the built-in FFT or FFTW, and either the built-in resampler or libsamplerate" - but the reason for this was more to suggest avoiding the other options than anything else. I should probably update that wording.
Sounds good to me.
Hmm, so I assume it wouldn't be wrong to use libsamplerate on 32-bit platforms, and the built-in on 64-bit ones?
That would also be fine I think.
This issue is fixed for my purposes, so I'm closing.
I'm working to bump rubberband in Void Linux's repos to 3.2.1, but I'm facing an issue where the "Stretcher" test times out on i686 on an x86_64 CPU. Compiling to and running the tests on x86_64 work fine. I've confirmed this on two separate laptops, and it also happens on GitHub's CI. I combed through the GitHub and Sourcehut issue trackers but failed to find any similar reports.
Here are the full xbps-src logs:
xbps-src logs
``` => xbps-src: updating repositories for host (i686)... [*] Updating repository `https://repo-default.voidlinux.org/current/bootstrap/i686-repodata' ... [*] Updating repository `https://repo-default.voidlinux.org/current/i686-repodata' ... [*] Updating repository `https://repo-default.voidlinux.org/current/nonfree/i686-repodata' ... [*] Updating repository `https://repo-default.voidlinux.org/current/debug/i686-repodata' ... => xbps-src: updating software in / masterdir... => xbps-src: cleaning up / masterdir... => rubberband-3.2.1_1: removing autodeps, please wait... => rubberband-3.2.1_1: building with [meson] for i686... [host] pkg-config-0.29.2_3: found (https://repo-default.voidlinux.org/current) [host] meson-1.1.0_1: found (https://repo-default.voidlinux.org/current) [check] boost-devel-1.82.0_1: found (https://repo-default.voidlinux.org/current) [target] ladspa-sdk-1.15_3: found (https://repo-default.voidlinux.org/current) [target] libsamplerate-devel-0.2.2_1: found (https://repo-default.voidlinux.org/current) [target] vamp-plugin-sdk-devel-2.10.0_1: found (https://repo-default.voidlinux.org/current) [target] fftw-devel-3.3.10_1: found (https://repo-default.voidlinux.org/current) [target] lv2-1.18.2_1: found (https://repo-default.voidlinux.org/current) [runtime] libvamp-plugin-sdk-2.10.0_1: found (https://repo-default.voidlinux.org/current) [runtime] libvamp-plugin-sdk-2.10.0_1: found (https://repo-default.voidlinux.org/current) [runtime] librubberband-3.2.1_1: not found (subpkg, ignored) => rubberband-3.2.1_1: installing host dependencies: pkg-config-0.29.2_3 meson-1.1.0_1 boost-devel-1.82.0_1 ... => rubberband-3.2.1_1: installing target dependencies: ladspa-sdk-1.15_3 libsamplerate-devel-0.2.2_1 vamp-plugin-sdk-devel-2.10.0_1 fftw-devel-3.3.10_1 lv2-1.18.2_1 ... => rubberband-3.2.1_1: running do-fetch hook: 00-distfiles ... => rubberband-3.2.1_1: running do-extract hook: 00-distfiles ... => rubberband-3.2.1_1: extracting distfile(s), please wait... => rubberband-3.2.1_1: running do_patch ... => rubberband-3.2.1_1: running do-patch hook: 00-patches ... => rubberband-3.2.1_1: running pre-configure hook: 00-gnu-configure-asneeded ... => rubberband-3.2.1_1: running pre-configure hook: 01-override-config ... => rubberband-3.2.1_1: running pre-configure hook: 02-script-wrapper ... => rubberband-3.2.1_1: running do_configure ... The Meson build system Version: 1.1.0 Source dir: /builddir/rubberband-3.2.1 Build dir: /builddir/rubberband-3.2.1/build Build type: native build Project name: Rubber Band Library Project version: 3.2.1 C compiler for the host machine: cc (gcc 12.2.0 "cc (GCC) 12.2.0") C linker for the host machine: cc ld.bfd 2.39 C++ compiler for the host machine: g++ (gcc 12.2.0 "g++ (GCC) 12.2.0") C++ linker for the host machine: g++ ld.bfd 2.39 Host machine cpu family: x86 Host machine cpu: i686 Found pkg-config: /usr/bin/pkg-config (0.29.2) Run-time dependency fftw3 found: YES 3.3.10 Did not find CMake 'cmake' Found CMake: NO Run-time dependency sleef found: NO (tried pkgconfig and cmake) Run-time dependency sleefdft found: NO (tried pkgconfig and cmake) Run-time dependency samplerate found: YES 0.2.2 Run-time dependency speexdsp found: NO (tried pkgconfig and cmake) Run-time dependency sndfile found: YES 1.2.0 Run-time dependency vamp-sdk found: YES 2.10 Run-time dependency Boost (found: unit_test_framework) found: YES 1.82.0 (/usr) Run-time dependency threads found: YES Has header "ladspa.h" : YES Has header "lv2.h" : YES Checking for function "sincos" : YES Compiler for language java for the build machine not found. Compiler for language java for the host machine not found. Message: For FFT: using built-in implementation Message: (to use FFTW instead, reconfigure with -Dfft=fftw) Message: For resampler: using built-in implementation Message: (to use libsamplerate instead, reconfigure with -Dresampler=libsamplerate) Message: Will build Rubber Band Library static library Message: Will build Rubber Band Library dynamic library Message: Not building Java Native Interface: Java compiler or archiver missing Message: Will build LADSPA plugin Message: Will build LV2 plugin Message: Will build Vamp plugin Message: Will build command-line utilities Message: Will build unit tests: use "meson test -CAny idea how to fix this? Feel free to ask me if you need any more details.