Bug 498280 - Compositor latency causes input lag
Summary: Compositor latency causes input lag
Status: REOPENED
Alias: None
Product: kwin
Classification: Plasma
Component: input (show other bugs)
Version: 6.2.3
Platform: Other Other
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-05 14:23 UTC by jackyzy823
Modified: 2025-01-13 17:19 UTC (History)
2 users (show)

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


Attachments
redacted-journal-log.txt (343.48 KB, text/plain)
2025-01-05 14:23 UTC, jackyzy823
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jackyzy823 2025-01-05 14:23:59 UTC
Created attachment 177126 [details]
redacted-journal-log.txt

SUMMARY
I'm not sure what happened. But suddenly the mouse / touchpad 's move speed is far slower than normal. The keyboard's input speed is slow too.
However the audio output is at normal speed.  The CPU/Memory usage is normal in the System Monitor.

I tried to unplug and plug the receiver of the mouse. it doesn't help
I tried `kwin_wayland --replace` and it doesn't help.
I tried `systemctl restart sddm` and then re-login . it doesn't help.

Only reboot solves the problem.

This is the second time i encountered this issue.

OBSERVED RESULT
Random laggy

EXPECTED RESULT
No random laggy

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:  Fedora 40
KDE Plasma Version: 6.2.3
KDE Frameworks Version: 6.8.0
Qt Version: 6.7.2

ADDITIONAL INFORMATION

The log around the time when laggy happens , shows 
```
Jan 05 21:21:53 MACHINE_NAME kwin_wayland[1932]: kwin_libinput: Libinput: event14 - PNP0C50:00 0911:5288 Touchpad: kernel bug: Touch jump detected and discarded.
                                           See https://wayland.freedesktop.org/libinput/doc/1.26.2/touchpad-jumping-cursors.html for details

Jan 05 21:23:52 MACHINE_NAME kwin_wayland[1932]: kwin_libinput: Libinput: client bug: timer event14 keyboard: scheduled expiry is in the past (-70ms), your system is too slow
Jan 05 21:24:07 MACHINE_NAME kwin_wayland_wrapper[2032]: Key repeat discarded, Wayland compositor doesn't seem to be processing events fast enough!
```

I guess this might be related to libinput.
Comment 1 Nate Graham 2025-01-06 19:15:27 UTC
You're right, it is a Libinput issue. Generally when this happens, it's because Libinput enabled pointer hysteresis because it detected that the hardware wasn't providing great enough precision, which can also sometimes happen if the system is under load.

IMO this is a terrible mis-feature and 100% of the time when it's triggered for me across four laptops, it's made the situation worse than it would have been without it.

You can open a bug report about this at https://gitlab.freedesktop.org/libinput/libinput/-/issues
Comment 2 jackyzy823 2025-01-12 09:43:38 UTC
Update: I opened a ticket on https://gitlab.freedesktop.org/libinput/libinput/-/issues/1074 when i encounter the problem the third time.

and they said it is "not our bug" .

> so the delay here is caused by the compositor, presumably because it's busy rendering things.


I don't know what to do know.  :(