Bug 450312 - real time audio issues with KWayland
Summary: real time audio issues with KWayland
Status: RESOLVED NOT A BUG
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: 5.24.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-15 15:25 UTC by benjamin
Modified: 2022-03-02 15:31 UTC (History)
5 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description benjamin 2022-02-15 15:25:00 UTC
SUMMARY
When doing some music production, I noticed that my system can't meet the real time deadlines (lots of xruns) when I use KWayland. If I start my session with X11 then everything works as expected.

STEPS TO REPRODUCE
1. On the login screen (here SSDM), select the Wayland session over the X11 one
2. Start jack2 using Cadence
3. Open a project in Ardour
4. See in Cadence how the xruns keep coming
 
OBSERVED RESULT
Lots of xruns, i.e unusable audio software

EXPECTED RESULT
Not more xruns than with an X11 sessions

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Archlinux, Linux 5.16.9 
KDE Plasma Version: 5.24.0
KDE Frameworks Version: 5.91.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
CPU: AMD Ryzen 9 5900HX
GPU: GeForce RTX 3080 Mobile (prime)
Comment 1 David Edmundson 2022-03-02 14:25:15 UTC
Generic performance improvements are always on going. There isn't enough in this report to identify a specific bug.
Comment 2 benjamin 2022-03-02 15:31:25 UTC
(In reply to David Edmundson from comment #1)
> Generic performance improvements are always on going. There isn't enough in
> this report to identify a specific bug.

Tell me if I can provide any meaningful information to help with this issue.

I might be wrong, but I'm not sure this falls under the "general performance improvements" umbrella as real time issues are quite specific.

Since the audio thread have real time capabilities (SCHED_FIFO + high priority), missing a deadline means that something happens which prevent the scheduler to resume this thread on time. Such typical things are kernel calls or higher priority threads running.

So it's not really that KWin is too slow in general, it's more that it's doing something special that prevent high priority real time threads from running. But I know close to nothing about KWin, Wayland and graphics in general so I can't really guess what this blocking thing might be.