From: Jon Moeller <jon@moeller.io>
To: linux-input@vger.kernel.org
Subject: BUG: palm recognition / confidence is not working properly
Date: Tue, 16 Apr 2024 11:21:10 -0700 [thread overview]
Message-ID: <CABWf9sZRWoqn1iZA4538rWgxt1SEk3FmKnyxpxzok6W9Hgvr7A@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 3922 bytes --]
Hello -
I think I've found a bug, either with hid-multitouch, or with the
quirks for my device.
I have an HP Spectre x360, which has a nice haptic touchpad, with
excellent finger tracking; the model is ELAN07CE:00 04F3:32C8
Touchpad.
I noticed that palm rejection wasn't working, and after some
investigation found that the touchpad uses "Confidence" as a way to
indicate whether a given touch is a finger or a palm. So I disabled
MT_QUIRK_ALWAYS_VALID and enabled MT_QUIRK_VALID_IS_CONFIDENCE.
While this worked, and palm touches were now not being sent via evdev,
occasionally the cursor will "lock up" after I have been typing or
doing other things that involve resting my palms on the touchpad. I've
examined the hidraw output during these situations, and the touchpad
is sending correct data.
I believe what is happening is that the kernel is holding a slot for a
finger/palm that is no longer there, and so all subsequent touches,
even if single-finger, are interpreted as "gestures" by libinput.
I've tried setting MT_QUIRK_SLOT_IS_CONTACTID, since the touchpad
reliably maps each touch to a contactID - this doesn't help.
I've tried using MT_QUIRK_CONFIDENCE instead, which seemed promising,
but never see any ABS_MT_TOOL_TYPE event codes (neither MT_TOOL_FINGER
or MT_TOOL_PALM) reported by evtest.
So my questions are:
1) Is the MT_QUIRK_VALID_IS_CONFIDENCE messing up event/slot tracking
somehow? The "lock up" doesn't happen when this quirk is not set.
I've attached a recording of the issue in the attached yaml file from
`libinput record --with-hidraw`. It includes the initial palm touches,
followed by a one finger motion that was ignored or misinterpreted
somewhere in the stack due to the prior palm touches, followed by a
6-finger touch on the touchpad, which reliably resets the tracking
state since the touchpad only supports 5 fingers.
2) Why am I unable to get MT_TOOL_FINGER or MT_TOOL_PALM reports to
show up anywhere? It seems like there is some kind of legacy emulation
going on (converting finger tools to BTN_TOOL?), but I haven't figured
out how or why this is happening.
Happy to provide more info if necessary.
Set of quirks I'm using:
default (no issues except false touches)
MT_QUIRK_ALWAYS_VALID | MT_QUIRK_CONTACT_CNT_ACCURATE
palm-reject (rejects palm, but appears to hold slots for fingers that
aren't there any more):
MT_QUIRK_VALID_IS_CONFIDENCE | MT_QUIRK_CONTACT_CNT_ACCURATE
use-tool (attempt to get "real" tools working - currently has the same
effect as default):
MT_QUIRK_CONFIDENCE | MT_QUIRK_CONTACT_CNT_ACCURATE
Thanks,
Jon
Attachments follow:
$ evtest /dev/input.event12
Input driver version is 1.0.1
Input device ID: bus 0x18 vendor 0x4f3 product 0x32c8 version 0x100
Input device name: "ELAN07CE:00 04F3:32C8 Touchpad"
Supported events:
Event type 0 (EV_SYN)
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 2470
Min 0
Max 4936
Resolution 31
Event code 1 (ABS_Y)
Value 696
Min 0
Max 3045
Resolution 31
Event code 47 (ABS_MT_SLOT)
Value 1
Min 0
Max 4
Event code 53 (ABS_MT_POSITION_X)
Value 0
Min 0
Max 4936
Resolution 31
Event code 54 (ABS_MT_POSITION_Y)
Value 0
Min 0
Max 3045
Resolution 31
Event code 57 (ABS_MT_TRACKING_ID)
Value 0
Min 0
Max 65535
Event type 4 (EV_MSC)
Event code 5 (MSC_TIMESTAMP)
Properties:
Property type 0 (INPUT_PROP_POINTER)
Property type 2 (INPUT_PROP_BUTTONPAD)
[-- Attachment #2: touchbug3.yaml --]
[-- Type: application/yaml, Size: 288274 bytes --]
reply other threads:[~2024-04-16 18:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CABWf9sZRWoqn1iZA4538rWgxt1SEk3FmKnyxpxzok6W9Hgvr7A@mail.gmail.com \
--to=jon@moeller.io \
--cc=linux-input@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).