Bug 489602 - Mouse movement causes stuttering in PipeWire captured content
Summary: Mouse movement causes stuttering in PipeWire captured content
Status: REPORTED
Alias: None
Product: kwin
Classification: Plasma
Component: screencasting (show other bugs)
Version: 6.1.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-02 12:30 UTC by fililip
Modified: 2025-01-09 19:41 UTC (History)
3 users (show)

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


Attachments
Demo capture (504.12 KB, video/webm)
2024-07-02 12:30 UTC, fililip
Details

Note You need to log in before you can comment on or make changes to this bug.
Description fililip 2024-07-02 12:30:43 UTC
Created attachment 171278 [details]
Demo capture

SUMMARY
When moving the mouse on a PipeWire captured display, its content stutters inside of the capture. However, the actual display output is smooth. This does not happen while the cursor is enlarged with shakecursor.

STEPS TO REPRODUCE
1. Set 60Hz on the about-to-be-captured display
2. Launch OBS, use Screen Capture (PipeWire), enable Show Cursor, set OBS capture FPS to 60
3. Launch a fullscreen application, i.e. VRRTest
4. Enable VSync in the app, ensure it's rendering at the display's refresh rate
5. Start recording
6. Start moving the mouse slowly but steadily and keep at it for a while
7. Stop moving the mouse
8. Trigger shakecursor and keep it active for a while
9. Stop moving the mouse again
10. Stop recording

OBSERVED RESULT
The captured display's content stutters when the cursor is moving, but not while shakecursor is active
(Also see the attached "Demo capture" video file)

EXPECTED RESULT
Nothing stutters at all

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.1.1
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.2
Kernel Version: 6.9.7.arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5800X 8-Core Processor
Memory: 62.7 GiB of RAM
Graphics Processor: AMD Radeon RX 6600 XT
Comment 1 Vlad Zahorodnii 2024-07-02 13:55:01 UTC
Git commit 465873ecac2f515aac4300ab33729b715cab5e8d by Vlad Zahorodnii.
Committed on 02/07/2024 at 13:54.
Pushed by vladz into branch 'master'.

plugins/screencast: Handle frame rate throttling timer firing a bit earlier

The QTimer can fire a bit earlier than expected. If that happens, don't
try to start it again, but record a frame instead.

M  +19   -9    src/plugins/screencast/screencaststream.cpp
M  +2    -1    src/plugins/screencast/screencaststream.h

https://invent.kde.org/plasma/kwin/-/commit/465873ecac2f515aac4300ab33729b715cab5e8d
Comment 2 Bug Janitor Service 2024-07-02 14:00:13 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/6034
Comment 3 Vlad Zahorodnii 2024-07-02 14:46:03 UTC
Git commit 2b4068673944b40d3ffa223ea6ae04f379f9ec93 by Vlad Zahorodnii.
Committed on 02/07/2024 at 13:59.
Pushed by vladz into branch 'Plasma/6.1'.

plugins/screencast: Handle frame rate throttling timer firing a bit earlier

The QTimer can fire a bit earlier than expected. If that happens, don't
try to start it again, but record a frame instead.
(cherry picked from commit 465873ecac2f515aac4300ab33729b715cab5e8d)

M  +19   -9    src/plugins/screencast/screencaststream.cpp
M  +2    -1    src/plugins/screencast/screencaststream.h

https://invent.kde.org/plasma/kwin/-/commit/2b4068673944b40d3ffa223ea6ae04f379f9ec93
Comment 4 fililip 2024-07-22 11:00:39 UTC
I found a very cool OpenGL/Vulkan layer for game capture, anyone who has stuttering issues or annoyances with pipewire window/desktop capture should try this and see if it helps (it makes content entirely stutter free :D): https://github.com/nowrep/obs-vkcapture