Bug 419421 - QML timers go too fast with multi-threaded render loop when using any high refresh rate screens on X11 when using FOSS amdgpu drivers
Summary: QML timers go too fast with multi-threaded render loop when using any high re...
Status: CLOSED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (show other bugs)
Version: 5.19.5
Platform: Kubuntu Linux
: VHI normal
Target Milestone: 1.0
Assignee: David Edmundson
URL:
Keywords:
: 403272 428978 435469 435508 438718 446637 447625 456504 460012 474188 478786 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-03-30 15:34 UTC by nuc
Modified: 2023-12-21 20:29 UTC (History)
23 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.0


Attachments
test case (1.16 KB, text/plain)
2021-01-16 18:58 UTC, David Edmundson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description nuc 2020-03-30 15:34:02 UTC
I have recently set to open folders/files by double clicking instead of single click, in the plasma settings.

While it works fine within dolphin, I cannot open any files or folder on my desktop. It is broken.
Comment 1 nuc 2020-03-30 15:35:21 UTC
Steps to repro:
1. Set settings to double click in plasma settings
2. Try to open a folder/file by double clicking, which is on the desktop.
Comment 2 Nate Graham 2020-03-30 19:47:53 UTC
Works for me. What Qt version do you have installed? Qt has broken this before.
Comment 3 Nate Graham 2020-03-30 19:48:22 UTC
(stub)
Comment 4 nuc 2020-03-31 00:28:02 UTC
Yeah it started working a while ago session, but after restarting the system it stopped working again.

My Qt is v5.14.1
Comment 5 nuc 2020-03-31 00:28:30 UTC
*in one user session
Comment 6 Nate Graham 2020-03-31 16:39:45 UTC
Weird. I've also got Qt 5.14.1 and double-click works fine for me with Desktop icons.
Comment 7 Nate Graham 2020-04-15 00:45:50 UTC
Still working for me. Is this still broken for you?
Comment 8 Christoph Feck 2020-05-12 12:19:54 UTC
If you can provide the information requested in comment 7, please add it.

Please also try with a freshly created user account to rule out configuration issues.
Comment 9 Bug Janitor Service 2020-05-27 04:33:12 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 10 Bug Janitor Service 2020-06-14 04:33:21 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!
Comment 11 nuc 2020-07-09 03:35:54 UTC
Hey sorry for the late answer. Tbh I have kinda given up reporting bugs related to plasma, but here we go.

Yes the bug is still occuring to me. I have tried your suggestion of adding a new user. I did it the GUI way and encountered at least 3 plasma bugs again but who cares (last time I tried out wayland it completely destroyed my regular plasma session, so I have basically given up on experimenting).

Anyways on a new session I cannot reproduce the bug. However I have only tried it once. As I said the issue is intermittend for me - meaning sometimes it just works, but other times it just doesn't.

So not sure what to make of this, if you want any logs, I can provide it, however I am not going to reset my whole user session or anything comparable. I have a hard time avoiding bugs in plasma already, yet reconfiguring my session.
Comment 12 Yaroslav 2021-01-15 15:13:00 UTC
I have same bug.
I found a relationship - if any section is selected in the application launch menu except for the favorites, for example (Computer / Applications / Exit, etc.), then links and folders on the desktop do not open. If you select favorites in the menu, then everything works fine.

Versions:
Kubuntu 20.10
KDE Plasma: 5.19.5
KDE Frameworks: 5.74.0
Qt: 5.14.2
Core: 5.8.38-generic
Comment 13 Nate Graham 2021-01-15 18:46:13 UTC
Hmm, I still can't reproduce that that. If I open kickoff and then double-click on a desktop file or folder while it's still open, it works no matter which page is open.
Comment 14 Yaroslav 2021-01-15 19:25:34 UTC
I have 240hz monitor. if i set 60hz mode all works fine. But if i set 240hz - desktop elements need to be clicked very quickly. 
Also the monitor mode affects the hold time of the notifications. (in the settings, 20 seconds are crushed, and the notification itself actually disappears in 5-7 seconds).
In dolphin and other applications all works good.
Comment 15 Nate Graham 2021-01-15 19:32:06 UTC
Aha! That seems very relevant. Perhaps QML Timer objects aren't scaling by the refresh rate. That would be pretty sucky.

