xournalpp
xournalpp copied to clipboard
Text input causes severe lag
Affects versions :
OS: Arch Linux In case of linux, which desktop environment XFCE4 Xournal++ 1.0.17 Describe the bug When using the typing tool, there is severe lag. This lag is not only extremely annoying but causes characters typed to be missed too
To Reproduce Steps to reproduce the behavior:
- Open Xournalpp
- Use the typing tool
- Click anywhere, and the lag will begin
Can confirm that the Text tool is really slow on my laptop (which is a pretty fast machine).
Confirmed on my laptop as well (linuxmint 19.3): everything else is fine, but text input is so laggy as to be almost unusable.
Note that it seems to be related to GPU drivers in some fashion. Using the "high performance" nvidia gpu (with the proprietary nvidia drivers) I get this issue. Switching to the "power-saving" intel gpu the problem more or less disappears (still a tiny bit laggy, but quite usable).
I can confirm this bug on
- 1.0.18 535d261d
- 1.1.0.dev-nightly.20201005-x86_64.AppImage
Manjaro using XFCE 4 + proprietary Nvidia drivers
I can confirm this on 1.0.20v on Fedora workstation 33 (btrfs) on both flatpak and rpm.
+1, reproducible on arch linux on amd/nvidia system with proprietary nvidia drivers.
+1 same problem, arch linux 5.11.16, nvidia proprietary 465.24.02, xournalpp 1.0.20
+1, leaving text box open causes periodic stuttering even while tabbed out, Xournal 1.0.20, arch 5.12.3, nvidia 465.27
Does turning cursor blinking off help in version 1.1.0+dev? Note that this can only be done since #2170.
For those of you who use a Gnome-based Linux distro you can find this setting in gnome-control-center
, universal access section.
See also this description
I tried using 1.1.0+dev and the problem seems to be mostly gone (left everything on default settings). There's still a small but noticeable delay when typing (especially when hold down backspace), but it is at least usable. No repeated characters or missed characters, no lag outside the app when leaving the text box open.
xournalpp-1.1.0.dev-nightly.20210429-x86_64.AppImage nvidia 465.27-4 arch 5.12.1
I tried using 1.1.0+dev and the problem seems to be mostly gone (left everything on default settings). There's still a small but noticeable delay when typing (especially when hold down backspace), but it is at least usable. No repeated characters or missed characters, no lag outside the app when leaving the text box open.
xournalpp-1.1.0.dev-nightly.20210429-x86_64.AppImage nvidia 465.27-4 arch 5.12.1
I can confirm that the option you suggested still causes text input lag. xournalpp-1.1.0.dev-nightly.20210429-x86_64.AppImage Nvidia driver version: 460.73.01 uname -r: 5.10.34-1-MANJARO
I can confirm the lags still exist as al-jshen described. xournalpp: 1.0.20 nvidia: 465.31 linux: 5.12.6
Problem still exists. Causes severe lag across the whole system.
xournalpp: 1.1.1 nvidia: 510.68.02 linux: 5.17.5
same problem here on Ubuntu 20.04 (xournalpp stable)
Is this still an issue on the latest dev branch? I can't reproduce (neither on 1.1.1 nor on latest master).
I just checked again. I'm still seeing the same issues on master and on 1.1.1.
I really can't reproduce... could you give me the versions of GLibc, GTK, Pango and Cairo you are using?
I'm on Arch and pacman reports the following versions:
glibc 2.35-6 gtk3 1:3.24.34-1 pango 1:1.50.8-1 cairo 1.17.6-2
Mmm... same versions here, Arch as well. Gnome or other DE? X11 or Wayland? I'm running out of ideas as to where the difference in performance may come from.
i3 and X11. It doesn't even really feel like a performance bottle neck. It almost feels like a too aggressive de-bounce or something. I cannot type single letters but when I press a key for a long time, then I get it to insert the letter.
Oh, I just noticed something interesting: this only happens for my external keyboard. When I type on my laptop keyboard, it's totally fine.
I have had this issue a while ago on my desktop computer where there is no issue regarding an external keyboard. I just tested if I still have this issue on an empty document and it seems that I can't reproduce it anymore. Would be nice if I could remember the version I used back then but these are the information I got for my current setup where I don't have this issue anymore:
Xournal++ 1.1.1 LibGTK 3.24.34 GLibc 2.35-6 GTK3 1:3.24.34-1 Pango 1:1.50.8-1 Cairo 1.17.6-2 NVIDIA's proprietary driver 515.57 Linux kernel 5.10.133-1-MANJARO On Manjaro with GNOME 42.3 and X11. Cursor Blinking is on.
Maybe the issue you have @lassepe is a different one? There seems to be some differences like you not having problems when using your laptop keyboard and also that you have issues when typing a character at any time, right? The severe lag only occurred to me when the cursor bar blinked/appeared. In between this half-a-second blinking interval it was fine. Maybe input from more people who still have this issue could be very helpful.
I can confirm this issue on my side with the following setup:
- Xournal++ version: 1.1.1 (Flathub)
- OS: EndeavourOS
- Kernel: 5.19.7-arch1-1
- DE: KDE Plasma 5.25.5 (using Xorg display server)
- WM: KWin
- GPU (integrated / iGPU): Intel HD Graphics 530
- GPU (dedicated / dGPU): NVIDIA GeForce GTX 960M
- Driver: Closed-source/proprietary NVIDIA driver, version 515.65.01
After reading about so many people mentioning laptops and NVIDIA and Intel switching and @Nesaijn not being able to reproduce the issue in a desktop PC, I think that just like @cverb thinks it might be an issue regarding the GPU drivers or the rendering software stack in systems with a dual GPU setup (NVIDIA Optimus / Linux PRIME).
However, after experimenting a bit I was able to narrow down the scenario a bit more. In my case, the lag only happens when the "NVIDIA (Performance Mode)" mode (often referred as "NVIDIA-only" or "PRIME mode") is enabled, and in the form of a substantial spike in frame-rendering times every few moments, but almost in a perfect loop and at regular intervals.
https://user-images.githubusercontent.com/48522412/189902582-d1b16e1b-526f-4b98-b628-aeceaacd86ba.mp4
In performance mode, the NVIDIA driver takes over the rendering and compositing of the entire desktop environment session, which makes everything much smoother and makes all applications use the NVIDIA GPU without having to set environment flags or use helpers like prime-run
and is the mode most people use. However, it can introduce synchronization issues between the dGPU and the iGPU, with the last being the one that actually drives all displays (be it embedded or external) connected to the device and can cause rendering issues and increase latency in some cases, specially for applications and graphics software that haven't been adapted properly to work with dual GPU setups.
Disabling the NVIDIA-only mode and returning back to the default "NVIDIA On-Demand" mode (often referred as "hybrid mode" or "Optimus mode") fixed the issue for me. In hybrid mode, both GPUs are available to use, but the default GPU and the one that handles the rendering of the desktop environment is the iGPU. If the user wants to use the dGPU with a certain application, they have to either set the appropriate environment variables, use a helper like prime-run
or (if the application supports Vulkan) set the dGPU as the one to use in the application settings. Since the GPU that drives the display is the same that renders the desktop environment, less latency is introduced and any software that hasn't been adapted to work with dual GPU setups and ignore PRIME rendering offloading settings will render with the same GPU that is driving the display. I've tested this both with and without prime-run
and the results are the same: it works just fine and without any issues.
https://user-images.githubusercontent.com/48522412/189903737-2ddb29f4-13fb-4fd4-9a45-cf2c0d0fe33e.mp4
This might not even be an issue with Xournal++, but with how the libraries it relies on to render the GUI, text and the notebook canvas (Freetype, Cairo, Pango, GTK...) support hardware-accelerated rendering and how well they handle synchronization with the rendering device, the application that is using them and/or the display in dual GPU setups. Maybe updating the libraries to the latest stable release or tweaking how Xournal++ interacts with them could solve this issue.
I still have this issue on a Desktop with a Nvidia GTX 1060 6GB.
Text insertion mode makes the whole PC lag.
Hello. I have the same issue, I have a laptop with a RTX3070 Max-Q. I also get a similar issue using the highlighter with the line tool. I see the CPU usage going up all the way to 100% when it's doing that. The audio lags as well and overall it's a sluggish experience overall.
inxi -F output:
System:
Host: Vic1184-GP66 Kernel: 5.15.0-91-generic x86_64 bits: 64
Desktop: Cinnamon 5.6.8 Distro: Linux Mint 21.1 Vera
Machine:
Type: Laptop System: Micro-Star product: GP66 Leopard 10UG v: REV:1.0
serial: