AutoDJProcessorTest.FadeToDeck2_Long_Transition fix#34
AutoDJProcessorTest.FadeToDeck2_Long_Transition fix#34Be-ing merged 19 commits intoBe-ing:autodj_intro_outrofrom
Conversation
…also a stalled autoDJ in caseof transition time exceedes track duration.
| } else { | ||
| pFromDeck->fadeBeginPos = endPoint; | ||
| pFromDeck->fadeEndPos = endPoint - m_transitionTime; | ||
| pFromDeck->fadeEndPos = endPoint; |
There was a problem hiding this comment.
This breaks fading with a negative transition time. AutoDJ stops in this case.
There was a problem hiding this comment.
This was causes elsewhere, but fixed now.
|
When the transition time is 0, tracks are loaded at the end. AutoDJ keeps playing by seeking back to the start when it is time to transition, but this is really confusing. |
| if (m_eState == ADJ_IDLE) { | ||
| if (thisDeckPlaying || thisPlayPosition >= 1.0) { | ||
| // cache this before calculating the new transition in otherDeck.play(); | ||
| bool hasFadeTransition = thisDeck.fadeBeginPos < thisDeck.fadeEndPos; |
There was a problem hiding this comment.
When could this be false? It is not obvious. At first glance it seems like this should be a debug assert.
There was a problem hiding this comment.
This is always false, if you use a negative or zero transition time.
I will add a comment.
Does this seek to the end happens automatically? I cannot confirm that. I have only found and fix an issue using n invalid cue point of -1. Or do you mean manual seeking to the end? The track should not seek or unload to allow the user to adjust the outro, right? Do you now have a different opinion? |
Yes, the second track and every track after that loaded in Full Track mode with a transition transition time of 0 loads at the end of the track. |
|
I cannot reproduce this and I have no idea where the seek is coming from. |
|
Could it be the deck clone feature? It looks like the new code tricks the detection. |
|
This seeking to the end bug is new with this PR and 100% reproducible for me. I am not sure what commit introduced the bug because AutoDJ has not worked at all with a transition time of 0 since before any of your recent PRs were merged. ee9cfcc is the most recent commit before this PR where Full Track mode works with a transition time of 0. That commit does not have the loading at end of track bug.
No. Maybe it would happen with Skip Silence mode if the outro end was at the very end of the track but I have not tested.
Yes. |
|
I have a bug in rare cases where the seek to 0:0 does not happen. Instead it is seeked to the main cue as set in the deck preferences. I guess here the seek is omitted: Maybe in you case there is a stray 1 stored as seek point and never overridden due to an early return in calculateTransition() Can you verify this? I have tried to remove the is playing dependency, but this has messed up the tests. |
|
I tested your latest changes and the bug is still there. I will try debugging tonight.
The main cue is not at the end of the track, so I don't think this bug is related. |
|
Being at the main cue maybe only a side effect. Maybe we should force it to -1 in case of early exit. |
Actually I won't have time until this weekend. |
…ixed deck index orientation asumption
|
My issue is gone now. Yours as well? |
|
The random seek issue still happens sometimes. I am currently digging into it. |
|
Fixed now. @Be-ing: Is your issue fixed as well? |
|
No, the seeking to the end bug is still there. I am puzzled why you cannot reproduce it. I can reproduce it 100% of the time by choosing Full Track mode and setting the transition time to 0. The bug appears as soon as the first transition is made after enabling AutoDJ. |
|
Strange, I have added some debug. Can you create a mixxx.log file. I am curious which path in the code seeks to 1. |
|
I think the bug is actually in WOverview, not AutoDJProcessor. I just noticed that when the bug occurs, the scrolling waveform is in the correct position, it is only the overview that is in the wrong position. I suspect this was caused by merging master after mixxxdj#2238 was merged to master. |
|
This does seem to be somehow related to the track load preference. When I have the preference set to load at the beginning of the track, the bug occurs with every track. When I set it to load at intro start, the bug only occurs when the intro start is at the very beginning of the track. |
|
Yes, the problem is in WOverview. Adding a call to |
c5528d0 to
db49654
Compare
|
After merging master, I can reproduce the issue. |
|
Okay, so how should we solve it? |
|
@Be-ing: Now it should be solved. Please test again. |
|
It's fixed! |
| // We require ADJ_IDLE to prevent changing the thresholds in the middle of a | ||
| // fade. | ||
| if (m_eState != ADJ_IDLE) { | ||
| VERIFY_OR_DEBUG_ASSERT(m_eState == ADJ_IDLE) { |
There was a problem hiding this comment.
I am confused why you changed this to a debug assertion. There is now code scattered throughout AutoDJProcessor repeating this check before calling calculateTransition. Why is it not sufficient to check this here at the top of calculateTransition? Aren't those other checks redundant?
There was a problem hiding this comment.
I have moved the check outside to clearly mark all calling functions as "guard for manual user changes only".
I had a knot in my head when debugging because of all these slots.
This change helped me finally for a better understanding. I have kept the change, because it also saved some cpu cycles.
|
What was the root cause of the bug? I don't understand how the changes you made fixed it. |
|
It was actually a combination of two bugs. One was a recursive call of playerPositionChanged(). A stop() causes finally another playerPositionChanged() to 0 before the fist value was passed to the woverview. So first 1 was passed after the following 0. The other issue was in engine buffer, that a seek of an old track to a position prevents a new track to seek to the same position. The later was the original bug where the fix inside AutoDj leads to the first bug. I think I now have catched the route cause. I guess the behaviour has changed in master lately due to the engine track loading refactoring. |
|
Okay, thank you for digging deep to solve those tricky bugs. I am glad we did not go with the quick hack in WOverview. |
No description provided.