Bug 476729 - Inconsistent timing when Plasma is run on Wayland on VirtualBox
Summary: Inconsistent timing when Plasma is run on Wayland on VirtualBox
Status: RESOLVED WORKSFORME
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: master
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2023-11-08 22:47 UTC by guimarcalsilva
Modified: 2023-12-13 23:31 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
5.27 - Normal speed (1.92 MB, video/mp4)
2023-11-08 22:47 UTC, guimarcalsilva
Details
Inconsistent speed on Plasma 6 (3.87 MB, video/mp4)
2023-11-08 22:49 UTC, guimarcalsilva
Details

Note You need to log in before you can comment on or make changes to this bug.
Description guimarcalsilva 2023-11-08 22:47:08 UTC
Created attachment 162957 [details]
5.27 - Normal speed

SUMMARY
I downloaded the latest Neon Unstable version from Nov. 7th and I noticed screen rendering on a Wayland session when running on VirtualBox is really inconsistent timing-wise (at first it's trying to display all frames sequentially very slowly, then out of nowhere it either displays (or skips) the rest of the frames of the animation really fast, as if someone was playing with the animation speed slider as the animation is being played). Also, if you make the clock show the seconds on the panel, you'll notice the seconds stop running while the slowdowns occur. I'll upload some videos to show what I mean.

While this timing bug isn't exactly new to Plasma 6 (On Plasma 5 the gear animation when starting the session always ran much faster than normal when on a VM on Wayland), on Plasma 6 each time an animation is played the system slows to a crawl, including mouse movement, and then it speeds up at the end again. I'll attach two videos, one from 5.27 and one from 6 on VirtualBox using Wayland. Notice how much laggier 6 is on the same VM.

Important: I'm enabling 3D acceleration on VirtualBox for both 5.27 and 6 (otherwise I only get a black screen when trying Wayland). This also doesn't happen with Gnome Boxes (I believe it's based on QEMU), where there's no animation at all. Changing the virtual GPU also doesn't help. I also tested GNOME on Wayland and there's no problem there while using the same VM, so this must be a bug in how Kwin interacts with VirtualBox.

STEPS TO REPRODUCE
1. Use VirtualBox
2. Start a Wayland Session (try Neon)
3. Click on applets and maximize the window (you can also try making the clock show seconds. When the slowdowns occur the seconds stop ticking).

OBSERVED RESULT
The animation seems to start really slow then it becomes fast at the end, the cursor is also affected and it moves slowly while the slowdowns occur and speeds up at the end of the animation.

EXPECTED RESULT
Animations have a constant speed, just like X11.

SOFTWARE/OS VERSIONS

HOST:

Operating System: KDE neon 5.27
KDE Plasma Version: 5.27.9
KDE Frameworks Version: 5.111.0
Qt Version: 5.15.11
Kernel Version: 6.2.0-36-generic (64-bit)
Graphics Platform: Wayland
Processors: 6 × Intel® Core™ i5-9400F CPU @ 2.90GHz
Memory: 15,5 GiB of RAM
Graphics Processor: AMD Radeon RX 570 Series

VM - VirtualBox:

KDE Plasma Version: 5.27.80
KDE Frameworks Version: 5.240.0
Qt Version: 6.6.0
Graphics Processor: SVGA3D; build; RELEASE; LLVM;
Comment 1 guimarcalsilva 2023-11-08 22:49:01 UTC
Created attachment 162958 [details]
Inconsistent speed on Plasma 6

Pay attention to the seconds on the clock. Notice how the animation starts slow and then speeds up (or skips frames) at the end. This affects the whole screen.
Comment 2 guimarcalsilva 2023-12-13 23:31:34 UTC
After a while, the problem mysteriously stopped.