Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proccessing multiple stereo channels at once? #89

Open
JoergAtGithub opened this issue Jul 15, 2023 · 2 comments
Open

Proccessing multiple stereo channels at once? #89

JoergAtGithub opened this issue Jul 15, 2023 · 2 comments

Comments

@JoergAtGithub
Copy link

I wonder if it's possible benefit from SIMD commands like SSE/AVX in a typical DJ application with 4 stereo channels, where all 4 stereo channels should be shifted in real-time.
Every stereo channel would be processed with the same parameters (buffer size, samplerate) except PitchRate and TimeRatio.

@cannam
Copy link
Member

cannam commented Sep 15, 2023

I don't think there is enough available in common between channels for this to work readily. Most of the bits of processing that are identical across channels (e.g. analysis FFT) are already candidates for SIMD optimisation in the other axis, so there would be nothing to gain. Other processes will differ significantly depending on the content analysis so would not be candidates for shared calculation.

It's possible for other reasons that a set of e.g. 4x stereo inputs could be processed faster by a single 8-channel stretcher than by 4x 2-channel stretchers. For example, a resampler can sometimes be faster when applied to multiple channels simultaneously than separately. The problem is that there's no way to tell an 8-channel stretcher that its inputs form a set of stereo pairs, so they won't get the benefit of proper stereo mode handling - the stretcher will instead stretch them individually. It might be interesting to run some quick performance tests for 8-channel input vs 4x 2-channel inputs and see if that's worth pursuing. I'm guessing probably not, if only because the latter can be distributed by the client application across CPUs more easily.

@JoergAtGithub
Copy link
Author

Thanks for your insight! In Mixxx we consider using https://github.com/kokkos/mdspan for audio signals with more than two channels per deck (for a future stem separation feature). But I'm not familar enough with the internals of audio strechers, to rate if this is also usable here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants