How can we disable USB autosuspend on Ubuntu 18.04 for all USB devices and/or specific ones?
Previous questions on this subject are outdated (How can I disable usb-autosuspend for a specific device? and How to disable auto power off of usb devices like usb mouse?)
Edit: This question is completely unrelated to Two USB ports stopped working because my USB ports have not stopped working completely, but apparently and momentarily suspended for just a few (mili)seconds
Update, 20201014: Just received validation (see comment from "Blackbird") that this solution continues to work in 20.04. Thanks Blackbird for the useful feedback!
This reference seems to be authoritative on disabling usb autosuspend.
Although the USB autosuspend is a feature designed to preserve battery life, its' 18.04 default is "enabled", whether or not the device Ubuntu is being installed on even has a battery.
Further, in order for autosuspend to be more help than harm, it appears that the USB device's driver needs to support autosuspend. Hence all the posts- yours' included- seeking to disable the "feature".
In 18.04 on my device, I scripted disabling autosuspend persistently in
/etc/default/grub
like so:The
sed
expression just prepends "usbcore.autosuspend=-1" with a trailing space after the initial quote mark to ensure it always matches whatever your particular GRUB_CMDLINE_LINUX_DEFAULT options look like.If you execute
cat /sys/module/usbcore/parameters/autosuspend
after a reboot, you'll remark the "-1" preference (disabled) is retained.Anyhoo, hope this helped you out-
The solution above DID NOT help in my case (Ubuntu 21.10), but I found working solution for me: https://hackology.co.uk/2015/selective-usb-power-saving-linux-laptop/
From comments by the author:
Create a file for udev like this:
with the content of:
Create a file:
with the content of:
Run