-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 jerking with Windows 11 and GeForce GTX770 #11399
Comments
After setting the v-sync settings in the NVIDIA control panel to various values and back to NVIDIA Default "For 3D applications" However there is every 5 seconds a phase of 1 s with a micro jitter. All v-sync settings are effected. This issue is the same for all tested Mixxx versions including #10989 |
Could you please test if this is fixed after merging #11681 |
Can you check if this still is the case? |
And can you check if this branch makes a difference: https://github.com/m0dB/mixxx/tree/vsyncthreadless (This is an experimental branch that does the vsync timing directly in the main thread instead of using a separate thread signaling the main thread, thus avoiding the overhead and impression of the signaling and the hassle of the semaphore) |
This branch doesn't start up:
|
can you try again? |
Now it runs! My assumptions: In general worker threads, where no Qt event queue is started to receive events, run with reliable speed. Sleep functions only depend on the scheduler, and these work much better than a timer. BTW: I found this post interesting to read: https://forum.qt.io/post/727544 |
I got access to the original test device. I still see a micro jitter in intervals. The vsyncthreadless branch is unfortunatly crashing:
This reveals the issue that the jitter may come form the Invalid timestamp form the Soundcard. |
@daschuer I added a check to make sure initializeGL has been called, I hope that fixes the crash.
Yes, blocked by another thread, or because of an event being handled in the main thread itself. And that is what this approach tries to avoid. There is IMO no added value of using a separate thread for the vsync signal. There would be, if the drawing could be triggered directly from the vsync thread, but since it's still the main thread that has to handle the event, we could as well do the triggering in the main thread itself, and arguably better: I added an idle callback, which is called when there are no events left on the queue. In the idle callback, if I see that the swap is due within a certain time window, I sleep the time that is remaining time and I do the swap. This reduces the risk that more events get added that would delay the swap. Additionally, I also checked if the swap is due in the eventFilter, basically giving priority to the swap over the event handling. But I removed that because of the crash you experienced. Now, it might be that with my last change this can be put back (you could try this by uncommenting the commented lines at the top of MixxxMainWindow::eventFilter) Of course the ideal solution would be to do the rendering and swapping from the vsyncthread itself. This requires moving the QOpenGLContext to the VSyncThread. I got this working until a certain point and it indeed solves all the problems (like framedrops when scrolling the library). The problem is that Qt sometimes still uses the QOpenGLContext from the main thread (e.g. when resizing or when changing the layout) which causes a crash, and I have found no way around that... |
I think the real bug fix would be, to find out what blocks the Qt Event Queue and eliminate this. But this might be a very difficult task. The timers also depend on the Qt Event Queue. You can't trust the time period of them. If the Qt Event Queue were locked, than it sends several events at once after the lock. This does not happen with the free running vsync thread, which has no Qt Event Loop listener started. |
What timers do you mean? I am not using any QTimer except for the idle timer which isn't a real timer. |
Ah good, than my sentence about the timer doesn't apply here. |
To be clear, this branch is just an experiment I did and I was curious to see if it would make a difference for this issue. |
I think the original issue is solved. Even on my old Windows7 dual core laptop with poor GPU, I get 60fps with 2.4 and the default ST_TIMER. |
ok to close this bug then? we know there are random lag issues sometimes but I don't think they block 2.4. |
We have still work in progress regarding waveform jerking. Like this one #12516 |
But the original report was about low frame rates on one specific grapic adapter. We should close it, when this is confirmed to be fixed. |
I just did the test with Windows 11 2023-10 Update KB4023057 ST_FREE runs OK, ST_PLL is broken by heavy jitter and frame-rates dropping to 50 Hz. |
Bug Description
RGB (GLSL) runs only with 44 f/s (of 60)
RGB (GL) -> 50 f/s
RGB -> 55 f/s
RGB wuns with 30 f/s if 30 is selected, but the jerking does not stop and the droped frames are keeping counting.
My guess is that there is a new anti tearing code active.
Using 2.4-alpa or @m0dB #10989 does not make a difference.
Where the later gives extra smoothness on my Ubuntu Focal with intel GPU.
Version
2.3.4
OS
Windows 11
The text was updated successfully, but these errors were encountered: