System Wide Stuttering caused by Opening Programs, Taking Screenshots, etc

Hi there, brand new to Manjaro here! I’ve been experiencing this issue where system wide stutters occur whenever I do really anything, like opening a program, and taking screenshots. The stutters most clearly effect audio, as it crackles in and out during them, but video frames are also dropped.

I originally thought it was exclusive to audio, so I spent a few hours figuring out how to troubleshoot pipewire and even went as far as to install pulse-audio instead, turns out it wasn’t directly related to audio as both audio servers experienced the identical issue.

I don’t know what logs to include for this, Xorg.0.log only contains complaints about my USB devices being weird, nothing about any kind of system slowdown as far as I can tell. I can provide any logs I have.

I just wanna listen to Will Wood without crackling every time I screenshot something

Hello,

This tutorial will help to clarify what information to provide

Thanks for the info there, I’ll admit I didn’t read that before. I checked a few of the logs manually but didn’t find anything particularly useful, so I ran journalctl -f instead and recreated the stutter.

Output of journalctl -f while recreating a stutter via screen capturing using Spectacle.

Aug 06 23:19:03 skyman kstart5[11937]: Omitting both --window and --windowclass arguments is not recommended
Aug 06 23:19:03 skyman dbus-daemon[708]: [session uid=1000 pid=708] Activating via systemd: service name='org.kde.Spectacle' unit='app-org.kde.spectacle.service' requested by ':1.105' (uid=1000 pid=11940 comm="/usr/bin/qdbus org.kde.Spectacle / ActiveWindow -1")
Aug 06 23:19:03 skyman systemd[686]: Starting Spectacle screenshot capture utility...
Aug 06 23:19:03 skyman systemd[686]: Started /usr/bin/qdbus.
Aug 06 23:19:03 skyman kwin_x11[749]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 54705, resource id: 90177545, major code: 18 (ChangeProperty), minor code: 0
Aug 06 23:19:03 skyman dbus-daemon[708]: [session uid=1000 pid=708] Successfully activated service 'org.kde.Spectacle'
Aug 06 23:19:03 skyman systemd[686]: Started Spectacle screenshot capture utility.
Aug 06 23:19:03 skyman plasmashell[833]: Could not find the Plasmoid for Plasma::FrameSvgItem(0x5620602cd520) QQmlContext(0x56205e75f590) QUrl("file:///usr/share/plasma/plasmoids/org.kde.plasma.notifications/contents/ui/global/Globals.qml")
Aug 06 23:19:03 skyman plasmashell[833]: Could not find the Plasmoid for Plasma::FrameSvgItem(0x5620602cd520) QQmlContext(0x56205e75f590) QUrl("file:///usr/share/plasma/plasmoids/org.kde.plasma.notifications/contents/ui/global/Globals.qml")
Aug 06 23:19:03 skyman plasmashell[833]: file:///usr/share/plasma/plasmoids/org.kde.plasma.notifications/contents/ui/NotificationItem.qml:219:21: QML SelectableLabel: Binding loop detected for property "implicitWidth"
Aug 06 23:19:03 skyman plasmashell[833]: file:///usr/share/plasma/plasmoids/org.kde.plasma.notifications/contents/ui/NotificationItem.qml:219:21: QML SelectableLabel: Binding loop detected for property "implicitWidth"
Aug 06 23:19:03 skyman plasmashell[833]: file:///usr/share/plasma/plasmoids/org.kde.plasma.notifications/contents/ui/NotificationItem.qml:219:21: QML SelectableLabel: Binding loop detected for property "implicitHeight"
Aug 06 23:19:03 skyman plasmashell[833]: Could not find the Plasmoid for Plasma::FrameSvgItem(0x56205e334e40) QQmlContext(0x56205e75f590) QUrl("file:///usr/share/plasma/plasmoids/org.kde.plasma.notifications/contents/ui/global/Globals.qml")
Aug 06 23:19:03 skyman plasmashell[833]: Could not find the Plasmoid for Plasma::FrameSvgItem(0x56205e334e40) QQmlContext(0x56205e75f590) QUrl("file:///usr/share/plasma/plasmoids/org.kde.plasma.notifications/contents/ui/global/Globals.qml")
Aug 06 23:19:03 skyman plasmashell[833]: file:///usr/share/plasma/plasmoids/org.kde.plasma.notifications/contents/ui/NotificationItem.qml:219:21: QML SelectableLabel: Binding loop detected for property "implicitWidth"
Aug 06 23:19:03 skyman plasmashell[833]: file:///usr/share/plasma/plasmoids/org.kde.plasma.notifications/contents/ui/NotificationItem.qml:219:21: QML SelectableLabel: Binding loop detected for property "implicitWidth"
Aug 06 23:19:03 skyman plasmashell[833]: file:///usr/share/plasma/plasmoids/org.kde.plasma.notifications/contents/ui/NotificationItem.qml:219:21: QML SelectableLabel: Binding loop detected for property "implicitHeight"
Aug 06 23:19:04 skyman kwin_x11[749]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 55806, resource id: 98566150, major code: 18 (ChangeProperty), minor code: 0

