Bug 96275 - Detect slot jumps on semi-mt devices
Summary: Detect slot jumps on semi-mt devices
Alias: None
Product: Wayland
Classification: Unclassified
Component: libinput (show other bugs)
Version: 1.3.0
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Wayland bug list
QA Contact:
Depends on:
Reported: 2016-05-30 08:22 UTC by Juanjo Benages
Modified: 2016-07-14 07:52 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:

evemu recording of the device (244.26 KB, text/plain)
2016-05-30 08:22 UTC, Juanjo Benages
Output of libinput-debug-events --enable-tap (11.13 KB, text/plain)
2016-05-31 17:43 UTC, Juanjo Benages
New evemu recording of the device (248.00 KB, text/plain)
2016-05-31 17:45 UTC, Juanjo Benages
dmesg (47.87 KB, text/plain)
2016-06-01 16:11 UTC, Juanjo Benages

Description Juanjo Benages 2016-05-30 08:22:04 UTC
Created attachment 124173 [details]
evemu recording of the device

When using two finger scrolling the cursor jumps and the Xorg.0.log gets full of errors like:
[  2367.177] (EE) libinput bug: invalid tap event, no fingers are down
[  2377.707] (EE) libinput bug: invalid tap event, no fingers are down
[  2482.789] (EE) libinput bug: invalid tap event when fingers are up
[  2483.981] (EE) libinput bug: invalid tap event, no fingers are down
[  2677.826] (EE) libinput bug: invalid tap event when fingers are up
[  2681.796] (EE) libinput bug: invalid tap event when fingers are up
[  2698.724] (EE) kernel bug: Touch jump detected and discarded.
See https://wayland.freedesktop.org/libinput/doc/1.3.0/touchpad_jumping_cursor for details
[  2698.915] (EE) libinput bug: invalid tap event when fingers are up

When you file a bug, please attach the following information:
* a virtual description of your input device

* the libinput version. 
libinput-bin/testing,now 1.3.0-2 amd64 

* the current libinput settings for the device.
Device 'SynPS/2 Synaptics TouchPad':
	Device Enabled (138):	1
	Coordinate Transformation Matrix (140):	1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
	libinput Tapping Enabled (276):	1
	libinput Tapping Enabled Default (277):	0
	libinput Tapping Drag Enabled (278):	1
	libinput Tapping Drag Enabled Default (279):	1
	libinput Tapping Drag Lock Enabled (280):	0
	libinput Tapping Drag Lock Enabled Default (281):	0
	libinput Accel Speed (282):	-0.117647
	libinput Accel Speed Default (283):	0.000000
	libinput Natural Scrolling Enabled (284):	0
	libinput Natural Scrolling Enabled Default (285):	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 (286):	0
	libinput Left Handed Enabled Default (287):	0
	libinput Scroll Methods Available (288):	1, 1, 0
	libinput Scroll Method Enabled (289):	1, 0, 0
	libinput Scroll Method Enabled Default (290):	1, 0, 0
	libinput Disable While Typing Enabled (291):	1
	libinput Disable While Typing Enabled Default (292):	1
	Device Node (263):	"/dev/input/event1"
	Device Product ID (264):	2, 7
	libinput Drag Lock Buttons (293):	<no items>
	libinput Horizonal Scroll Enabled (265):	1

*if the device is a touchpad or a pointing stick, the vendor model number of your laptop, and the content of /sys/class/dmi/id/modalias.

My laptop is an Acer Aspire 5749

* if the device is a touchpad, the physical dimensions of your touchpad in mm
88x46 mm
Comment 1 Peter Hutterer 2016-05-31 05:25:00 UTC
hmm, I tried replaying this on current master (f34c8d) and on 1.3.0 but I don't see the errors here. Can your reproduce this running libinput-debug-events --enable-tap and then replaying that recording?
Comment 2 Juanjo Benages 2016-05-31 17:43:40 UTC
Created attachment 124217 [details]
Output of libinput-debug-events --enable-tap
Comment 3 Juanjo Benages 2016-05-31 17:45:04 UTC
Created attachment 124218 [details]
New evemu recording of the device
Comment 4 Juanjo Benages 2016-05-31 17:59:57 UTC
I don't see the errors in the replay. I think i messed up the recording. Sorry.
But I have made a new recording with the error. I have also uploaded the output of libinput-debug-events --enable-tap of the new recording
Comment 5 Peter Hutterer 2016-06-01 02:51:35 UTC
event at E: 0.542783 shows the issue, the touches are in slot 0 (4210/2560) and slot 1 (481/2550). But the finger release is misdetected, causing slot 1 to end and slot 0 to continue with slot 1's coordinates. This is the cause of the jumps but this only explains the error message with the link.

I cannot reproduce your original messages (the invalid tap event ones), sorry
Comment 6 Benjamin Tissoires 2016-06-01 07:16:43 UTC
Could you attach a dmesg of your laptop so I can figure out which kernel driver is in use?
Looks like the jump is introduced by a bad tracking from the firmware or from the kernel.
Comment 7 Juanjo Benages 2016-06-01 16:11:14 UTC
Created attachment 124240 [details]

This is the dmesg output
The kernel version is linux-image-4.5.0-2-amd64/testing,now 4.5.4-1 amd64
Comment 8 Benjamin Tissoires 2016-06-03 07:17:30 UTC
thanks for the dmesg. Here are my analysis:
- the touchpad is a synaptics one, using the non image sensor
- the touchpad support multi-finger but given the poor tracking, the kernel sets the SEMI_MT flag.

- finger jumps in the slotted touches are normal here, we are using semi-mt protocol
- at E: 0.542783, I don't think the ABS_X/Y are jumping, so you should be fine in term of scrolling for this event at least.

Peter: when we have semi-mt devices, we can't assume the kernel won't send jumps. So I think libinput should not tell user-space that there is a jump and should simply detect and discard the jumps.
Comment 9 Peter Hutterer 2016-06-12 23:53:37 UTC
ommit 92b21247f434037202e9ebb4355f08775d007ae2
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri Jun 10 10:30:24 2016 +1000

    touchpad: don't warn about kernel jumps on semi-mt devices

this silences the warning, I'm assuming you still see cursor jumps with the most recent libinput and a recent-ish kernel?
Comment 10 Juanjo Benages 2016-06-13 19:01:32 UTC
Yes, I am seeing some jumps with libinput 1.3.1 and kernel 4.5
Comment 11 Peter Hutterer 2016-06-14 01:20:48 UTC
renaming so the summery is easier to understand: libinput needs a way to detect jumps between slots on semi-mt devices, specifically when one slot ends and the remaining one takes over the coordinates of the recent slot.
Comment 12 Peter Hutterer 2016-06-17 02:17:25 UTC
looking at this again, we have the code for this already. tp_need_motion_history_reset() triggers when the number of finger changes so we paper over that slot change.

juanjo, I'll need an evemu recording that isolates the problem with a description of what type of jump you are seeing. In the recording from comment 3 I can see scroll events and pointer motion but it's hard for me to tell whether the pointer motion is intentional based on the recording itself.
Comment 13 Juanjo Benages 2016-06-29 19:47:31 UTC
I now have the kernel 4.6 and the scrolling behavior is better.
Comment 14 Peter Hutterer 2016-06-29 22:32:56 UTC
if it's good enough we can close this bug, otherwise I'll need some more evemu recordings like outlined in comment 12
Comment 15 Peter Hutterer 2016-07-13 00:49:03 UTC
how are we going with this bug?
Comment 16 Juanjo Benages 2016-07-14 07:27:26 UTC
Sorry for not responding before. You can close the bug.

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.