roc-streaming / roc-toolkit

Real-time audio streaming over the network.
https://roc-streaming.org
Mozilla Public License 2.0
1.03k stars 205 forks source link

Problems with rates different from 44100 and 48000 #572

Open gavv opened 9 months ago

gavv commented 9 months ago

If you uncomment the full list of rates in test_resampler.cpp:

const size_t supported_rates[] = {
    // FIXME: the following tests fail with full range of rates:
    //  - supported_scalings: builtin resampler panics on some rates
    //  - scaling_trend: fails on some rates
    // 8000, 11025, 16000, 22050, 44100, 48000, 88200, 96000
    44100, 48000
};

You'll get two problems:

Panic stacktrace:

src/internal_modules/roc_audio/resampler_builtin.cpp:427: error: roc_panic()

ERROR: roc_audio: ind_begin_prev > frame_size_ch_

Backtrace:
#1: 0x558a1eb280ee roc::core::print_backtrace_full()+0x6e
#2: 0x558a1eb26eb2 roc::core::die_gracefully(char const*, bool)+0x72
#3: 0x558a1eb216cd roc::core::panic(char const*, char const*, int, char const*, ...)+0x18d
#4: 0x558a1eb1ea76 roc::audio::BuiltinResampler::resample_(unsigned long)+0x116
#5: 0x558a1eb1e8f4 roc::audio::BuiltinResampler::pop_output(roc::audio::Frame&)+0x144
#6: 0x558a1eb19efd roc::audio::ResamplerReader::read(roc::audio::Frame&)+0x11d
#7: 0x558a1ea51c44 roc::audio::TEST_resampler_supported_scalings_Test::testBody()+0x5e4
#8: 0x558a1eb3cd88 PlatformSpecificSetJmpImplementation+0x48
#9: 0x558a1eb3c0af Utest::run()+0xdf
#10: 0x558a1eb3b8a2 UtestShell::runOneTestInCurrentProcess(TestPlugin*, TestResult&)+0xc2
#11: 0x558a1eb3cd88 PlatformSpecificSetJmpImplementation+0x48
#12: 0x558a1eb394b9 UtestShell::runOneTest(TestPlugin*, TestResult&)+0x99
#13: 0x558a1eb38bcd TestRegistry::runAllTests(TestResult&)+0x4d
#14: 0x558a1eb2a5bc CommandLineTestRunner::runAllTests()+0x10c
#15: 0x558a1eb2a757 CommandLineTestRunner::runAllTestsMain()+0x77
#16: 0x558a1eb2a8d6 CommandLineTestRunner::RunAllTests(int, char const* const*)+0xe6
#17: 0x558a1ea5ebb1 main+0x161
#18: 0x7fbd1a8de1ca __libc_init_first+0x8a
#19: 0x7fbd1a8de285 __libc_start_main+0x85
#20: 0x558a1ea1d471 _start+0x21
Aborted