Touchpads are unresponsive and laggy for small finger movements

Bug #1696929 reported by Daniel van Vugt
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
libinput
Fix Released
Medium
libinput (Ubuntu)
Fix Released
High
Daniel van Vugt
Declined for Artful by Timo Aaltonen
Bionic
Fix Released
High
Daniel van Vugt

Bug Description

Touchpads are unresponsive and laggy for small finger movements. This is a regression caused by the introduction of libinput, visible on at least Lenovo X1 Carbon gen 4 and 5, Dell XPS 13, and Apple Macbook Air.

WORKAROUND (1)

1. Log into "Ubuntu on Xorg" only. This workaround only works for Xorg.
2. sudo apt install xserver-xorg-input-synaptics
3. Tweak your personal preferences using 'synclient' (the GUI settings won't work any more). For example:
   synclient HorizHysteresis=0 VertHysteresis=0

WORKAROUND (2)

1. Downgrade to version 1.9.4-1 of libinput: https://launchpad.net/ubuntu/+source/libinput/1.9.4-1/+build/13855729
That version contained the fix for this bug, briefly.

RELEVANT UPSTREAM BUGS ABOUT THE SAME ISSUE:

https://bugs.freedesktop.org/show_bug.cgi?id=98839
https://bugs.freedesktop.org/show_bug.cgi?id=101428
https://bugs.freedesktop.org/show_bug.cgi?id=100752
https://bugs.freedesktop.org/show_bug.cgi?id=104470
https://bugs.freedesktop.org/show_bug.cgi?id=103619

ProblemType: Bug
DistroRelease: Ubuntu 17.10
Package: libinput10 1.6.3-1ubuntu1
ProcVersionSignature: Ubuntu 4.10.0-22.24-generic 4.10.15
Uname: Linux 4.10.0-22-generic x86_64
ApportVersion: 2.20.5-0ubuntu4
Architecture: amd64
Date: Fri Jun 9 14:52:18 2017
InstallationDate: Installed on 2017-06-08 (0 days ago)
InstallationMedia: Ubuntu 17.10 "Artful Aardvark" - Alpha amd64 (20170607)
SourcePackage: libinput
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Daniel van Vugt (vanvugt) wrote :
description: updated
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

An interesting test is to move your finger around in small circles on the touchpad. If the hysteresis is too high then you will see the cursor move in a more square-like shape.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

See also:
https://bugs.freedesktop.org/show_bug.cgi?id=98839
https://bugs.freedesktop.org/show_bug.cgi?id=94986

Hmm, if blacklisting or writing custom configs is the solution then maybe this bug should be hardware-specific.

summary: - Laptop touchpads are unresponsive (with hysteresis enabled by default)
+ X1 Carbon gen4 and gen5 touchpads are unresponsive and laggy
description: updated
Changed in libinput (Ubuntu):
importance: Undecided → High
Changed in libinput:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
Launchpad Janitor (janitor) wrote : Re: X1 Carbon gen4 and gen5 touchpads are unresponsive and laggy

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gnome-shell (Ubuntu):
status: New → Confirmed
Changed in libinput (Ubuntu):
status: New → Confirmed
Revision history for this message
Timo Aaltonen (tjaalton) wrote :
Changed in libinput (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Yes it sounds like Peter had already prototyped something like what I later suggested in
https://bugs.freedesktop.org/show_bug.cgi?id=98839#c27

However I already know that's not going to fix this problem. Fixing hysteresis like that only solves the problem of the cursor moving in squares when the finger is moved in circles, at most. Whereas the X1 Carbon gen4/gen5 (and possibly X1 Yoga too) require all hysteresis to be turned _off_. This is because the hardware itself starting in gen4 has so much hysteresis built in (firmware change?) that any additional hysteresis in software makes it unusable. I can move my finger almost a centimeter before the cursor moves...

summary: - X1 Carbon gen4 and gen5 touchpads are unresponsive and laggy
+ Touchpads are unresponsive and laggy
Changed in libinput (Ubuntu):
status: Incomplete → Confirmed
no longer affects: gnome-shell (Ubuntu)
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Re: Touchpads are unresponsive and laggy

Workaround:

1. sudo apt install xserver-xorg-input-synaptics
2. Log out
3. On the login screen select session "Ubuntu on Xorg"
4. After logging in, disable hysteresis:
   synclient HorizHysteresis=0 VertHysteresis=0

This won't cure laggy hardware but it will at least eliminate the software lag in touchpad response.

Next, since you're now using Xorg and not Wayland, you likely are also using the Intel graphics driver for Xorg. The intel xorg graphics driver is also laggier than Wayland by default (by one frame or ~16.6ms). You can fix that by creating a /etc/X11/xorg.conf with:

Section "Device"
  Identifier "MyLaptop"
  Driver "intel"
  Option "TripleBuffer" "off"
EndSection

Although this does risk hurting the framerate smoothness of gnome-shell while it is still relatively young and un-optimized, you can choose between smoother graphics ("TripleBuffer" "on") or lower latency ("TripleBuffer" "off").

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Don't forget to also 'chmod 644 /etc/X11/xorg.conf' or else logging in may fail.

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

intel hasn't been the default driver since 16.10, modesetting is (on gen4 and up)

Revision history for this message
Daniel van Vugt (vanvugt) wrote : Re: X1 Carbon gen4 and gen5 touchpads are unresponsive and laggy

Ah, yes sorry.

I've changed the bug title again because generalizing was just asking for trouble. There would be a never-ending stream of "me too! not fixed!" from other users with other hardware.

summary: - Touchpads are unresponsive and laggy
+ X1 Carbon gen4 and gen5 touchpads are unresponsive and laggy
Changed in libinput:
status: Confirmed → Fix Released
Changed in libinput (Ubuntu):
status: Confirmed → Fix Committed
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Fix not actually committed to anything in Ubuntu yet. Turns out the fix is in master, so that's probably libinput 2.0 and not 1.9 :P

Changed in libinput (Ubuntu):
status: Fix Committed → Triaged
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Correction: libinput 1.10 comes after 1.9. Expect the fix in libinput 1.10

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Fix for bionic attached.

Although if someone wants to make it a fix for Debian in general then that's fine too.

Changed in libinput (Ubuntu):
assignee: nobody → Daniel van Vugt (vanvugt)
status: Triaged → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libinput - 1.9.4-1

---------------
libinput (1.9.4-1) unstable; urgency=medium

  * New upstream release.
  * Add fix-lp1696929.patch to fix unresponsive/laggy touchpad behaviour
    caused by inappropriate use of software hysteresis (LP: #1696929).
    Thanks, Daniel van Vugt!

 -- Timo Aaltonen <email address hidden> Thu, 14 Dec 2017 12:40:25 +0200

Changed in libinput (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

note that this patch does not work properly, it seems to be too aggressive disabling hysteresis so I dropped it from Debian, see https://bugs.debian.org/884599

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

reopening, as libinput got autosynced

Changed in libinput (Ubuntu Bionic):
status: Fix Released → Triaged
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I'll see what upstream has to say about a plan for v1.10 ...

Revision history for this message
Daniel van Vugt (vanvugt) wrote : Re: Touchpads are unresponsive and laggy

Generalised the bug title again. I now realise other common machines like the Dell XPS 13 and Macbook Air 13 experience this same bug. In all cases I have to revert to a Xorg session and installing xserver-xorg-input-synaptics to be able to use the touchpad adequately.

summary: - X1 Carbon gen4 and gen5 touchpads are unresponsive and laggy
+ Touchpads are unresponsive and laggy
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Timo,

Any chance we could patch this for bionic only? No need to wait for libinput release 1.10. Just take the fixes that are in the master branch already and backport.

That would avoid clashing with James using Debian. Actually in general I think many more people will need the fix than the status quo. It would be very bad if the LTS went out without this fixed. A dramatic step backwards for lots of people. And many of them won't know it's coming until they do their LTS upgrade.

In my mind this libinput fix is more important than just about everything else graphical and interactive because without it, the desktop is just too frustrating to use. And worse, the primary workaround for this bug is to revert to Xorg+synaptics, so we also lose the dream of being able to stay in Wayland.

description: updated
description: updated
summary: - Touchpads are unresponsive and laggy
+ Touchpads are unresponsive and laggy for small finger movements
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Actually we may be blocked waiting to see if the first fix for James' issue lands:

https://lists.freedesktop.org/archives/wayland-devel/2018-January/036475.html

We should include that if it does.

The second fix for James' issue we can ignore providing it stays a kernel problem:

https://bugs.freedesktop.org/show_bug.cgi?id=104533

description: updated
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

I don't understand how we can ignore a well known regression? If there's a kernel patch as a result then surely we'll want it in bionic?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Actually we don't need to ignore it. We can release the fixes for the regression. The fixes are:

1. libinput: https://lists.freedesktop.org/archives/wayland-devel/2018-January/036475.html (not landed yet)
2. kernel: https://bugs.freedesktop.org/show_bug.cgi?id=104533 (not tested yet)

James will need both, but as I understand it only the libinput fix is required for all touchpads in general. So we only need to wait for #1. I plan on testing it across a few laptops this week to get ahead of the ball.

description: updated
description: updated
description: updated
Changed in libinput (Ubuntu Bionic):
status: Triaged → In Progress
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

A fresh fix for bionic, that should satisfy everyone now.

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

uploaded, stuck in the queue like everything else

Changed in libinput (Ubuntu Bionic):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libinput - 1.9.4-2ubuntu1

---------------
libinput (1.9.4-2ubuntu1) bionic; urgency=medium

  * Restore and refresh fix-lp1696929.patch to fix unresponsive/laggy touchpad
    behaviour caused by inappropriate use of software hysteresis (LP: #1696929)
    This time the patch includes the fix for Debian bug #884599.

 -- Daniel van Vugt <email address hidden> Mon, 22 Jan 2018 16:18:09 +0800

Changed in libinput (Ubuntu Bionic):
status: Fix Committed → Fix Released
Changed in libinput:
status: Fix Released → Confirmed
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Yes, upstream reopened this bug because it regressed. I'm not sure how we want to handle that in Launchpad.

Changed in libinput:
status: Confirmed → Fix Released
Revision history for this message
Dan Dascalescu (ddascalescu+launchpad) wrote :

I see a much worse version of this problem on my brand new ThinkPad X1 Carbon 6th gen: the mouse cursor moves/clicks only about 5% of the time I use the touchpad. The Trackpoint doesn't work at all. Installing Ubuntu was a keyboard-only affair, and I hoped that some updates would fix this dealbreaker issue. In Ubuntu Budgie 18.04, the mouse worked fine after the DE started up, but was frozen during the startup for ~30 seconds. So this isn't a hardware problem.

I've already installed xserver-xorg-input-synaptics and rebooted - no luck.

What else can I try? The mouse responds normally but only ~5% of the time I use the touchpad (move cursor, or tap/click).

Revision history for this message
Dan Dascalescu (ddascalescu+launchpad) wrote :

Actually my issue is much closer to bug 1791427 (comment #62).

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Regardless, this bug is closed. If you have any new problems with xserver-xorg-input-synaptics installed then please open a new bug by running:

  ubuntu-bug xserver-xorg-input-synaptics

Otherwise please run:

  ubuntu-bug libinput

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.