Created attachment 159849 [details] UFO Screen Test With Stutter SUMMARY *** NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols. See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports *** When sharing a window with OBS a brief stutter occurs every second, indefinitely. This stutter affects my entire desktop, including cursor movement. This issue does not occur when using a Screen Capture source. It's worth noting that I have installed OBS as a Flatpak and so it would be using the appropriate screen sharing portals to view windows. STEPS TO REPRODUCE 1. In OBS create a Window Capture source 2. Select a window to share from the Screen Sharing Portal and share it 3. Observe a periodic lag spike occurring every second OBSERVED RESULT Using a Window Capture source, when a portal is shared with OBS I begin to experience stuttering every second. If I open OBS and no portal is being actively shared I do not experience any stuttering. Sometimes it doesn't happen though, but I have not been able to reliably reproduce this good behaviour. EXPECTED RESULT There should be no stuttering when sharing a window. SOFTWARE/OS VERSIONS Operating System: Arch Linux KDE Plasma Version: 5.27.6 KDE Frameworks Version: 5.107.0 Qt Version: 5.15.10 Kernel Version: 6.3.8-arch1-1 (64-bit) Graphics Platform: Wayland Processors: 24 × AMD Ryzen 9 3900X 12-Core Processor Memory: 31.3 GiB of RAM Graphics Processor: AMD Radeon RX 7900 XT Manufacturer: ASUS ADDITIONAL INFORMATION This was originally reported to OBS but was requested to be upstreamed: https://github.com/obsproject/obs-studio/issues/9070
*** Bug 446115 has been marked as a duplicate of this bug. ***
Created attachment 159888 [details] pipewire connections I've tested this issue a little more and it looks like this issue affects the Screen Capture Source as well. When you create a new Window/Screen capture source the Screen Sharing Portal dialog pops up with previews of the windows/screens to choose. This is when the stuttering begins. If you cancel out of that dialog the stuttering goes away. Also, I tried disconnecting all of the pipewire screencast streams using qpwgraph while I had the Screen Sharing Portal preview dialog open to see if that would kill the stuttering (there are multiple win_wayland [kwin-screencast-...] sources connected to xdg-desktop-portal-kde [plasma-screencast-...], kwin_wayland [kwin-screencast-...], and plasmashell [plasma-screencast-...] sinks, see the attached screenshot) but that did not work.
It's worth noting that this issue doesn't seem to occur when using a Game Capture source using obs-vkcapture (and obs-gstreamer).
I've experienced this with other apps other than OBS such as Webcord.
deadmeu, is one of you CPU cores pinned at 100% or close to it when you screen share? As I believe this issue is related to https://bugs.kde.org/show_bug.cgi?id=469777 as I get 100% on one core when screen sharing on Plasma, I don't experience this on other Wayland compositors.
(In reply to toby from comment #5) > deadmeu, is one of you CPU cores pinned at 100% or close to it when you > screen share? As I believe this issue is related to > https://bugs.kde.org/show_bug.cgi?id=469777 as I get 100% on one core when > screen sharing on Plasma, I don't experience this on other Wayland > compositors. Thanks for commenting toby. Yes, when any window/screen sharing occurs, regardless of whether it's by the portal sharing selection dialog or a currently active source, I can see a single thread being pinned at max utilisation. I can see the kwin_wayland process maxing out at 4% utilisation which, on my CPU with 24 threads, lines up with the almost 100% utilisation I'm seeing on a single thread.
From the bug report I mentioned earlier Prajna Sariputra is reverting commit 226d8c0a3b464f8870c45bfe5079f042a3cd5d67 in kwin, I've just done that myself to see if it resolves this issue and from what I can tell I'm not getting any stuttering.
*** This bug has been marked as a duplicate of bug 469777 ***