Cursor flickers when hovering using a graphics tablet

Hi, so it’s my first time using a graphics tablet with linux and I was having this issue where the cursor starts flickering when it isn’t moving or being pressed.

I’m using a Huion Kamvas 13 with OpenTabletDriver and when I change the Output Mode to Relative or Absolute it stops happening but then pen pressure stops working, so I can’t really count that as a solution.

I have also tried changing its screen scaling factor, changing its refresh rate, turning off the primary monitor and using the tablet as the only one, but nothing has worked for me so far.

  • I’m including the output of inxi -Fxxc0z as I think it could be helpful:
Summary

System:
Kernel: 6.16.0-arch2-1 arch: x86_64 bits: 64 compiler: gcc v: 15.2.1
Desktop: KDE Plasma v: 6.4.4 tk: Qt v: N/A wm: kwin_wayland dm: SDDM
Distro: EndeavourOS base: Arch Linux
Machine:
Type: Desktop System: Micro-Star product: MS-7C96 v: 1.0
serial:
Mobo: Micro-Star model: B550M-A PRO (MS-7C96) v: 1.0
serial: UEFI: American Megatrends LLC. v: 2.F0
date: 07/26/2024
CPU:
Info: 8-core model: AMD Ryzen 7 5700X3D bits: 64 type: MT MCP arch: Zen 3+
rev: 2 cache: L1: 512 KiB L2: 4 MiB L3: 96 MiB
Speed (MHz): avg: 3962 min/max: 575/4151 boost: enabled cores: 1: 3962
2: 3962 3: 3962 4: 3962 5: 3962 6: 3962 7: 3962 8: 3962 9: 3962 10: 3962
11: 3962 12: 3962 13: 3962 14: 3962 15: 3962 16: 3962 bogomips: 96006
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Graphics:
Device-1: Advanced Micro Devices [AMD/ATI] Navi 21 [Radeon RX 6800/6800 XT
/ 6900 XT] vendor: Sapphire NITRO+ driver: amdgpu v: kernel arch: RDNA-2
pcie: speed: 16 GT/s lanes: 16 ports: active: DP-1,HDMI-A-1
empty: DP-2,DP-3,Writeback-1 bus-ID: 25:00.0 chip-ID: 1002:73bf
Display: wayland server: X.org v: 1.21.1.18 with: Xwayland v: 24.1.8
compositor: kwin_wayland driver: X: loaded: amdgpu
unloaded: modesetting,radeon alternate: fbdev,vesa dri: radeonsi
gpu: amdgpu d-rect: 2560x2520 display-ID: 0
Monitor-1: DP-1 pos: primary,top model: Mi Monitor res: 2560x1440 hz: 180
dpi: 109 diag: 686mm (27")
Monitor-2: HDMI-A-1 pos: bottom model: Kamvas 13 res: 1920x1080 hz: 60
dpi: 166 diag: 337mm (13.3")
API: EGL v: 1.5 platforms: device: 0 drv: radeonsi device: 1 drv: swrast
gbm: drv: kms_swrast surfaceless: drv: radeonsi wayland: drv: radeonsi x11:
drv: radeonsi
API: OpenGL v: 4.6 compat-v: 4.5 vendor: amd mesa v: 25.1.7-arch1.1
glx-v: 1.4 direct-render: yes renderer: AMD Radeon RX 6800 XT (radeonsi
navi21 LLVM 20.1.8 DRM 3.64 6.16.0-arch2-1) device-ID: 1002:73bf
display-ID: :1.0
API: Vulkan v: 1.4.321 surfaces: N/A device: 0 type: discrete-gpu
driver: mesa radv device-ID: 1002:73bf
Info: Tools: api: clinfo, eglinfo, glxinfo, vulkaninfo
de: kscreen-console,kscreen-doctor gpu: corectrl wl: wayland-info
x11: xdpyinfo, xprop, xrandr
Audio:
Device-1: Advanced Micro Devices [AMD/ATI] Navi 21/23 HDMI/DP Audio
driver: snd_hda_intel v: kernel pcie: speed: 16 GT/s lanes: 16
bus-ID: 25:00.1 chip-ID: 1002:ab28
Device-2: Advanced Micro Devices [AMD] Starship/Matisse HD Audio
vendor: Micro-Star MSI driver: snd_hda_intel v: kernel pcie: speed: 16 GT/s
lanes: 16 bus-ID: 27:00.4 chip-ID: 1022:1487
API: ALSA v: k6.16.0-arch2-1 status: kernel-api
Server-1: PipeWire v: 1.4.7 status: active with: 1: pipewire-pulse
status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
4: pw-jack type: plugin
Network:
Device-1: Realtek RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet
vendor: Micro-Star MSI driver: r8169 v: kernel pcie: speed: 2.5 GT/s
lanes: 1 port: f000 bus-ID: 22:00.0 chip-ID: 10ec:8168
IF: enp34s0 state: down mac:
Device-2: MediaTek Wireless_Device driver: mt7921u type: USB rev: 3.2
speed: 5 Gb/s lanes: 1 bus-ID: 2-1:2 chip-ID: 0e8d:7961
IF: wlan0 state: up mac:
Drives:
Local Storage: total: 1.82 TiB used: 748.93 GiB (40.2%)
ID-1: /dev/nvme0n1 vendor: Lexar model: SSD NQ710 500GB size: 465.76 GiB
speed: 63.2 Gb/s lanes: 4 serial: temp: 34.9 C
ID-2: /dev/sda vendor: Samsung model: SSD 860 EVO 500GB size: 465.76 GiB
speed: 6.0 Gb/s serial:
ID-3: /dev/sdb vendor: Seagate model: ST1000DM010-2EP102 size: 931.51 GiB
speed: 6.0 Gb/s serial:
Partition:
ID-1: / size: 58.76 GiB used: 21.2 GiB (36.1%) fs: ext4 dev: /dev/nvme0n1p4
ID-2: /boot/efi size: 499 MiB used: 176 KiB (0.0%) fs: vfat
dev: /dev/nvme0n1p3
ID-3: /home size: 132.29 GiB used: 55.68 GiB (42.1%) fs: ext4
dev: /dev/nvme0n1p5
Swap:
ID-1: swap-1 type: partition size: 4 GiB used: 0 KiB (0.0%) priority: -2
dev: /dev/nvme0n1p2
Sensors:
System Temperatures: cpu: 56.6 C mobo: 48.0 C gpu: amdgpu temp: 53.0 C
mem: 52.0 C
Fan Speeds (rpm): N/A gpu: amdgpu fan: 1137
Info:
Memory: total: 16 GiB available: 15.54 GiB used: 5.23 GiB (33.7%)
Processes: 386 Power: uptime: 2h 32m wakeups: 0 Init: systemd v: 257
default: graphical
Packages: 1305 pm: pacman pkgs: 1291 pm: flatpak pkgs: 14 Compilers:
clang: 20.1.8 gcc: 15.2.1 Shell: Bash v: 5.3.3 running-in: konsole

  • I’m also adding a video I recorded of the issue:

If there is anything more I could add that would be helpful, please ask me!

Thanks in advance!

I will just paste what I already posted on another forum (https://discourse.gnome.org/t/cursor-flickers-and-disappears-when-tablet-pen-is-still/30464/5) here:

First for those who just want the quick and temporary fix (that atleast works for me as of writing this):

You have to be on Linux-lts kernel. Set the variable “export WLR_NO_HARDWARE_CURSORS=1” in your .bashrc for example. Then on every boot, after you have first introduced your tablet to the system (hovered the pen), you have to reload your system (for me on Hyprland I do “hyprctl reload”). Also works if you just toggle the variable from 1 to 0 or vice versa. Just make a script with this and bind it onto something or run it when launching Krita (remember to always introduce the tablet to the sytem in this case before launching Krita).

Now for those interested in resolving this issue in a more proper way:

It seems to be a problem on Huion tablets, I have a Huion HS611, and the two issues alike that I have seen are also Huion (this one and other on this thread: Cursor flickers when hovering using a graphics tablet ) Both posts are recent, and I had not encountered this issue in the past either. The issue appears on both Fedora and Arch and on different WM’s and DE’s, so we can rule those out. We all are also using an AMD GPU.

Results from my testing point to maybe a kernel and gpu level bug. Firstly, the problem only occurs on apps that use hardware rendering (Krita, Discord…) and not on Firefox or desktop/no app –> GPU rendering issue.

Secondly the only fix that is working for me right now is a sort of “refresh” to the cursor planes. NOTE this only works on the Linux-lts kernel, I didn’t find any solutions on the Linux or Linux-zen kernels. Example: Boot –> Having a variable set, like WLR_NO_HARDWARE_CURSORS actually does nothing before the issue appears –> issue appears when the system first recognises the hover events from the tablet –> only after the issue has first appeared one of these will fix it: Setting the variable (WLR_NO_HARDWARE_CURSORS), toggling the variable if already set (=0–>1 or vice versa) or reloading the system if the variable is already set (on Hyprland “hyprctl reload”).

The issue seems to be something along the lines of the hover events of the Huion tablets messing up when introduced to GPU rendering/acceleration on the Linux kernels. A simple refresh to the hardware rendered cursor planes fixes this (only on the Linux-lts kernel, and it is possible that this stops working in the future too).

If someone more knowledgeable could give their take on this, I would appreciate it.

1 Like

Thank you for the answer!

About the temporary fix, I think i would prefer to stay at the standard kernel for the moment, but if it isn’t fixed in some months then I will probably have to.

About the error, if I’m remember correctly, I think I saw an AMD issue thread about the cursor blinking that could have fixed it, but it wasn’t a graphics tablet problem but a general use one, so I think it wouldn’t have been the solution to my problem.

And about Huion-only or at least mainly problem, yeah, I thought so, they haven’t updated their linux drivers in a year and they only have them for Ubuntu and Debian, so I will probably have to go with XP Pen if I ever need another tablet

Just wanted to say that, at least in my case, after updating the linux kernel the flicker stops happening, but after rebooting to apply the update, the flickering starts again.

Don’t know why it stops happening only after the update and before the reboot, but wanted to let it be known in case it could be useful for someone.

Also, another heads up, the cursor flickering, at least for me, stops happening when changing sessions to x11, so maybe it’s a wayland problem? If you are reading this and are having the same problem, try changing to x11 and see if it happens there as well.

Even if I don’t like x11 too much, at least now that I know it doesn’t have the problem i’ll have to use it when drawing, at least for the momment.