我为此绞尽脑汁好几天了……我浏览了几个论坛……等等,但都无济于事。我的机器是 Dell Optiplex 330,最初运行的是 Windows 10,USB 键盘/鼠标唤醒功能运行良好。现在,无论我做什么,似乎都无法使用键盘和/或鼠标将计算机从挂起状态唤醒。有什么想法吗?
答案1
以下是一个纯 udev 方式来执行建议的操作https://askubuntu.com/a/848699/1048516。
- 成为 root
- 大致了解鼠标和键盘的连接位置:
# udevadm info /dev/input/by-path/*-kbd
P: /devices/pci0000:00/0000:00:14.0/usb2/2-3/2-3.1/2-3.1:1.0/0003:045E:001D.0002/input/inp
ut4/event4
[...]
# udevadm info /dev/input/by-path/*-mouse | grep P:
P: /devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4:1.0/0003:046D:C03D.0001/input/input3/event3
P: /devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4:1.0/0003:046D:C03D.0001/input/input3/mouse0
- 从路径上看,键盘位于 usb2/2-3/2-3.1,鼠标位于 usb2/2-4
- 检查当前唤醒状态:
# grep . /sys/bus/usb/devices/*/power/wakeup
/sys/bus/usb/devices/1-1/power/wakeup:disabled
/sys/bus/usb/devices/2-10/power/wakeup:disabled
/sys/bus/usb/devices/2-3.1/power/wakeup:disabled
/sys/bus/usb/devices/2-3/power/wakeup:disabled
/sys/bus/usb/devices/2-4/power/wakeup:disabled
/sys/bus/usb/devices/2-8/power/wakeup:disabled
/sys/bus/usb/devices/4-1/power/wakeup:disabled
/sys/bus/usb/devices/usb1/power/wakeup:disabled
/sys/bus/usb/devices/usb2/power/wakeup:disabled
/sys/bus/usb/devices/usb3/power/wakeup:disabled
/sys/bus/usb/devices/usb4/power/wakeup:disabled
- 将以下内容添加到文件 /etc/udev/rules.d/10-wake-computer-with-keyboard-or-mouse.rules
# /etc/udev/rules.d/10-wake-computer-with-keyboard-or-mouse.rules
# - enable wakeup on ALL USB hubs (0-99)
# e.g. ls /sys/bus/usb/devices/usb*
# - rumor is that this step may not be necessary
# on all computers
# (I couldn't figure out how to enable wake on
# only parent hub of the keyboard and mouse.)
KERNEL=="usb[0-9]|usb[0-9][0-9]", SUBSYSTEM=="usb", DRIVER=="usb", ATTR{power/wakeup}="enabled"
# enable wakeup for all keyboards
# Keyboards are HID class 3 protocol 1 devices.
SUBSYSTEM=="usb", ATTRS{bInterfaceClass}=="03", ATTRS{bInterfaceProtocol}=="01", ATTR{../power/wakeup}="enabled"
# enable wakeup for all mice (button click, not movement)
# Mice are HID class 3 protocol 2 devices.
SUBSYSTEM=="usb", ATTRS{bInterfaceClass}=="03", ATTRS{bInterfaceProtocol}=="02", ATTR{../power/wakeup}="enabled"
- 重新加载并触发 udev:
# systemctl restart udev.service
# udevadm trigger
- 再次检查允许唤醒状态:
# grep . /sys/bus/usb/devices/*/power/wakeup
/sys/bus/usb/devices/1-1/power/wakeup:disabled
/sys/bus/usb/devices/2-10/power/wakeup:disabled
/sys/bus/usb/devices/2-3.1/power/wakeup:enabled
/sys/bus/usb/devices/2-3/power/wakeup:disabled
/sys/bus/usb/devices/2-4/power/wakeup:enabled
/sys/bus/usb/devices/2-8/power/wakeup:disabled
/sys/bus/usb/devices/4-1/power/wakeup:disabled
/sys/bus/usb/devices/usb1/power/wakeup:enabled
/sys/bus/usb/devices/usb2/power/wakeup:enabled
/sys/bus/usb/devices/usb3/power/wakeup:enabled
/sys/bus/usb/devices/usb4/power/wakeup:enabled
- 测试(多种方法之一)
# systemctl unmask suspend.target
# systemctl suspend
答案2
尽管很少,但我以前也经历过这种情况。
尝试插入 ps/2 键盘和/或鼠标,看看是否能解决您的问题。
一些主板存在 USB 端口“进入睡眠状态”的问题。
另外,重新启动,进入 BIOS 并检查您用于 kybd/鼠标的 USB 端口是否完全处于活动状态。BIOS 使用不同的功能和术语来描述这一点。寻找最不可能让 USB 端口进入睡眠状态的下拉选项。