Bug 101094

Summary: Elantech touchpad too sensitive on ASUS Zenbook UX410UQ
Product: Wayland Reporter: mhbugreport
Component: libinputAssignee: Wayland bug list <wayland-bugs>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: medium CC: benjamin.tissoires, capsel+freedesktop, peter.hutterer
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Evemu output for Elantech touchpad using libinput
Kernel Log with boot option i2c_hid.debug=1
Hid-recording of the touchpad
Evemu-recording

Description mhbugreport 2017-05-19 06:33:44 UTC
Created attachment 131414 [details]
Evemu output for Elantech touchpad using libinput

Hi,
I am using libinput on an ASUS UX410UQ Elantech touchpad.
I am running Manjaro linux with kernal 4.9.27-1, and libinput version 1.7.2-1.

My main problem is that the touchpad is too sensitive, causing click, drag or select events with very light unintentional touches. 

I have tried setting the touchpad pressure range as mentionned in https://wayland.freedesktop.org/libinput/doc/latest/touchpad_pressure.html,
but there is no 'ABS_MT_PRESSURE' in the evemu output (attached).

It is usable, but I have to really pay attention to what I am doing to avoid unintentional events, which is quite unconvenient.

The other issue is that the double tap time is way too short, and I didn't find any way to set it. Here is my xinput list-props output : 

Device 'ELAN1200:00 04F3:3022 Touchpad':
	Device Enabled (139):	1
	Coordinate Transformation Matrix (141):	1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
	libinput Tapping Enabled (277):	1
	libinput Tapping Enabled Default (278):	0
	libinput Tapping Drag Enabled (279):	1
	libinput Tapping Drag Enabled Default (280):	1
	libinput Tapping Drag Lock Enabled (281):	0
	libinput Tapping Drag Lock Enabled Default (282):	0
	libinput Tapping Button Mapping Enabled (283):	1, 0
	libinput Tapping Button Mapping Default (284):	1, 0
	libinput Accel Speed (285):	-0.500000
	libinput Accel Speed Default (286):	0.000000
	libinput Natural Scrolling Enabled (287):	1
	libinput Natural Scrolling Enabled Default (288):	0
	libinput Send Events Modes Available (262):	1, 1
	libinput Send Events Mode Enabled (263):	0, 0
	libinput Send Events Mode Enabled Default (264):	0, 0
	libinput Left Handed Enabled (289):	0
	libinput Left Handed Enabled Default (290):	0
	libinput Scroll Methods Available (291):	1, 1, 0
	libinput Scroll Method Enabled (292):	1, 0, 0
	libinput Scroll Method Enabled Default (293):	1, 0, 0
	libinput Click Methods Available (294):	1, 1
	libinput Click Method Enabled (295):	1, 0
	libinput Click Method Enabled Default (296):	1, 0
	libinput Middle Emulation Enabled (297):	0
	libinput Middle Emulation Enabled Default (298):	0
	libinput Disable While Typing Enabled (299):	1
	libinput Disable While Typing Enabled Default (300):	1
	Device Node (265):	"/dev/input/event10"
	Device Product ID (266):	1267, 12322
	libinput Drag Lock Buttons (301):	<no items>
	libinput Horizontal Scroll Enabled (302):	1

Thanks for the great work, cheers !
Comment 1 Peter Hutterer 2017-05-22 10:13:22 UTC
hmm, that's not good. the problem is that your touchpad merely gives us x/y locations and nothing else. libinput's touch thresholds can't kick in here because, well, there are no thresholds we get. I'm sorry, we can't do anything here, there is no data we could use to make this more useful.

There's no CANTFIX resolution, so I'm choosing WONTFIX instead

