ubuntu 16.04 usb 设备自动挂起问题

usb 设备自动挂起问题

  • 现象

鼠标停止操作后3秒自动挂起,需要点击才能有反应;键盘也是,需要按一下按键才能有反应

It's a very old question, related with laptop-mode, but I'll post my solution:

In Ubuntu 14.04 I edited /etc/laptop-mode/conf.d/usb-autosuspend.conf and change this lines to blacklist usbhid:

# The list of USB driver types that should not use autosuspend.  The driver
# type is given by "DRIVER=..." in a USB device's uevent file.
# Example: AUTOSUSPEND_USBID_BLACKLIST="usbhid usb-storage"
## Old value: AUTOSUSPEND_USBTYPE_BLACKLIST=""
#AUTOSUSPEND_USBID_BLACKLIST="17ef:6050"
AUTOSUSPEND_USBTYPE_BLACKLIST="usbhid"

In Ubuntu 12.04 I must to edit /etc/laptop-mode/conf.d/runtime-pm.conf and change this lines to blacklist usbhid:

# The list of device driver types that should use autosuspend.  The driver
# type is given by "DRIVER=..." in a device's uevent file.
# Example: AUTOSUSPEND_DEVTYPE_WHITELIST="usbhid usb-storage"
## Old value: AUTOSUSPEND_RUNTIME_DEVTYPE_WHITELIST=""
AUTOSUSPEND_RUNTIME_DEVTYPE_WHITELIST="usbhid"

You can also blacklist usb-storage! and you can also blacklist device by ID (AUTOSUSPEND_RUNTIME_DEVID_WHITELIST in Ubuntu 12.04 or AUTOSUSPEND_USBID_BLACKLIST in Ubuntu 14.04).

Then you'll need to restart laptop mode for the changes to take effect:

sudo /etc/init.d/laptop-mode restart

And then replug mouse. The mouse will not suspend again.

This works for me at work (ubuntu 12.04) and home (ubuntu 14.04).

Hope It helps 😃

方法二:
https://www.cnblogs.com/tom-lau/p/9455202.html

vim /etc/laptop-mode/conf.d/usb-autosuspend.conf
CONTROL_USB_AUTOSUSPEND=0
BATT_SUSPEND_USB=0
LM_AC_SUSPEND_USB=0
NOLM_AC_SUSPEND_USB=0
AUTOSUSPEND_TIMEOUT=36000
AUTOSUSPEND_USBTYPE_BLACKLIST="usbhid usb-storage"

sudo /etc/init.d/laptop-mode restart
posted @ 2020-05-16 20:54  keep-minding  阅读(727)  评论(0编辑  收藏  举报