I personally can’t decipher this too well, but googling the unique warnings didn’t net me much any info. I’ve referred to the tutorial you’ve posted and can’t find any other relevant logs that would be excluded from journalctl.

Output of inxi -v7azy to gather my system information.

System:
  Kernel: 5.15.57-2-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 12.1.0
    parameters: BOOT_IMAGE=/boot/vmlinuz-5.15-x86_64
    root=UUID=1858e904-23a8-4810-ae8f-bce85d42efdb rw quiet
    resume=UUID=9e4f9e44-e840-4724-bb5c-889640d7b35d udev.log_priority=3
  Desktop: KDE Plasma v: 5.24.6 tk: Qt v: 5.15.5 wm: kwin_x11 vt: 1 dm: SDDM
    Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Desktop Mobo: ASRock model: AB350 Pro4 serial: <superuser required>
    UEFI: American Megatrends v: P6.40 date: 08/31/2020
Battery:
  ID-1: hidpp_battery_0 charge: 55% condition: N/A volts: 3.8 min: N/A
    model: Logitech G502 LIGHTSPEED Wireless Gaming Mouse type: N/A
    serial: <filter> status: discharging
Memory:
  RAM: total: 31.28 GiB used: 5.42 GiB (17.3%)
  RAM Report: permissions: Unable to run dmidecode. Root privileges
    required.