I don't have any higher-than-average refresh rate screens to test, sadly.
Comment 16 Yaroslav 2021-01-15 19:40:57 UTC
Oh.. Okay. I will wait and try to find some solution =/
Comment 17 Nate Graham 2021-01-15 19:43:55 UTC
Found someone with a 144hz screen two graciously tested this, and he said it was working for him.

How exactly did you set it the screen to 240hz mode? Just using the Display Configuration page in System Settings, or some command line tool, or something else?

Also, Philip P, do you also have a high refresh rate screen?
Comment 18 Nate Graham 2021-01-15 20:01:53 UTC
Oh and also what GPU are you folks using?
Comment 19 Yaroslav 2021-01-15 20:12:33 UTC
I set mode in system configuration.
And modify two files:
in /.config/kwinrc  in section [Compositing] i add parameter MaxFPS=240
in /etc/environment i added to the end of the file:
LUTTER_DEFAULT_FPS=240
__GL_SYNC_DISPLAY_DEVICE=DP-2

without this modifications testufo.com displayed 60 Hz and the monitor continued to work in 60 Hz mode.

If i removed my modifications desktop-elements you also need to click very quickly.

I have a GPU: GTX 1060 3GB 
Driver: nvidia-driver-450 (proprietary)
Comment 20 Nate Graham 2021-01-15 20:14:20 UTC
Thanks for the info!
Comment 21 Yaroslav 2021-01-15 20:58:50 UTC
And yet - I have 2 monitors. second monitor (DVI-D) 60Hz. I tried to disable it and after reboot everything started working properly. But I need my second monitor. :/
(With the condition that the first will be 240 Hz)

offtop: I would like to be able to set 265Hz, but I don't know how to do it =)
Comment 22 Nate Graham 2021-01-15 21:03:09 UTC
Ahh, so this is caused by your workaround for us not supporting mixed refresh rates on X11. :/ We just merged some big changes to support this on Wayland in Plasma 5.21. Maybe you can switch to Wayland and use that eventually.

You're still using regular KWin, right? Not one of the forks?

I wonder if it could actually be a bug in the proprietary Nvidia driver... We've had issues before where it caused timers and animations to go too fast.
Comment 23 Yaroslav 2021-01-15 21:32:42 UTC
I tried a lot of things to solve my frequency problems.
I just recently switched to Linux and in particular KDE, so I don't even know how to switch this X11 to Wayland =)
kwin --v showed (kwin 5.19.5)
echo $XDG_SESSION_TYPE showed (x11)

for now, I'll try to test it with another video driver.
Comment 24 Yaroslav 2021-01-15 21:54:06 UTC
With the "X.Org server - Nouveau dusplay driver" I have a limit of 60 fps on both monitors and all elements of the desktop can be opened with a double click.
Comment 25 Nate Graham 2021-01-15 22:02:53 UTC
I'm starting to lean towards the Nvidia driver being at fault here. :)
Comment 26 nuc 2021-01-16 06:16:00 UTC
Hey looks like this finally blew up a little :D

Im also on a 240hz(DP)<->60hz(hdmi) setup.
AMD RX470 graphics card here, with open drivers.

I did not not modify an config files though, I was able to simply set the 240hz from the Plasma Settings.

Same issue with the notifications (I never knew what the heck is wrong with then lol).
The progress bar within notifications is also often not working correctly.. but that might also be a different bug :p
Comment 27 Yaroslav 2021-01-16 14:51:47 UTC
In my settings, too, 240 was set, but in the browser/games it was still 60. I had to look for an alternative solution.

