Bug 100463 - Unusable pressure values on ETPS/2 Elantech Touchpad
Summary: Unusable pressure values on ETPS/2 Elantech Touchpad
Status: RESOLVED INVALID
Alias: None
Product: Wayland
Classification: Unclassified
Component: libinput (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Wayland bug list
QA Contact:
URL:
Whiteboard:
Keywords:
: 100449 100631 100696 100873 100927 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-03-30 08:47 UTC by Aleksey Vasilenko
Modified: 2017-09-11 03:22 UTC (History)
13 users (show)

See Also:
i915 platform:
i915 features:


Attachments
evemu.log (3.93 KB, text/x-log)
2017-03-30 08:47 UTC, Aleksey Vasilenko
Details
evemu2.log (38.23 KB, text/plain)
2017-04-03 06:28 UTC, Aleksey Vasilenko
Details
pressure-values.svg (10.04 KB, image/svg+xml)
2017-04-04 01:31 UTC, Peter Hutterer
Details
lenovo y700 elantech touchpad evemu-describe (3.82 KB, text/plain)
2017-04-25 22:58 UTC, Mohit Keswani
Details
lenovo y700-15isk elantech touchpad - evemu-record with libinput 1.6.3.1 (196.67 KB, text/plain)
2017-05-06 18:03 UTC, Mohit Keswani
Details
lenovo y700-15isk elantech touchpad - evemu-record with libinput 1.7.2.1 (287.88 KB, text/plain)
2017-05-06 18:06 UTC, Mohit Keswani
Details

Description Aleksey Vasilenko 2017-03-30 08:47:43 UTC
Created attachment 130560 [details]
evemu.log

After 1.7 update my Elantech touchpad on Asus UX301LA became unusable. After this changes things get back to normal:

diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index 674cf1c..7daa0f2 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -2388,8 +2388,8 @@ tp_init_pressure(struct tp_dispatch *tp,
        range = abs->maximum - abs->minimum;
 
        if (device->model_flags & EVDEV_MODEL_ELANTECH_TOUCHPAD) {
-               tp->pressure.high = 24;
-               tp->pressure.low = 10;
+               tp->pressure.high = 10;
+               tp->pressure.low = 8;
        } else if (device->model_flags & EVDEV_MODEL_CYAPA) {
                tp->pressure.high = 10;
                tp->pressure.low = 8;

evemu device info attached, here is udevadm output:
udevadm info /sys/class/input/event13 
P: /devices/platform/i8042/serio4/input/input16/event13
N: input/event13
E: DEVNAME=/dev/input/event13
E: DEVPATH=/devices/platform/i8042/serio4/input/input16/event13
E: ID_BUS=i8042
E: ID_INPUT=1
E: ID_INPUT_HEIGHT_MM=60
E: ID_INPUT_TOUCHPAD=1
E: ID_INPUT_TOUCHPAD_INTEGRATION=internal
E: ID_INPUT_WIDTH_MM=92
E: LIBINPUT_ATTR_RESOLUTION_HINT=31x31
E: LIBINPUT_DEVICE_GROUP=11/2/e/0:isa0060/serio4
E: LIBINPUT_MODEL_ELANTECH_TOUCHPAD=1
E: MAJOR=13
E: MINOR=77
E: SUBSYSTEM=input
E: USEC_INITIALIZED=2814847
Comment 1 aun 2017-03-30 12:15:12 UTC
*** Bug 100449 has been marked as a duplicate of this bug. ***
Comment 2 Peter Hutterer 2017-04-03 01:21:41 UTC
(In reply to Aleksey Vasilenko from comment #0)
> Created attachment 130560 [details]
> evemu.log

sorry, this log doesn't have any events in it, please attach one from a couple of normal finger motions, I have some tools here that help visualise what the ranges need to be - just to double-check the 10/8 range
Comment 3 Aleksey Vasilenko 2017-04-03 06:28:17 UTC
Created attachment 130652 [details]
evemu2.log

Record with finger movements.
Comment 4 Peter Hutterer 2017-04-04 01:31:04 UTC
Created attachment 130659 [details]
pressure-values.svg

urgh, yeah, the pressure range here is terrible. We'll need a device-specific hook for that but I agree, 8/10 seems like the right value here.
Comment 5 Atri 2017-04-16 09:59:09 UTC
Thanks, Aleksey! My laptop has an ELANTECH touchpad too and your patch helped a lot.
Comment 6 Peter Hutterer 2017-04-20 06:02:25 UTC
fwiw, I tidied this up so it will be available through a hwdb entry which is going to make your patch a bit easier/different:

https://lists.freedesktop.org/archives/wayland-devel/2017-April/033917.html
Comment 7 Paul Kocialkowski 2017-04-21 09:46:04 UTC
Hi, I've been experiencing similar trouble with an Elantech touchpad.

However, in my case the touchpad is connected through i2c (that's an Acer Chromebook R13 CB5-312T codename elm) and is not properly detected from the hwdb. The problem is really that the default values "Approximately the synaptics defaults" don't do well with my touchpad. To the extent that I can't really move the cursor unless I push quite hard on it.

Even if I get it to be selected by the hwdb, the current values (24:8) cause the same issue. However, moving to 10:8 solves it.

I have a bunch of devices with Elantech touchpads at disposal, both with the PS2 driver and with the i2c driver. Adding proper hwdb detection for the i2c touchpads and moving the values to 10:8 solves the issue.

What I'm going to do next is to prepare patches, that will apply on top of "touchpad: move the pressure range to a hwdb entry" and fix these issues.
Comment 8 Paul Kocialkowski 2017-04-21 09:49:18 UTC
Also, since this makes touchpads nearly unusable, I think this should be fixed in the 1.7.0 release (so prior to moving to a new major version, if I understood how things work correctly) so that distros (especially rolling-release ones) can get the fix ASAP.
Comment 9 Paul Kocialkowski 2017-04-21 11:33:12 UTC
Just sent out the patches to the mailing list. Comments and feedback are welcome :)
Comment 10 Peter Hutterer 2017-04-24 05:27:13 UTC
link to the series mentioned in comment #9: https://lists.freedesktop.org/archives/wayland-devel/2017-April/033930.html
Comment 11 Mohit Keswani 2017-04-25 22:58:54 UTC
Created attachment 131025 [details]
lenovo y700 elantech touchpad evemu-describe
Comment 12 Mohit Keswani 2017-04-25 22:59:35 UTC
Comment on attachment 131025 [details]
lenovo y700 elantech touchpad evemu-describe

Lenovo y700 elantech two finger scrolling not working
Comment 13 Peter Hutterer 2017-04-26 03:47:23 UTC
Mohit: evemu-describe ony prints the static description of the device, it doesn't look at events itself. evemu-record is what you'll need for this. 

https://wayland.freedesktop.org/libinput/doc/latest/touchpad_pressure.html
has a description on how to get to the values we're looking for.
Comment 14 Peter Hutterer 2017-04-27 03:41:28 UTC
*** Bug 100631 has been marked as a duplicate of this bug. ***
Comment 15 Peter Hutterer 2017-04-27 06:02:47 UTC
*** Bug 100696 has been marked as a duplicate of this bug. ***
Comment 16 Peter Hutterer 2017-05-02 02:13:37 UTC
Fixed with commit 1dfedc6995cf63e004bd3e0b1d22ae263feb7362, thanks!
Comment 17 Peter Hutterer 2017-05-05 04:50:38 UTC
*** Bug 100927 has been marked as a duplicate of this bug. ***
Comment 18 Peter Hutterer 2017-05-05 05:03:41 UTC
*** Bug 100873 has been marked as a duplicate of this bug. ***
Comment 19 Mohit Keswani 2017-05-06 18:03:55 UTC
Created attachment 131235 [details]
lenovo y700-15isk elantech touchpad - evemu-record with libinput 1.6.3.1
Comment 20 Mohit Keswani 2017-05-06 18:06:23 UTC
Created attachment 131236 [details]
lenovo y700-15isk elantech touchpad - evemu-record with libinput 1.7.2.1
Comment 21 Mohit Keswani 2017-05-06 18:09:37 UTC
(In reply to Peter Hutterer from comment #13)
> Mohit: evemu-describe ony prints the static description of the device, it
> doesn't look at events itself. evemu-record is what you'll need for this. 
> 
> https://wayland.freedesktop.org/libinput/doc/latest/touchpad_pressure.html
> has a description on how to get to the values we're looking for.

Sorry, I didnt get an update email. I checked your message now
I'm using Arch linux and when using version 1.6.3.1 of libinput everything is working fine. As soon as I upgrade above 1.7 the touchpad behaves weird.
The pressure value is off for two finger scroll and even moving the mouse pointer is difficult
Comment 22 Mohit Keswani 2017-05-06 18:10:27 UTC
I've uploaded two files mouse recording files. One which works fine 1.6.3.1 and the other which doesnt 1.7.2.1
Comment 23 Paul Kocialkowski 2017-05-07 09:06:08 UTC
Looks like the values you are getting should be compatible with the generic pressure values we set in 1.7.2. Could you double-check and confirm that you're not in fact using 1.7.1?
Comment 24 Peter Hutterer 2017-05-07 22:18:29 UTC
also note that evemu sits below libinput and isn't affected by the libinput version, so the same recording will work with any libinput version (and can show bugs that way)
Comment 25 cp 2017-07-17 10:44:34 UTC
Reopening. I can confirm this is still happening on my Samsung 870Z5G with Arch Linux and an Elantech touchpad, and it is definitely version-related.

While I was on 1.6.3 everything worked fine, but on both 1.7 and 1.8 the touchpad is unusable. I am currently using libinput 1.8.0.

I fixed it by following the instructions at https://wayland.freedesktop.org/libinput/doc/latest/touchpad_pressure.html with the values found by Paul. I created /etc/udev/hwdb.d/99-touchpad-pressure.hwdb containing:

svnSAMSUNGELECTRONICSCO.,LTD.:pn870Z5G/880Z5F
 LIBINPUT_ATTR_PRESSURE_RANGE=10:8

After a Wayland restart everything works again.

Combinations I tested:
libinput <= 1.6.3 + kernel < 4.12 -> ok
libinput <= 1.6.3 + kernel >= 4.12 -> touchpad not responding
libinput == 1.7.x + kernel == 4.11 -> bad pressure values
libinput == 1.8.0 + kernel == 4.11 -> bad pressure values
libinput == 1.8.0 + kernel == 4.11 + pressure fix -> ok
Comment 26 Peter Hutterer 2017-07-18 00:08:07 UTC
10:8 is the default pressure range for elantech touchpads now, so the above fix should not be needed. what's going on there?

Note that to apply the hwdb properties you need to *both* run udevadm hwdb --update *and* restart to make sure the property is applied to the device. What's the output of udevadm info /sys/class/input/eventX for your touchpad device?
Comment 27 Peter Hutterer 2017-08-23 06:07:30 UTC
ping?
Comment 28 Peter Hutterer 2017-09-11 03:22:39 UTC
closing, needinfo for too long


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.