Bug 423230 - Compositor only works at 60 FPS on a 144 Hz monitor on X11
Summary: Compositor only works at 60 FPS on a 144 Hz monitor on X11
Status: CONFIRMED
Alias: None
Product: kwin
Classification: Plasma
Component: compositing (show other bugs)
Version: 5.19.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-19 13:30 UTC by Mircea Kitsune
Modified: 2023-03-17 05:45 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mircea Kitsune 2020-06-19 13:30:29 UTC
Since switching to a 144 Hz monitor, I visually noticed that desktop compositing still runs at 60 FPS in the X11 Plasma session (doesn't affect Wayland). Normally it should run at the monitor's active refresh rate.

After some digging on the issue, I found a workaround that fixes this problem for the time being: You need to edit ~/.config/kwinrc and manually add MaxFPS=144 under the [Compositing] section. I can confirm this gets the compositor working at the proper refresh rate and visibly appearing smoother, however that should be detected and happening automatically.
Comment 1 Marcus Seyfarth 2021-05-16 09:40:58 UTC
It seems that no progress has been made on this, I've seen this issue on 5.21.4 on Kubuntu and with KDE-git on Manjaro as of May 9th 2021 on my 144 Hz Freesync-capable HP 25x. Every time I boot up the machine (Vega 56, DRI 3 and Freesync enabled in X11), the refresh rate is about 64 Hz on the desktop (for testing just visit https://webglsamples.org/aquarium/aquarium.html with Chrome) even though I enabled 144 Hz in the compositor settings of systemsettings (I use OpenGL 3.1, tried OpenGL 2.0, the balanced, force low-latency and force smoothest output options). This is a huge quality of life problem, as Youtube drops frames like crazy, especially with FullHD 60 Hz content, resulting in choppy video output. My workaround is to start up a game and quit it again, the refresh rate then changes to 144 Hz as expected. That is basically what I have to do every time I boot up the machine to get the expected refresh rate - please fix it as it is rather annoying. By the way, KwinFT doesn't have this issue.
Comment 2 Marcus Seyfarth 2021-05-16 09:47:52 UTC
By the way, I've just tried the workaround mentioned by Mircea Kitsune, but unfortunately it does not work for me.
Comment 3 Mircea Kitsune 2021-05-16 12:46:56 UTC
(In reply to Marcus Seyfarth from comment #2)

Strange, it doesn't seem to have broken for me: I can tell mouse cursor movement and desktop effects are smoothed accordingly, it's still 144 FPS here (X11). Are you sure the monitor is set above 60 Hz, did you restart after making the change? Plasma 5.21.4 / Framework 5.81.0: If you're using newer versions they might have broken there which is something we'll need to be on the lookout for.
Comment 4 Marcus Seyfarth 2021-05-16 13:06:25 UTC
As I mentioned, 144 Hz is set in systemsettings, I am on 5.21.4 but I have also seen it on KDE-git as of last week on Manjaro. My HP monitor is set to Freesync mode and connected via Display Port, I've created a file for X to enable it (and DRI3) accordingly. Once I do my workaround, I get 144 Hz without touching anything, hence I suspect that Kwin has issues on startup to set the refresh rate correctly.

The rest of my system:
System:    Host: klx99 Kernel: 5.12.4-xanmod1-llvm-2 x86_64 bits: 64 Console: tty 1 Distro: Ubuntu 21.04 (Hirsute Hippo) 
Machine:   Type: Desktop System: LENOVO product: GAMING TF v: N/A serial: A3X99XXXXXXXXXXXX 
           Mobo: Lenovo model: X99-TF Gaming v: G368J V1.1 serial: A3X99XXXXXXXXXXXX UEFI: American Megatrends v: CX99DE26 
           date: 10/10/2020 
CPU:       Info: 12-Core model: Intel Xeon E5-2678 v3 bits: 64 type: MT MCP L2 cache: 30 MiB 
           Speed: 2414 MHz min/max: 1200/3300 MHz Core speeds (MHz): 1: 2414 2: 2127 3: 3301 4: 2273 5: 1735 6: 1201 7: 1618 
           8: 3302 9: 2636 10: 2858 11: 2355 12: 1843 13: 1383 14: 1200 15: 1200 16: 1200 17: 1201 18: 1200 19: 1447 20: 1200 
           21: 1492 22: 1200 23: 1200 24: 1811 
Graphics:  Device-1: Advanced Micro Devices [AMD/ATI] Vega 10 XL/XT [Radeon RX Vega 56/64] driver: amdgpu v: kernel 
           Display: server: X.Org 1.20.11 driver: loaded: amdgpu,ati unloaded: fbdev,modesetting,vesa resolution: 1920x1080 
           OpenGL: renderer: Radeon RX Vega (VEGA10 DRM 3.40.0 5.12.4-xanmod1-llvm-2 LLVM 12.0.0) 
           v: 4.6 Mesa 21.2.0-devel (git-bcdebf4ff8) 
Audio:     Device-1: Intel C610/X99 series HD Audio driver: snd_hda_intel 
           Device-2: Advanced Micro Devices [AMD/ATI] Vega 10 HDMI Audio [Radeon Vega 56/64] driver: snd_hda_intel 
           Sound Server: ALSA v: k5.12.4-xanmod1-llvm-2 
Network:   Device-1: Intel I350 Gigabit Network driver: igb 
           IF: ens1f0 state: down mac: a0:36:9f:a3:72:44 
           Device-2: Intel I350 Gigabit Network driver: igb 
           IF: ens1f1 state: up speed: 1000 Mbps duplex: full mac: a0:36:9f:09:3f:67 
           Device-3: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet driver: r8169 
           IF: enp8s0 state: down mac: 00:e0:4c:68:02:1c 
RAID:      Hardware-1: Intel C610/X99 series sSATA Controller [RAID mode] driver: ahci 
Drives:    Local Storage: total: 5.03 TiB used: 57.81 GiB (1.1%) 
           ID-1: /dev/nvme0n1 vendor: Silicon Power model: SPCC M.2 PCIe SSD size: 953.87 GiB 
           ID-2: /dev/sda vendor: Seagate model: ST2000DX001-1CM164 size: 1.82 TiB 
           ID-3: /dev/sdb vendor: Seagate model: ST2000DX001-1CM164 size: 1.82 TiB 
           ID-4: /dev/sdc vendor: Samsung model: SSD 860 EVO 500GB size: 465.76 GiB 
Partition: ID-1: / size: 3.58 TiB used: 57.8 GiB (1.6%) fs: ext4 dev: /dev/dm-2 
           ID-2: /boot/efi size: 511 MiB used: 5.2 MiB (1.0%) fs: vfat dev: /dev/dm-1 
Swap:      ID-1: swap-1 type: file size: 2 GiB used: 0 KiB (0.0%) file: /swapfile 
Sensors:   System Temperatures: cpu: 32.0 C mobo: N/A gpu: amdgpu temp: 64.0 C 
           Fan Speeds (RPM): N/A gpu: amdgpu fan: 97 
Info:      Processes: 410 Uptime: 50m Memory: 31.21 GiB used: 2.05 GiB (6.6%) Shell: Bash inxi: 3.3.01  

A second easy way to reproduce is to visit the UFO VSync Tester: https://www.testufo.com/animation-time-graph#scale=10&ppf=2&measure=animation&busywait=0&fullscreen=1

On EVERY startup, I get heavy fluctuations between 8ms and minus 6ms, once I do my workaround, the line is super smooth for the rest of the session. As mentioned in my first post these fluctuations result in heavy frame drops in Youtube and WebGL applications like the linked Aquarium demo which are also stuck at around 64 fps. Again, once I enter a game and quit it back to desktop, everything is fine. Also if I use KwinFT on Manjaro, I can no longer see this issue (hence ruling out other oddities with the Kernel or hardware which could cause this).
Comment 5 Mircea Kitsune 2021-05-16 13:34:51 UTC
(In reply to Marcus Seyfarth from comment #4)

Thanks for clarifying. I'm on Manjaro too but not using KDE-git, it may be something in the new version then. If it's relevant, my monitor is connected via DisplayPort cable... fairly sure it worked on HDMI too when I tried it.

But this was just a workaround in the end: The real fix is to get rid of the MaxFPS setting and automatically use the refresh rate of the monitor... highest refresh rate when multiple monitors are connected and it varies per device. I take it that should be fairly easy to accomplish?

And as a reminder: This is only needed for X11 IIRC, on Wayland the desktop automatically works at the refresh rate of the screen. Of course Wayland isn't stable enough to use yet which is why we must still hang onto X11 for yet a while longer.
Comment 6 Marcus Seyfarth 2021-07-04 20:41:05 UTC
Some good news, as of this week with KDE 5.22.2, Kernel 5.13, Mesa-git and Chome 92 Beta, I cannot reproduce the reported frame drop issue on 1080p videos in Youtube with HW decode acceleration via VAAPI anymore, however the browser is still running at 60 Hz only on my 144 Hz monitor which is set at 144 Hz and latency set to balanced (default).
Comment 7 Vlad Zahorodnii 2021-07-07 12:38:04 UTC
(In reply to Marcus Seyfarth from comment #6)
> Some good news, as of this week with KDE 5.22.2, Kernel 5.13, Mesa-git and
> Chome 92 Beta, I cannot reproduce the reported frame drop issue on 1080p
> videos in Youtube with HW decode acceleration via VAAPI anymore, however the
> browser is still running at 60 Hz only on my 144 Hz monitor which is set at
> 144 Hz and latency set to balanced (default).

That's a limitation of X11. If you have several monitors with different refresh rates, it's better to switch to wayland.
Comment 8 Marcus Seyfarth 2021-07-07 16:49:15 UTC
It is a HP 25X, only a single display, 144 Hz, DP and Freesync. With KWinFT I got to run Chrome at 144 Hz on X11 eventually (the default display recognition was buggy though, I had to set 144 Hz manually as with the auto settings it also got stuck at 60 Hz), but I didn't get vanilla KWin to run Chrome with 144 Hz yet. 

I'll keep in mind to try out Wayland, but I am leaning to wait a bit longer to see it mature. Thanks for taking a look anyways, Vlad.
Comment 9 outfrost 2022-01-02 23:29:21 UTC
Confirming this is an issue in 5.23.4, on X11, with kernel 5.15.12-1-MANJARO (amd64), amdgpu, mesa 21.3.2.

I've checked, and I do have `MaxFPS=144` under `[Compositing]` in kwinrc. Still, compositing on my 144 Hz monitor is limited to 60 fps. If I disable compositing, then moving windows, scrolling websites in Firefox etc. is smooth again.

I used to be able to work around this by setting the compositing backend to XRender. In 5.23, XRender has been removed, so I'm stuck again.

My setup is:
* 1920x1080 60Hz @ 0,840
* 2560x1440 144Hz @ 1920,400 primary
* 1920x1080 60Hz @ 4480,0 rotated left

Observation: There is no screen at 0,0 in my setup. In bug #438176, Oto Šťáva mentioned that that has an effect on whether they experience compositing issues.

I've tried changing every compositor setting in the kcm, to no avail. The only thing I haven't used is "keep window thumbnails: always".
Comment 10 gabeklav 2023-03-17 05:45:58 UTC
I can add that in my setup, my 165Hz monitor is noticeably not displaying at 165Hz with compositing on (both compared to compositing off and to Windows). Adding MaxFPS=165 under [Compositing] in my ~/.config/kwinrc and restarting did not make any difference that I could detect. However, disabling my second monitor does in fact make things look 165Hz on the main monitor with compositing on. Perhaps this is now just a limitation of compositing over X11?

- OpenSUSE TW 20230313
- KDE Plasma 5.27.2
- KDE Frameworks 5.104.0
- Qt 5.15.8
- Kernel 6.2.4-1
- X11
- Monitor 1: 2k resolution over DP @ 165Hz
- Monitor 2: 1080p resolution over DP @ 60Hz