Bug 104990

Summary: XPS13 L322X touchpad laggy
Product: Wayland Reporter: VF <f0rhum>
Component: libinputAssignee: Sean Lanigan <development>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: development, kai.heng.feng, peter.hutterer
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: HWDB entry for XPS13 L322X touchpad
Dell XPS13 L322X touchpad quirks
Dell XPS13 L322X touchpad quirks (updated to match more variants)
Dell XPS13 L322X touchpad quirks (updated to match more variants)

Description VF 2018-02-07 10:10:35 UTC
Hi
From there https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1746740
the touchpad frequently locks
This is with libinput10
Comment 1 VF 2018-02-07 10:11:54 UTC
THe version is 1.9.4-2
Comment 2 Daniel van Vugt 2018-02-09 02:01:18 UTC
Please clarify which version is laggy.

Above you mention "1.9.4-2" however on Launchpad it was said "1.9.4-2ubuntu1" [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1746740/comments/18]
Comment 3 VF 2018-02-09 10:09:58 UTC
Yes
dpkg -s libinput10 | grep Version
Version: 1.9.4-2ubuntu1

I could not select this version in the droplist above, and also I'm not sure it is Wayland as I read ubuntu 18.04 defaults to Xorg
Comment 4 VF 2018-02-10 17:00:25 UTC
dmesg|grep -i "ps/2"
[    0.805591] i8042: PNP: PS/2 Controller [PNP0303:PS2K,PNP0f13:PS2M] at 0x60,0x64 irq 1,12
[    0.813505] mousedev: PS/2 mouse device common for all mice
[    2.008952] input: CyPS/2 Cypress Trackpad as /devices/platform/i8042/serio1/input/input6
Comment 5 VF 2018-02-10 17:02:54 UTC
[EDIT] Above log if from K4.4.0-generic (ubuntu 14.04.5)
Comment 6 VF 2018-02-10 18:06:12 UTC
[EDIT] Above log if from K4.4.0-112-generic (ubuntu 14.04.5)
Comment 7 VF 2018-02-22 09:05:28 UTC
I found these additional information in Dell XP13-L322X specifications : 

