linux-surface / iptsd

Userspace daemon for Intel Precise Touch & Stylus
GNU General Public License v2.0
98 stars 47 forks source link

Multitouch index tracking issue #11

Open tarmack opened 4 years ago

tarmack commented 4 years ago

When touching the screen with only one finger everything seems fine. When having one finger on the screen and touching another to the left of the first one all is fine.

When having one finger on the screen and touching another to the right of it, I get an error from libinput debug-gui. When releasing the second finger the light dot for "last know position" gets drawn where the first finger is.

The output from libinput debug-gui:

[touch 2]
libevdev: BUG: Device "IPTS Touch" received a double tracking ID 1 in slot 0.
libevdev error in sanitize_event: BUG: Device "IPTS Touch" received a double tracking ID 1 in slot 0.
[release 2]
libevdev: BUG: Device "IPTS Touch" received a double tracking ID 1 in slot 0.
libevdev error in sanitize_event: BUG: Device "IPTS Touch" received a double tracking ID 1 in slot 0.

This is on a Pro 2017, so the sensor is left/right is reversed.

StollD commented 4 years ago

As it seems libinput can't handle if an input suddenly switches the slot (i.e. finger 1 switching from being reported in slot 1 to being in slot 0).

I pushed a commit that should fix this by tracking the slot too and making sure it is always the same as the finger index. For me it fixes the libinput errors and the input jumping across the screen. Could you try if it works for you too?

StollD commented 4 years ago

Side note: This also slightly improves zoom / rotation behaviour for me in Krita.

tarmack commented 4 years ago

This change does make the error go away but for me it seems to actually make the zoom/rotate (in Google maps) worse.

In the debug screen I can see that the light red dot of the second finger gets moved to the first fingers location at the moment that the first finger has a detection interruption as described in issue #10 .

I suspect that the problem that remains (or even the only problem there ever was) is the detection glitches in issue #10 .

I think it is best to let this issue rest for now until we can find a way to prevent the glitches.

StollD commented 4 years ago

That sounds like both fingers loose contact for a short moment. When the input is registered again, the previous frame that iptsd caches won't contain any contacts anymore, so there is no way for finger tracking to say that finger 1 is still finger 1 and not finger 0. So finger 1 will be lifted up, while finger 0 moves across the display, as far as libinput is concerned.

The evtest log could clarify some things. Could you try to reproduce the issue, while having sudo evtest > evtest.log running (with the IPTS Touch device selected), and then upload the produced logfile?

tarmack commented 4 years ago

Looking at it with evtest, I suspect that the portion below may help in finding the issue:

Event: time 1594587835.910232, -------------- SYN_REPORT ------------
Event: time 1594587835.923414, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 7142
Event: time 1594587835.923414, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 1298
Event: time 1594587835.923414, -------------- SYN_REPORT ------------
Event: time 1594587835.924158, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value -1
Event: time 1594587835.924158, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 0
Event: time 1594587835.924158, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 0
Event: time 1594587835.924158, -------------- SYN_REPORT ------------
Event: time 1594587835.924768, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 0
Event: time 1594587835.924768, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 7141
Event: time 1594587835.924768, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 1296

It looks like id -1 shines trough, if I'm not mistaken that is an internal value to mark touches that are duplicates.

tarmack commented 4 years ago

I also noticed this section where the reports seem to get split, although that could just be an output thing?

Event: time 1594587834.800965, -------------- SYN_REPORT ------------
Event: time 1594587834.801807, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 1302
Event: time 1594587834.801807, -------------- SYN_REPORT ------------
Event: time 1594587834.813589, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 7147
Event: time 1594587834.813589, -------------- SYN_REPORT ------------
Event: time 1594587834.826758, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 7146
Event: time 1594587834.826758, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 1303
Event: time 1594587834.826758, -------------- SYN_REPORT ------------
Event: time 1594587834.839983, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 1304
Event: time 1594587834.839983, -------------- SYN_REPORT ------------
Event: time 1594587834.840771, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 1302
Event: time 1594587834.840771, -------------- SYN_REPORT ------------
Event: time 1594587834.855186, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 7145
Event: time 1594587834.855186, -------------- SYN_REPORT ------------
Event: time 1594587834.869894, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 1301