Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Touchegg can't see gesture events even though geisview can #524

Closed
compilebunny opened this issue Sep 12, 2021 · 22 comments
Closed

Touchegg can't see gesture events even though geisview can #524

compilebunny opened this issue Sep 12, 2021 · 22 comments
Labels
Milestone

Comments

@compilebunny
Copy link

System is Ubuntu Mate 20.04. Touchegg version is 2021-09100709-stable-2.0.11-ubuntu20.04.1 compiled from the github repository.

Touchegg is running as a daemon. Touchegg was previously configured to detect "pinch in" and "pinch out" using touche (see attached touchegg.conf).

When the touchegg client is run ("touchegg" with no parameters) and gestures are performed, the client produces no output. The expected behavior when running the touchegg client is for gesture events to be noted on the console.

Since geisview does see gesture inputs (tested with pinch), the device and driver are set up for multitouch.

The output of "geisview > pinch.txt" is attached. It represents the output of geisview during a single pinch.

pinch.txt
touchegg.conf.txt
geisview

@JoseExposito
Copy link
Owner

Under the hood, Touchégg uses the libinput X11 driver. Have you configured your device to use a different driver? Geis is a "old" technology not maintained any more by Canonical/Ubuntu, my recommendation is to move to libinput if you can.

@compilebunny
Copy link
Author

How would I check that?

@compilebunny
Copy link
Author

The Xorg log seems to indicate that the touchscreen is on the libinput driver.

[ 14.399] (II) config/udev: Adding input device WaveShare WS170120 (/dev/input/event0)
[ 14.400] () WaveShare WS170120: Applying InputClass "evdev touchscreen catchall"
[ 14.400] (
) WaveShare WS170120: Applying InputClass "libinput touchscreen catchall"
[ 14.400] (II) LoadModule: "libinput"
[ 14.400] (II) Loading /usr/lib/xorg/modules/input/libinput_drv.so
[ 14.412] (II) Module libinput: vendor="X.Org Foundation"
[ 14.412] compiled for 1.20.4, module version = 0.29.0
[ 14.412] Module class: X.Org XInput Driver
[ 14.412] ABI class: X.Org XInput driver, version 24.1
[ 14.412] (II) Using input driver 'libinput' for 'WaveShare WS170120'
[ 14.412] () WaveShare WS170120: always reports core events
[ 14.412] (
) Option "Device" "/dev/input/event0"
[ 14.412] () Option "_source" "server/udev"
[ 14.424] (II) event0 - WaveShare WS170120: is tagged by udev as: Touchscreen
[ 14.425] (II) event0 - WaveShare WS170120: device is a touch device
[ 14.426] (II) event0 - WaveShare WS170120: device removed
[ 14.452] (
) Option "config_info" "udev:/sys/devices/platform/scb-

14.452] () WaveShare WS170120: (accel) acceleration factor: 2.000
[ 14.452] (
) WaveShare WS170120: (accel) acceleration threshold: 4
[ 14.461] (II) event0 - WaveShare WS170120: is tagged by udev as: Touchscreen
[ 14.462] (II) event0 - WaveShare WS170120: device is a touch device
[ 14.466] (II) config/udev: Adding input device WaveShare WS170120 (/dev/input/mouse0)
[ 14.466] (II) No input driver specified, ignoring this device.
[ 14.466] (II) This device may have been added with another device file.
[ 17.444] (WW) EDID timing clock 148.50 exceeds claimed max 145MHz, fixing
[ 17.445] (II) modeset(0): EDID vendor "LEN", prod id 4230
[ 17.445] (II) modeset(0): Using EDID range info for horizontal sync
[ 17.445] (II) modeset(0): Using EDID range info for vertical refresh
[ 17.445] (II) modeset(0): Printing DDC gathered Modelines:

@JoseExposito
Copy link
Owner

Ah ok, it's a touchscreen. Could you attach the output of this command, please?

$ journalctl -u touchegg -b

It should show your touchscreen after "A list of detected compatible devices will be displayed below".

If it's not listed, please include:

$ sudo libinput list-devices

When running Touchégg in client mode, you can set this flag to get more information:

$ touchegg --debug

@compilebunny
Copy link
Author

Here is the output of journalctl -u touchegg -b

-- Logs begin at Wed 2021-07-21 12:00:21 PDT, end at Tue 2021-09-14 17:50:53 PDT. --
Sep 14 17:49:10 devbox systemd[1]: Started Touchégg Daemon.
Sep 14 17:49:11 devbox touchegg[651]: Touchégg v2.0.11.
Sep 14 17:49:11 devbox touchegg[651]: Starting Touchégg in daemon mode
Sep 14 17:49:11 devbox touchegg[651]: Starting daemon server...
Sep 14 17:49:11 devbox touchegg[651]: Generating D-Bus introspection data
Sep 14 17:49:11 devbox touchegg[651]: Creating D-Bus server
Sep 14 17:49:11 devbox touchegg[651]: Server started at address unix:abstract=touchegg
Sep 14 17:49:11 devbox touchegg[651]: A list of detected compatible devices will be displayed below:
Sep 14 17:49:16 devbox touchegg[651]: Compatible device detected:
Sep 14 17:49:16 devbox touchegg[651]: Name: WaveShare WS170120
Sep 14 17:49:16 devbox touchegg[651]: It wasn't possible to get your device physical size, falling back to default start_threshold and finish_threshold. You can tune this values in your service file
Sep 14 17:49:16 devbox touchegg[651]: start_threshold: 200
Sep 14 17:49:16 devbox touchegg[651]: finish_threshold_horizontal: 2500
Sep 14 17:49:16 devbox touchegg[651]: finish_threshold_vertical: 2500
Sep 14 17:49:54 devbox touchegg[651]: New client connection request
Sep 14 17:49:54 devbox touchegg[651]: New client connected

touchegg --debug tells me that I need to delete the lockfile.

After I delete the lockfile, I run touchegg --debug again but get only

ouchégg v2.0.11.
Starting Touchégg in client mode
Parsing your configuration file...
Using configuration file "/home/[xxxx]/.config/touchegg/touchegg.conf"
Configuration parsed successfully
Connecting to Touchégg daemon...
Connection with Touchégg established

No further output is produced on performing simple pinch gestures (pinch has been defined in the .conf file attached to the initial post.

@compilebunny
Copy link
Author

Is there any more information that I can provide?

@JoseExposito
Copy link
Owner

Sorry for the delay answering. After some testing, running the client as touchegg --debug I can see that the pinch gesture doesn't start until the ~50% of the gesture is performed.

In my case the pinch is recognized eventually if I try long enough. Is is your case?

@JoseExposito JoseExposito added this to the 2.0.12 milestone Sep 21, 2021
@compilebunny
Copy link
Author

compilebunny commented Sep 22, 2021

Thank you.

I suppose that it isn't a problem with the files being in the right place or with communication between processes as the 3 finger and 4 finger swipes both seem to work.

However, I don't see the pinch at all. Out of about 20 tries, I was able to see the two-finger tap only once.
touchegg-test3.txt

@compilebunny
Copy link
Author

Here is a small update.

It seems like two- and three-finger swipes work well. If I get the timing exactly right, I can manage the two-finger tap.

I can't seem to manage the pinch regardless of how large or small the motion.

Perhaps there is a way to configure the amount of time that touchegg allows between the first and second finger touch for the two-finger tap (the window is very small) and the manner in which the pinch is detected?

@JoseExposito
Copy link
Owner

Hi @compilebunny

I just created a pull request that should fix the issue (#530)

Could you compile and test it? Here are instructions to compile the project:
https://github.com/JoseExposito/touchegg/blob/master/HACKING.md#compilation

Let me know if you need help downloading the right code and I'll send you detailed instructions.

@compilebunny
Copy link
Author

Thank you.

Unfortunately, I don't see any difference in results.

I used
git clone https://github.com/JoseExposito/touchegg.git
git pull origin touch-update-delta-on-start

to get the right set of sources and then proceeded to compile. Unfortunately, I seem to get the same results (no pinch and two-finger tap only when I get the timing just right).

@JoseExposito
Copy link
Owner

Sigh, ok, I didn't notice this line in your log, sorry about that 🤦‍♂️

Sep 14 17:49:16 devbox touchegg[651]: Name: WaveShare WS170120
Sep 14 17:49:16 devbox touchegg[651]: It wasn't possible to get your device physical size, falling back to default start_threshold and finish_threshold. You can tune this values in your service file

The OS doesn't know the size of your screen so Touchégg fallbacks to a default size to calculate the gesture thresholds.

Hopefully, there is a couple of options in place to fix this issue:
https://github.com/JoseExposito/touchegg#daemon-configuration

The recommended values are:

  • start_threshold: The 3% of the height of your screen in mm
  • finish_threshold: The 15% of the height of your screen in mm

For example, if your screen height is 100mm, this command should return:

$ cat /lib/systemd/system/touchegg.service | grep ExecStart
ExecStart=/usr/bin/touchegg --daemon 3 15

Restart the daemon as explained in the README file and double check that the right thresholds are printed. Gestures should be recognized.

It might be worth it to report the issue to the touchscreen vendor so they can fix it.

@compilebunny
Copy link
Author

Thank you.

This change does cause pinches and double taps to be recognized, however they re recognized as two-finger swipes about 90% of the time.

I'm not sure what type of logs would be useful for understanding this?

@JoseExposito
Copy link
Owner

libinput includes couple of tools that can help us to debug the problem.

Please run the following command and attach the output:

$ sudo libinput record > 3-fingers-pinch.txt

The command will display a list of input devices and will ask you to select one, type the number of your touchscreen. Then, perform a 3 finger pinch and press Control+C to exit.

Also, send me the thresholds you used in ExecStart=/usr/bin/touchegg --daemon X Y so I can reproduce it locally.

@compilebunny
Copy link
Author

Thank you.

I have recorded both a 2-finger pinch (diagonal from top right and bottom left towards the center) and a 3-finger pinch.

2-finger-pinch.txt
3-finger-pinch.txt

@JoseExposito
Copy link
Owner

Both records look fine. When you recorded the 3 finger pinch, where you able to execute the action associated to the gesture? Or was it a buggy gesture? What thresholds are you using?

When I replay your 3 finger pinch record using sudo libinput replay 3-finger-pinch.txt I'm able to execute the action associated with the gesture (in my case maximizing a window) without any problems.

For reference, I'm using 3 and 28 as thresholds as printed by:

$ sudo journalctl -u touchegg -b -f
Sep 26 17:17:59 fedora touchegg[14349]: Compatible device detected:
Sep 26 17:17:59 fedora touchegg[14349]:         Name: WaveShare WS170120
Sep 26 17:17:59 fedora touchegg[14349]:         It wasn't possible to get your device physical size, falling back to default start_threshold and finish_threshold. You can tune this values in your service file: https://github.com/JoseExposito/touchegg#daemon-configuration
Sep 26 17:17:59 fedora touchegg[14349]:         start_threshold: 3
Sep 26 17:17:59 fedora touchegg[14349]:         finish_threshold_horizontal: 28
Sep 26 17:17:59 fedora touchegg[14349]:         finish_threshold_vertical: 28

And the client is able to detect the gesture:

$ touchegg --debug
 touchegg --debug
Touchégg v2.0.11.
Starting Touchégg in client mode
Parsing your configuration file...
Using configuration file "/home/jose/.config/touchegg/touchegg.conf"
Configuration parsed successfully
Connecting to Touchégg daemon...
Connection with Touchégg established
Gesture begin detected
	Gesture information:
		Fingers: 3
		Type: PINCH
		Direction: IN
	Gesture performed on app: Gnome-terminal
	Action configured for this gesture
	Starting action
Gesture update detected (3.76812%)
Gesture update detected (3.76812%)
Gesture update detected (6.66667%)
[...]
Gesture update detected (68.1159%)
Gesture update detected (68.4058%)
Gesture end detected

@compilebunny
Copy link
Author

The three-finger pinch produced a response, but the result was not clear and I was not running touchegg at the time. When I repeated the physical gesture under touchegg --debug, the three-finger pinch appeared as a two-finger swipe.

I was using 3 and 13 as the thresholds.

Threshold 3/13

  • 2 finger pinch = swipe right
  • 3 finger pinch = pinch in

Threshold 3/28

  • 2 finger pinch = swipe right
  • 3 finger pinch = pinch in

So, it looks like the three finger pinch did happen that time. I've recorded two additional files. The first includes give three-finger pinches and the second includes five two-finger pinches.
five_2-finger_pinches.txt
five_3-finger_pinches.txt

One of the two-finger pinches does come through at 3/28, but the others are seen as different gestures.

Threshold 3/7

  • 2 finger pinch =
  • 3 finger pinch =

@compilebunny
Copy link
Author

Oops, I had meant to fill this in. It is based on the single-gesture files

Threshold 3/7

2 finger pinch = swipe right
3 finger pinch = pinch in

@JoseExposito
Copy link
Owner

Thanks for the recordings, they made easier to debug the issue.

The "problem" seems to be that, unlike me, you usually keep a finger pinned at the beginning of the pinch gesture and my algorithm just failed to detect this case.

I just pushed a fix to master (bb9a602). You can pull the latest code, hopefully it should make pinch detection more reliable.

Let me know if that worked or there are any other case where it felt short, thanks!

@compilebunny
Copy link
Author

That makes a huge difference! The two-finger pinches in and out are now recognized quite well.

@compilebunny
Copy link
Author

What is your intent with respect to the two-finger touch? I have been trying to get them to touch the screen simultaneously, but wonder if that is wrong.

@JoseExposito
Copy link
Owner

That makes a huge difference! The two-finger pinches in and out are now recognized quite well.

Sweet! I'll tag a release with this improvements soon.

What is your intent with respect to the two-finger touch? I have been trying to get them to touch the screen simultaneously, but wonder if that is wrong.

Do you mean tap gestures? https://github.com/JoseExposito/touchegg#tap

It is not necessary to tap in the exact same moment, a bit of delay is allowed. Unfortunately, the mouse pointer is placed by X11, making difficult to right click precisely... Ideally, apps should implement long press to right click, but that's up to them.

Closing the issue, unless you are experimenting issues with tap gestures. In that case, feel free to reopen it and attach a recording.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants