Bug 94264 - libinput 1.2: two finger scrolling broken
Summary: libinput 1.2: two finger scrolling broken
Status: RESOLVED FIXED
Alias: None
Product: Wayland
Classification: Unclassified
Component: libinput (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Peter Hutterer
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-23 14:02 UTC by Greg White
Modified: 2016-02-28 22:44 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Recording of an attempted two finger scroll (22.08 KB, text/plain)
2016-02-24 01:58 UTC, Greg White
Details
0001-touchpad-expand-immediate-pinch-detection-to-25mm.patch (1.24 KB, patch)
2016-02-24 03:51 UTC, Peter Hutterer
Details | Splinter Review
0001-touchpad-only-trigger-immediate-pinch-detection-for-.patch (1.43 KB, patch)
2016-02-25 01:38 UTC, Peter Hutterer
Details | Splinter Review
Another recording of attempted two-finger scroll (29.04 KB, text/plain)
2016-02-25 21:21 UTC, Jan Alexander Steffens (heftig)
Details

Description Greg White 2016-02-23 14:02:38 UTC
This worked fine in previous releases.  Now all two finger scroll events seem to be reported as PINCH.

Device:           SynPS/2 Synaptics TouchPad
Kernel:           /dev/input/event10
Group:            6
Seat:             seat0, default
Size:             101.76x77.14mm
Capabilities:     pointer 
Tap-to-click:     disabled
Tap-and-drag:     enabled
Tap drag lock:    disabled
Left-handed:      disabled
Nat.scrolling:    disabled
Middle emulation: n/a
Calibration:      n/a
Scroll methods:   *two-finger edge 
Click methods:    *button-areas clickfinger 
Disable-w-typing: enabled
Accel profiles:   none

Here's a two finger scroll:

event10 POINTER_MOTION    +1.70s          2.16/  0.45
event10 GESTURE_PINCH_BEGIN  +2.38s     2
event10 GESTURE_PINCH_UPDATE  +2.38s    2 -0.73/-0.69 (-1.87/-1.79 unaccelerated)  1.00 @ -0.24
event10 GESTURE_PINCH_UPDATE  +2.39s    2 -0.58/ 0.00 (-1.87/ 0.00 unaccelerated)  1.00 @  0.23
event10 GESTURE_PINCH_UPDATE  +2.41s    2 -0.61/-1.75 (-1.87/-5.37 unaccelerated)  1.01 @  0.21
event10 GESTURE_PINCH_UPDATE  +2.44s    2 -1.48/-2.82 (-3.75/-7.16 unaccelerated)  1.02 @ -0.03
event10 GESTURE_PINCH_UPDATE  +2.46s    2 -1.50/-2.86 (-3.75/-7.16 unaccelerated)  1.02 @ -0.03
event10 GESTURE_PINCH_UPDATE  +2.48s    2 -0.75/-4.29 (-1.87/-10.74 unaccelerated)  1.03 @  0.19
event10 GESTURE_PINCH_UPDATE  +2.50s    2  0.00/-8.59 ( 0.00/-21.47 unaccelerated)  1.03 @  0.00
event10 GESTURE_PINCH_UPDATE  +2.52s    2  0.00/-21.34 ( 0.00/-48.32 unaccelerated)  1.01 @  0.53
event10 GESTURE_PINCH_UPDATE  +2.54s    2  2.16/-39.26 ( 3.75/-68.00 unaccelerated)  1.00 @  0.53
event10 GESTURE_PINCH_UPDATE  +2.56s    2  2.67/-58.54 ( 3.75/-82.32 unaccelerated)  1.02 @  0.76
event10 GESTURE_PINCH_UPDATE  +2.58s    2  6.00/-84.46 ( 7.50/-105.58 unaccelerated)  1.04 @  0.80
event10 GESTURE_PINCH_UPDATE  +2.60s    2  6.00/-83.04 ( 7.50/-103.79 unaccelerated)  1.06 @  0.70
event10 GESTURE_PINCH_UPDATE  +2.62s    2  4.50/-80.17 ( 5.62/-100.21 unaccelerated)  1.08 @  0.46
event10 GESTURE_PINCH_UPDATE  +2.64s    2  4.50/-71.58 ( 5.62/-89.48 unaccelerated)  1.09 @  0.62
event10 GESTURE_PINCH_UPDATE  +2.66s    2  6.00/-54.40 ( 7.50/-68.00 unaccelerated)  1.10 @  0.35
event10 GESTURE_PINCH_UPDATE  +2.68s    2  4.50/-40.09 ( 5.62/-50.11 unaccelerated)  1.11 @  0.48
event10 GESTURE_PINCH_UPDATE  +2.70s    2  4.23/-28.25 ( 5.62/-37.58 unaccelerated)  1.12 @  0.10
event10 GESTURE_PINCH_UPDATE  +2.72s    2  3.71/-18.89 ( 5.62/-28.63 unaccelerated)  1.13 @  0.53
event10 GESTURE_PINCH_UPDATE  +2.74s    2  4.90/-21.07 ( 7.50/-32.21 unaccelerated)  1.13 @  0.07
event10 GESTURE_PINCH_UPDATE  +2.76s    2  6.19/-20.08 ( 9.37/-30.42 unaccelerated)  1.12 @  0.31
event10 GESTURE_PINCH_UPDATE  +2.78s    2  4.78/-19.39 ( 7.50/-30.42 unaccelerated)  1.10 @  0.19
event10 GESTURE_PINCH_UPDATE  +2.80s    2  4.64/-16.62 ( 7.50/-26.84 unaccelerated)  1.09 @  0.45
event10 GESTURE_PINCH_UPDATE  +2.82s    2  5.64/-12.91 ( 9.37/-21.47 unaccelerated)  1.10 @  0.20
event10 GESTURE_PINCH_UPDATE  +2.84s    2  3.06/-6.81 ( 5.62/-12.53 unaccelerated)  1.10 @  0.16
event10 GESTURE_PINCH_UPDATE  +2.86s    2  0.89/-3.39 ( 1.87/-7.16 unaccelerated)  1.10 @  0.20
event10 GESTURE_PINCH_UPDATE  +2.88s    2  1.66/-0.79 ( 3.75/-1.79 unaccelerated)  1.10 @ -0.04
event10 GESTURE_PINCH_UPDATE  +2.90s    2  0.79/-1.52 ( 1.87/-3.58 unaccelerated)  1.11 @  0.20
event10 GESTURE_PINCH_UPDATE  +2.94s    2  0.00/-0.74 ( 0.00/-1.79 unaccelerated)  1.11 @ -0.04
event10 GESTURE_PINCH_UPDATE  +2.98s    2  0.00/-0.72 ( 0.00/-1.79 unaccelerated)  1.11 @ -0.04
event10 GESTURE_PINCH_END  +3.02s       2
Comment 1 Peter Hutterer 2016-02-23 21:23:02 UTC
capture one of thes sequences with evemu-record and attach it here please
Comment 2 Greg White 2016-02-24 01:58:44 UTC
Created attachment 121932 [details]
Recording of an attempted two finger scroll
Comment 3 Greg White 2016-02-24 01:59:14 UTC
stdout from evemu-record:

# EVEMU 1.3
# Kernel: 4.5.0-rc5-GTW1+
# DMI: dmi:bvnDellInc.:bvrA07:bd10/15/2014:svnDellInc.:pnXPS159530:pvrA07:rvnDellInc.:rnXPS159530:rvrA07:cvnDellInc.:ct8:cvrNotSpecified:
# Input device name: "SynPS/2 Synaptics TouchPad"
# Input device ID: bus 0x11 vendor 0x02 product 0x07 version 0x1b1
# Supported events:
#   Event type 0 (EV_SYN)
#     Event code 0 (SYN_REPORT)
#     Event code 1 (SYN_CONFIG)
#     Event code 2 (SYN_MT_REPORT)
#     Event code 3 (SYN_DROPPED)
#     Event code 4 ((null))
#     Event code 5 ((null))
#     Event code 6 ((null))
#     Event code 7 ((null))
#     Event code 8 ((null))
#     Event code 9 ((null))
#     Event code 10 ((null))
#     Event code 11 ((null))
#     Event code 12 ((null))
#     Event code 13 ((null))
#     Event code 14 ((null))
#   Event type 1 (EV_KEY)
#     Event code 272 (BTN_LEFT)
#     Event code 325 (BTN_TOOL_FINGER)
#     Event code 328 (BTN_TOOL_QUINTTAP)
#     Event code 330 (BTN_TOUCH)
#     Event code 333 (BTN_TOOL_DOUBLETAP)
#     Event code 334 (BTN_TOOL_TRIPLETAP)
#     Event code 335 (BTN_TOOL_QUADTAP)
#   Event type 3 (EV_ABS)
#     Event code 0 (ABS_X)
#       Value   1532
#       Min     1386
#       Max     5660
#       Fuzz       0
#       Flat       0
#       Resolution 42
#     Event code 1 (ABS_Y)
#       Value   3049
#       Min     1252
#       Max     4646
#       Fuzz       0
#       Flat       0
#       Resolution 44
#     Event code 24 (ABS_PRESSURE)
#       Value      0
#       Min        0
#       Max      255
#       Fuzz       0
#       Flat       0
#       Resolution 0
#     Event code 28 (ABS_TOOL_WIDTH)
#       Value      0
#       Min        0
#       Max       15
#       Fuzz       0
#       Flat       0
#       Resolution 0
#     Event code 47 (ABS_MT_SLOT)
#       Value      0
#       Min        0
#       Max        1
#       Fuzz       0
#       Flat       0
#       Resolution 0
#     Event code 53 (ABS_MT_POSITION_X)
#       Value      0
#       Min     1386
#       Max     5660
#       Fuzz       0
#       Flat       0
#       Resolution 42
#     Event code 54 (ABS_MT_POSITION_Y)
#       Value      0
#       Min     1252
#       Max     4646
#       Fuzz       0
#       Flat       0
#       Resolution 44
#     Event code 57 (ABS_MT_TRACKING_ID)
#       Value      0
#       Min        0
#       Max    65535
#       Fuzz       0
#       Flat       0
#       Resolution 0
#     Event code 58 (ABS_MT_PRESSURE)
#       Value      0
#       Min        0
#       Max      255
#       Fuzz       0
#       Flat       0
#       Resolution 0
# Properties:
#   Property  type 0 (INPUT_PROP_POINTER)
#   Property  type 2 (INPUT_PROP_BUTTONPAD)
N: SynPS/2 Synaptics TouchPad
I: 0011 0002 0007 01b1
P: 05 00 00 00 00 00 00 00
B: 00 0b 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 01 00 00 00 00 00
B: 01 20 e5 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 02 00 00 00 00 00 00 00 00
B: 03 03 00 00 11 00 80 60 06
B: 04 00 00 00 00 00 00 00 00
B: 05 00 00 00 00 00 00 00 00
B: 11 00 00 00 00 00 00 00 00
B: 12 00 00 00 00 00 00 00 00
B: 14 00 00 00 00 00 00 00 00
B: 15 00 00 00 00 00 00 00 00
B: 15 00 00 00 00 00 00 00 00
A: 00 1386 5660 0 0 42
A: 01 1252 4646 0 0 44
A: 18 0 255 0 0 0
A: 1c 0 15 0 0 0
A: 2f 0 1 0 0 0
A: 35 1386 5660 0 0 42
A: 36 1252 4646 0 0 44
A: 39 0 65535 0 0 0
A: 3a 0 255 0 0 0
Comment 4 Peter Hutterer 2016-02-24 03:32:49 UTC
ok, that's not surprising. Your finger position is that of a pinch, with the two fingers lined up vertically and 21mm apart. We have code that identifies a pinch gesture whenever the fingers are more than 20mm vertically apart.

so as an immediate workaround you can just keep your fingers closer together. long term we should increase that distance, 20mm is too small.
Comment 5 Peter Hutterer 2016-02-24 03:44:14 UTC
oh, attach the output of touchpad-edge-detector please and the physical dimensions of your touchpad in mm
Comment 6 Peter Hutterer 2016-02-24 03:51:59 UTC
Created attachment 121934 [details] [review]
0001-touchpad-expand-immediate-pinch-detection-to-25mm.patch

this patch ups it to 25mm which should be enough based on your recording (I find more than 25mm quite unnatural, but ymmv). Try it and see if it helps, as said in the above comment we need to also check that your touchpad dimensions are correct
Comment 7 Greg White 2016-02-24 14:11:28 UTC
The touchpad measures as 105x80mm.

Touchpad SynPS/2 Synaptics TouchPad on /dev/input/event10
Move one finger around the touchpad to detect the actual edges
Kernel says:    x [1386..5660], y [1252..4646]
Touchpad sends: x [1392..5659], y [1227..4604] /^C

Touchpad size as listed by the kernel: 101x77mm
Calculate resolution as:
        x axis: 4274/<width in mm>
        y axis: 3394/<height in mm>

Suggested udev rule:
# <Laptop model description goes here>
evdev:name:SynPS/2 Synaptics TouchPad:dmi:bvnDellInc.:bvrA07:bd10/15/2014:svnDellInc.:pnXPS159530:pvrA07:rvnDellInc.:rnXPS159530:rvrA07:cvnDellInc.:ct8:cvrNotSpecified:*
 EVDEV_ABS_00=1392:5659:<x resolution>
 EVDEV_ABS_01=1227:4604:<y resolution>
 EVDEV_ABS_35=1392:5659:<x resolution>
 EVDEV_ABS_36=1227:4604:<y resolution>
Comment 8 Greg White 2016-02-24 14:16:58 UTC
I will try the patch.

That said, I disagree with your algorithm.  A pinch is when there are two fingers down and they are moving towards or away from each other.  A scroll is when there are two fingers down moving in the same direction, no matter how far apart.

25mm will be better (at 20mm, I have to jam my fingers together to get a scroll and I have small fingers.)  However, I often have my fingers much more than 25mm apart when I am scrolling, sometimes as much as 50mm.  I'm "finger trained" on a Macbook, but I've been using this synaptics pad for years.

If the existing algorithm stands, what I'd really like is to disable pinch.  Not only do I never use pinch but, as noted, it's going to break scrolling rather badly.
Comment 9 Greg White 2016-02-24 14:33:50 UTC
Patch applied.  That was better.

I modified the patch to completely disable pinch at that spot.  Perfect.
Comment 10 Peter Hutterer 2016-02-24 21:35:48 UTC
the size difference between the announced ranges and the actual ranges on the touchpad are likely enough to trigger incorrect detection,.

add this to your /usr/lib/udev/hwdb.d/60-evdev.hwdb (note the comment at the top about how to make a local copy), i'll get this into systemd upstream. Once applied, reboot and evemu-describe should now show the modified ranges and resolutions.

evdev:name:SynPS/2 Synaptics TouchPad:dmi:bvnDellInc.*:pnXPS159530:*
 EVDEV_ABS_00=1392:5659:41
 EVDEV_ABS_01=1227:4604:44
 EVDEV_ABS_35=1392:5659:41
 EVDEV_ABS_36=1227:4604:44

(In reply to Greg White from comment #9)
> Patch applied.  That was better.
> 
> I modified the patch to completely disable pinch at that spot.  Perfect.

did you test it without the modification? I won't disable pinch here altogether, at least not until we get some other issues. The hwdb entry and the 25mm patch together should be enough to make 2fg scrolling reliable.
Comment 11 Greg White 2016-02-25 01:16:20 UTC
OK, great, I put that into my hwdb.  Mostly, it seems to have improved the sensitivity of the pointer.  Which is a great goodness.

I did try the patch.  As I noted, I very commonly scroll with my fingers very far apart, and I definitely get missed scrolls even with the patch in place and with the hwdb updated.  As I said, my fingers learned on a Macbook.  I definitely scroll with my fingers far apart, but it's always worked on this touchpad in the past...so it's very jarring.

I would again urge you to rethink pinch.  Scrolling is the (VERY MUCH) more common case - please bias toward making it work as smoothly as possible.
Comment 12 Peter Hutterer 2016-02-25 01:38:15 UTC
Created attachment 121956 [details] [review]
0001-touchpad-only-trigger-immediate-pinch-detection-for-.patch

Try this one please, instead of the previous one. This should be the correct solution and provide you with reliable scrolling and mostly reliable pinch gestures.
Comment 13 Greg White 2016-02-25 02:00:14 UTC
Beautiful.  Works like a charm with that patch installed.  No scroll fails.
Comment 14 Jan Alexander Steffens (heftig) 2016-02-25 21:21:26 UTC
Created attachment 121968 [details]
Another recording of attempted two-finger scroll

This patch solves the problem for me as well. Thanks.

Tested-by: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
Comment 16 Peter Hutterer 2016-02-28 22:44:40 UTC
commit dbb85f67396ce47ca0fb66b610b3818f9a041ca0
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Feb 24 13:46:48 2016 +1000

    touchpad: only trigger immediate pinch detection for three fingers


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.