libsamplerate icon indicating copy to clipboard operation
libsamplerate copied to clipboard

Multi threading

Open ss3git opened this issue 2 years ago • 9 comments

Experimental multi-thread implementation. (disabled by default with BUILD_MULTI_THREADING build option.)

Related issue: Parallelize resampling (with high delay) #176

compiled and tested on

FreeBSD clang version 14.0.5 (https://github.com/llvm/llvm-project.git llvmorg-14.0.5-0-gc12386ae247c) Target: x86_64-unknown-freebsd13.2 Thread model: posix

ss3git avatar Sep 20 '23 08:09 ss3git

Is there an ETA on this ?

luzpaz avatar Oct 28 '23 19:10 luzpaz

@SoapGentoo , @arthurt , what do you think? I guess we can add it when it's ready.

evpobr avatar Nov 17 '23 07:11 evpobr

Hi. @evpobr

Sorry for that I did some commits after you had reviewed the code once. The change may boost the performance when an integer equivalant src_ratio is in use. I hope it works ok since I quickly merged it from my local branch (which supports S32 interface; if you are also interested: https://github.com/ss3git/libsamplerate/tree/S32Interface).

I have no more changes to this branch planned, so I'm leaving this up to you (or, maintainers) unless I find bugs.

One thing I'm aware of is that if you are actually releasing it, adding converter types like "SRC_SINC_BEST_QUALITY_MT" may be an idea to have both ST and MT versions switchable in one library.

ss3git avatar Nov 17 '23 15:11 ss3git

Just wondering what's left here ?

luzpaz avatar Feb 10 '24 22:02 luzpaz

Hello @luzpaz.

This PR works well enough at least on my machine. Maybe waiting for more testers other than me?

ss3git avatar Feb 11 '24 03:02 ss3git

@ss3git , are the results bitwise identical to the reference implementation?

evpobr avatar Feb 26 '24 06:02 evpobr

Hi, @evpobr .

I've already forgotten a lot of the details though, the core calculation part is intended to be bitwise identical to the reference implementation (if you mean the single-thread version).

Since the single-thread implementation seems to have input/output processing variance depending on the number of channels processed (e.g. https://github.com/libsndfile/libsamplerate/issues/206), I am not hundred percent sure if the outputs "always" match.

ss3git avatar Feb 26 '24 11:02 ss3git

One thing I'm aware of is that if you are actually releasing it, adding converter types like "SRC_SINC_BEST_QUALITY_MT" may be an idea to have both ST and MT versions switchable in one library.

Good idea.

evpobr avatar May 11 '24 03:05 evpobr

Sorry to bump, just wondering if there has been any more progress ?

luzpaz avatar Jul 18 '24 21:07 luzpaz