Kwin OpenGL Stutter

kde

#1

Hi. I’m experiencing stutter issues when using Plasma 5 with composition on AMDGPU (RX 570) with FullHD 60p display. This stuttering is very apparent with 1080p60 videos as this or while autoscrolliing in Firefox. As per this issue kwin is skipping frames with default frame rates settings. Manually setting RefreshRate=61 and MaxFPS=61 in ~/.config/kwinrc solves this stuttering problem, but introduces input latencies for dragging windows.
Xrender works fine but with tearing. Setting Option “tearfree” "true solves tearing but now moving cursor or windows on 1080p60 content causes stutter too.

Is there any way to sync both display and compositor`s OpenGL backend to using 60 fps?


#2

Hej;

I dont know if it can help you but so is how i have my settings in plasma with a similar set look pic:

System:    Host: jorge-pc Kernel: 4.20.3-1-MANJARO x86_64 bits: 64 compiler: gcc v: 8.2.1 Desktop: KDE Plasma 5.14.5 
           tk: Qt 5.12.0 wm: kwin_x11 dm: SDDM Distro: Manjaro Linux 
Machine:   Type: Desktop Mobo: MSI model: 970 GAMING (MS-7693) v: 4.0 serial: <filter> UEFI: American Megatrends v: 22.4 
           date: 12/21/2015 
CPU:       Topology: 8-Core model: AMD FX-8350 bits: 64 type: MCP arch: Bulldozer L2 cache: 2048 KiB 
           flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 64031 
           Speed: 1397 MHz min/max: 1400/4000 MHz Core speeds (MHz): 1: 1397 2: 1399 3: 1454 4: 1531 5: 1791 6: 1646 7: 1963 
           8: 2035 
Graphics:  Device-1: Advanced Micro Devices [AMD/ATI] Ellesmere [Radeon RX 470/480/570/570X/580/580X] 
           vendor: PC Partner Limited driver: amdgpu v: kernel bus ID: 01:00.0 chip ID: 1002:67df 
           Display: x11 server: X.Org 1.20.3 driver: amdgpu,ati unloaded: modesetting,radeon alternate: fbdev,vesa 
           compositor: kwin_x11 resolution: 1680x1050~60Hz 
           OpenGL: renderer: AMD Radeon RX 470 Graphics (POLARIS10 DRM 3.27.0 4.20.3-1-MANJARO LLVM 7.0.1) v: 4.5 Mesa 18.3.2 
           direct render: Yes 

Edit: you can in the other hand try it


#3

Is a video from my first post 100% stutter free on your system with these default settings? For me, the only way to prevent stutter is to explicitly set RefreshRate=61 and MaxFPS=61 or higher which causes delay in dragging windows.

Doesn`t eliminate stutter with OpenGL but works with xrender. Sadly, all kinds of hiccups still occur when moving cursor on top of 1080p60 playback.


#4

Tried everything using my NVIDIA 1080Ti as well. I ended up either:

  1. Have tearing everywhere, but scrolling was quite ok. 4K60p video still stuttered.
  2. No tearing but lots of lag.

I would honestly recommend using performance patched mutter in KDE and everything will fly - it’s insane. I can even watch 4K60p video in Chrome while compiling a package without any stutter.

Take a look here:
https://aur.archlinux.org/packages/mutter-781835-workaround/
Just install by (having Pamac installed) with

pamac build mutter-781835-workaround
mutter --replace

If you encounter any issues either restart or type

kwin --replace

Just make sure to install a GTK3 theme which matches your KDE theme.


#5

…that doesnt seem like a sane suggestion.
We know OP is using KDE … so why are you suggesting a mutter replacement?
KDE does not use mutter.

@Goligoski
Please provide the output from
inxi -Fxxxz


#6

Because the problem is related to either bad or slow (depending on configuration) compositing. Mutter with the patched provided in the pkgbuild doesn’t suffer from these issues anymore.

In case it doesn’t help, uninstalling mutter and kwin --replace or a simple reboot helps.


#7

System:    Host: home Kernel: 4.20.5-1-MANJARO x86_64 bits: 64 compiler: gcc v: 8.2.1 Desktop: KDE Plasma 5.14.5 tk: Qt 5.12.0 
           info: latte-dock wm: kwin_x11 dm: SDDM Distro: Manjaro Linux 
Machine:   Type: Desktop Mobo: ASUSTeK model: CROSSHAIR VI HERO v: Rev 1.xx serial: <filter> 
           UEFI [Legacy]: American Megatrends v: 6401 date: 12/07/2018 
CPU:       Topology: 6-Core model: AMD Ryzen 5 2600 bits: 64 type: MT MCP arch: Zen+ rev: 2 L2 cache: 3072 KiB 
           flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 81470 
           Speed: 1309 MHz min/max: 1550/3400 MHz boost: enabled Core speeds (MHz): 1: 1379 2: 1385 3: 1377 4: 1380 5: 1468 
           6: 1402 7: 1377 8: 1406 9: 1377 10: 1377 11: 1378 12: 1379 
