These days Linux supports a lot of devices. However, occasionally you will find a device that works but only for a while, requiring a reboot to work again. This is often due to the device itself not behaving according to the USB standard, and that's more often than not caused by misbehaving USB suspend.
The proper way of fixing this would be either a workaround in the driver or, God forbid, a fix in the device's firmware. But quite often nobody does anything, so what's left is to do the improper. And the easiest improper fix is to disable USB autosuspend.
For the command line, just add usbcore.autosuspend=-1
to GRUB_CMDLINE_LINUX_DEFAULT
:
sudo sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="[a-z ]*/& usbcore.autosuspend=-1/' \
/etc/default/grub
sudo update-grub2
reboot
Once the system is up, you can check that the value is indeed -1
(disabled).
cat /sys/module/usbcore/parameters/autosuspend
sudo nano /var/lib/gdm3/.config/92-usb-input-no-powersave.rules
ACTION==”add”, SUBSYSTEM==”input”, TEST==”power/control”, ATTR{power/control}=”on”
sudo chown gdm:gdm /var/lib/gdm3/.config/92-usb-input-no-powersave.rules
https://hackology.co.uk/2015/selective-usb-power-saving-linux-laptop/
Thanks Josip. This is the only solution to Apple Magic Trackpad Series 1 disconnecting for several seconds every few minutes or so, that worked with my Intel NUC running Ubuntu 22.04. Typed in exact script and after reboot, bingo, Auto-Suspend shows up as -1 and problem now solved. Even eight years after this solution was published it still works many thanks Rob!
the solutions on the top of the page worked just fine, thanks :)