Bug 89206

Summary: enabling tapping adds delay to cursor move
Product: Wayland Reporter: Mantas Mikulėnas <grawity>
Component: libinputAssignee: Peter Hutterer <peter.hutterer>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: jwrdegoede, peter.hutterer
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: evemu record of moving the cursor
0001-touchpad-change-tap-motion-threshold-to-3-mm.patch
event-test log
actual event-test log
evemu record of moving the cursor (for #8)
corresponding event-debug log
0001-touchpad-change-tap-motion-threshold-to-3-mm.patch

Description Mantas Mikulėnas 2015-02-18 14:37:53 UTC
So I'm testing the libinput-based driver on Arch. First thing I noticed, if I enable touchpad tapping via xprop...

$ xinput set-int-prop "ETPS/2 Elantech Touchpad" "libinput Tapping Enabled" 8 1

..then it starts having a short but still noticeable delay for regular pointer moving/dragging. That is, when I touch the pad, the pointer doesn't start moving until ~0.3 later. (Maybe it's waiting to decide whether it's a tap or swipe?...)

Sorry if this is in the wrong place; I don't actually know if it's a bug in xf86-input-libinput or if it's a libinput issue itself... Either way, it doesn't happen with xf86-input-synaptics.

libinput 0.10.0-1
xf86-input-libinput 0.6.0-2
xorg-server 1.17.1-1
Comment 1 Peter Hutterer 2015-02-22 23:02:47 UTC
It's a libinput bug or feature, depending how you look at it.

The timeout is 180ms and we don't post motion events from the touch until the timeout expires or the motion exceeds a certain threshold (see the comment in tp_tap_handle_state).

This is on purpose, synaptics has an issue where tapping would also sometimes move the cursor, causing a mis-tap. IMO 180ms is short enough though, I'm having a lot of troubles even reproducing this - either I move fast enough for the timeout to not trigger but then I exceed the motion threshold or I move slow to stay under the threshold but then the timeout expires. In short, I don't think I've managed to reproduce this even once in the 20 tries I had here.

So this is likely a difference in touchpads though, can you attach an evemu recording of your touchpad here please?
Comment 2 Mantas Mikulėnas 2015-02-23 06:14:11 UTC
Created attachment 113749 [details]
evemu record of moving the cursor

Okay I hope I recorded the right thing.

(curious if it's the same timeout that synaptics lowered to even 100ms in -git...)
Comment 3 Peter Hutterer 2015-03-03 22:28:06 UTC
Created attachment 113969 [details] [review]
0001-touchpad-change-tap-motion-threshold-to-3-mm.patch

Give this one a try please, let me know how you go
Comment 4 Mantas Mikulėnas 2015-03-03 22:57:35 UTC
Tested it on top of 0.11.0 and current master (0.11.0-14-g01d415c).

It acts strangely: the pointer starts moving immediately, but after a few cm it actually stops. If I continue moving my finger, sometimes it starts moving again for another cm or two, but usually just remains stuck in place.
Comment 5 Peter Hutterer 2015-03-04 04:13:33 UTC
that is strange. can you run ./tools/event-debug --enable-tap --verbose and look at the output? does the tapping state change in some weird way or another?
Comment 6 Mantas Mikulėnas 2015-03-04 06:04:17 UTC
Created attachment 113972 [details]
event-test log

(with libinput 0.11.0-14-g01d415c +patch)
Comment 7 Mantas Mikulėnas 2015-03-04 06:05:06 UTC
Created attachment 113973 [details]
actual event-test log

Err. Wrong file.
Comment 8 Peter Hutterer 2015-03-04 06:24:34 UTC
I take it all the 00/00 events were the ones you were still moving your finger around but didn't get any events? I don't see anything that stands out here.

Can you evemu-record such a sequence by any chance?

Can you try the tools/event-gui too? does the pointer move there? Maybe that's a xorg libinput driver issue now.
Comment 9 Mantas Mikulėnas 2015-03-04 06:37:00 UTC
Created attachment 113974 [details]
evemu record of moving the cursor (for #8)
Comment 10 Mantas Mikulėnas 2015-03-04 06:37:26 UTC
Created attachment 113975 [details]
corresponding event-debug log
Comment 11 Mantas Mikulėnas 2015-03-04 06:42:56 UTC
(In reply to Peter Hutterer from comment #8)
> I take it all the 00/00 events were the ones you were still moving your
> finger around but didn't get any events? I don't see anything that stands
> out here.

It seems so.

> Can you evemu-record such a sequence by any chance?

Attached logs of both started at the same time.

> Can you try the tools/event-gui too? does the pointer move there? Maybe
> that's a xorg libinput driver issue now.

I ran "sudo tools/event-gui --enable-tap --device /dev/input/event7" from within a working (synaptics) X session, it shows the same problem.
Comment 12 Mantas Mikulėnas 2015-03-04 15:01:21 UTC
(In reply to Mantas Mikulėnas from comment #11)
> I ran "sudo tools/event-gui --enable-tap --device /dev/input/event7" from
> within a working (synaptics) X session, it shows the same problem.

(...and, uh, to clarify, I meant from an X session that used the synaptics driver, not a whole new touchpad.)
Comment 13 Peter Hutterer 2015-03-05 09:09:07 UTC
Created attachment 114023 [details] [review]
0001-touchpad-change-tap-motion-threshold-to-3-mm.patch

Give this one a try please. That should fix the dead cursor issue. (sorry, just a diff, it's multiple patches in the repo)
Comment 14 Mantas Mikulėnas 2015-03-05 15:33:03 UTC
(In reply to Peter Hutterer from comment #13)
> Created attachment 114023 [details] [review] [review]
> 0001-touchpad-change-tap-motion-threshold-to-3-mm.patch
> 
> Give this one a try please. That should fix the dead cursor issue. (sorry,
> just a diff, it's multiple patches in the repo)

Yes, this one seems to work fine.

~

Possibly related: The first patch talked about Elantech touchpads having a lower resolution than Synaptics. Could that also affect the two-finger scrolling? Currently it's much too sensitive when scrolling in programs (although seems fine in tools/event-gui) and I was going to post a separate bug about that.
Comment 15 Peter Hutterer 2015-03-05 21:40:14 UTC
The two-finger scrolling is a xorg libinput bug and got fixed yesterday too. see http://cgit.freedesktop.org/xorg/driver/xf86-input-libinput/commit/?id=7ec0bf7ae2e3753d7e4989495bae80057f39508e

Thanks for testing, I'll get this upstream asap
Comment 16 Peter Hutterer 2015-03-10 04:41:50 UTC
commit 38ee2c7aacd23a99e20b608f45a7d1292e1feb10
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Mar 4 08:24:36 2015 +1000

    touchpad: change tap motion threshold to 3 mm

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.