Graphics:  Device-1: Advanced Micro Devices [AMD/ATI] Ellesmere [Radeon RX 470/480/570/570X/580/580X] vendor: Sapphire Limited 
           driver: amdgpu v: kernel bus ID: 0a:00.0 chip ID: 1002:67df 
           Display: x11 server: X.Org 1.20.3 driver: amdgpu compositor: kwin_x11 resolution: 1920x1080~60Hz 
           OpenGL: renderer: Radeon RX 570 Series (POLARIS10 DRM 3.27.0 4.20.5-1-MANJARO LLVM 7.0.1) v: 4.5 Mesa 18.3.2 
           direct render: Yes 
Audio:     Device-1: Advanced Micro Devices [AMD/ATI] Ellesmere [Radeon RX 580] vendor: Sapphire Limited driver: snd_hda_intel 
           v: kernel bus ID: 0a:00.1 chip ID: 1002:aaf0 
           Device-2: Advanced Micro Devices [AMD] Family 17h HD Audio vendor: ASUSTeK driver: snd_hda_intel v: kernel 
           bus ID: 0c:00.3 chip ID: 1022:1457 
           Device-3: C-Media Blue Snowball type: USB driver: hid-generic,snd-usb-audio,usbhid bus ID: 1-5:2 chip ID: 0d8c:0005 
           serial: <filter> 
           Sound Server: ALSA v: k4.20.5-1-MANJARO 
Network:   Device-1: Intel I211 Gigabit Network vendor: ASUSTeK driver: igb v: 5.4.0-k port: e000 bus ID: 04:00.0 
           chip ID: 8086:1539 
           IF: enp4s0 state: up speed: 100 Mbps duplex: full mac: <filter> 
Drives:    Local Storage: total: 577.55 GiB used: 411.38 GiB (71.2%) 
           ID-1: /dev/sda vendor: Samsung model: SSD 750 EVO 120GB size: 111.79 GiB speed: 6.0 Gb/s serial: <filter> rev: 1B6Q 
           scheme: MBR 
           ID-2: /dev/sdb vendor: Crucial model: CT500MX500SSD1 size: 465.76 GiB speed: 6.0 Gb/s serial: <filter> rev: 020 
           scheme: MBR 
Partition: ID-1: / size: 37.95 GiB used: 19.81 GiB (52.2%) fs: ext4 dev: /dev/sda2 
           ID-2: /boot size: 487.9 MiB used: 88.7 MiB (18.2%) fs: ext4 dev: /dev/sda1 
           ID-3: /home size: 62.96 GiB used: 24.73 GiB (39.3%) fs: ext4 dev: /dev/sda4 
           ID-4: swap-1 size: 8.00 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/sda3 
Sensors:   System Temperatures: cpu: 32.0 C mobo: N/A gpu: amdgpu temp: 29 C 
           Fan Speeds (RPM): cpu: 0 gpu: amdgpu fan: 801 
Info:      Processes: 279 Uptime: 14m Memory: 15.65 GiB used: 2.01 GiB (12.8%) Init: systemd v: 240 Compilers: gcc: 8.2.1

#8

Mutter is not installed or running on KDE systems.

If you have mutter for some reason on KDE then thats probably a problem.


#9
dmesg | grep amdgpu
journalctl -p3 -b1

#10
[    0.000000] Command line: BOOT_IMAGE=/vmlinuz-4.20-x86_64 root=UUID=2d9c2438-fe2e-47f4-aff4-77b93da2f358 rw nosplash resume=UUID=d55271d8-baec-498f-9048-4af225fe246a amdgpu.dc=0
[    0.000000] Kernel command line: BOOT_IMAGE=/vmlinuz-4.20-x86_64 root=UUID=2d9c2438-fe2e-47f4-aff4-77b93da2f358 rw nosplash resume=UUID=d55271d8-baec-498f-9048-4af225fe246a amdgpu.dc=0
[    4.396904] [drm] amdgpu kernel modesetting enabled.
[    4.397068] fb0: switching to amdgpudrmfb from VESA VGA
[    4.397554] amdgpu 0000:0a:00.0: No more image in the PCI ROM
[    4.398156] amdgpu 0000:0a:00.0: VRAM: 4096M 0x000000F400000000 - 0x000000F4FFFFFFFF (4096M used)
[    4.398157] amdgpu 0000:0a:00.0: GART: 256M 0x000000FF00000000 - 0x000000FF0FFFFFFF
[    4.398228] [drm] amdgpu: 4096M of VRAM memory ready
[    4.398229] [drm] amdgpu: 4096M of GTT memory ready.
[    4.718118] fbcon: amdgpudrmfb (fb0) is primary device
[    5.002199] amdgpu 0000:0a:00.0: fb0: amdgpudrmfb frame buffer device
[    5.037966] [drm] Initialized amdgpu 3.27.0 20150101 for 0000:0a:00.0 on minor 0

#11

Any reason for that ?
(I kinda doubt its related…)

Also … have you tried disabling any effects?
And are you using any special widgets?


#12

This and this.
I think that stuttering problems are not related to effects or widgets as manually setting higher frame rate solves this issue.


#13

So…its supposed to fix the issue you have but does not?
(silly questions … but you made sure to update grub after the change? and you have checked without it?)


#14

In other case it wouldn`t be in the output of dmesg.


#15

True. But I still want to know if you first implemented it because of this issue and if it has any effect with 0/1/non-existent. [whether positive, negative, or seemingly unrelated]