Keyboard and mouse stuttering

I’m having an issue where every so often (at seemingly random intervals, but I haven’t been able to measure) where the mouse will appear to not respond for a very brief period and will then suddenly catch up with itself. It’s most noticeable when I’m scrolling through a long article as it’ll not scroll immediately and will then suddenly scroll several lines at once.

I’ve noticed the same issue is affecting the keyboard. Sometimes when I press a key it doesn’t appear straight away, and will then catch up after a brief period (fraction of a second) or type multiples of the same character. In the worst instance, when pressing backspace to delete a single character, it’ll stutter and then delete a word or two instead.

For context, I’m using 6.0.11-arch1-1 for the kernel with KDE Plasma (5.26.4). I’m also using nvidia with prime (on X11) which I installed using the nvidia-inst package/script.

Has anyone else experienced this problem? Any idea how to fix it?

1 Like

Wired or wireless mouse and keyboard?

i saw issues with mouse on nouveau drivers with nvidia GPU using KDE plasma.
Could be install of Nvidia proprietary fails on you? show:
inxi -Gaz

Bluetooth mouse, built-in laptop keyboard

Here’s the output of inxi -Gaz

  Device-1: Intel TigerLake-H GT1 [UHD Graphics] vendor: CLEVO/KAPOK
    driver: i915 v: kernel arch: Gen-12.1 process: Intel 10nm built: 2020-21
    ports: active: eDP-1 empty: DP-1, DP-2, DP-3, DP-4 bus-ID: 00:02.0
    chip-ID: 8086:9a60 class-ID: 0300
  Device-2: NVIDIA GA106M [GeForce RTX 3060 Mobile / Max-Q]
    vendor: CLEVO/KAPOK driver: nvidia v: 525.60.11
    alternate: nouveau,nvidia_drm non-free: 520.xx+
    status: current (as of 2022-10) arch: Ampere code: GAxxx
    process: TSMC n7 (7nm) built: 2020-22 pcie: gen: 4 speed: 16 GT/s
    lanes: 16 ports: active: none empty: DP-5,HDMI-A-1 bus-ID: 01:00.0
    chip-ID: 10de:2520 class-ID: 0300
  Device-3: Acer BisonCam NB Pro type: USB driver: uvcvideo bus-ID: 3-8:2
    chip-ID: 5986:9102 class-ID: 0e02
  Display: x11 server: X.Org v: 21.1.4 with: Xwayland v: 22.1.5
    compositor: kwin_x11 driver: X: loaded: modesetting,nvidia dri: iris
    gpu: i915 display-ID: :0 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 75 s-size: 652x366mm (25.67x14.41")
    s-diag: 748mm (29.44")
  Monitor-1: eDP-1 mapped: eDP-1-1 model: LG Display 0x0625 built: 2018
    res: 1920x1080 hz: 144 dpi: 142 gamma: 1.2 size: 344x194mm (13.54x7.64")
    diag: 395mm (15.5") ratio: 16:9 modes: 1920x1080
  API: OpenGL v: 4.6.0 NVIDIA 525.60.11 renderer: NVIDIA GeForce RTX 3060
    Laptop GPU/PCIe/SSE2 direct render: Yes
  API: OpenGL v: 4.6.0 NVIDIA 525.60.11 renderer: NVIDIA GeForce RTX 3060
    Laptop GPU/PCIe/SSE2 direct render: Yes

so no issue with driver it looks like Nvidia is used and running…

I have the same issue with the keyboard and it was supper annoying, I could not type as I was not sure if it is going to register or not. After a while I figured out if I go to Accessibility and toggle ‘sticky keys’ on and off on time it goes away. No idea why and how. I am using Xfce DE btw.

yes, can happen on xfce4 that you accidentally enable this when wrongly keystroking… not sure for kde ?

It’s not turned on for me in KDE, so don’t think it’s that.

journal is not showing any error ? you can run it as life output journalctl -f

No, nothing. I’ve been running it for the last 30 minutes and haven’t had any errors other than one about a “missing plasmoid for plasma”, but I don’t think that’s related to this issue.

If it was only with a bluetooth mouse, I would suspect connectivity issues.
If it was only with a cable keyboard, I would suspect the terminal font is not Monospace.

Since it happens on both the above, I suggest checking for excessive CPU/RAM usage, with some system task manager (htop, etc.).

A little more digging showed that it seemed to coincide with my nvidia card changing its clock speeds because of power management etc. The powermizer preferred mode was originally set to Adaptive, so I tried changing it to Prefer Maximum Performance to see if that would have any effect.

After a few minutes of running with this setting changed, I still hadn’t seen any freezing of the mouse (I moved it around constantly during this period), so decided to make the change permanent by adding:

Option "RegistryDwords" "PowerMizerEnable=0x1; PerfLevelSrc=0x3322; PowerMizerDefaultAC=0x1"

to the xorg.conf file located at /etc/X11/xorg.conf.d/99-nvidia.conf (I believe this was created by the nvidia-inst script), and then rebooted.

This seems to have done the trick, but obviously at the expense of increase power consumption, which is not ideal. The other alternative, and probably the reason I didn’t have this problem on my previous insert other distro’s name installation on the same laptop, is to disable the nvidia card and use only the integrated card. I may still do that as the nvidia card is obviously going to be hotter now and use more power.

1 Like

In a normal Optimus setup, iGPU is the main GPU to handle all applications, except for the power demanding apps, where either automatically, or manually, the tasks are send to dGPU/nvidia for rendering.
In the case of keyboard and mouse, they should normally being driven by your iGPU/Intel.
If this is not happening, then something must be wrong, either a misconfiguration, or a bug. (at least AFAIK).

Why don’t you post your Xorg log, when the issue is happening? (use a paste-bin web service) :person_shrugging:

I used the Optimus Switch method described at, which only seems to allow me to choose Intel (Nvidia powered down) or Nvidia, but not the hybrid mode I’ve seen in other methods (eg. Optimus Manager). I’m actually quite happy using the Nvidia card for all rendering as when I plug my monitors into my laptop it’ll use the Nvidia card anyway as that’s what the display ports are attached to.

1 Like

Normal (for me) is without special utils, only using Prime with prime-run (manually), or nvidia/Xorg auto-pass mechanisms on newer nvidia cards.