bulletmark / libinput-gestures

Actions gestures on your touchpad using libinput
3.9k stars 241 forks source link

System crash with simultaneous multi-touch touchscreen and touchpad events #300

Closed punyidea closed 3 years ago

punyidea commented 3 years ago

My machine is an HP Zbook x360 studio G5 with touchscreen, and I am running Ubuntu 20.04 LTS

Run libinput-gestures -l on the command line and paste the output here.

libinput-gestures: session ubuntu+x11 on Linux-5.8.0-50-generic-x86_64-with-glibc2.29, python 3.8.5, libinput 1.15.5
/usr/bin/libinput-gestures: hash f264e6fcfd567b8d762ed65e3981f653
Gestures configured in ~/.config/libinput-gestures.conf:
swipe up         3 xdotool key super
swipe down       3 xdotool key Escape
swipe right      3 xdotool key ctrl+alt+Left
swipe left       3 xdotool key ctrl+alt+Right
swipe up         4 xdotool key super
swipe down       4 xdotool key Escape
swipe right      4 xdotool key ctrl+alt+Left
swipe left       4 xdotool key ctrl+alt+Right
pinch in         3 xdotool key ctrl+minus
pinch out        3 xdotool key ctrl+plus
swipe_threshold 11
libinput-gestures: device /dev/input/by-path/pci-0000:00:15.1-platform-i2c_designware.1-event-mouse(event23): SYNA307B:00 06CB:CD46 Touchpad

Describe the issue

Please allow me to start by saying that I am slightly new to Linux. I have looked through the guide and felt that I had enough information to post this issue.

Simply put, I have experienced system crash (requiring reboot) when my hand was on the screen at the same time, or immediately after, scrolling. I was able to replicate this after some short time by performing a multi-finger operation on the touchscreen and the touchpad in extremely quick succession to one another.

The issue presented itself when I was taking lecture notes on my screen just after scrolling on my touchpad.

Workaround and reason for bug report The reason I suspect libinput-gestures is at least partly at fault here is that after I changed the swipe_threshold from 0 to 11, my issue seems to have lessened substantially.

bulletmark commented 3 years ago

Please paste the output of libinput-gestures-setup status here.

Also, what do you mean by "crash"? Please describe exactly the problem you experience. Does your machine completely lock up? E.g. mouse can not move, time display has stopped, etc? Can you ssh in to the machine from remote?

punyidea commented 3 years ago
libinput-gestures is installed.
libinput-gestures is set up as a desktop application.
libinput-gestures is currently running as a desktop application.
libinput-gestures is set to autostart as a desktop application.
libinput-gestures is using custom configuration.

I use cunidev's GUI for the program.

By "crash" I do mean that the computer becomes unresponsive to all input (as far as I know), and that I must reboot it, and time display stops. I'm not using this on a server but rather on my main laptop so I can't confirm ssh.

There is a separate instability in the OS that I experience as well. It may be related, or may also be a bug with libinput? I started noticing it after really trying to test this issue, and after changing the swipe threshold (again, the system is more stable after this). After swiping aggressively with multiple fingers on the touchpad and touchscreen simultaneously, I can get into a state where my mouse pointer turns into a closed hand, as if it were trying to click and drag. However, nothing seems to be selected. I can move the mouse around but give no keyboard input, nor can I click. I've found that I can get out of this state by swiping three fingers down on my touchpad.

bulletmark commented 3 years ago

i just watched the video demo of that "cunidev GUI". Seems a cumbersome way to edit a simple text file and it seems you can only configure 4 of the possible 8 swipe gestures anyhow.

Can you reproduce this problem? Please disable libinput-gestures completely and see if the problem still happens. If not, then keep libinput-gestures disabled but run libinput debug-events and see if the problem happens. Just can't see how this trivial program can cause a problem like that so I would guess it is a libinput/kernel bug. Can you try a current libinput version?

punyidea commented 3 years ago

I agree, knowing know what I know about this library, having a GUI seems a bit excessive. At the time, I was just trying to switch to a new operating system and preserve the features I knew. So a google search helped. Admittedly, it can protect newbies from entering incorrect syntax.

On to the bug. I was able to experience the second instability I mention, when libinput-gestures is run in debug mode (changing swipe_threshold back to 0 in hopes of getting the big bug.

After swiping aggressively with multiple fingers on the touchpad and touchscreen simultaneously, I can get into a state where my mouse pointer turns into a closed hand, as if it were trying to click and drag. However, nothing seems to be selected. I can move the mouse around but give no keyboard input, nor can I click. I've found that I can get out of this state by swiping three fingers down on my touchpad.

I was not able to reproduce my initial issue of a system crash when this ran. However, I did see this noteworthy message pop up.

libinput-gestures: SWIPE down 3 [-122.49000000000001, 330.27]
   xdotool key Escape
libinput error: event14 - SYNA307B:00 06CB:CD46 Touchpad: kernel bug: Touch jump detected and discarded.
See https://wayland.freedesktop.org/libinput/doc/1.15.5/touchpad-jumping-cursors.html for details
libinput error: event14 - SYNA307B:00 06CB:CD46 Touchpad: kernel bug: Touch jump detected and discarded.
See https://wayland.freedesktop.org/libinput/doc/1.15.5/touchpad-jumping-cursors.html for details
libinput error: event14 - SYNA307B:00 06CB:CD46 Touchpad: kernel bug: Touch jump detected and discarded.
See https://wayland.freedesktop.org/libinput/doc/1.15.5/touchpad-jumping-cursors.html for details
libinput-gestures: SWIPE up 3 [402.45, -435.26]
   xdotool key super
libinput-gestures: SWIPE left 3 [-710.8399999999999, 200.14000000000001]
   xdotool key ctrl+alt+Right

I had noticed that error in my syslog before, and it may not be anything to worry about from what I've read. It only happens in my case when there is a multitouch event on both the trackpad and touchscreen.

For the life of me, I am actually not able to reproduce the crash now (even without debug mode on). This is unfortunate as it was a daily occurrence for about a week before I decided to write the bug report - Not to mention the fact I could reproduce it at the time I started this report. Let's chalk it up to ghosts in the kernel? It's possible that a software update has unknowingly fixed my issue.

Edit: One possible cause of the issue may actually be the nvidia driver I had previously on my machine - I've heard that they have a reputation for instability. I since reverted to the Xorg video driver. It's possible this explains my extra stability, and my previous explanation with the swipe_threshold may have been a red herring. In any case, I'm not sure I wish to continue testing this bug. Its source seems not to do with this package and I don't seem to have issues with my machine at the moment. I'll mention if I have further problems. Thanks for your time and attention.

bulletmark commented 3 years ago

The kernel bug: Touch jump detected and discarded message has been posted about very many times around here and elsewhere and is experienced by nearly everybody, including me for as long as I can remember. It is absolutely benign so that is irrelevant to any problem you may be experiencing.

The swipe_threshold parameter only sets the minimum number of pixels before this utility actions the command so I just can't possibly see how changing that parameter would affect anything to do with your reported lockup.

I will leave this open for a week or two but if you can't reproduce it then I will close it given it is most certainly some instability related to your system and not to libinput-gestures.

punyidea commented 3 years ago

Wanted to give a followup: this (at least system crash) actually seems to be a bug with xournalpp.