2

Sometimes, when I wake my laptop from sleep, the touchpad acts funny. The mouse pointer jump on the screen and it is really hard to control the mouse. I tried to turn of and on the touchpad in ubuntu control center, hoping this will unload and load the module and it didn't help. Restarting the machine solve this.

Yotam
  • 1,428

5 Answers5

2

I have the same problem with synaptics touchpad on my HP Probook G6 after sleep on ubuntu 18.04. The solution is the same as V-Mark suggested, but reloading i2c_hid module instead of hid_multitouch.

sudo rmmod i2c_hid
sudo modprobe i2c-hid

And it starts to work smooth.

2

Restarting the driver helps:

Just Ctrl+alt+T, and run:

sudo rmmod psmouse

sudo modprobe psmouse

On a Macbook I think you may need to use "appletouch" instead of psmouse.

NoBugs
  • 1,400
2

It is an old topic, but I want to answer my solution, because it seems that pointer devices does not really like other power states.
BTW this is a good way for module "reset" if you have problems with a device after suspend/hibernate etc, not just for touchpad.

My problem was exactly the same:
- After hibernate, my touch pad was hard to use,
- but my connected USB mouse was OK.

Following the answer from NoBugs I realized with

lsmod | grep touch

that my device name is "hid_multitouch"

sudo rmmod hid_multitouch
sudo modprobe hid_multitouch

... and my touch pad worked well again.

I wrote a script to a file in /etc/pm/sleep.d

sudo pico /etc/pm/sleep.d/20_touchpad_reset

with the following content:

case "${1}" in thaw) rmmod hid_multitouch modprobe hid_multitouch ;; esac

... and made it executable with

sudo chmod +x /etc/pm/sleep.d/20_touchpad_reset

This snippet makes exactly the same as the above mentioned commands, but
- automatically
- run only after hibernation
from now on

sudo pm-hibernate

working nicely.

BUT pm-tools are not used by decent Ubuntu (Debian), so we need to install a service for systemd.

For this I created I created a service file:

sudo pico /lib/systemd/system/touchpad-reset.service

with the following text:
[Unit] Description=Reset multitouch device after hibernate After=hibernate.target After=hybrid-sleep.target [Service] ExecStart=/bin/bash /etc/pm/sleep.d/20_touchpad_reset thaw [Install] WantedBy=hibernate.target WantedBy=hybrid-sleep.target ... then I acivated my new service:

sudo systemctl enable touchpad-reset.service

You can check if everything worked well with:

sudo systemctl status touchpad-reset.service

V-Mark
  • 302
0

Systemctl service didn't work for me. It would not always execute. So what I did was:

  • First you need to find your touchpad name with either lsmod | grep touch or lsmod | grep mouse, mine was psmouse
  • Then try if your mouse if working well after executing these two command in your terminal
sudo rmmod your_device_name
sudo modprobe your_device_name
  • If the two commands are working, and the mouse is not laggy anymore, you can add the command to a file that will always execute after resuming. To do so:

  • Create a file: sudo nano /lib/systemd/system-sleep/touchpad-restart

  • Past this content into it:

#!/bin/sh
PATH=/sbin:/usr/sbin:/bin:/usr/bin
#you can add your own code there to test if the script is working
case "$1" in
    pre)
    ;;
    post)
            rmmod your_device_name
            modprobe your_device_name
 ;;
esac
exit 0
  • Now make the script executable sudo chmod +x /lib/systemd/system-sleep/touchpad-restart

You are done !

If you want to try if your script is working correctly, you can try one of these method.

  • We want to test if the script can simply execute, without the hibernation/waking-up sequence. The part that restart your mouse will only execute after waking-up from sleep. To try the script without having to hibernate/wake-up you can add a simple line at line 3 where the comment is. For example : echo "Hello" will print "Hello" in the terminal that is executing the script. To launch it manually type: /lib/systemd/system-sleep/touchpad-restart . Don't forget to delete the command after you are done testing.

  • You can also try if the script is working after waking-up by adding a command to write on a log file. To do this you will add a line after the modprobe your_device_name part because this is the part that is only executing after waking-up. You can write to a temporary log file, or to your home directory.

For the home directory add this line: echo $(date) >> $HOME/log.txt

For the temp directory add this line: echo $(date) >> /tmp/log.txt

Then put your computer to sleep and wake it up. You should find a line with the current date added to your log file if everything is working correctly. If temp file is not working, it could be a permission issue, write to your home directory instead.

  • The last method is risky for begginers. Try it if you know you can fix mistakes. Delete the line modprobe your_device_name in your code. Warning, this will not restart your mouse, and it will stop responding. To avoid this problem I recommend having a terminal open with the line you deleted already there. After waking-up, if your mouse is not working, it means that the command rmmod your_device_name is working, correctly. You can restart your device by pressing enter in the terminal with the command sudo modprobe your_device_name that was ready.
0

Running 17.04 on an HP ENVY 15 360 with the same issue. I tried the solutions provided to no avail.

Started just powering off instead of sleep every time. Super annoying.

Then it happened again, from fresh boot. So not power management at all.

Check to see if you are using the Synaptics driver, that may be the issue:

The details and solution here worked for me: Ubuntu touchpad issues - mouse pointer jumps around