You are not logged in.
Pages: 1
I am trying to stop my mouse from waking my computer. Thought it would be simple.........
I am following the wiki instructions here: https://wiki.archlinux.org/title/Udev#W … USB_device . I am assuming that if I want to stop a device from waking the computer, I need to change "enabled" to "disabled".
So, I run the commands like the article says:
[root@HOSTNAME /]# lsusb | grep Razer
Bus 001 Device 005: ID 1532:0043 Razer USA, Ltd DeathAdder Chroma
Then I grep for the location under proc:
[root@HOSTNAME /]# grep 0043 /sys/bus/usb/devices/*/idProduct
/sys/bus/usb/devices/1-7/idProduct:0043
[root@pLAN9-Wil /]#
OK, so the wiki says I need to make a .rules file but replace the idVendor, idProduct, and the "driver/<whatever>/power/wakeup" with the values shown before. So I do that in /etc/udev/rules.d/50-wake-on-device.rules:
ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="1532", ATTRS{idProduct}=="0043", ATTR{power/wakeup}="disabled", ATTR{driver/1-7/power/wakeup}="disabled"
and..... fail. The mouse still wakes up the computer. I get the following errors in the journal:
Mar 26 15:51:34 HOSTNAME (udev-worker)[411]: 1-7:1.1: /etc/udev/rules.d/50-wake-on-device.rules:1 Failed to write ATTR{/sys/devices/pci0000:00/0000:00:01.2/0000:02:00.0/usb1/1-7/1-7:1.1/power/wakeup}, ignoring: No such file or directory
Mar 26 15:51:34 HOSTNAME (udev-worker)[411]: 1-7:1.1: /etc/udev/rules.d/50-wake-on-device.rules:1 Failed to write ATTR{/sys/devices/pci0000:00/0000:00:01.2/0000:02:00.0/usb1/1-7/1-7:1.1/driver/1-7/power/wakeup}, ignoring: No such file or directory
Mar 26 15:51:34 HOSTNAME (udev-worker)[414]: 1-7:1.0: /etc/udev/rules.d/50-wake-on-device.rules:1 Failed to write ATTR{/sys/devices/pci0000:00/0000:00:01.2/0000:02:00.0/usb1/1-7/1-7:1.0/power/wakeup}, ignoring: No such file or directory
Mar 26 15:51:34 HOSTNAME (udev-worker)[414]: 1-7:1.0: /etc/udev/rules.d/50-wake-on-device.rules:1 Failed to write ATTR{/sys/devices/pci0000:00/0000:00:01.2/0000:02:00.0/usb1/1-7/1-7:1.0/driver/1-7/power/wakeup}, ignoring: No such file or directory
Mar 26 15:51:34 HOSTNAME (udev-worker)[419]: 1-7:1.2: /etc/udev/rules.d/50-wake-on-device.rules:1 Failed to write ATTR{/sys/devices/pci0000:00/0000:00:01.2/0000:02:00.0/usb1/1-7/1-7:1.2/power/wakeup}, ignoring: No such file or directory
Mar 26 15:51:34 HOSTNAME (udev-worker)[419]: 1-7:1.2: /etc/udev/rules.d/50-wake-on-device.rules:1 Failed to write ATTR{/sys/devices/pci0000:00/0000:00:01.2/0000:02:00.0/usb1/1-7/1-7:1.2/driver/1-7/power/wakeup}, ignoring: No such file or directory
Really don't understand where I screwed up, I have no idea where those giant "Failed to write ATTR{......." directories are coming from, or why they show up 3 times, but they definitely doesn't exist......
Offline
I am trying to stop my mouse from waking my computer.
Do you mean waking from suspend or from hibernate? Or both?
Really don't understand where I screwed up, I have no idea where those giant "Failed to write ATTR{......." directories are coming from, or why they show up 3 times, but they definitely doesn't exist......
Because "1-7:1.1" component in "/sys/devices/pci0000:00/0000:00:01.2/0000:02:00.0/usb1/1-7/1-7:1.1/" path corresponds to an interface of USB device. Interfaces don't have idVendor/idProduct attribute as well as "power/wakeup". Probably you want
... ATTR{idVendor}=="1532", ATTR{idProduct}=="0043", ...
Note ATTR istead of ATTRS.
Also
ATTR{driver/1-7/power/wakeup}
looks redundant.
Offline
I mean suspend, I do not have hibernation enabled.
So you're saying the whole rules file should like this?:
ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0043", ATTR{power/wakeup}="disabled"
Because this still doesn't work, the error messages in the log are gone but the mouse still wakes up the computer....
Offline
So you're saying the whole rules file should like this?:
I explained where those directories are coming from: ATTRS matches all devices which parent node contain specifies attribute too, not only device itself.
Because this still doesn't work, the error messages in the log are gone but the mouse still wakes up the computer....
What "/sys/bus/usb/devices/1-7/power/wakeup" contain? Reload udev rules (`udevadm control -R`) and re-plug the mouse before checking. Or even better reboot for reliability.
Offline
What "/sys/bus/usb/devices/1-7/power/wakeup" contain? Reload udev rules (`udevadm control -R`) and re-plug the mouse before checking. Or even better reboot for reliability.
The file contains "enabled". I have been rebooting each time, no change.
Offline
The file contains "enabled". I have been rebooting each time, no change.
Output of
# udevadm info /sys/bus/usb/devices/1-7
?
What if you set it manually from command line:
# echo disabled > /sys/bus/usb/devices/1-7/power/wakeup
and suspend the system? Does mouse still wake it up? What is content of power/wakeup after waking up?
Offline
train__wreck wrote:The file contains "enabled". I have been rebooting each time, no change.
Output of
# udevadm info /sys/bus/usb/devices/1-7
P: /devices/pci0000:00/0000:00:01.2/0000:02:00.0/usb1/1-7
M: 1-7
R: 7
U: usb
T: usb_device
D: c 189:4
N: bus/usb/001/005
L: 0
V: usb
E: DEVPATH=/devices/pci0000:00/0000:00:01.2/0000:02:00.0/usb1/1-7
E: SUBSYSTEM=usb
E: DEVNAME=/dev/bus/usb/001/005
E: DEVTYPE=usb_device
E: DRIVER=usb
E: PRODUCT=1532/43/200
E: TYPE=0/0/0
E: BUSNUM=001
E: DEVNUM=005
E: MAJOR=189
E: MINOR=4
E: USEC_INITIALIZED=7516621
E: ID_BUS=usb
E: ID_MODEL=Razer_DeathAdder_Chroma
E: ID_MODEL_ENC=Razer\x20DeathAdder\x20Chroma
E: ID_MODEL_ID=0043
E: ID_SERIAL=Razer_Razer_DeathAdder_Chroma
E: ID_VENDOR=Razer
E: ID_VENDOR_ENC=Razer
E: ID_VENDOR_ID=1532
E: ID_REVISION=0200
E: ID_USB_MODEL=Razer_DeathAdder_Chroma
E: ID_USB_MODEL_ENC=Razer\x20DeathAdder\x20Chroma
E: ID_USB_MODEL_ID=0043
E: ID_USB_SERIAL=Razer_Razer_DeathAdder_Chroma
E: ID_USB_VENDOR=Razer
E: ID_USB_VENDOR_ENC=Razer
E: ID_USB_VENDOR_ID=1532
E: ID_USB_REVISION=0200
E: ID_USB_INTERFACES=:030102:030000:030101:
E: ID_VENDOR_FROM_DATABASE=Razer USA, Ltd
E: ID_MODEL_FROM_DATABASE=DeathAdder Chroma
E: ID_PATH=pci-0000:02:00.0-usb-0:7
E: ID_PATH_TAG=pci-0000_02_00_0-usb-0_7
E: ID_FOR_SEAT=usb-pci-0000_02_00_0-usb-0_7
E: TAGS=:seat:uaccess:
E: CURRENT_TAGS=:seat:uaccess:
What if you set it manually from command line:
# echo disabled > /sys/bus/usb/devices/1-7/power/wakeup
and suspend the system? Does mouse still wake it up? What is content of power/wakeup after waking up?
This not only stops the mouse from waking the computer, it stops the keyboard too...... It remains "disabled" after wake up.
Offline
Try this rule:
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0043", ATTR{power/wakeup}="disabled", RUN+="/usr/bin/logger -t udev 'Mouse attribute set to $attr{power/wakeup}'"
After reboot check journal:
# journalctl -b0 -t udev
Is attribute reported to be set to "disabled" but actual state is "enabled"?
If yes, probably some other udev rule or another piece of software (desktop environment?) overrides it.
This not only stops the mouse from waking the computer, it stops the keyboard too......
That's weird.
Last edited by dimich (2023-03-27 07:10:54)
Offline
cat /proc/acpi/wakeup
lsusb -tv
Mouse and keyboard likely hang on the same hub and only the hub can be configured to wake the system.
I am trying to stop my mouse from waking my computer.
Is the problem that it causes spurious wakeups or that you want to be able to move (unplug?) it w/o having it wake the system?
Online
Try this rule:
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0043", ATTR{power/wakeup}="disabled", RUN+="/usr/bin/logger -t udev 'Mouse attribute set to $attr{power/wakeup}'"
After reboot check journal:
# journalctl -b0 -t udev
Is attribute reported to be set to "disabled" but actual state is "enabled"?
If yes, probably some other udev rule or another piece of software (desktop environment?) overrides it.train__wreck wrote:This not only stops the mouse from waking the computer, it stops the keyboard too......
That's weird.
OK, I tried your udev rule. I get the expected output in the journal after boot:
Mar 27 02:45:06 HOSTNAME udev[439]: Mouse attribute set to disabled
But it still doesn't work, the mouse still wakes up the computer. "cat /sys/bus/usb/devices/1-7/power/wakeup" says enabled.....
Offline
cat /proc/acpi/wakeup lsusb -tv
Mouse and keyboard likely hang on the same hub and only the hub can be configured to wake the system.
I am trying to stop my mouse from waking my computer.
Is the problem that it causes spurious wakeups or that you want to be able to move (unplug?) it w/o having it wake the system?
It is causing spurious wakeups, even the act of walking across the room vibrates the mouse enough that it wakes up the system. I want to stop this from happening. I would like to still have the keyboard wake the system.
If you're saying that the only way to accomplish this is by disabling the entire USB hub from wakeup, then I guess that's what I'll have to do.....
Offline
Have you actually looked up the BIOS? There can be a switch there (I have one in mine) to enable or disable wakeup with mouse or keyboard.
Offline
Have you actually looked up the BIOS? There can be a switch there (I have one in mine) to enable or disable wakeup with mouse or keyboard.
I looked, I don't. The closest thing seemed to be a setting to allow "PCIE devices" to wake from sleep, I tried disabling that but the problem still persists.
Offline
* lower the mouse's resolution
* put it onto a better surface (mousepad?)
* duct tape …
And post the output of the previous commands, maybe you can just use a different slot for the mouse or keyboard to keep them apart.
Online
My method.
cat /proc/acpi/wakeup
pick your mouse code,.
sudo echo "code" > /proc/acpi/wakeup. This may require trial and error with different codes, but no need to reboot
This is not permanent and gets reset on boot so create a batch file similar to below and a systemd file similar to :-
**ie no-wake.service
[Unit]
Description=Disable devices mouse as wakeup
[Service]
ExecStart=/bin/bash /usr/local/bin/disable-devices-as-wakeup.sh
Type=oneshot
[Install]
WantedBy=multi-user.target
**ie. disable-devices-as-wakeup.sh
#!/bin/bash
#sh -c "echo UHC6 > /proc/acpi/wakeup"
declare -a devices=(UHC6) # <-- Add your entries here
for device in "${devices[@]}"; do
if grep -qw ^$device.*enabled /proc/acpi/wakeup; then
sudo sh -c "echo $device > /proc/acpi/wakeup"
fi
done
Offline
ACPI behaviour may depend on hardware and BIOS settings. In my system "power/wakeup" for mouse is "disabled" by default. Even if i set it to "enabled", mouse move doesn't wake the system from suspend, only mouse button click does.
Offline
Thanks for the answers and ideas here! Instead of a systemd service file to echo, and thanks to this other discussion and wiki page:
https://bbs.archlinux.org/viewtopic.php?id=164580
https://wiki.archlinux.org/title/System … rary_files
I ended up with the following file in /etc/tmpfiles.d/disable-wake.conf
# Path Mode UID GID Age Argument
w /proc/acpi/wakeup - - - - XHC
Offline
OK, I tried your udev rule. I get the expected output in the journal after boot:
Mar 27 02:45:06 HOSTNAME udev[439]: Mouse attribute set to disabled
But it still doesn't work, the mouse still wakes up the computer. "cat /sys/bus/usb/devices/1-7/power/wakeup" says enabled.....
Hi, new guy around here with the same exact problem. My new mouse wouldn't stop from waking up the computer from even the slightest movement.
Made an account on here just to post my solution after working on it for two days. Modifying things in proc/acpi/wakeup as the last replies said didn't work for me, and this solution mixes together everything here:
The rule
ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0043", ATTR{power/wakeup}="disabled"
is enough to modify the attribute of the 'wakeup' file, but after rebooting the computer some other rule which I wasn't able to figure out will re-modify the attribute to 'enabled'.
However, if you unplug and re-plug the mouse, our rule should nicely come into effect and change everything as we want. Since it's bothersome to to just that anytime you would reboot, we can bind and unbind the mouse in software after every reboot (in order for our rule to kick in). I used cronie for that:
# cat /proc/acpi/wakeup
As NoSavvy said, get your mouse code from here. For me it was the only one with XHC device.
Install cronie.
# systemctl enable cronie
# sudo crontab -e
Nano will open up, we have to list the commands we need cronie to run automatically at reboot:
@reboot bash -c "echo 0000:0c:00.3 > /sys/bus/pci/drivers/xhci_hcd/unbind" && bash -c "echo 0000:0c:00.3 > /sys/bus/pci/drivers/xhci_hcd/bind"
Save and exit. Replace 0000:0c:00.3 with your mouse code. Disabling only the USB device wouldn't work so we're unbinding and binding the whole Host Controller (xHCI). Hope this helps!
Offline
It is causing spurious wakeups, even the act of walking across the room vibrates the mouse enough that it wakes up the system. I want to stop this from happening. I would like to still have the keyboard wake the system.
This is odd, I actually had to do the opposite in my case - enable wakeup for my mouse which was disabled by default. But the only way of waking up is to click on a mouse button, just moving it doesn't, fortunately. That would be very annoying indeed.
I'm guessing this is all due to how the mouse firmware is designed, so that it all depends on each mouse pretty much, what they decide will cause a USB wakeup event... I don't think there's any way you can configure that. So you can change mice. ;D
If you're saying that the only way to accomplish this is by disabling the entire USB hub from wakeup, then I guess that's what I'll have to do.....
That's possible. In my case, the mouse is directly connected to one of the motherboard's USB port, but internally, it *is* on a hub. Just an internal one. Maybe it makes a difference compared to an external hub. Not sure.
But I can certainly disable/enable wakeup for each device selectively, and it does work without having to touch the hub itself.
And with all that said, the BIOS may have something to do with it as well indeed. In my case, for instance, while the keyboard is set to disabled for wakeup, if I press several times on the same key while in standby, this will wake up the computer anyway. It's handled by the BIOS. So that's another layer, you may have settings for this in your BIOS, or you may not.
Last edited by OpusOne (2023-12-19 05:31:20)
Offline
Pages: 1