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

Clamp offset in VisualPlayPosition with extra time of two vsync interval #12470

Merged
merged 2 commits into from Jan 2, 2024

Conversation

daschuer
Copy link
Member

@daschuer daschuer commented Dec 29, 2023

It turns out that this is required to not clamp in all good conditions. Clamping causes a jittery waveform and must not happen under normal conditions.

This removes one cause of jittery waveforms, during my tests. All other tests where successful with reasonable values. So I guess that the remaining jitters are real vsync misses.

The clamping has been introduced to not move the waveform with a stalled audio engine. This still works, but is done one vsync cycle later.

It turns out that this is required to not clamp in all good conditions.
Clamping causes a jittery waveform and must not happen under normal conditions
@daschuer
Copy link
Member Author

daschuer commented Jan 1, 2024

@m0dB can you confirm this fix?

@m0dB
Copy link
Contributor

m0dB commented Jan 2, 2024

looks good to me, at least I don't notice any regression.

@JoergAtGithub
Copy link
Member

Shouldn't we log a warning, if this clamping happens?

@daschuer
Copy link
Member Author

daschuer commented Jan 2, 2024

the warning is now in place.

@JoergAtGithub
Copy link
Member

LGTM! Thank you!

@JoergAtGithub JoergAtGithub merged commit bff9a30 into mixxxdj:2.4 Jan 2, 2024
13 checks passed
@m0dB
Copy link
Contributor

m0dB commented Jan 2, 2024

Why might want to limit the logging of these warnings...

warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)
warning [Main] VisualPlayPosition::calcOffsetAtNextVSync "[Channel1]" no transport (offset < -maxOffset)

@daschuer
Copy link
Member Author

daschuer commented Jan 3, 2024

There is already a boolean intended to avoid log spam.

Each warning is indicating a stucked waveform and a visible stutter. If you see them all the time without transport issues it indicates broken syncing.
This can be either the v-syn algorithm or the soundcard clock.

I have no idea how to remove this spam without removing the warning altogether. I think it is better to fix the root cause if we can. On Linux I was not able to produce a single warning.

A first step would be to make this warning more verbose.

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.

None yet

3 participants