CC-ing benjamin in case he has any more suggestions, but...
Comment 2 Peter Hutterer 2017-05-22 22:07:36 UTC
just seeing this one again - please file a separate bug for the tap time, thanks.
Comment 3 mhbugreport 2017-05-22 23:01:43 UTC
(In reply to Peter Hutterer from comment #1)
> hmm, that's not good. the problem is that your touchpad merely gives us x/y
> locations and nothing else. libinput's touch thresholds can't kick in here
> because, well, there are no thresholds we get. I'm sorry, we can't do
> anything here, there is no data we could use to make this more useful.
> 
> There's no CANTFIX resolution, so I'm choosing WONTFIX instead
> 
> CC-ing benjamin in case he has any more suggestions, but...

Thank you for your answer.

Do you have any idea where this absence of PRESSURE information from the touchpad could come from ?

Is it a hardware problem (which seems weird to me since it is a very recent notebook), or is it software (kernel, driver ?)

Cheers
Comment 4 Peter Hutterer 2017-05-22 23:44:09 UTC
boot with i2c_hid.debug=1 and attach the dmesg output please, that may have some information. And I guess the output from hid-record for a short touch sequence won't hurt either.
Comment 5 mhbugreport 2017-05-23 12:20:51 UTC
(In reply to Peter Hutterer from comment #4)
> boot with i2c_hid.debug=1 and attach the dmesg output please, that may have
> some information. And I guess the output from hid-record for a short touch
> sequence won't hurt either.

Could you please explain in more detail what booting with i2c_hid.debug=1 consists in as well as attaching the dmesg output ?

I am quite a beginner in playing with hardware/drivers :)
Comment 6 Peter Hutterer 2017-05-23 22:11:23 UTC
no worries. booting with that argument means hit a key at the grub prompt, select the entry to boot and add a module parameter to the boot command line. See the first answer to this question:
https://askubuntu.com/questions/19486/how-do-i-add-a-kernel-boot-parameter

dmesg is easiest via journal: journalctl -kb > kernel.log, then attach this here as bugzilla attachment (see the Add an attachment link)
Comment 7 mhbugreport 2017-05-25 17:30:47 UTC
Created attachment 131512 [details]
Kernel Log with boot option i2c_hid.debug=1
Comment 8 mhbugreport 2017-05-25 17:31:22 UTC
(In reply to Peter Hutterer from comment #6)
> no worries. booting with that argument means hit a key at the grub prompt,
> select the entry to boot and add a module parameter to the boot command
> line. See the first answer to this question:
> https://askubuntu.com/questions/19486/how-do-i-add-a-kernel-boot-parameter
> 
> dmesg is easiest via journal: journalctl -kb > kernel.log, then attach this
> here as bugzilla attachment (see the Add an attachment link)

Thank you for your answer, I have just attached the kernel log.

Cheers
Comment 9 Benjamin Tissoires 2017-06-02 08:08:26 UTC
Thanks for the log. However, it doesn't contain the debug information :)

No big deal, it's actually easier/better to just provide a hid-recording of the touchpad. Grab hid-replay from http://bentiss.github.io/hid-replay-docs/ and follow the instructions for compiling from the sources if you are not running Fedora.

Then provide a hid-recorder output of the touchscreen (run this as root).
Comment 10 mhbugreport 2017-06-08 15:10:08 UTC
(In reply to Benjamin Tissoires from comment #9)
> Thanks for the log. However, it doesn't contain the debug information :)
> 
> No big deal, it's actually easier/better to just provide a hid-recording of
> the touchpad. Grab hid-replay from http://bentiss.github.io/hid-replay-docs/
> and follow the instructions for compiling from the sources if you are not
> running Fedora.
> 
> Then provide a hid-recorder output of the touchscreen (run this as root).

Thanks for the reply, and sorry for the log which doesn't contain debug information, I guess I am definitely a beginner in this field :)

You will find attached the hid-recording of the touchpad.

Cheers
Comment 11 mhbugreport 2017-06-08 15:10:29 UTC
Created attachment 131808 [details]
Hid-recording of the touchpad
Comment 12 Benjamin Tissoires 2017-06-09 07:30:12 UTC
Thanks for the log.

After parsing the hid-recorder output, it seems the device simply doesn't export pressure/width information, which explains why the kernel doesn't export it.

There are 4 bytes at the end of each report which are tagged as proprietary protocol and constant that might or not be somewhat close to a pressure, but give it has been explicitly marked to be discarded I wonder if this is not just some left over from a different firmware version.

Anyway, long story short: we can't do much at the kernel level, we don't have more information than what we report to user space already.
Comment 13 Alexander Mishurov 2017-07-02 08:42:26 UTC
(In reply to Benjamin Tissoires from comment #12)
> Anyway, long story short: we can't do much at the kernel level, we don't
> have more information than what we report to user space already.

I have a Zenbook UX310UQ and a similar problem.

[    2.500440] input: ELAN1200:00 04F3:3022 Touchpad as /devices/pci0000:00/0000:00:15.1/i2c_designware.1/i2c-7/i2c-ELAN1200:00/0018:04F3:3022.0001/input/input12
[    2.501905] hid-multitouch 0018:04F3:3022.0001: input,hidraw0: I2C HID v1.00 Mouse [ELAN1200:00 04F3:3022] on i2c-ELAN1200:00

It's handled by the hid-multitouch module, not by the elan_i2c. When I unload the hid-multitouch and load the elan_i2c, a kernel can't recognise it. Can it be that the hardware is actually able to work in another mode and use another protocol and it just needs some appropriate firmware?

The problem with the absence of the pressure data is that a driver on 2 finger touches and releases can't choose a right action to do: to trigger right click or two finger scroll or start locked dragging which results in random right clicks and dragging selections during scrolling.

The problem can be partially solved in a userspace driver: to make some timeout between scrolls, eg when 2 finger scrolling changes direction, to block triggering right clicks and drags during scrolling, to make more precise limits for delta in coordinates which decide whether an event is a move or a touch-release, register right click drag only with a first two finger tap and move with the one finger. I'd been implementing these features for a FreeBSD Cypress driver which worked using IntelliMouse protocol, I made a simple state machine. But the solution is far from perfect anyway.

I think that the ambiguity in actions for a two-finger event can be also resolved by recording statistics of events and using some learning algorithm to tweak probabilities, and then to keep little history of events in a driver, for example ten recent events as an input data for inference.


I have made some hacks to the synaptics driver which merely block right clicks after two finger scrolling have started and unblock after a second release event and couple of additional checks, at least it doesn't make two finger scrolls painful infesting it with random right clicks, although makes right clicks somewhat complicated. I hope that there will be some advances with drivers from the hardware manufacturers.
Comment 14 mhbugreport 2017-11-13 13:41:10 UTC
After several kernel and libinput updates, my touchpad still behaves unpredictibly. That is, really too sensitive, and sometimes lagging and creating unwanted events (clicks, right clicks...)

Do you have any news on the support of this elantech touchpad, whether it will be improved or not ?

(As a comparison, the touchpad works just fine on my W$ dual-booted install)
Comment 15 Peter Hutterer 2017-11-15 03:09:42 UTC
Attach another evemu recording, with data please. As said above we don't seem to have any information that we can use to differentiate between a light and a true touch so I'm not sure there's much we can do. There's still the slim chances of the touchpad talking some other protocol but I wouldn't rely on it.

There are custom solutions that can reduce the level of pain but I'm hesitant to get those into libinput proper unless there is a significant percentage of users affected by it. Adding custom solutions like this add a lot of extra cost for maintenance.
Comment 16 mhbugreport 2017-11-17 13:12:09 UTC
Created attachment 135555 [details]
Evemu-recording

You will find attached a new evemu recording, with latest kernel version (4.14) and libinput (1.9.1-1)

On this recording, the touchpad behaved without particular bugs.
Comment 17 mhbugreport 2017-11-17 13:34:23 UTC
Also, there seems to be some Asus specific issue with the Elan touchpad :
https://bugs.freedesktop.org/show_bug.cgi?id=98770

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.