Random Freezes and character repeating

My system is freezing randomly for 2-3 seconds and during that time sound and mouse stops working. And sometimes when i try to type The first character duplicate it self for example

if i want to type “Apple” the system sometimes types “Aapple”. I have gone through every post on this forum but its not fixing my problem.

System spec :
i7 9th gen
gtx 1650 gpu @ video–hybrid-nvidia-455-prime
Manjaro linux using gnome and running 5.8.x kernel.

I have reinstalled gpu drivers according to one post but its not helping me

I have the same issue sometimes. In /var/log/Xorg.0.log i get then messages like that:

[ 14839.587] (EE) event14 - Logitech USB Receiver: client bug: event processing lagging behind by 33ms, your system is too slow

Didn’t solve it, but disabling mitigation at the kernel reduces it much.

https://wiki.archlinux.org/index.php/Improving_performance#Turn_off_CPU_exploit_mitigations

What could also be possible is that you are running out of ram and the system is swapping. Sometimes it only takes seconds, sometimes minutes of delay.

free -h

https://wiki.archlinux.org/index.php/swap#Swappiness

~ >>> free -h
total used free shared buff/cache available
Mem: 15Gi 1.7Gi 12Gi 99Mi 1.3Gi 13Gi
Swap: 8.6Gi 0B 8.6Gi
~ >>>

XD bro i got 16 gigs. its more than enough

How should one know if one don’t tell? xD

Well check your /etc/tlp.conf for power saving defaults.

Since you use prime, you will run intel as main gpu. Therefore desktop animations are running on this gpu. I would try to disable them in “gnome tweaks settings” or something like that.

But i believe it has to do with the security mitigation’s of the kernel. If you disable them, you will have a exploit hole, but on the other hand you will have a performance boost up to 50% on intel cpus.

Would be nice if you could provide some logs?

journalclt -b0
for x in $(ls /var/log/Xorg.*.log*); do echo -e "\n---$x---\n\n$(cat $x)"; done

(If no files there try to locate them: locate Xorg.0.log )

Xorg log :

[ 502.262] (II) systemd-logind: got pause for 13:93
[ 502.262] (II) systemd-logind: got pause for 13:83
[ 502.262] (II) systemd-logind: got pause for 13:91
[ 502.262] (II) systemd-logind: got pause for 13:82
[ 502.262] (II) systemd-logind: got pause for 13:92
[ 502.262] (II) systemd-logind: got pause for 13:65
[ 502.262] (II) systemd-logind: got pause for 13:90
[ 502.262] (II) systemd-logind: got pause for 226:0
[ 502.263] (II) systemd-logind: got pause for 13:72
[ 502.263] (II) systemd-logind: got pause for 13:84
[ 502.263] (II) systemd-logind: got pause for 13:66
[ 502.263] (II) systemd-logind: got pause for 13:85
[ 502.263] (II) systemd-logind: got pause for 13:73
[ 502.263] (II) systemd-logind: got pause for 13:71
[ 502.263] (II) systemd-logind: got pause for 13:68
[ 502.263] (II) systemd-logind: got pause for 13:89
[ 502.263] (II) systemd-logind: got pause for 13:67

I have exactly the same issue. Not responsive mouse or keyboard for a second and in case of the keyboard it types the first character two times (by writing this post I noticed it can also happen with Ctrl+V).

I though it had something to do with a power saving mode, that’s why I disabled the USB autosuspend in /etc/default/grub by adding this grub option usbcore.autosuspend=-1. It doesn’t seem to work.

As @megavolt pointed, I have a similar output every time the system freezes on my /var/log/Xorg.0.log. I watch the logs in real time by using tail -f /var/log/Xorg.0.log. Whenever the system freezes the following lines appear:

[    69.881] (II) event6  - MSFT0001:01 04F3:309E Touchpad: SYN_DROPPED event - some input events have been lost. 
[    69.882] (EE) client bug: timer event6 tap: scheduled expiry is in the past (-152ms), your system is too slow

Do you guys have any update? I tried different kernels but the issue persists, right now I am running 5.10

Here you have my inxi -Fazy:

perl: warning: Setting locale failed. 
perl: warning: Please check that your locale settings: 
        LANGUAGE = "", 
        LC_ALL = (unset), 
        LC_ADDRESS = "en_GB.UTF-8", 
        LC_IDENTIFICATION = "en_GB.UTF-8", 
        LC_MEASUREMENT = "en_GB.UTF-8", 
        LC_MONETARY = "en_GB.UTF-8", 
        LC_NAME = "en_GB.UTF-8", 
        LC_NUMERIC = "en_GB.UTF-8", 
        LC_PAPER = "en_GB.UTF-8", 
        LC_TELEPHONE = "en_GB.UTF-8", 
        LC_TIME = "en_DK.UTF-8", 
        LANG = "en_GB.UTF-8" 
    are supported and installed on your system. 
perl: warning: Falling back to a fallback locale ("en_GB.UTF-8"). 
System: 
  Kernel: 5.10.15-1-MANJARO x86_64 bits: 64 compiler: gcc v: 10.2.1  
  parameters: BOOT_IMAGE=/boot/vmlinuz-5.10-x86_64  
  root=UUID=d7fb37a0-afce-4f0a-b91d-4414fc357e41 ro quiet apparmor=1  
  security=apparmor udev.log_priority=3 intel_pstate=active  
  usbcore.autosuspend=-1  
  Desktop: KDE Plasma 5.20.5 tk: Qt 5.15.2 wm: kwin_x11 dm: SDDM  
  Distro: Manjaro Linux  
Machine: 
  Type: Laptop System: LENOVO product: 81SX v: Legion Y540-15IRH  
  serial: <filter> Chassis: type: 10 v: Legion Y540-15IRH serial: <filter>  
  Mobo: LENOVO model: LNVNB161216 v: SDK0R32862 WIN serial: <filter>  
  UEFI: LENOVO v: BHCN29WW date: 06/19/2019  
Battery: 
  ID-1: BAT0 charge: 47.1 Wh condition: 48.5/57.0 Wh (85%) volts: 13.0/11.5  
  model: SMP L17M3PG2 type: Li-poly serial: <filter> status: Charging  
  cycles: 398  
CPU: 
  Info: 6-Core model: Intel Core i7-9750H bits: 64 type: MT MCP  
  arch: Kaby Lake note: check family: 6 model-id: 9E (158) stepping: A (10)  
  microcode: DE L2 cache: 12 MiB  
  flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx  
  bogomips: 62431  
  Speed: 800 MHz min/max: 800/4500 MHz Core speeds (MHz): 1: 800 2: 800 3: 800  
  4: 800 5: 801 6: 800 7: 800 8: 800 9: 800 10: 800 11: 800 12: 800  
  Vulnerabilities: Type: itlb_multihit status: KVM: VMX disabled  
  Type: l1tf  
  mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable  
  Type: mds mitigation: Clear CPU buffers; SMT vulnerable  
  Type: meltdown mitigation: PTI  
  Type: spec_store_bypass  
  mitigation: Speculative Store Bypass disabled via prctl and seccomp  
  Type: spectre_v1  
  mitigation: usercopy/swapgs barriers and __user pointer sanitization  
  Type: spectre_v2 mitigation: Full generic retpoline, IBPB: conditional,  
  IBRS_FW, STIBP: conditional, RSB filling  
  Type: srbds mitigation: Microcode  
  Type: tsx_async_abort status: Not affected  
