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

Waveform stutters during drag'n'drop on Windows #7397

Open
mixxxbot opened this issue Aug 22, 2022 · 9 comments
Open

Waveform stutters during drag'n'drop on Windows #7397

mixxxbot opened this issue Aug 22, 2022 · 9 comments

Comments

@mixxxbot
Copy link
Collaborator

Reported by: kain88-de
Date: 2014-04-01T09:04:51Z
Status: Triaged
Importance: Medium
Launchpad Issue: lp1300664
Tags: waveform, windows
Attachments: [profiler screenshot](https://bugs.launchpad.net/bugs/1300664/+attachment/4161482/+files/profiler screenshot)


I always get stuttering waveforms when I drag'n'drop tracks. I don't see any of this under linux

@mixxxbot
Copy link
Collaborator Author

Commented by: default-kramer
Date: 2014-07-18T16:15:47Z


I can reproduce this (32-bit Mixxx on Win7 64). In fact, I get occasional stuttering all the time and heavy stuttering during drag and drop. It seems to affect all skins.

I'd be willing to try to fix this but I think I should try tackling some easy bugs first.

@mixxxbot
Copy link
Collaborator Author

Commented by: esbrandt
Date: 2014-07-19T09:36:47Z


See this on OS X too, probably related to"GUI stutters if you click in sidebar or scroll through library", lp:685795

@mixxxbot
Copy link
Collaborator Author

Commented by: default-kramer
Date: 2014-07-19T14:08:57Z


Did some investigation - the problem has at least 2 parts. The first problem is around this line:

    int usRefToVSync = vsyncThread->usFromTimerToNextSync(&data.m_referenceTime);

When "data.m_referenceTime" is newer than the VSync thread's "m_timer" the resulting call to "PerformanceTimer::difference()" underflows an unsigned int, resulting in a huge "offset" which is used on this line:

    playPos += data.m_positionStep * offset * data.m_rate / m_dAudioBufferSize / 1000;

so the playPos jumps way too far ahead.

The first part is to fix this underflow, define what "difference()" should return in this case, and in general, handle the case where "data.m_referenceTime" is newer than the vsync thread's "m_timer" .

The 2nd part is this. I fixed the underflow and the playPos no longer jumps around. But the waveform (appears to) run at a very low framerate. I'm guessing the VSync thread is getting starved.

@mixxxbot
Copy link
Collaborator Author

Commented by: default-kramer
Date: 2014-07-19T23:51:09Z


I submitted pull request 292 for the stuttering waveform issue specifically. #292

I created bug #⁠1345220 for the overall UI slowdown that occurs when dragging.

@mixxxbot
Copy link
Collaborator Author

Commented by: kain88-de
Date: 2014-07-22T09:18:56Z


This is the bug for UI-slowdown when dragging, the titel is quite clear about that. So please keep any discussions about this in here.

Nice fix for the general stutter that you got though thanks.

@mixxxbot
Copy link
Collaborator Author

Commented by: default-kramer
Date: 2014-07-23T23:38:49Z
Attachments: [profiler screenshot](https://bugs.launchpad.net/mixxx/+bug/1300664/+attachment/4161482/+files/profiler screenshot)


Well I've made some progress... I need to dump my brain because it's getting full and I have other stuff to do for a while.

First, this problem existed in the 1.11.0 release, although it may have been less noticeable. Second, as long as you keep the mouse moving quickly it doesn't happen. It's only when you hold a drag still.

The problem is that the GUI thread is waiting. (And the VSync thread is waiting on the GUI thread via semaphores, but that's not relevant.) There's plenty of CPU available too, so something is blocking. I ran the Very Sleepy profiler and you can see in the attached screenshot that "DoDragDrop" in ole32 is the culprit. This probably explains why the problem doesn't affect Linux (ole32 is a standard windows module).

This really looks like a flaw in Qt - I'm pretty sure they did not want to make a blocking call here. But perhaps they have no choice on Windows?

Does anyone have a Qt5 Windows version they can test? It would be interesting to see if the problem exists with Qt5.

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2020-05-09T08:20:01Z


Lowering Priority, because this is no party stopper.

@mixxxbot mixxxbot transferred this issue from another repository Aug 24, 2022
@daschuer
Copy link
Member

@JoergAtGithub can this be closed with Mixxx 2.4-alpha?

@JoergAtGithub
Copy link
Member

I can reproduce it with latest Mixxx 2.4 on Windows11.
It occurs as well for drag and drop inside Mixxx (e.g. library to deck)
as with drag and drop from file explorer to Mixxx (the stuttering starts when the mouse enters the Mixxx window).

@JoergAtGithub JoergAtGithub changed the title waveform stutters during drag'n'drop on Win7 Waveform stutters during drag'n'drop on Windows Aug 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants