Bug 1470974 - ThinkPad T540p: switched from synaptics to libinput and 3-finger tap is not that sensitive as before
ThinkPad T540p: switched from synaptics to libinput and 3-finger tap is not t...
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: libinput (Show other bugs)
26
Unspecified Unspecified
unspecified Severity low
: ---
: ---
Assigned To: Peter Hutterer
Fedora Extras Quality Assurance
:
Depends On: 1455443
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-14 03:30 EDT by Jan Hutař
Modified: 2017-09-05 18:27 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1455443
Environment:
Last Closed: 2017-09-05 18:27:54 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
evemu-record (86.04 KB, text/plain)
2017-07-14 03:31 EDT, Jan Hutař
no flags Details
libinput-debug-events --enable-tap --verbose # about first 4 3-finger-taps successfull, then 3 unsuccesfull (27.47 KB, text/plain)
2017-07-14 03:33 EDT, Jan Hutař
no flags Details

  None (edit)
Description Jan Hutař 2017-07-14 03:30:23 EDT
Hello. I believe I can see same/similar issue on Fedora 26 (upgraded) now.



+++ This bug was initially created as a clone of Bug #1455443 +++

Description of problem:
I'm on ThinkPad T540p with XFce4 and I have switched from synaptics to libinput and 3-finger click on the touchpad is not that sensitive as before. Often I have to do multiple attempts


Version-Release number of selected component (if applicable):
libinput-1.6.3-4.fc25.x86_64
xorg-x11-drv-libinput-0.23.0-4.fc25.x86_64
xfce4-session-4.12.1-9.fc25.x86_64


How reproducible:
always


Steps to Reproduce:
1. Use libinput on XFce on ThinkPad T540p
2. Try to do a 3-finger click (e.g. to paste content of the clipboard)


Actual results:
It is not that sensitive or reliable as it was with synaptics


Expected results:
Should be similarly sensitive

--- Additional comment from Peter Hutterer on 2017-05-25 17:31:06 EDT ---

record a few 3-finger clicks with evemu-record please and attach the output here, so I can replay it.

Also, maybe test with sudo libinput-debug-events (optionally with --verbose) and look at the output, if events are misdetected there may be a hint in the output.

--- Additional comment from Jan Hutař on 2017-05-26 01:16 EDT ---

Third (I'm quite sure) and sixth (not sure, maybe fifth or seventh) three-finger click was unsuccessful.

--- Additional comment from Jan Hutař on 2017-05-26 01:31:03 EDT ---

When running `libinput-debug-events`, usual three-finger clicks (successful or unsuccessful) does not log anything. Only time I have seen something (and it was for unsuccessful three-finger click) was:

# libinput-debug-events 
-event2   DEVICE_ADDED     Power Button                      seat0 default group1  cap:k
-event4   DEVICE_ADDED     Video Bus                         seat0 default group2  cap:k
-event1   DEVICE_ADDED     Sleep Button                      seat0 default group3  cap:k
-event14  DEVICE_ADDED     Integrated Camera                 seat0 default group4  cap:k
-event3   DEVICE_ADDED     AT Translated Set 2 keyboard      seat0 default group5  cap:k
-event5   DEVICE_ADDED     SynPS/2 Synaptics TouchPad        seat0 default group6  cap:pg  size 97x67mm tap(dl off) left scroll-nat scroll-2fg-edge click-buttonareas-clickfinger dwt-on
-event6   DEVICE_ADDED     ThinkPad Extra Buttons            seat0 default group7  cap:k
[...]
 event5   GESTURE_PINCH_BEGIN +14.01s	3
 event5   GESTURE_PINCH_UPDATE +14.01s	3  0.11/ 0.00 ( 0.47/ 0.00 unaccelerated)  1.00 @ -0.03
 event5   GESTURE_PINCH_END +14.04s	3
[...]

--- Additional comment from Jan Hutař on 2017-05-26 01:50 EDT ---

I have been inserting (with middle click) string "AAAAAAAAA" so please ignore it. Also it feels like when I'm running libinput-debug-events, it is much more reliable (say 4 of 5 attempts) than without it (say 1 of 3).

--- Additional comment from Jan Hutař on 2017-05-26 01:55:43 EDT ---

I have tried to save `xinput list-props 11 > normal` when libinput-debug-events was and was not running, but outputs are identical.

--- Additional comment from Peter Hutterer on 2017-05-26 02:35:39 EDT ---

wait, are we talking about tapping or clicking here? i.e. physical click with 3 fingers on the touchpad or a three-finger tap?

https://wayland.freedesktop.org/libinput/doc/latest/tapping.html

--- Additional comment from Jan Hutař on 2017-05-26 02:57:44 EDT ---

Sorry, did not knew there is a difference. I'm talking about 3 fingers touching touchpad at the same time (emulating middle mouse button). And I'm just (silently) touching the touchpad, not pressing it (which gives that "click" sound).

--- Additional comment from Peter Hutterer on 2017-06-05 23:20:43 EDT ---

ok, in that case the next question is: is tapping enabled? xinput list-props "device name" should show us, please attach or paste the output here.

--- Additional comment from Jan Hutař on 2017-06-06 01:38 EDT ---

It is enabled. It just takes me 2 - 3 attempts to 3-finger tap when pasting text. Any idea?

--- Additional comment from Peter Hutterer on 2017-06-12 23:04:04 EDT ---

run sudo libinput-debug-events --enable-tap --verbose and check the output. What we found on those particular devices is that the tripletap data isn't always reliable, i.e. in quite a few cases a three-finger tap wouldn't send BTN_TOOL_TRIPLETAP so libinput would think it's a 2-finger tap. Or there was some movement before the data comes in.

If you run debug-events the state debugging may give a hint of what states libinput sees. Likewise, if you run evemu-record on the side you can keep an eye out on BTN_TOOL_TRIPLETAP. The recording you submitted had a few in it but that doesn't mean all got detected.

--- Additional comment from Jan Hutař on 2017-06-13 02:04 EDT ---



--- Additional comment from Jan Hutař on 2017-06-13 02:09 EDT ---



--- Additional comment from Jan Hutař on 2017-06-13 02:17:34 EDT ---

# libinput-list-devices
[...]
Device:           SynPS/2 Synaptics TouchPad
Kernel:           /dev/input/event5
Group:            6
Seat:             seat0, default
Size:             97.33x66.86mm
Capabilities:     pointer 
Tap-to-click:     disabled
Tap-and-drag:     enabled
Tap drag lock:    disabled
Left-handed:      disabled
Nat.scrolling:    disabled
Middle emulation: disabled
Calibration:      n/a
Scroll methods:   *two-finger edge 
Click methods:    *button-areas clickfinger 
Disable-w-typing: enabled
Accel profiles:   none
Rotation:         n/a
[...]

Please do you have any idea on why there is "Tap-to-click: disabled" although tapping works? Also I'll try to disable all scroll edges and button areas bacause these might interfere.

--- Additional comment from Jan Hutař on 2017-06-13 02:32:58 EDT ---

Hmm, in this output tapping is enabled:

# xinput list-props 11
Device 'SynPS/2 Synaptics TouchPad':
	Device Enabled (140):	1
	Coordinate Transformation Matrix (142):	1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
	libinput Tapping Enabled (275):	1
	libinput Tapping Enabled Default (276):	0
	libinput Tapping Drag Enabled (277):	1
	libinput Tapping Drag Enabled Default (278):	1
	libinput Tapping Drag Lock Enabled (279):	0
	libinput Tapping Drag Lock Enabled Default (280):	0
	libinput Tapping Button Mapping Enabled (281):	1, 0
	libinput Tapping Button Mapping Default (282):	1, 0
	libinput Accel Speed (283):	0.500000
	libinput Accel Speed Default (284):	0.000000
	libinput Natural Scrolling Enabled (285):	0
	libinput Natural Scrolling Enabled Default (286):	0
	libinput Send Events Modes Available (260):	1, 1
	libinput Send Events Mode Enabled (261):	0, 0
	libinput Send Events Mode Enabled Default (262):	0, 0
	libinput Left Handed Enabled (287):	0
	libinput Left Handed Enabled Default (288):	0
	libinput Scroll Methods Available (289):	1, 1, 0
	libinput Scroll Method Enabled (290):	1, 0, 0
	libinput Scroll Method Enabled Default (291):	1, 0, 0
	libinput Click Methods Available (292):	1, 1
	libinput Click Method Enabled (293):	1, 0
	libinput Click Method Enabled Default (294):	1, 0
	libinput Middle Emulation Enabled (295):	0
	libinput Middle Emulation Enabled Default (296):	0
	libinput Disable While Typing Enabled (297):	1
	libinput Disable While Typing Enabled Default (298):	1
	Device Node (263):	"/dev/input/event5"
	Device Product ID (264):	2, 7
	libinput Drag Lock Buttons (299):	<no items>
	libinput Horizontal Scroll Enabled (300):	1

(only change I did is I have set acceleration to 0.5)

--- Additional comment from Jan Hutař on 2017-06-13 02:46:12 EDT ---

From `man libinput`:

       libinput Scroll Methods Available
              3 boolean values (8 bit, 0 or 1), in order "two-finger", "edge", "button".  Indicates which scroll methods are available on this device.

       libinput Scroll Method Enabled
              3 boolean values (8 bit, 0 or 1), in order "two-finger", "edge", "button".  Indicates which scroll method is currently enabled on this device.

So looks like "ibinput Scroll Method Enabled Default (291): 1, 0, 0" is what I want (i.e. no scroll edges).

I'm out of ideas. Again.

--- Additional comment from Peter Hutterer on 2017-06-13 19:16:53 EDT ---

(In reply to Jan Hutař from comment #13)
> # libinput-list-devices

man libinput-list-devices:
"Each device shows available configurations the respective default configuration setting."

X has its own libinput context, the tools can't see into that context so nothing in those tools will give you the exact data the driver has internally. That should explain why tapping is enabled in the properties - those are the values the driver actually has.

libinput-debug-events behaves differently because of that too, it will see the same events as the X driver, but it has a separate context with potentially different options.

Ok, now to the state debugging:
tap state: TAP_STATE_TOUCH_2 → TAP_EVENT_TOUCH → TAP_STATE_TOUCH_3
tap state: TAP_STATE_TOUCH_3 → TAP_EVENT_MOTION → TAP_STATE_TOUCH_3_HOLD
tap state: TAP_STATE_TOUCH_3_HOLD → TAP_EVENT_MOTION → TAP_STATE_TOUCH_3_HOLD

So it detects 2fg touch, then a touch, goes to the 3fg state. But then it detects a motion event above the movement threshold and goes into "three fingers down but no tap" state. This is the bit we have to watch out for in the evemu recordings, I'll try to have a look at that asap.

--- Additional comment from Peter Hutterer on 2017-06-14 02:22:50 EDT ---

right, as expected, the recording has a jump at timestamp 5.393864, that is causing the state transition to 3-finger-hold rather than tap. synaptics doesn't look at finger positions so it doesn't care when they're moving - hence why it's more reliable here. Not 100% how to fix this yet.

--- Additional comment from Jan Hutař on 2017-06-14 03:57:44 EDT ---

Thank you for the investigation and explaining to me.

Maybe I'm just not touching/tapping correctly if others are not complaining about that. Is there some option do disable that motion detection? Or way to increase threshold?

--- Additional comment from Peter Hutterer on 2017-06-14 22:56:03 EDT ---

it's a hardware-dependent problem, so there isn't that much you can do. The thresholds are largely hard-coded, increasing them isn't really helping much because then you'll find touch movements will be affected, etc. the only real solution would be to switch to the BTN_TOOL_* detection that synaptics does, but that means we'd lose gestures.

--- Additional comment from Peter Hutterer on 2017-06-15 00:29:48 EDT ---

https://koji.fedoraproject.org/koji/taskinfo?taskID=20026845

Can you give this scratch build a try please? Thanks

--- Additional comment from Jan Hutař on 2017-06-15 01:21:20 EDT ---

Hello, I'm running that now:

# rpm -q libinput
libinput-1.6.3-5.fc25.x86_64
# rpm -Uvh https://kojipkgs.fedoraproject.org//work/tasks/6847/20026847/libinput-1.6.3-5.bz1455443.fc25.x86_64.rpm
Retrieving https://kojipkgs.fedoraproject.org//work/tasks/6847/20026847/libinput-1.6.3-5.bz1455443.fc25.x86_64.rpm
Preparing...                          ################################# [100%]
	package libinput-1.6.3-5.fc25.x86_64 (which is newer than libinput-1.6.3-5.bz1455443.fc25.x86_64) is already installed
# rpm -Uvh --oldpackage https://kojipkgs.fedoraproject.org//work/tasks/6847/20026847/libinput-1.6.3-5.bz1455443.fc25.x86_64.rpm
Retrieving https://kojipkgs.fedoraproject.org//work/tasks/6847/20026847/libinput-1.6.3-5.bz1455443.fc25.x86_64.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:libinput-1.6.3-5.bz1455443.fc25  ################################# [ 50%]
Cleaning up / removing...
   2:libinput-1.6.3-5.fc25            ################################# [100%]
# rpm -q libinput
libinput-1.6.3-5.bz1455443.fc25.x86_64

but IMO it is still same. I'm attaching `libinput-debug-events --enable-tap --verbose` for two unsuccessful 3-finger-taps.

--- Additional comment from Jan Hutař on 2017-06-15 01:22:01 EDT ---

(and I have restarted laptop after package update)

--- Additional comment from Jan Hutař on 2017-06-15 01:23 EDT ---



--- Additional comment from Peter Hutterer on 2017-06-15 18:29:51 EDT ---

hmm, is that device tagged as synaptics serial touchpad? That's the only way I can see how the fix doesn't apply. Please submit a full libinput-debug-events --enable-tap --verbose, specifically the device list at the top, it should print the model tags applied. Also attach your udevadm info /sys/class/input/eventX output for that device, thanks.

--- Additional comment from Jan Hutař on 2017-06-16 06:49 EDT ---

Few unsuccessful 3-finger-taps, at the end one successful

--- Additional comment from Jan Hutař on 2017-06-16 06:52 EDT ---

Hope I figured out which devices correctly. Also noticed there is "ThinkPad Extra Buttons", so added these as well in case these are relevant.

--- Additional comment from Jan Hutař on 2017-06-16 06:55:46 EDT ---

Errr, sorry, your build was upgraded, let me try again later:

# rpm -qa | grep -e libinput -e synaptics
libinput-1.6.3-5.fc25.x86_64
xorg-x11-drv-libinput-0.23.0-4.fc25.x86_64

--- Additional comment from Peter Hutterer on 2017-06-18 22:03:54 EDT ---

renamed the package in the spec file so it sorts higher than the f25 default one: https://koji.fedoraproject.org/koji/taskinfo?taskID=20062284

--- Additional comment from Peter Hutterer on 2017-06-20 20:43:49 EDT ---

fwiw, I'd like to get this patch into libinput 1.8 and for that I need some testing feedback. If you could confirm whether the new scratch build works for you, that'd be great, thanks

--- Additional comment from Jan Hutař on 2017-06-21 01:00:08 EDT ---

I'm sorry. Everything below comment 21 is wrong. When I have installed your scratch build and was about to reboot, I said to myself "if I'm going to reboot anyway, lets upgrade other fedora upgrades". Did that and did not checked that upgraded that package as well. My mistake, sorry for feeding wrong results.

As of now:

# rpm -q libinput
libinput-1.6.3-5.1bz1455443.fc25.x86_64

--- Additional comment from Jan Hutař on 2017-06-21 01:03 EDT ---

Did 5 3-finger-taps here and they were:

1. successful
2. successful
3. unsuccessful
4. successful
5. unsuccessful

--- Additional comment from Jan Hutař on 2017-06-21 01:12:06 EDT ---

So,I have done lots of 3-finger-taps now and looks pretty good. I'm not sure if these which fails (below 30% I guess) are still a bug or my clumpy fingers, but definitely I see improvement here, so please include the magic into next official build.

--- Additional comment from Peter Hutterer on 2017-06-21 01:47:22 EDT ---

I think I'll need a new evemu record together with the libinput-debug-event recording at the same time. I don't know how you get

  tap state: TAP_STATE_TOUCH_3 → TAP_EVENT_MOTION → TAP_STATE_TOUCH_3_HOLD

That code path has been effectively disabled on your touchpad

--- Additional comment from Jan Hutař on 2017-06-21 02:28 EDT ---



--- Additional comment from Jan Hutař on 2017-06-21 02:30 EDT ---



--- Additional comment from Jan Hutař on 2017-06-21 02:32:34 EDT ---

So these two commands (last 2 attachments) were running in parallel and I did five 3-finger-taps. First was unsuccessful, rest of them worked. Hope this is output you wanted.

--- Additional comment from Peter Hutterer on 2017-06-21 03:45:20 EDT ---

yep, perfect, thanks. found the issue: the new code works fine on finger down but if there's a movement on finger up, that triggers the motion just before the touch release. I'll get a fix for this out asap.

--- Additional comment from Peter Hutterer on 2017-06-21 20:43:03 EDT ---

Scratch build with the fix available here:
https://koji.fedoraproject.org/koji/taskinfo?taskID=20083337

--- Additional comment from Peter Hutterer on 2017-06-22 01:50:51 EDT ---

ok, another update to only limit this to 3fg touches (I don't want to touch 2fg ones until absolutely necessary):
https://koji.fedoraproject.org/koji/taskinfo?taskID=20088537

--- Additional comment from Jan Hutař on 2017-06-23 03:27:25 EDT ---

Hello. IMO it is perfect now, thank you very much!

$ rpm -q libinput
libinput-1.6.3-5.3bz1455443.fc25.x86_64

--- Additional comment from Peter Hutterer on 2017-06-25 21:34:15 EDT ---

awesome, thanks, proper update coming up.

--- Additional comment from Fedora Update System on 2017-06-25 21:48:04 EDT ---

libinput-1.6.3-6.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-85017e5432

--- Additional comment from Fedora Update System on 2017-06-26 23:23:08 EDT ---

libinput-1.6.3-6.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-85017e5432

--- Additional comment from Fedora Update System on 2017-06-28 16:52:19 EDT ---

libinput-1.6.3-6.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.
Comment 1 Jan Hutař 2017-07-14 03:31 EDT
Created attachment 1298159 [details]
evemu-record
Comment 2 Jan Hutař 2017-07-14 03:33 EDT
Created attachment 1298160 [details]
libinput-debug-events --enable-tap --verbose   # about first 4 3-finger-taps successfull, then 3 unsuccesfull
Comment 3 Jan Hutař 2017-07-14 03:34:33 EDT
Package versions:

libinput-1.7.3-1.fc26.x86_64
xorg-x11-drv-libinput-0.25.1-2.fc26.x86_64
xfce4-session-4.12.1-10.fc26.x86_64
kernel-4.11.9-300.fc26.x86_64
Comment 4 Peter Hutterer 2017-07-17 23:27:51 EDT
whoops, that patch never made it into f26. I'll pull 1.8 in as soon as koji works again and that should fix it, sorry about that.
Comment 5 Peter Hutterer 2017-09-05 18:27:54 EDT
forgot to update this one - 1.8 is in F26, so this should be fixed.

Note You need to log in before you can comment on or make changes to this bug.