Bug 463958

Summary: Recurring stutter of the whole desktop
Product: [Plasma] kwin Reporter: Edgars <edgarsscirulis>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED DOWNSTREAM    
Severity: major CC: apricus, doorknob60, nate, nicolas.fella, tomenglund26
Priority: NOR    
Version: 5.26.5   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
URL: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7624
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Edgars 2023-01-07 04:54:03 UTC
STEPS TO REPRODUCE
1. Play any music or whatch movie with sound.
2. wait some hours
3. profit?

OBSERVED RESULT
Weird stuttering effect with crackling sound effect.

EXPECTED RESULT
No weird stuttering effect with crackling sound effect.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.26.5
KDE Frameworks Version: 5.101.0
Qt Version: 5.15.7
Kernel Version: 6.1.3-zen1-1-zen (64-bit)
Graphics Platform: Wayland
Processors: 8 × AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx
Memory: 6.7 GiB of RAM
Graphics Processor: AMD Radeon Vega 8 Graphics
Manufacturer: HUAWEI
Product Name: BOHK-WAX9X
System Version: M1020

ADDITIONAL INFORMATION

Using pipewire with wayland session.

It seems that there's a new bug with the Wayland session? I'm assuming that's what it is. I'm getting a weird stuttering effect.

When I play music and do random stuff, sometimes the whole Plasma desktop environment stutters with a crackling sound. At first, I thought it was a problem with PipeWire, but now I'm not sure.
Comment 1 Edgars 2023-01-08 12:26:03 UTC
Any response? My friends getting the issue too. Kind annoying. Any workarounds?
Comment 2 Nate Graham 2023-01-09 22:04:22 UTC
What app are you using to play audio that experiences this? All of them? Only some of them? Is it consistent, or random?

I do suspect a PipeWire issue, rather than anything in KDE software, but let's gather more information just to be sure.
Comment 3 Edgars 2023-01-09 22:14:17 UTC
(In reply to Nate Graham from comment #2)
> What app are you using to play audio that experiences this? All of them?
> Only some of them? Is it consistent, or random?
> 
> I do suspect a PipeWire issue, rather than anything in KDE software, but
> let's gather more information just to be sure.


Indeed test(In reply to Nate Graham from comment #2)
> What app are you using to play audio that experiences this? All of them?
> Only some of them? Is it consistent, or random?
> 
> I do suspect a PipeWire issue, rather than anything in KDE software, but
> let's gather more information just to be sure.

Chrome, In-game. Actually I've noticed it's not pipewire fault because it sutters whole desktop env randomly even if there's no audio session. Downgrading KDE to 5.26.4 fixes the issue. The bug is hard repeat. It's really random.

My friends experiencing it too.
Comment 4 Hexagon 2023-01-10 05:04:04 UTC
I can confirm this problem. My setup:
- Using Arch Linux (Kernel linux 6.1.4.arch1-1)
- Using KDE Plasma (Wayland): plasma-wayland-session 5.26.5-1
- Processor: AMD 5900X, GPU: AMD Radeon 6900XT, MESA drivers

My findings:
- The problem is new. 3 weeks old max I think.
- The problem is hard to reproduce. It randomly occours sometimes every 30 minutes, sometimes 2 hours without a stutter. The stutter is very short (about 800ms). During this stutter the complete desktop hangs including the mouse cursor, audio (pipewire), playing video or anything else you have open. I have encountered it dragging Wayland applications like Dolphin over the screen, playing a fullscreen YouTube video with Firefox (Wayland), playing Minecraft (Xwayland), playing games through Steam like CS:GO (linux native), playing games through WINE like The Witcher 3, listening to music with Elisa and more. It is very annoying and makes consuming multimedia content (especially with sound) extremely frustrating, wondering when it will hang the next time.

It feels like there is a buffer of some sort running full. (just speculation)

If you need further information, don't hesitate to ask. I hope the problem can be found soon :)
Comment 5 Edgars 2023-01-10 09:54:05 UTC
Seems like the same issue got you have, it's really annoying. I've noticed first time when playing Minecraft
Comment 6 Nate Graham 2023-01-10 21:55:31 UTC
Ah, both of you are using AMD GPUs. In that case I know what this is: a recent graphics driver regression. See https://gitlab.freedesktop.org/mesa/mesa/-/issues/7624. It's already been fixed and just needs to make it into a release.
Comment 7 Edgars 2023-01-14 02:10:24 UTC
(In reply to Nate Graham from comment #6)
> Ah, both of you are using AMD GPUs. In that case I know what this is: a
> recent graphics driver regression. See
> https://gitlab.freedesktop.org/mesa/mesa/-/issues/7624. It's already been
> fixed and just needs to make it into a release.

Looks like its not the issue. after updating mesa issue still persists.
Comment 8 Hexagon 2023-01-16 14:30:40 UTC
Edgars, what did you do exactly to downgrade to KDE 5.26.4? I have not tried to downgrade as I don't know which components have to be downgraded, as the KDE environment consists of about 20 packages on Arch. Which ones did you downgrade? Just plasma-wayland-session?
Maybe by selectively downgrading each package at a time we could narrow down the problem to a specific KDE component. Furthermore: Does this only happen on Wayland or on X11 too?
Comment 9 Edgars 2023-01-17 02:48:56 UTC
(In reply to Hexagon from comment #8)
> Edgars, what did you do exactly to downgrade to KDE 5.26.4? I have not tried
> to downgrade as I don't know which components have to be downgraded, as the
> KDE environment consists of about 20 packages on Arch. Which ones did you
> downgrade? Just plasma-wayland-session?
> Maybe by selectively downgrading each package at a time we could narrow down
> the problem to a specific KDE component. Furthermore: Does this only happen
> on Wayland or on X11 too?

In that particular reason I've downgraded whole plasma desktop environment to 5.26.4 ain't updating I'm sure it's kwin issue
Comment 10 Edgars 2023-01-17 02:51:05 UTC
(In reply to Hexagon from comment #8)
> Edgars, what did you do exactly to downgrade to KDE 5.26.4? I have not tried
> to downgrade as I don't know which components have to be downgraded, as the
> KDE environment consists of about 20 packages on Arch. Which ones did you
> downgrade? Just plasma-wayland-session?
> Maybe by selectively downgrading each package at a time we could narrow down
> the problem to a specific KDE component. Furthermore: Does this only happen
> on Wayland or on X11 too?

Also I've added in hold list so it won't be updated
Comment 11 Edgars 2023-01-17 02:53:49 UTC
Also noticed it happens on xorg too
Comment 12 Nate Graham 2023-01-17 16:45:56 UTC
(In reply to Edgars from comment #7)
> (In reply to Nate Graham from comment #6)
> > Ah, both of you are using AMD GPUs. In that case I know what this is: a
> > recent graphics driver regression. See
> > https://gitlab.freedesktop.org/mesa/mesa/-/issues/7624. It's already been
> > fixed and just needs to make it into a release.
> 
> Looks like its not the issue. after updating mesa issue still persists.
Can you verify that the version you upgraded to has the fix in it?
Comment 13 Edgars 2023-01-18 02:30:41 UTC
(In reply to Nate Graham from comment #12)
> (In reply to Edgars from comment #7)
> > (In reply to Nate Graham from comment #6)
> > > Ah, both of you are using AMD GPUs. In that case I know what this is: a
> > > recent graphics driver regression. See
> > > https://gitlab.freedesktop.org/mesa/mesa/-/issues/7624. It's already been
> > > fixed and just needs to make it into a release.
> > 
> > Looks like its not the issue. after updating mesa issue still persists.
> Can you verify that the version you upgraded to has the fix in it?

https://docs.mesa3d.org/relnotes/22.3.3.html

Bug fixes:
plasmashell sometimes hangs with mesa_glthread

Xaver Hugl (1):
driconf: add a workaround for plasmashell freezing


Mesa version latest is present, also tried reinstalling whole linux distro from beggin. Still issue persists.

server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
    Max core profile version: 4.6
    Max compat profile version: 4.6
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
OpenGL core profile version string: 4.6 (Core Profile) Mesa 22.3.3
OpenGL core profile shading language version string: 4.60
OpenGL version string: 4.6 (Compatibility Profile) Mesa 22.3.3
OpenGL shading language version string: 4.60
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 22.3.3
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
Comment 14 Bug Janitor Service 2023-02-02 05:01:44 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 15 Hexagon 2023-02-02 05:29:20 UTC
Hi. The problem is still present with the newest Plasma version and I think it is pretty severe and should have greater attention as it has breaking effects for a lot of use cases on the whole desktop. The recurring stutter is unacceptable for any form of media consumption, creation and even video calls, etc. What information is needed to start fixing this problem? I am more than happy to provide any information needed to get my stutter free desktop experience back. Thanks :)
Comment 16 Edgars 2023-02-08 08:25:26 UTC
Same and still. Some details are up to read just hard ro produce bug.
Comment 17 Austin 2023-02-10 23:51:24 UTC
I am having the same issue on my system. Like the others, it occurs randomly and infrequently. Over the course of an 8 hour workday, it might happen less than 10 times. Each "stutter" lasts maybe a second. It affects the sound, mouse movement, video playback, everything. I am usually watching Twitch streams in Firefox when using the computer.

Operating System: Arch Linux
KDE Plasma Version: 5.26.5
KDE Frameworks Version: 5.102.0
Qt Version: 5.15.8
Kernel Version: 6.1.9-arch1-2 (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 3600 6-Core Processor
Memory: 31.3 GiB of RAM
Graphics Processor: AMD Radeon RX 6600 XT

I am using a cheap USB sound device to plug in my headphones (my front panel audio is broken) which I suspected may be part of the problem, but I have not been able to test that theory (I don't have another one handy to swap out). After seeing others here with the same issue, I suspect the sound device is probably not be the issue. I also have not tried X11 to compare (Wayland is generally really nice and smooth without tearing), but I may have to give that a shot for debugging purposes.
Comment 18 Tom Englund 2023-02-11 18:46:11 UTC
if i didnt miss something but seems you all are on ryzens. i would check if your fTPM/TPM is enabled in bios. unsure when exactly this landed https://github.com/torvalds/linux/commit/b006c439d58db625318bf2207feabf847510a8a6 but it introduces the https://www.amd.com/en/support/kb/faq/pa-410 which windows 11 users hit when it began requiring people to enable TPM. i myself hit it aswell. affects pretty much entire ryzen lineup. some vendors have bios updates to mitigate this. most dont. they are working on some workaround for this tho https://bugzilla.kernel.org/show_bug.cgi?id=216989 , i myself dont use the tpm for anything and simply disabled it in bios.
Comment 19 Austin 2023-02-13 22:24:48 UTC
(In reply to Tom Englund from comment #18)
> if i didnt miss something but seems you all are on ryzens. i would check if
> your fTPM/TPM is enabled in bios. unsure when exactly this landed
> https://github.com/torvalds/linux/commit/
> b006c439d58db625318bf2207feabf847510a8a6 but it introduces the
> https://www.amd.com/en/support/kb/faq/pa-410 which windows 11 users hit when
> it began requiring people to enable TPM. i myself hit it aswell. affects
> pretty much entire ryzen lineup. some vendors have bios updates to mitigate
> this. most dont. they are working on some workaround for this tho
> https://bugzilla.kernel.org/show_bug.cgi?id=216989 , i myself dont use the
> tpm for anything and simply disabled it in bios.

Wow, I would have never thought to try that. Turned off TPM this morning, and so far it's been fine all day. I'm not using Windows 11 or anything else that uses the TPM so no harm done disabling it. So sounds like that may be the culprit.
Comment 20 Hexagon 2023-02-14 13:42:46 UTC
(In reply to Tom Englund from comment #18)
> if i didnt miss something but seems you all are on ryzens. i would check if
> your fTPM/TPM is enabled in bios. unsure when exactly this landed
> https://github.com/torvalds/linux/commit/
> b006c439d58db625318bf2207feabf847510a8a6 but it introduces the
> https://www.amd.com/en/support/kb/faq/pa-410 which windows 11 users hit when
> it began requiring people to enable TPM. i myself hit it aswell. affects
> pretty much entire ryzen lineup. some vendors have bios updates to mitigate
> this. most dont. they are working on some workaround for this tho
> https://bugzilla.kernel.org/show_bug.cgi?id=216989 , i myself dont use the
> tpm for anything and simply disabled it in bios.

Thanks Tom for the information. I checked my mainboard's (MSI MPG-B550-GAMING-PLUS) website and there was an UEFI update that I executed. I disabled the fTPM functionality of my mainboard as well. I will tell, if it does occur again. Maybe it is really just the known "fTPM stutter problem" that AMD processors face and has nothing to do with KDE and was introduced with the Linux kernel 6.1. Thanks for the tip :)
Comment 21 Nate Graham 2023-02-14 17:43:51 UTC
Wow, TIL.
Comment 22 Hexagon 2023-02-19 11:00:30 UTC
After four days of testing and looking for the stutter I can confirm, that it has not occurred on my machine again. Either the UEFI update or disabling the fTPM functionality of my mainboard has indeed solved the issue.
Comment 23 Nate Graham 2023-02-21 18:50:23 UTC
Amazing!