Graphics: 
  Device-1: Intel UHD Graphics 630 vendor: Lenovo driver: i915 v: kernel  
  bus ID: 00:02.0 chip ID: 8086:3e9b class ID: 0300  
  Device-2: NVIDIA TU106M [GeForce RTX 2060 Mobile] vendor: Lenovo  
  driver: nvidia v: 460.39 alternate: nouveau,nvidia_drm bus ID: 01:00.0  
  chip ID: 10de:1f11 class ID: 0300  
  Device-3: Lite-On Integrated Camera type: USB driver: uvcvideo bus ID: 1-6:2  
  chip ID: 04ca:7070 class ID: 0e02  
  Display: x11 server: X.Org 1.20.10 compositor: kwin_x11 driver:  
  loaded: modesetting,nvidia display ID: :0 screens: 1  
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.0x11.2")  
  s-diag: 582mm (22.9")  
  Monitor-1: eDP-1-1 res: 1920x1080 dpi: 142 size: 344x193mm (13.5x7.6")  
  diag: 394mm (15.5")  
  OpenGL: renderer: GeForce RTX 2060/PCIe/SSE2 v: 4.6.0 NVIDIA 460.39  
  direct render: Yes  
Audio: 
  Device-1: Intel Cannon Lake PCH cAVS vendor: Lenovo driver: snd_hda_intel  
  v: kernel alternate: snd_soc_skl,snd_sof_pci bus ID: 00:1f.3  
  chip ID: 8086:a348 class ID: 0403  
  Sound Server: ALSA v: k5.10.15-1-MANJARO  
Network: 
  Device-1: Intel Wireless-AC 9560 [Jefferson Peak] driver: iwlwifi v: kernel  
  port: 5000 bus ID: 00:14.3 chip ID: 8086:a370 class ID: 0280  
  IF: wlp0s20f3 state: dormant mac: <filter>  
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet  
  vendor: Lenovo driver: r8169 v: kernel port: 3000 bus ID: 07:00.0  
  chip ID: 10ec:8168 class ID: 0200  
  IF: enp7s0 state: down mac: <filter>  
  IF-ID-1: br-704d80f9ebd8 state: down mac: <filter>  
  IF-ID-2: docker0 state: down mac: <filter>  
Bluetooth: 
  Device-1: Intel Bluetooth 9460/9560 Jefferson Peak (JfP) type: USB  
  driver: btusb v: 0.8 bus ID: 1-14:4 chip ID: 8087:0aaa class ID: e001  
  Message: Required tool hciconfig not installed. Check --recommends  
Drives: 
  Local Storage: total: 924.07 GiB used: 54.41 GiB (5.9%)  
  SMART Message: Unable to run smartctl. Root privileges required.  
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Micron model: MTFDHBA512TCK  
  size: 476.94 GiB block size: physical: 512 B logical: 512 B speed: 31.6 Gb/s  
  lanes: 4 rotation: SSD serial: <filter> rev: 002 P1LN temp: 46.9 C  
  scheme: GPT  
  ID-2: /dev/sda maj-min: 8:0 vendor: Crucial model: CT480BX500SSD1  
  size: 447.13 GiB block size: physical: 512 B logical: 512 B speed: 6.0 Gb/s  
  rotation: SSD serial: <filter> rev: R022 scheme: GPT  
Partition: 
  ID-1: / raw size: 267.88 GiB size: 262.68 GiB (98.06%)  
  used: 54.38 GiB (20.7%) fs: ext4 dev: /dev/nvme0n1p5 maj-min: 259:5  
  ID-2: /boot/efi raw size: 260 MiB size: 256 MiB (98.46%)  
  used: 35.3 MiB (13.8%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1  
Swap: 
  Alert: No Swap data was found.  
Sensors: 
  System Temperatures: cpu: 63.0 C mobo: N/A gpu: nvidia temp: 54 C  
  Fan Speeds (RPM): N/A  
Info: 
  Processes: 299 Uptime: N/A wakeups: 1 Memory: 15.52 GiB used: 1.1 GiB (7.1%)  
  Init: systemd v: 247 Compilers: gcc: 10.2.0 alt: 9 Packages: 1391  
  pacman: 1382 lib: 408 flatpak: 0 snap: 9 Shell: Zsh v: 5.8  
  running in: yakuake inxi: 3.3.01 

I noticed that by using integrated graphics instead of the Nvidia ones the issue doesn’t appear (I switch from one to another with optimus manager). So maybe the issue is related with Nvidia drivers?