With the open driver, everything worked for me because all the monitors started working in 60Hz mode again. (although in the settings the first one is set to 240Hz)
apparently because everything is synchronized on the monitor in DVE-D-0 (60Hz)
Comment 28 Nate Graham 2021-01-16 15:08:06 UTC
Moving to KWin for now; the developers there should be able to triage this further.
Comment 29 David Edmundson 2021-01-16 17:37:18 UTC
I am extremely lost as to what this bug is about.

Comment #1 is about folderview

The title is about QML Timer, which is /entirely/ client side.

>Perhaps QML Timer objects aren't scaling by the refresh rate. That would be pretty sucky.

Why would a timer be scaled? 

Can someone confirm a clear summary of what is known.
Comment 30 Yaroslav 2021-01-16 18:01:25 UTC
I just found two problems:
1. Files and folders don`t open by double click. 
But.. This problem don`t work if Comment 12. Or i set 60Hz mode on my DP-1 monitor.
2. Notifications hide faster if monitor mode > 60-120hz.
Comment 31 David Edmundson 2021-01-16 18:58:31 UTC
Created attachment 134944 [details]
test case
Comment 32 David Edmundson 2021-01-16 19:01:11 UTC
Can you download the above and run "qmlscene test.qml"

It's a timer, a double click, and an animation.

I'm somewhat confused how there could be a link, and debugging with a whole plasma is an uphill battle as it has too much noise.


Qt's Timer driven from the frame rate. QAnimationDriver is, but they serve different purposes.

