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

Rubberband V3 stretcher #4853

Merged
merged 3 commits into from
Jul 23, 2022
Merged

Rubberband V3 stretcher #4853

merged 3 commits into from
Jul 23, 2022

Conversation

Swiftb0y
Copy link
Member

if we're compiling with rubberband v3 available, automatically use the finer engine. The latest commit builds and works with Rubberband v2 and v3. This is not really intended to be merged because we want the engine to be configurable in the preferences. Consider this PR a starting point for anyone that wants to work on prefence integration.

@Swiftb0y
Copy link
Member Author

I also forgot to mention that with the R3 engine, changing the pitch results in temporary XRuns. We need to investigate that.

@Be-ing
Copy link
Contributor

Be-ing commented Jul 13, 2022

It would be nice to add a CMake warning for old Rubberband versions noting that a new feature will not be available.

@Swiftb0y
Copy link
Member Author

Sure, I can look into that.

@ronso0
Copy link
Member

ronso0 commented Jul 13, 2022

I also forgot to mention that with the R3 engine, changing the pitch results in temporary XRuns. We need to investigate that.

True, also more xruns in general, CPU increased by ~25% (no waveforms, no spinnies). Still didn't do a sound check.
(tested v2 / v3 with #4855)

@Swiftb0y
Copy link
Member Author

True, also more xruns in general, CPU increased by ~25% (no waveforms, no spinnies).

True, but that is too be expected. As I already mentioned on Zulip, I had to double my buffer size to 10ms, but it works after that (fedora with full preempt kernel).

@Swiftb0y
Copy link
Member Author

It would be nice to add a CMake warning for old Rubberband versions noting that a new feature will not be available.

I tried a bunch of things but can't get anything reliable. I can use the version acquired via PkgConfig, but that will only use the system installation and not the one actually used when specifing alternate library and include dirs.

I don't consider it very important as well...

@Swiftb0y
Copy link
Member Author

I also forgot to mention that with the R3 engine, changing the pitch results in temporary XRuns. We need to investigate that.

I didn't find much time to work on this. I'm pretty sure its an issue within rubberband, but I need to spend more time confirming that.
For now, I consider this PR good enough to be merged. It won't be used much anyways because of the lack of Rubberband 3 availability.

@Swiftb0y Swiftb0y marked this pull request as ready for review July 16, 2022 14:05
@@ -17,9 +17,13 @@ using RubberBand::RubberBandStretcher;

namespace {

// TODO (XXX): this should be removed. It is only needed to work around
// a Rubberband 1.3 bug.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we ifdef it based on the rubberband version?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was only able to verify that this is not present the newer rubberband version. So I didn't want to introduce regressions based on speculation.

@ywwg
Copy link
Member

ywwg commented Jul 18, 2022

interestingly I only get underruns when the musical pitch changes. If I turn on keylock I can move around the pitch slider and it doesn't drop at all (5ms buffer). But if I click the up-down arrows for key matching, or if I change key with keylock off and adjust the pitch slider (so that the music pitch changes) I get dropouts on every adjustment

Copy link
Member

@ywwg ywwg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we print out a warning during compilation (or cmake configure time) if the user has rubberband 3 installed to say that the library is only experimentally supported right now? otherwise if we merge this as-is we will get a lot of redundant reports about the dropout issues.

@ronso0
Copy link
Member

ronso0 commented Jul 19, 2022

@ywwg

This is not really intended to be merged because we want the engine to be configurable in the preferences. Consider this PR a starting point for anyone that wants to work on prefence integration.

I built on top of this in #4855 and added the pref option. Please try that (select RBv2) and verify it performs as it does in main.
Given the xruns, I'll re-add the "experimental" disclaimer to the RBv3 option in the preferences until someone tackles the cleanup in src/engine/bufferscalers/enginebufferscalerubberband.cpp

@Swiftb0y
Copy link
Member Author

Swiftb0y commented Jul 19, 2022

Can we print out a warning during compilation (or cmake configure time) if the user has rubberband 3 installed to say that the library is only experimentally supported right now? otherwise if we merge this as-is we will get a lot of redundant reports about the dropout issues.

I looked into it, its not trivial. #4853 (comment)

Copy link
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you.

@Swiftb0y
Copy link
Member Author

ping me before merging please so I can autosquash the fixup commits.

@Swiftb0y
Copy link
Member Author

Since this already got two approvals, I went a ahead and squashed anyways. Merge?

@daschuer
Copy link
Member

Yes, thank you.

@daschuer daschuer merged commit 0d1dc9f into mixxxdj:main Jul 23, 2022
@Swiftb0y Swiftb0y deleted the rubberband-v3 branch July 23, 2022 18:10
@ronso0
Copy link
Member

ronso0 commented Jul 23, 2022

I don't really understand why this was merged without adding a v2/v3 switch first? This is a performance regression for all who have v3 installed. Did I miss something? Or maybe I'm overestimating that because v3 didn't land in any distro yet anyway, and users who install it manually should be aware of the sideeffects?

@Swiftb0y
Copy link
Member Author

This is a performance regression for all who have v3 installed.

Its unlikely someone will have v3 installed.

The plan was to merge #4855 asap if I'm not mistaken.

@daschuer
Copy link
Member

I don't really understand why this was merged without adding a v2/v3 switch first?

@ronso0 Oh I must have miss-read your initial comment in #4855 that you wait for this to be merged.

But anyway, I am just working on the final bit and than we can hopefully merge that as well to get around possible regressions.

@ywwg
Copy link
Member

ywwg commented Jul 29, 2022

yeah normally we like to preserve behavior but having a quick followup seems fine here

@ronso0
Copy link
Member

ronso0 commented Jul 29, 2022

@ronso0 Oh I must have miss-read your initial comment in #4855 that you wait for this to be merged.

Sorry that was unclear. I expected this to be polished, than I'd rebase my followup and we merge both quickly one after another.
Anyway, probably only few are affected so I'll finish mine (ours) asap.

napaalm pushed a commit to napaalm/mixxx that referenced this pull request Jul 10, 2023
napaalm pushed a commit to napaalm/mixxx that referenced this pull request Jul 10, 2023
napaalm pushed a commit to napaalm/mixxx that referenced this pull request Jul 10, 2023
napaalm pushed a commit to napaalm/mixxx that referenced this pull request Jul 10, 2023
napaalm pushed a commit to napaalm/mixxx that referenced this pull request Jul 11, 2023
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

Successfully merging this pull request may close these issues.

5 participants