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

SyncLock: Fix issues with single-playing syncables. #4155

Merged
merged 6 commits into from
Oct 12, 2021

Conversation

ywwg
Copy link
Member

@ywwg ywwg commented Jul 27, 2021

Discovered while investigating https://mixxx.discourse.group/t/vestax-tr-1-weird-behaviour-quantizing-drops-tempo/22715/7
When only one syncable is playing, use its beat distance to update the leader, so that seeks are properly handled

https://mixxx.discourse.group/t/vestax-tr-1-weird-behaviour-quantizing-drops-tempo/22715/7
Fixes two issues:
* Do not seek phase when audible status changes
* When only one syncable is playing, use its beat distance to update the leader, so that seeks are properly handled
@ywwg
Copy link
Member Author

ywwg commented Jul 27, 2021

I was unable to write a test to cover these cases :(

@Holzhaus
Copy link
Member

I was unable to write a test to cover these cases :(

Why? What was the issue?

@ywwg
Copy link
Member Author

ywwg commented Jul 27, 2021

Why? What was the issue?

I tried to create the same set of circumstances but the test always passed -- I couldn't get it to fail in the test environment.

@Holzhaus
Copy link
Member

The likely cause, PR #3772, was merged into 2.3 but this PR is for main. Does the bug only occur in 2.4, not 2.3?

@Holzhaus
Copy link
Member

Race condition ;-) you answered my question by opening #4156.

@Holzhaus Holzhaus added this to the 2.4.0 milestone Jul 27, 2021
@coveralls
Copy link

coveralls commented Jul 27, 2021

Pull Request Test Coverage Report for Build 1078757626

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 28.645%

Totals Coverage Status
Change from base Build 1078438701: 0.02%
Covered Lines: 20119
Relevant Lines: 70236

💛 - Coveralls

@daschuer
Copy link
Member

How about merging #4156 to 2.3 first, merge 2.3 to main and rebase this on top of it to get rid of two commits doing the same?

@ywwg
Copy link
Member Author

ywwg commented Jul 28, 2021

yes that's a good idea

@ywwg
Copy link
Member Author

ywwg commented Jul 29, 2021

main has the other PR, so this one is ready to go too

@@ -371,7 +371,7 @@ void EngineSync::notifyPlayingAudible(Syncable* pSyncable, bool playingAudible)
// Even if we didn't change leader, if there is only one player (us), then we should
Copy link
Contributor

Choose a reason for hiding this comment

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

The comment doesn't match the new method invocation.

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@daschuer
Copy link
Member

Unfortunately #4156 does not completely fix the issue in 2.3 see my comments there. The same issue is already fixed here, unfortunately here it is shifted to another point.

  • Play two tracks in sync.
  • Both quantize enabled
  • Nudge the follower track
  • Disable sync at the follower track
  • The follower is shifted into sync loosing the user offset.
    The expected behavior is that the track continues to play without any tempo dip or shift.

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.

There is a pending issue.

@ywwg
Copy link
Member Author

ywwg commented Jul 30, 2021

hm ok I'll take a look

@Holzhaus
Copy link
Member

Might be the same issue that @daschuer mentioned, but I'm not sure: https://mixxx.discourse.group/t/vestax-tr-1-weird-behaviour-quantizing-drops-tempo/22715/14?u=hlzhs

@ywwg
Copy link
Member Author

ywwg commented Aug 1, 2021

that feels like a bad beatgrid issue. I'm looking in to daniel's issue now.

@ywwg
Copy link
Member Author

ywwg commented Aug 1, 2021

The follower is shifted into sync loosing the user offset.

Ah I see what is going on. This is a separate issue, I'd prefer to address it in a separate PR. (Otherwise this becomes "let's fix absolutely every issue with sync lock in one PR" which is not reasonable)

@ywwg
Copy link
Member Author

ywwg commented Aug 1, 2021

#4169 for the other issue

@ywwg
Copy link
Member Author

ywwg commented Aug 6, 2021

anything more needed here?

@daschuer
Copy link
Member

daschuer commented Aug 6, 2021

There is still an issue, when the explicit master is paused, quantize play doe not longer work, see:
https://user-images.githubusercontent.com/1777442/128471887-988f96e5-675c-4701-baf8-f82901bda319.mp4

There is also an issue that the double detection is applied twice when repeated clicking on sync twice or using the right click:
https://user-images.githubusercontent.com/1777442/128473395-b0149309-3949-4f27-8923-97d4e92a916a.mp4

Can you also take a look at the issue https://bugs.launchpad.net/mixxx/+bug/1939103 to backport the fix in this PR completely?

@ywwg
Copy link
Member Author

ywwg commented Sep 12, 2021

do those issues only affect this branch, or do they affect main as well? I have three outstanding synclock PRs and each fixes a different issue. If those issues are new after these fixes, then they are bugs here that should be addressed. If they also exist in main then they are out of scope. These things will never get fixed if we allow every sync lock PR to expand to encompass all synclock bugs.

@daschuer
Copy link
Member

If they also exist in main then they are out of scope.

Yes of cause. I hope I will find time to check that soon with main. If you find time before to test it, it would be a good step forward.

@daschuer
Copy link
Member

I can confirm that the first issue happens with plain master as well. I have filed a bug:
https://bugs.launchpad.net/mixxx/+bug/1946677

@daschuer
Copy link
Member

I no longer reproduce the second issue with this branch and with main.
Hopfully it has been fixed in the meanwhile.

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,

@daschuer daschuer merged commit 15805bc into mixxxdj:main Oct 12, 2021
@daschuer
Copy link
Member

Ups, I have merged this with a broken test. I will take a look.

@ywwg
Copy link
Member Author

ywwg commented Oct 13, 2021

thanks again for all your reviews

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

Successfully merging this pull request may close these issues.

5 participants