Touchpad
Resolution: 250 cpi
Size:
Width: 96,8 mm (3,81")
Heitgh: 58,8 mm (2,31")


Please notice that I was not able to identify the device on Cypress web site, and that resolution information supplied by Dell for the L322X is very different than the one they give for the next very closely marketed model (XPS13-9333), which is:
Touchpad
Resolution:
Horizontal: 1275 dpi
Vertical: 1656 dpi
Size (same as L322X):
Width: 96,8 mm (3,81")
Heitgh: 58,8 mm (2,31")
Comment 8 Peter Hutterer 2018-03-21 03:54:53 UTC
Can you try with 1.10.3 please, this has had some improvements for the hysteresis that should make the device feel more responsive. If it's not fixed, please specify exactly what 'laggy' means in this context, thanks.
Comment 9 VF 2018-03-28 17:01:46 UTC
Hi. I did the test with latest 18.04 daily ubuntu with libinput10 1.10.3.
After reading the post of Silvio here https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1746740/comments/25 I feel I have to reword "laggy": "The sensitivity was WAY too high so the cursor could only be moved with extremely low pressure" he says, far better than I did. Usual pressure seems to lock the cursor in place after a very short movement.
I'd add I didn't reach to start a rectangle selection/capture with the touchpad, what I can usually do with quick double-tap to set the 1srt corner then move the cursor to the opposite corner where I want. I'll give another try within minutes and come back here only to say I succeeded.
Comment 10 VF 2018-03-28 17:15:06 UTC
Please ignore last 2 sentences: I can do selection with touchpad, with double-tap with very ultra-light light pressure : it seem this device has hidden capabilities, pressure dependant, that interfere with simple move feature.
Comment 11 Peter Hutterer 2018-04-03 04:35:26 UTC
Run the libinput measure touch-size tool please, or the libinput measure touchpad-pressure. Both as root, only one is likely to work on your device, depending on hw capabilities.

https://wayland.freedesktop.org/libinput/doc/latest/touchpad_pressure.html
Comment 12 Ekinoks 2018-04-06 15:26:43 UTC
Hello,

I have the same probleme here with my XPS L322X.
Where is the result of touchpad-pressure:

ekinoks@XPS-L322X: sudo libinput measure touchpad-pressure
Using CyPS/2 Cypress Trackpad: /dev/input/event6

Ready for recoding data.
Pressure range used: 25:30
Palm pressure range used: 130
Place a single finger on the touch to measure pressure values.
Ctrl+C to exit

Sequence 2397 pressure: min:  56 max: 159 avg: 101 median 100 tags: down palm
Sequence 2398 pressure: min:  57 max: 154 avg: 111 median 116 tags: down palm
Sequence 2399 pressure: min:  55 max: 146 avg: 101 median 101 tags: down palm
Sequence 2400 pressure: min:  18 max: 117 avg:  72 median  71 tags: down
Sequence 2401 pressure: min:  39 max: 130 avg: 102 median 102 tags: down


I think it's because of "down palm" that the mouse freezes.
Comment 13 VF 2018-04-08 13:58:51 UTC
Here my own measures:
ubuntu@ubuntu:~$ sudo libinput measure touch-size
Using CyPS/2 Cypress Trackpad: /dev/input/event6

Error: device does not have ABS_MT_TOUCH_MAJOR
ubuntu@ubuntu:~$ sudo libinput measure touchpad-pressure
Using CyPS/2 Cypress Trackpad: /dev/input/event6

Ready for recording data.
Pressure range used: 25:30
Palm pressure range used: 130
Place a single finger on the touchpad to measure pressure values.
Ctrl+C to exit

Sequence 145 pressure: min:  59 max: 131 avg: 111 median: 122 tags: down palm
Sequence 146 pressure: min:  69 max: 134 avg: 122 median: 125 tags: down palm
Sequence 147 pressure: min:  56 max:  90 avg:  78 median:  88 tags: down
Sequence 148 pressure: min:  31 max: 113 avg:  90 median:  99 tags: down
Sequence 149 pressure: min:  42 max: 120 avg:  94 median: 103 tags: down
Sequence 150 pressure: min:  44 max: 119 avg:  98 median: 109 tags: down
Sequence 151 pressure: min:  76 max: 123 avg: 107 median: 114 tags: down
Sequence 152 pressure: min:  48 max: 119 avg:  95 median: 106 tags: down
Sequence 153 pressure: min:  60 max: 107 avg:  90 median:  98 tags: down
Sequence 154 pressure: min:  77 max: 100 avg:  88 median:  94 tags: down
Sequence 155 pressure: min:  66 max:  94 avg:  83 median:  93 tags: down
Sequence 156 pressure: min:  39 max:  76 avg:  63 median:  70 tags: down
Sequence 157 pressure: min:  39 max: 108 avg:  87 median:  97 tags: down
Sequence 158 pressure: min:  29 max:  89 avg:  69 median:  84 tags: down
Sequence 159 pressure: min:  31 max:  91 avg:  69 median:  81 tags: down
Sequence 160 pressure: min:  10 max:  88 avg:  58 median:  62 tags: down
Sequence 161 pressure: min:  31 max:  87 avg:  66 median:  71 tags: down
Sequence 162 pressure: min:  23 max:  98 avg:  71 median:  80 tags: down
Sequence 163 pressure: min:  52 max: 102 avg:  81 median:  86 tags: down
Sequence 164 pressure: min:  37 max:  80 avg:  61 median:  65 tags: down
Sequence 165 pressure: min:  34 max:  87 avg:  68 median:  77 tags: down
Sequence 166 pressure: min:  42 max:  91 avg:  74 median:  78 tags: down
Sequence 167 pressure: min:  29 max:  97 avg:  76 median:  88 tags: down
Sequence 168 pressure: min:  34 max:  96 avg:  77 median:  88 tags: down
Sequence 169 pressure: min:  36 max:  90 avg:  72 median:  76 tags: down
Sequence 170 pressure: min:  53 max:  93 avg:  79 median:  87 tags: down
Sequence 171 pressure: min:  70 max: 118 avg: 100 median: 108 tags: down
Sequence 172 pressure: min:  40 max:  90 avg:  73 median:  80 tags: down
Sequence 173 pressure: min:  40 max:  94 avg:  76 median:  81 tags: down
Sequence 174 pressure: min:  42 max:  97 avg:  78 median:  86 tags: down
Sequence 175 pressure: min:  31 max:  96 avg:  73 median:  82 tags: down
Sequence 176 pressure: min:  36 max:  94 avg:  70 median:  78 tags: down
Sequence 177 pressure: min:  41 max:  73 avg:  61 median:  66 tags: down
Sequence 178 pressure: min:  10 max:  10 avg:  10 median:  10 tags:
Sequence 179 pressure: min:  25 max:  56 avg:  44 median:  50 tags: down
Sequence 180 pressure: min:  28 max:  69 avg:  54 median:  56 tags: down
Sequence 181 pressure: min:  26 max:  78 avg:  61 median:  72 tags: down
Sequence 182 pressure: min:  41 max:  96 avg:  77 median:  79 tags: down
Sequence 183 pressure: min:  43 max: 121 avg:  97 median: 104 tags: down
Sequence 184 pressure: min:  39 max: 126 avg:  97 median: 111 tags: down
Sequence 185 pressure: min:  49 max: 125 avg:  99 median: 113 tags: down
Sequence 186 pressure: min:  53 max: 121 avg:  99 median: 106 tags: down
Sequence 187 pressure: min:  32 max: 107 avg:  81 median:  95 tags: down
Sequence 188 pressure: min:  44 max:  85 avg:  68 median:  72 tags: down
Sequence 189 pressure: min:  41 max:  67 avg:  58 median:  63 tags: down
Sequence 190 pressure: min:  20 max: 106 avg:  80 median:  96 tags: down
Sequence 191 pressure: min:  47 max: 115 avg:  90 median:  97 tags: down
Sequence 192 pressure: min:  56 max: 109 avg:  90 median:  93 tags: down
Sequence 193 pressure: min:  50 max: 110 avg:  89 median:  92 tags: down
Sequence 194 pressure: min:  70 max: 104 avg:  91 median: 101 tags: down
Sequence 195 pressure: min:  69 max: 131 avg: 106 median: 118 tags: down palm
Sequence 196 pressure: min:  65 max: 127 avg: 103 median: 116 tags: down
Sequence 197 pressure: min:  87 max: 144 avg: 122 median: 136 tags: down palm
Sequence 198 pressure: min:  67 max: 149 avg: 121 median: 127 tags: down palm
Sequence 199 pressure: min:  54 max: 146 avg: 111 median: 112 tags: down palm
Sequence 200 pressure: min:  58 max: 128 avg: 104 median: 109 tags: down
Sequence 201 pressure: min:  54 max: 183 avg: 142 median: 152 tags: down palm
Sequence 202 pressure: min:  59 max: 168 avg: 138 median: 148 tags: down palm
Sequence 203 pressure: min:  56 max: 164 avg: 134 median: 147 tags: down palm
Sequence 204 pressure: min:  42 max: 106 avg:  86 median:  99 tags: down
Sequence 205 pressure: min:  52 max: 112 avg:  92 median: 101 tags: down
Sequence 206 pressure: min:  48 max:  73 avg:  61 median:  62 tags: down
Sequence 207 pressure: min:  49 max: 101 avg:  84 median:  87 tags: down
Sequence 208 pressure: min:  51 max:  91 avg:  75 median:  83 tags: down
Sequence 209 pressure: min:  57 max: 105 avg:  89 median:  97 tags: down
Sequence 210 pressure: min:  18 max:  29 avg:  25 median:  28 tags:
Sequence 211 pressure: min:  55 max:  72 avg:  63 median:  69 tags: down
Sequence 212 pressure: min:  28 max:  89 avg:  69 median:  79 tags: down
Sequence 213 pressure: min:  36 max: 111 avg:  90 median: 100 tags: down
Sequence 214 pressure: min:  33 max: 112 avg:  86 median:  95 tags: down
Sequence 215 pressure: min:  35 max: 121 avg:  96 median: 104 tags: down
Sequence 216 pressure: min:  50 max: 102 avg:  82 median:  87 tags: down
Sequence 217 pressure: min:  51 max: 109 avg:  89 median:  98 tags: down
Sequence 218 pressure: min:  51 max:  90 avg:  77 median:  83 tags: down
Sequence 219 pressure: min:  19 max: 110 avg:  82 median:  95 tags: down
Sequence 220 pressure: min:  28 max: 118 avg:  95 median: 111 tags: down
Sequence 221 pressure: min:  33 max: 107 avg:  83 median:  96 tags: down
Sequence 222 pressure: min:  39 max: 116 avg:  90 median:  99 tags: down
Sequence 223 pressure: min:  39 max: 109 avg:  84 median:  98 tags: down
Sequence 224 pressure: min:  42 max: 105 avg:  82 median:  92 tags: down
Sequence 225 pressure: min:  28 max:  94 avg:  72 median:  80 tags: down
Sequence 226 pressure: min:  32 max:  69 avg:  54 median:  58 tags: down
Sequence 227 pressure: min:  47 max:  92 avg:  74 median:  77 tags: down
Sequence 228 pressure: min:  43 max:  97 avg:  76 median:  80 tags: down
Sequence 229 pressure: min:  39 max:  82 avg:  66 median:  73 tags: down
Sequence 230 pressure: min:  20 max:  66 avg:  49 median:  54 tags: down
Sequence 231 pressure: min:  35 max:  58 avg:  48 median:  51 tags: down
Sequence 232 pressure: min:  19 max:  50 avg:  40 median:  45 tags: down
Sequence 233 pressure: min:  32 max:  56 avg:  47 median:  51 tags: down
Sequence 234 pressure: min:  25 max:  48 avg:  40 median:  42 tags: down
Sequence 235 pressure: min:   9 max:  25 avg:  19 median:  23 tags:
Sequence 236 pressure: min:  20 max:  30 avg:  25 median:  30 tags: down
Sequence 237 pressure: min:  12 max:  32 avg:  25 median:  27 tags: down
Sequence 238 pressure: min:  14 max:  27 avg:  21 median:  22 tags:
Sequence 239 pressure: min:  14 max:  47 avg:  34 median:  39 tags: down
Sequence 240 pressure: min:  12 max:  18 avg:  15 median:  17 tags:
Sequence 241 pressure: min:  21 max:  41 avg:  33 median:  36 tags: down
Sequence 242 pressure: min:  18 max:  39 avg:  31 median:  35 tags: down
Sequence 243 pressure: min:  17 max:  31 avg:  25 median:  27 tags: down
Sequence 244 pressure: min:  18 max:  29 avg:  23 median:  26 tags:
Sequence 245 pressure: min:  47 max:  98 avg:  75 median:  86 tags: down
Sequence 246 pressure: min:  64 max: 110 avg:  89 median:  99 tags: down
Sequence 247 pressure: min:  35 max:  64 avg:  52 median:  57 tags: down
Sequence 248 pressure: min:  51 max:  75 avg:  66 median:  74 tags: down
Sequence 249 pressure: min:  44 max: 104 avg:  81 median:  84 tags: down
Sequence 250 pressure: min:  27 max: 105 avg:  78 median:  86 tags: down
Sequence 251 pressure: min:  42 max: 104 avg:  78 median:  86 tags: down
Sequence 252 pressure: min:  38 max: 104 avg:  79 median:  87 tags: down
Sequence 253 pressure: min:  52 max: 130 avg: 102 median: 108 tags: down
Sequence 254 pressure: min:  51 max: 124 avg:  98 median: 105 tags: down
Sequence 255 pressure: min:  57 max: 114 avg:  88 median:  98 tags: down
Sequence 256 pressure: min:  62 max: 131 avg: 104 median: 106 tags: down palm
Sequence 257 pressure: min:  57 max: 113 avg:  89 median:  99 tags: down
Sequence 258 pressure: min:  47 max: 118 avg:  89 median:  97 tags: down
Sequence 259 pressure: min:  52 max: 130 avg: 102 median: 109 tags: down
Sequence 260 pressure: min:  55 max: 122 avg:  99 median: 111 tags: down
Sequence 261 pressure: min:  68 max: 103 avg:  87 median:  92 tags: down
Sequence 262 pressure: min:  56 max: 123 avg:  97 median: 104 tags: down
Sequence 263 pressure: min:  66 max: 129 avg: 107 median: 115 tags: down
Sequence 264 pressure: min:  75 max: 116 avg: 100 median: 106 tags: down
Comment 14 Peter Hutterer 2018-04-09 00:53:43 UTC
> I think it's because of "down palm" that the mouse freezes.

indeed, that would cause the touch to be ignored.

This is an iterative process and I need you to play around with the touch thresholds until you come up with one that works reliably, both for finger detection and palm detection. Please see https://wayland.freedesktop.org/libinput/doc/latest/touchpad_pressure.html#touchpad_pressure_hwdb for the details.

Ideally, the pressure thresholds should reliably detect touches but ignore accidental light brushes.
Comment 15 Sean Lanigan 2018-04-10 10:00:48 UTC
I also have a Dell XPS13 L322X, I've followed the steps linked to and have found that using 'libinput measure touchpad-pressure --touch-thresholds=105:60 --palm-threshold=230' seemed to work well.

I was not able to format it into the hwdb file, however, so couldn't actually test it on my machine.
Comment 16 Sean Lanigan 2018-04-10 10:04:05 UTC
I should note though that I don't really understand the full implications of the lower and upper thresholds - does "down" translate to a click? Or is "down" the minimum pressure required to actually move the cursor? If the latter, the values are much too high - I was thinking it was the former.
Comment 17 Peter Hutterer 2018-04-10 22:26:48 UTC
It's a so-called schmitt trigger, pressure needs to go above "down" to be detected as touch and below "up" to be released again. down > up to make the touch more resilient.

libinput:name:*CyPS/2 Cypress Trackpad:dmi:*svnDell:*pnXPSL322X*
 LIBINPUT_ATTR_PRESSURE_RANGE=105:60
 LIBINPUT_ATTR_PALM_PRESSURE_THRESHOLD=230

Something like this should work. Check /sys/class/dmi/id/modalias and adjust the dmi bit accordingly, make sure the svn and pn bits match. https://wayland.freedesktop.org/libinput/doc/latest/faq.html#faq_hwdb_changes

I'll need you to figure out that hwdb match though, I can't test this locally without the same machine so anything I'd merge is prone to be buggy.
Comment 18 Sean Lanigan 2018-04-11 09:44:33 UTC
Created attachment 138752 [details]
HWDB entry for XPS13 L322X touchpad

OK, I've done some playing and have the attached config - it seems to work pretty well for me. I've set the "palm detection" to be quite high, I was finding that when I did a click-drag it was triggering the palm detection.
Comment 19 Peter Hutterer 2018-04-11 23:04:48 UTC
Looks correct, thanks. Can you re-attach this as signed-off, git-formatted patch? This way I can directly apply it and you get all the credit and glory that comes with that ;)
Comment 20 Sean Lanigan 2018-04-12 11:21:26 UTC
Created attachment 138781 [details] [review]
Dell XPS13 L322X touchpad quirks

Sure, I think this should do it - this would be first patch submitted, let me know if it needs to be changed
Comment 21 Peter Hutterer 2018-04-13 01:28:57 UTC
Thanks, pushed

commit 69fe467fbacbc8376d548c335c79cca71b606b07
Author: Sean Lanigan <>
Date:   Thu Apr 12 21:17:00 2018 +1000

     Add Dell XPS13 L322X touchpad quirks

https://wayland.freedesktop.org/libinput/doc/latest/reporting_bugs.html#fixed_bugs
Comment 22 VF 2018-04-13 21:20:12 UTC
Thank you very much Sean (and freedesktop team), you were faster than I could : I've finished yesterday with fighting to have a persistent live usb key to work on this issue :)
Comment 23 VF 2018-04-14 13:27:08 UTC
@Sean
I could not have your tweak to work on my own laptop. I had to change it this way so that it matches:
 
+libinput:name:*CyPS/2 Cypress Trackpad:dmi:*svnDell*:pnXPSL322X*
+ LIBINPUT_ATTR_PRESSURE_RANGE=30:20
+ LIBINPUT_ATTR_PALM_PRESSURE_THRESHOLD=254
+
 ##########################################
 # Elantech
 ##########################################
 (only removed the "DellSystem" substring in :pn....)

Maybe the dmi id was changed in my bios (latest A10 IIRC) 

cat /sys/class/dmi/id/modalias
dmi:bvnDellInc.:bvrA10:bd08/28/2013:svnDellInc.:pnXPSL322X:pvr:rvnDellInc.:rn0PJHXN:rvrA00:cvnDellInc.:ct8:cvr0.1:

  Maybe :pn*XPS*L322X* would be wide & precise enough if Dell guys change this in a new bios release, e.g. DellSystemXPS[13]L322X.
Or lighter :pn*L322X*
Comment 24 Sean Lanigan 2018-04-15 02:51:21 UTC
Created attachment 138840 [details] [review]
Dell XPS13 L322X touchpad quirks (updated to match more variants)

As requested, I've modified my patch just slightly so that it matches more L322X machines. I've tested it and it still works on my machine.
Comment 25 Sean Lanigan 2018-04-15 02:54:12 UTC
Created attachment 138841 [details] [review]
Dell XPS13 L322X touchpad quirks (updated to match more variants)

Sorry, uploaded the wrong one - that was just the old patch again. Attached with *this* upload is the more generic version. 

Can my previous patch be reverted, and replaced with this one instead?
Comment 26 Peter Hutterer 2018-04-17 00:18:43 UTC
Yup, all done, thanks for the update.

commit ea52b0d57571bf2ae35c7fc45967a6f804baac22
Author: Peter Hutterer <>
Date:   Tue Apr 17 10:06:22 2018 +1000

     Revert "Add Dell XPS13 L322X touchpad quirks"


commit 5aec854ac315d91b284dd6299a1d5e66c62f08d2
Author: Sean Lanigan <>
Date:   Sun Apr 15 12:17:00 2018 +1000

     Add Dell XPS13 L322X touchpad quirks
Comment 27 Alfredo 2019-04-27 17:41:09 UTC
As the L322X and the L321X share the same touchpad. Would it be possible to include this solution for the L321X? I upgraded to ubunu 18.04 from 17.10 and seems like the problem with the touchpad is the same. Exactly as described here..
Comment 28 Alfredo 2019-04-27 21:49:10 UTC
I am trying to edit the modalias file, I even tried opening it as admin on nautilus.. however I keep getting the eror.. 
:"
Could not save the file “admin:///sys/devices/virtual/dmi/id/modalias”.
You do not have the permissions necessary to save the file. Please check that you typed the location correctly and try again."

Any ideas?
Comment 29 Peter Hutterer 2019-04-29 00:11:20 UTC
For reference, Alfredo's issue has moved to https://gitlab.freedesktop.org/libinput/libinput/issues/276

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.