Hi,
I'm running debian 4.9 with xfce on a surface pro 4. I've got a presentation pointer mouse that goes into autosuspend after 2 seconds, which is pretty annoying during a presentation. One solution seems to be to change the '2' to a '0' or '-1' in /sys/bus/usb/devices/1-1/power/autosuspend. That works, but it needs to be changed every time I plug the mouse in. I've attempted to write a udev rule to do this every time the mouse gets plugged in, but the rule doesn't seem to have any effect:
ACTION=="add", ATTRS{idVendor}=="046d", RUN:="/bin/echo -1 > /sys/bus/usb/devices/1-1/power/autosuspend"
To see if this rule was actually being followed, I changed it to
ACTION=="add", ATTRS{idVendor}=="046d", RUN:="/bin/echo -1 > /home/jyoung/test"
The file 'test' is never created. When I use udevadm to see what rules get checked when this device is plugged in, my rule is in the list. But, I can figure out why it's not triggering. I've checked the idVendor value, it's certainly right. Does anyone have any suggestions? Or, is there a cleaner way to do this? I would have guessed that there would be an easy way to turn off autosuspend for a given device.
Any help would be valued!
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
udev rule not triggering
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: udev rule not triggering
Apply the usbcore.autosuspend=-1 kernel command line parameter (via /etc/default/grub & `update-grub`).
deadbang
Re: udev rule not triggering
Will that turn off autosuspend for all usb devices? Is there a way to do it on a device-specific basis?
I think there's a lot to be said for powering down devices when they're not needed.
Although, maybe it would be worth prevent autosuspend for all usb devices. autosuspend is of a weird behavior to have, where a device is powered down in a way that makes it unresponsive for a 5-10 seconds even when there is activity. I can imagine that it would be equally frustrating with, say, a memory stick. Which actually brings up a good point, I have used usb memory sticks and I haven't noticed this problem. Maybe the lag aspect is specific to this device.
I think there's a lot to be said for powering down devices when they're not needed.
Although, maybe it would be worth prevent autosuspend for all usb devices. autosuspend is of a weird behavior to have, where a device is powered down in a way that makes it unresponsive for a 5-10 seconds even when there is activity. I can imagine that it would be equally frustrating with, say, a memory stick. Which actually brings up a good point, I have used usb memory sticks and I haven't noticed this problem. Maybe the lag aspect is specific to this device.
Re: udev rule not triggering
this article has been pretty helpful for me.
the 'udevadm' command has some extra commands, i remember that 'udevadm monitor' helped.
i'm sure you can crack this.
the 'udevadm' command has some extra commands, i remember that 'udevadm monitor' helped.
i'm sure you can crack this.
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: udev rule not triggering
Try this instead:jyoung wrote:Code: Select all
ACTION=="add", ATTRS{idVendor}=="046d", RUN:="/bin/echo -1 > /sys/bus/usb/devices/1-1/power/autosuspend"
Code: Select all
ACTION=="add", ATTRS{idVendor}=="046d", RUN:="/usr/local/bin/stopsuspend"
Code: Select all
# tee /usr/local/bin/stopsuspend <<< "/bin/echo -1 > /sys/bus/usb/devices/1-1/power/autosuspend"
# chmod +x /usr/local/bin/stopsuspend
deadbang
Re: udev rule not triggering
Hi Folks,
I attempted to add the usbcore.autosuspend=-1 to grub, but, to make a long story short, I overwrote my bootloader and ended up having to reinstall the system. I'm honestly more familiar with grub 1 and lilo.
Once it was setup again, I directory edited the /boot/grub/grub.cfg file. I know it's inadvisable, but it did work. The usb pointer mouse no longer goes into autosuspend.
debiman, the article you posted is really good; that's what prompted me to try to write a udev rule.
I attempted to add the usbcore.autosuspend=-1 to grub, but, to make a long story short, I overwrote my bootloader and ended up having to reinstall the system. I'm honestly more familiar with grub 1 and lilo.
Once it was setup again, I directory edited the /boot/grub/grub.cfg file. I know it's inadvisable, but it did work. The usb pointer mouse no longer goes into autosuspend.
debiman, the article you posted is really good; that's what prompted me to try to write a udev rule.
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: udev rule not triggering
If you showed us exactly what you did rather than just describing it vaguely then we could tell you where you went wrongjyoung wrote:I attempted to add the usbcore.autosuspend=-1 to grub
Hint: GRUB_CMDLINE_LINUX
It will break again after the next kernel update, /etc/default/grub is the correct file for user modifications.I directory edited the /boot/grub/grub.cfg file. I know it's inadvisable, but it did work
deadbang