We have seen issues with QAnimationDriver getting confused.
Running "kcmshell5 qtquicksettings" and selecting the basic render loop can suppress that
Comment 33 Yaroslav 2021-01-16 20:21:11 UTC
Test worked properly.
In "kcmshell5 qtquicksettings" i set "simple" render loop in the list was (automatic simple and multi-threaded), restart PC - and everything start working properly! =)
Thank you!
Comment 34 Vlad Zahorodnii 2021-01-18 07:46:01 UTC
(sorry for the noise, I didn't see that the bug report was already moved back to plasma)
Comment 35 Nate Graham 2021-01-19 16:56:24 UTC
RESOLVED WAITINGFORINFO isn't a status that makes sense; re-opening. :)

It seems like a workaround has been found, which hopefully helps to isolate the problem itself. It seems like the automatic or multi-threaded render loop settings are provoking this issue?
Comment 36 Yaroslav 2021-01-19 17:02:45 UTC
Yes. automatic and Multi-threaded methods include this problem.
Comment 37 David Edmundson 2021-01-19 22:58:39 UTC
>Test worked properly.

Including the spinning rectangle on the right?

If you run plasmashell --replace does the issue also go away?
Comment 38 Chris 2021-01-20 04:41:24 UTC
I've also experienced the issue of double-clicking items on the desktop not working most of the time. Often I'd need to triple-click or just try again. My display is 144 Hz. With it set to 60 Hz mode, the issue wouldn't crop up. I tried running the test, and that seemed to work fine. When I changed that setting Yaroslav mentioned to Basic (choices for me were Automatic, Basic, Threaded) the problem went away immediately.
Comment 39 Nate Graham 2021-01-20 04:57:56 UTC
Does the same thing happen where notifications time out too fast with 144Hz?
Comment 40 Yaroslav 2021-01-20 09:23:52 UTC
> Including the spinning rectangle on the right?
Yes. One rotate in one second. (In all rendering modes)

> If you run plasmashell --replace does the issue also go away?
Yes problem going away.
(I set automatic rendering method, restart PC and executed plasmashell --replace)
Comment 41 Nate Graham 2021-03-04 20:53:24 UTC
*** Bug 428978 has been marked as a duplicate of this bug. ***
Comment 42 Nate Graham 2021-03-18 14:51:21 UTC
*** Bug 403272 has been marked as a duplicate of this bug. ***
Comment 43 Nate Graham 2021-04-07 17:33:30 UTC
*** Bug 435469 has been marked as a duplicate of this bug. ***
Comment 44 Nate Graham 2021-04-07 19:43:20 UTC
Erik, could I prevail upon you to take a look at this? Thanks!
Comment 45 Nate Graham 2021-04-09 02:31:29 UTC
*** Bug 435508 has been marked as a duplicate of this bug. ***
Comment 46 ssergio-ll 2021-05-11 08:21:56 UTC
It's curious. When I cannot do (double) click to open the files and folders on my desktop, if I open Kickoff menu and then close it by clicking on the desktop, it already lets me open files and folders on the desktop by double clicking until after a while it returns to pass and I have to do the same.

Is it known if there is any progress on this bug?

Thanks.
Comment 47 ssergio-ll 2021-06-08 15:27:59 UTC
(In reply to Nate Graham from comment #45)
> *** Bug 435508 has been marked as a duplicate of this bug. ***

I have updated to KDE 5.22. Now i can to do double click on my desktop files and open it. I think that this bug is fixed.
Comment 48 Nate Graham 2021-06-08 15:29:18 UTC
Oh wow, that's nice. Can any other Nvidia users with high refresh rate screens confirm?
Comment 49 ssergio-ll 2021-06-08 15:45:36 UTC
(In reply to Nate Graham from comment #48)
> Oh wow, that's nice. Can any other Nvidia users with high refresh rate
> screens confirm?

Sorry Nate.

I don't know what happened but this fail again. Now i can't open my desktop files.
Comment 50 Unknown 2021-06-08 19:42:01 UTC
Hello,

No, the bug is not resolved. I've a nvidia card.

Sometimes if I switch one of the screens back to 60hz I can open the desktop items, other times, even when I switch back to 60hz, it doesn't open.
Comment 51 Yaroslav 2021-06-08 22:40:14 UTC
On KDE 5.22.0 (Neon) bug still working. Desktop icons needs clicked very fast to open and notifications after showing quickly hidden.

The proposed temporary solution with the basic render loop (kcmshell5 qtquicksettings) solves these problems.
Comment 52 Nate Graham 2021-06-16 20:47:08 UTC
*** Bug 438718 has been marked as a duplicate of this bug. ***
Comment 53 Nate Graham 2021-08-27 20:52:25 UTC
Would be fixed by https://invent.kde.org/frameworks/kdeclarative/-/merge_requests/71
Comment 54 Yaroslav 2021-08-28 18:38:38 UTC
For me, the problem is solved.
Comment 55 Nate Graham 2021-08-28 19:27:19 UTC
...When you apply that merge request or switch to the Basic render loop?
Comment 56 Yaroslav 2021-08-29 12:07:57 UTC
I set automatic render loop, and use KDE Neon (KDE plasma 5.22.4, KDE Frameworks 5.86.0, Qt 5.15.3).
Comment 57 Nate Graham 2021-08-31 20:15:29 UTC
Fixed by David Redondo in Plasma 5.23 with https://invent.kde.org/frameworks/kdeclarative/-/commit/66c5bb0efa6ac2a9a7bef8a4776150fdaf129353, which makes Plasma use the single-threaded render loop by default for NVIDIA users.
Comment 58 David Edmundson 2021-08-31 22:55:50 UTC
That patch will make absolutely no difference for users here.
Comment 59 Nate Graham 2021-08-31 23:32:06 UTC
But using the basic render loop works around the issue here. Isn't that what that patch does?
Comment 60 David Edmundson 2021-08-31 23:39:08 UTC
There's an if (QGuiApplication::platformName() == QLatin1String("wayland")) {
Comment 61 Nate Graham 2021-08-31 23:56:57 UTC
Oh.

Maybe we should consider doing it on X11 too...
Comment 62 Bug Janitor Service 2021-09-01 03:08:12 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kdeclarative/-/merge_requests/75
Comment 63 Nicolas Fella 2021-12-07 21:14:06 UTC
https://bugs.kde.org/show_bug.cgi?id=446637 describes a probably related issue, but with an AMD GPU
Comment 64 pqwoerituytrueiwoq 2021-12-11 22:23:07 UTC
Bug 446637 also shows up with integrated Intel GPUs (i3-2100 / HD 2000)
Comment 65 Nate Graham 2022-01-12 00:34:40 UTC
*** Bug 447625 has been marked as a duplicate of this bug. ***
Comment 66 Nate Graham 2022-07-13 18:55:31 UTC
*** Bug 456504 has been marked as a duplicate of this bug. ***
Comment 67 Nate Graham 2022-10-09 23:46:43 UTC
*** Bug 460012 has been marked as a duplicate of this bug. ***
Comment 68 David Edmundson 2023-03-24 00:03:01 UTC
Qt 6.4 has auto detection of this and falls back to a software timer
Comment 69 nuc 2023-03-24 07:48:17 UTC
I am not sure who changed the title of this bug report, but I am the original reporter of this bug and I have never used an NVIDIA graphics card...

As I have pointed out earlier I am on a RX470.

I will test again once Plasma is on Qt6.
Comment 70 postix 2023-03-24 12:11:44 UTC
(In reply to Philip P. from comment #69)
> I am not sure who changed the title of this bug report, but I am the
> original reporter of this bug and I have never used an NVIDIA graphics
> card...

You can click on the "History" link [1] next to modify on the top of this page to see when and by whom something was changed.
In this case it was Nate who came to the conclusion that it'd be NVIDIA's fault (which always a good first guess :P ), but basically it anyone registered can change the title.
[1] https://bugs.kde.org/show_activity.cgi?id=419421

David, can you confirm that bug #446637 for "AMD cards" has been resolved with Qt6.4 too?
Comment 71 Nate Graham 2023-03-27 17:59:43 UTC
*** Bug 446637 has been marked as a duplicate of this bug. ***
Comment 72 Nate Graham 2023-09-05 19:34:09 UTC
*** Bug 474188 has been marked as a duplicate of this bug. ***
Comment 73 temp02 2023-09-13 09:39:09 UTC
I've noticed since system upgrade that plasma timer 2.0 runs too fast. Downgrading qt5 and the timer functions as normal. Arch Linux.

[2023-09-13T11:25:47+0200] [ALPM] downgraded qt5-base (5.15.10+kde+r155-1 -> 5.15.10+kde+r152-1)
[2023-09-13T11:26:08+0200] [ALPM] downgraded qt5-declarative (5.15.10+kde+r31-1 -> 5.15.10+kde+r29-1)
[2023-09-13T11:26:27+0200] [ALPM] downgraded qt5-tools (5.15.10+kde+r3-2 -> 5.15.10+kde+r3-1)
Comment 74 temp02 2023-09-13 09:56:42 UTC
(In reply to temp02 from comment #73)
> I've noticed since system upgrade that plasma timer 2.0 runs too fast.
> Downgrading qt5 and the timer functions as normal. Arch Linux.
> 
> [2023-09-13T11:25:47+0200] [ALPM] downgraded qt5-base (5.15.10+kde+r155-1 ->
> 5.15.10+kde+r152-1)
> [2023-09-13T11:26:08+0200] [ALPM] downgraded qt5-declarative
> (5.15.10+kde+r31-1 -> 5.15.10+kde+r29-1)
> [2023-09-13T11:26:27+0200] [ALPM] downgraded qt5-tools (5.15.10+kde+r3-2 ->
> 5.15.10+kde+r3-1)

This is with 120Hz on X11 with Nvidia.
Comment 75 temp02 2023-09-13 10:53:44 UTC
Nevermind, the problem is back again.
Comment 76 Nate Graham 2023-09-13 11:51:07 UTC
As the "Version Fixed In" field says, this is fixed in Plasma 6. So if you're not using Plasma 6 yet, it's still expected to be broken.
Comment 77 Nate Graham 2023-12-21 20:29:08 UTC
*** Bug 478786 has been marked as a duplicate of this bug. ***