CPU:
  Info: model: AMD Ryzen 7 3800X bits: 64 type: MT MCP arch: Zen 2 gen: 3
    built: 2020-22 process: TSMC n7 (7nm) family: 0x17 (23) model-id: 0x71 (113)
    stepping: 0 microcode: 0x8701021
  Topology: cpus: 1x cores: 8 tpc: 2 threads: 16 smt: enabled cache:
    L1: 512 KiB desc: d-8x32 KiB; i-8x32 KiB L2: 4 MiB desc: 8x512 KiB
    L3: 32 MiB desc: 2x16 MiB
  Speed (MHz): avg: 2995 high: 4372 min/max: 2200/4559 boost: enabled
    scaling: driver: acpi-cpufreq governor: schedutil cores: 1: 2695 2: 2157
    3: 4358 4: 2172 5: 2175 6: 3897 7: 4359 8: 2166 9: 3321 10: 2145 11: 3927
    12: 2177 13: 2178 14: 3647 15: 4372 16: 2179 bogomips: 124619
  Flags: 3dnowprefetch abm adx aes aperfmperf apic arat avic avx avx2 bmi1
    bmi2 bpext cat_l3 cdp_l3 clflush clflushopt clwb clzero cmov cmp_legacy
    constant_tsc cpb cpuid cqm cqm_llc cqm_mbm_local cqm_mbm_total
    cqm_occup_llc cr8_legacy cx16 cx8 de decodeassists extapic extd_apicid
    f16c flushbyasid fma fpu fsgsbase fxsr fxsr_opt ht hw_pstate ibpb ibs
    irperf lahf_lm lbrv lm mba mca mce misalignsse mmx mmxext monitor movbe
    msr mtrr mwaitx nonstop_tsc nopl npt nrip_save nx osvw overflow_recov pae
    pat pausefilter pclmulqdq pdpe1gb perfctr_core perfctr_llc perfctr_nb
    pfthreshold pge pni popcnt pse pse36 rapl rdpid rdpru rdrand rdseed rdt_a
    rdtscp rep_good sep sev sev_es sha_ni skinit smap smca sme smep ssbd sse
    sse2 sse4_1 sse4_2 sse4a ssse3 stibp succor svm svm_lock syscall tce
    topoext tsc tsc_scale umip v_spec_ctrl v_vmsave_vmload vgif vmcb_clean vme
    vmmcall wbnoinvd wdt xgetbv1 xsave xsavec xsaveerptr xsaveopt xsaves
  Vulnerabilities:
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data status: Not affected
  Type: retbleed mitigation: untrained return thunk; SMT enabled with STIBP
    protection
  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: Retpolines, IBPB: conditional, STIBP:
    always-on, RSB filling
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: NVIDIA TU106 [GeForce RTX 2070 Rev. A] vendor: ZOTAC
    driver: nvidia v: 515.57 alternate: nouveau,nvidia_drm non-free: 515.xx+
    status: current (as of 2022-07) arch: Turing code: TUxxx
    process: TSMC 12nm built: 2018-22 pcie: gen: 3 speed: 8 GT/s lanes: 16
    bus-ID: 0a:00.0 chip-ID: 10de:1f07 class-ID: 0300
  Display: x11 server: X.Org v: 21.1.4 compositor: kwin_x11 driver: X:
    loaded: nvidia gpu: nvidia display-ID: :0 screens: 1
  Screen-1: 0 s-res: 3520x1080 s-dpi: 94 s-size: 951x289mm (37.44x11.38")
    s-diag: 994mm (39.13")
  Monitor-1: DP-4 pos: primary,left res: 1920x1080 dpi: 93
    size: 527x296mm (20.75x11.65") diag: 604mm (23.8") modes: N/A
  Monitor-2: HDMI-0 pos: right res: 1600x900 hz: 60 dpi: 94
    size: 432x239mm (17.01x9.41") diag: 494mm (19.44") modes: N/A
  OpenGL: renderer: NVIDIA GeForce RTX 2070/PCIe/SSE2 v: 4.6.0 NVIDIA 515.57
    direct render: Yes
Audio:
  Device-1: NVIDIA TU106 High Definition Audio vendor: ZOTAC
    driver: snd_hda_intel bus-ID: 5-3:2 v: kernel chip-ID: 0d8c:0005 pcie:
    class-ID: 0300 gen: 3 speed: 8 GT/s serial: <filter> lanes: 16
    bus-ID: 0a:00.1 chip-ID: 10de:10f9 class-ID: 0403
  Device-2: AMD Starship/Matisse HD Audio vendor: ASRock
    driver: snd_hda_intel v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 16
    bus-ID: 0c:00.4 chip-ID: 1022:1487 class-ID: 0403
  Device-3: C-Media Blue Snowball type: USB
    driver: hid-generic,snd-usb-audio,usbhid
  Sound Server-1: ALSA v: k5.15.57-2-MANJARO running: yes
  Sound Server-2: PulseAudio v: 16.1 running: no
  Sound Server-3: PipeWire v: 0.3.56 running: yes
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: ASRock driver: r8169 v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 1
    port: d000 bus-ID: 09:00.0 chip-ID: 10ec:8168 class-ID: 0200
  IF: enp9s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
  IP v4: <filter> type: dynamic noprefixroute scope: global
    broadcast: <filter>
  IP v6: <filter> type: noprefixroute scope: link
  WAN IP: <filter>
Bluetooth:
  Message: No bluetooth data found.
Logical:
  Message: No logical block device data found.
RAID:
  Message: No RAID data found.
Drives:
  Local Storage: total: 2.27 TiB used: 1.09 TiB (48.0%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Western Digital
    model: WDS500G3XHC-00SJG0 size: 465.76 GiB block-size: physical: 512 B
    logical: 512 B speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter>
    rev: 102000WD temp: 34.9 C scheme: GPT
  ID-2: /dev/sda maj-min: 8:0 vendor: Samsung model: SSD 860 EVO 1TB
    size: 931.51 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
    type: SSD serial: <filter> rev: 4B6Q scheme: GPT
  ID-3: /dev/sdb maj-min: 8:16 vendor: Samsung model: SSD 860 EVO 1TB
    size: 931.51 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
    type: SSD serial: <filter> rev: 3B6Q scheme: MBR
  Message: No optical or floppy data found.
Partition:
  ID-1: / raw-size: 107.64 GiB size: 105.39 GiB (97.91%) used: 28.02 GiB
    (26.6%) fs: ext4 dev: /dev/nvme0n1p6 maj-min: 259:6 label: N/A
    uuid: 1858e904-23a8-4810-ae8f-bce85d42efdb
  ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%) used: 312 KiB
    (0.1%) fs: vfat dev: /dev/nvme0n1p7 maj-min: 259:7 label: NO_LABEL
    uuid: E5E3-5698
  ID-3: /run/media/skylarr/124EE1154EE0F281 raw-size: 349.76 GiB size: 349.76
    GiB (100.00%) used: 212.21 GiB (60.7%) fs: ntfs dev: /dev/nvme0n1p3
    maj-min: 259:3 label: N/A uuid: 124EE1154EE0F281
  ID-4: /run/media/skylarr/Avoopa raw-size: 931.5 GiB size: 931.48 GiB
    (100.00%) used: 878.3 GiB (94.3%) fs: exfat dev: /dev/sda2 maj-min: 8:2
    label: Avoopa uuid: 801F-AC68
  ID-5: /run/media/skylarr/help raw-size: 931.51 GiB size: 931.51 GiB
    (100.00%) used: 93.6 MiB (0.0%) fs: ntfs dev: /dev/sdb1 maj-min: 8:17
    label: help uuid: 2775CAD76FBA6AC9
Swap:
  Kernel: swappiness: 60 (default) cache-pressure: 100 (default)
  ID-1: swap-1 type: partition size: 7.45 GiB used: 0 KiB (0.0%)
    priority: -2 dev: /dev/nvme0n1p5 maj-min: 259:5 label: N/A
    uuid: 9e4f9e44-e840-4724-bb5c-889640d7b35d
Unmounted:
  ID-1: /dev/nvme0n1p1 maj-min: 259:1 size: 100 MiB fs: vfat label: N/A
    uuid: 5CD9-C7D2
  ID-2: /dev/nvme0n1p2 maj-min: 259:2 size: 16 MiB fs: <superuser required>
    label: N/A uuid: N/A
  ID-3: /dev/nvme0n1p4 maj-min: 259:4 size: 508 MiB fs: ntfs label: N/A
    uuid: 58786EDC786EB880
  ID-4: /dev/sda1 maj-min: 8:1 size: 16 MiB fs: <superuser required>
    label: N/A uuid: N/A
USB:
  Hub-1: 1-0:1 info: Hi-speed hub with single TT ports: 10 rev: 2.0
    speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900
  Device-1: 1-7:2 info: Logitech Cordless Mouse Receiver
    type: Keyboard,Mouse,HID driver: logitech-djreceiver,usbhid interfaces: 3
    rev: 2.0 speed: 12 Mb/s power: 98mA chip-ID: 046d:c539 class-ID: 0300
  Device-2: 1-10:3 info: Logitech G512 RGB MECHANICAL GAMING KEYBOARD
    type: Keyboard,HID driver: hid-generic,usbhid interfaces: 2 rev: 2.0
    speed: 12 Mb/s power: 500mA chip-ID: 046d:c33c class-ID: 0300
    serial: <filter>
  Hub-2: 2-0:1 info: Super-speed hub ports: 4 rev: 3.1 speed: 10 Gb/s
    chip-ID: 1d6b:0003 class-ID: 0900
  Hub-3: 3-0:1 info: Hi-speed hub with single TT ports: 2 rev: 2.0
    speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900
  Hub-4: 4-0:1 info: Super-speed hub ports: 4 rev: 3.1 speed: 10 Gb/s
    chip-ID: 1d6b:0003 class-ID: 0900
  Hub-5: 5-0:1 info: Hi-speed hub with single TT ports: 4 rev: 2.0
    speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900
  Device-1: 5-3:2 info: C-Media Blue Snowball type: Audio,HID
    driver: hid-generic,snd-usb-audio,usbhid interfaces: 3 rev: 1.1
    speed: 12 Mb/s power: 100mA chip-ID: 0d8c:0005 class-ID: 0300
    serial: <filter>
  Hub-6: 6-0:1 info: Super-speed hub ports: 4 rev: 3.1 speed: 10 Gb/s
    chip-ID: 1d6b:0003 class-ID: 0900
Sensors:
  System Temperatures: cpu: 54.8 C mobo: N/A gpu: nvidia temp: 48 C
  Fan Speeds (RPM): N/A gpu: nvidia fan: 31%
Info:
  Processes: 344 Uptime: 40m wakeups: 3 Init: systemd v: 251
  default: graphical tool: systemctl Compilers: gcc: 12.1.0 clang: 14.0.6
  Packages: 1298 pacman: 1292 lib: 371 flatpak: 6 Shell: Zsh v: 5.9
  default: Bash v: 5.1.16 running-in: konsole inxi: 3.3.20

I also tried different kernels at the suggestion of a friend, both 5.4 LTS and 5.18 (not rt) had the same issue.

Can i see what you have when running from terminal:
ls /etc/X11/*

and then also share
cat /etc/X11/mhwd.d/nvidia.conf

Output of ls /etc/X11/*

/etc/X11/mhwd.d:
nvidia.conf  nvidia.conf.nvidia-xconfig-original

/etc/X11/xinit:
xinitrc  xinitrc.d  xserverrc

/etc/X11/xorg.conf.d:
00-keyboard.conf  30-touchpad.conf  90-mhwd.conf

Output of cat /etc/X11/mhwd.d/nvidia.conf

# nvidia-xconfig:  version 515.57

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
        Option "NoLogo" "1"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Extensions"
    Option         "COMPOSITE" "Enable"
EndSection

 
Section "InputClass"
    Identifier          "Keyboard Defaults"
    MatchIsKeyboard        "yes"
    Option              "XkbOptions" "terminate:ctrl_alt_bksp"
EndSection```

Would you mind to change the Section "Device" from your nvidia.conf

with this:

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    Option  "ConnectToAcpid"    "Off"
    Option "metamodes" "nvidia-auto-select +0+0 {ForceFullCompositionPipeline=On}"
EndSection

And also make sure the Compositor is set like this in System Settings:

Reboot the system and see if things got improved.

I performed the changes and rebooted, there was no change and the issue is still present. What exactly does this edit do out of curiosity?

There is no need to listen ACPI events on a Desktop PC
https://wiki.archlinux.org/title/NVIDIA/Tips_and_tricks#Listening_to_ACPI_events

Avoids screen tearing
https://wiki.archlinux.org/title/NVIDIA/Troubleshooting#Avoid_screen_tearing

Sometimes is required for KDE plasma to use also

Option         "TripleBuffer"  "On"

Right above the Option "ConnectToAcpid" "Off" - and also creating the kwin.sh as described here

Maybe you also need to enable early KMS

Thanks for the explanations about the previous options.

No luck enabling Early KMS unfortunately, the stuttering is still present. I have noticed that since the changes to nvidia.conf, the audio only crackles from some sources, like a Discord voice call, while streaming music via Firefox doesn’t crackle during the stutters.

Then the only remaining is to see if that kwin.sh thing will help in your case. Other than that, i honestly don’t know what to think of, except:

And that Motherboard has * 2 PCIe 3.0 x16, 4 PCIe 2.0 x1 - so i think your GPU should be connected on the GEN3 one not the GEN2 and also set that from BIOS … I can’t say for sure, looking at this images

Maybe is a BIOS update thing that will add GEN3 in the options

My GPU is connected to the top slot, I’ve never noticed it was set to Gen2 speeds before, strange! I’ll check on that once I have access to the PC again, I’m away for a bit.

I’m actually already on the latest BIOS revision that’s safe for me, I’m running a slightly unsupported setup of having a 3rd gen Ryzen chip on a B350 Chipset, a budget one at that. Perhaps a new motherboard would solve this problem? I need to upgrade anyway since I’m out of SATA ports and don’t feel like dealing with a SATA card.