Ubuntu 24.04 usb power saving mode setting

 

The problem

I have an android phone sharing the the wifi network through a usb cable with my dell PC running on Ubuntu 24.04. After a certain time, the usb connection will stop automatically. It seems related to the power saving setting. The solution is to change it.

The solution

######## temporary fix ########
# check the current setting
$ cat /sys/module/usbcore/parameters/autosuspend
$ 2 # if you see 2, you are in power saving mode
# update it to -1
$ echo -1 > /sys/module/usbcore/parameters/autosuspend

######## permanent fix ########
# add usbcore.autosuspend=-1 to /etc/default/grub, append to the variable GRUB_CMDLINE_LINUX_DEFAULT
$ vim /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash usbcore.autosuspend=-1" # for example like this
$ sudo update-grub

Reference

Are all of your usb devices disconnecting periodically, for seemingly no reason? Here's the fix
byu/lasercat_pow inlinux


[1]: Ubuntu USB autosuspend disable. (n.d.). Gist. https://gist.github.com/gpetuhov/cb2f53d438ad7b9051c72f5c2149f84f


Comments