# [SOL]Mouse problem - Is it a strong power save on USB ports?

## Xywa

Hi,

After last update (udev or new kernel 3.15) I have a problem with my wireless USB mouse. After about 5 seconds, the mouse switch off, so I have to click two buttons together (like when I start) or even plug off and plug on USB stick . Firstly, I thought maybe batteries are old, but with a new batteries it was the same. So I tough the mouse is broken, so I bought a new one, but it still the same. Its very difficult to use a muse now, few seconds, and it is switched off. What to do? Help.Last edited by Xywa on Thu Oct 16, 2014 6:21 am; edited 1 time in total

----------

## Adel Ahmed

hmmm, I encountered this behaviour when I configured power saving for USB ports

I created a file called 60-power.rules and placed it under /etc/udev/rules.d/

here's the file's content:

SUBSYSTEM!="usb", GOTO="power_usb_rules_end"

ACTION!="add", GOTO="power_usb_rules_end"

KERNEL=="[0-9]*:*", WAIT_FOR_SYSFS="bInterfaceProtocol"

PROGRAM="/bin/sleep 0.1"

ATTR{power/level}=="*", ATTR{power/level}="auto"

LABEL="power_usb_rules_end"

this caused my optical mouse to turn off after a second of inactivity, and I had to unplug and plug the mouse back in as well

maybe you have a similar file under udev rules dir?

----------

## Xywa

 *blakdeath wrote:*   

> 
> 
> maybe you have a similar file under udev rules dir?

 

I have only this:

```
$ ls -la /etc/udev/rules.d/

total 24

drwxr-xr-x 2 root root 4096 Mar 28 12:17 .

drwxr-xr-x 4 root root 4096 Jul  7 10:37 ..

-rw-r--r-- 1 root root  796 May  1  2012 70-persistent-cd-old.rules

-rw-r--r-- 1 root root  674 May  4  2012 70-persistent-net.rules

-rw-r--r-- 1 root root 1667 Jan 10  2013 80-net-name-slot.rules

-rw-r--r-- 1 root root 1667 Mar 13 07:01 80-net-setup-link.rules

```

----------

## krinn

If i get it right, /etc/udev/rules.d is for your own rules. If you didn't add one that do it, it doesn't mean udev itself doesn't have a rule that do the same.

You should look at /lib/udev/rules.d and seek a default rules add by udev that might do the same.

(you will see you have way more rules than you think there)

With luck ssuominen will comes, and you will get a real answer faster than light.

If you can, boot your previous kernel and you will more define if your new kernel is the problem or udev.

While you're at it, you can also tell your udev version, as last update of udev is not helping (last update of udev in arch or ~arch may not result in the same version)

----------

## EmaRsk

I had the same issue. If it can be of any help, here are my /etc/udev/rules.d/10-local-powersave.rules relevant lines:

```
# USB autosuspend

ACTION=="add", SUBSYSTEM=="usb", ATTR{power/control}="auto"

ACTION=="add", SUBSYSTEM=="usb", TEST=="power/autosuspend" ATTR{power/autosuspend}="60"

# Logitech Trackball must be always on

ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c408", ATTR{power/control}="on"
```

Find vendor/product id with lsusb.

----------

## Xywa

```
# ls -la /lib/udev/rules.d/

total 496

drwxr-xr-x 2 root root   4096 Sep 16 09:16 .

drwxr-xr-x 4 root root   4096 Sep 16 09:16 ..

-rw-r--r-- 1 root root    534 Jun  2 08:01 39-usbmuxd.rules

-rw-r--r-- 1 root root    152 Aug 22 11:42 40-gentoo.rules

-rw-r--r-- 1 root root    998 Oct  2  2013 40-usb-media-players.rules

-rw-r--r-- 1 root root 134628 Jun  2 08:09 41-libsane.rules

-rw-r--r-- 1 root root   2207 Aug 22 11:42 42-usb-hid-pm.rules

-rw-r--r-- 1 root root    121 Aug 22 11:42 50-firmware.rules

-rw-r--r-- 1 root root   3249 Aug 22 11:42 50-udev-default.rules

-rw-r--r-- 1 root root    729 Jun 17 11:59 56-hpmud.rules

-rw-r--r-- 1 root root    646 Aug 22 11:42 60-cdrom_id.rules

-rw-r--r-- 1 root root    153 Aug 22 11:42 60-drm.rules

-rw-r--r-- 1 root root    237 Jun 16 22:20 60-heimdall.rules

-rw-r--r-- 1 root root    821 Aug 22 11:42 60-keyboard.rules

-rw-r--r-- 1 root root    616 Aug 22 11:42 60-persistent-alsa.rules

-rw-r--r-- 1 root root   2464 Aug 22 11:42 60-persistent-input.rules

-rw-r--r-- 1 root root    947 Aug 22 11:42 60-persistent-serial.rules

-rw-r--r-- 1 root root   5592 Aug 22 11:42 60-persistent-storage.rules

-rw-r--r-- 1 root root   1420 Aug 22 11:42 60-persistent-storage-tape.rules

-rw-r--r-- 1 root root    769 Aug 22 11:42 60-persistent-v4l.rules

-rw-r--r-- 1 root root    166 Aug 22 11:42 61-accelerometer.rules

-rw-r--r-- 1 root root    418 Aug 22 11:42 64-btrfs.rules

-rw-r--r-- 1 root root 178322 Jun  2 08:02 70-libgphoto2.rules

-rw-r--r-- 1 root root    378 Sep  8 21:34 70-printers.rules

-rw-r--r-- 1 root root   2569 Aug 22  2013 70-udev-acl.rules

-rw-r--r-- 1 root root    452 Aug 22 11:42 75-net-description.rules

-rw-r--r-- 1 root root    174 Aug 22 11:42 75-probe_mtd.rules

-rw-r--r-- 1 root root    426 Aug 22 11:42 75-tty-description.rules

-rw-r--r-- 1 root root   4400 Aug 22 11:42 78-sound-card.rules

-rw-r--r-- 1 root root    618 Aug 22 11:42 80-drivers.rules

-rw-r--r-- 1 root root    336 Aug 22 11:42 80-net-setup-link.rules

-rw-r--r-- 1 root root   7984 Mar 11  2014 80-udisks2.rules

-rw-r--r-- 1 root root     47 May  6  2012 81-udisks-realtek.rules

-rw-r--r-- 1 root root    225 Feb 13  2014 85-regulatory.rules

-rw-r--r-- 1 root root    399 Jun 24 09:54 90-alsa-restore.rules

-rw-r--r-- 1 root root   1850 Apr  7 09:56 90-libgpod.rules

-rw-r--r-- 1 root root    280 Jul 18 12:02 90-network.rules

-rw-r--r-- 1 root root    155 Aug 22 11:42 95-udev-late.rules

-rw-r--r-- 1 root root   2095 Aug 22 11:50 95-upower-csr.rules

-rw-r--r-- 1 root root   6165 Aug 22 11:50 95-upower-hid.rules

-rw-r--r-- 1 root root    354 Aug 22 11:50 95-upower-wup.rules

-rw-r--r-- 1 root root   1525 Sep 16 09:16 97-hid2hci.rules

-rw-r--r-- 1 root root    445 Jun 29 08:45 99-bumblebee-nvidia-dev.rules

-rw-r--r-- 1 root root    234 Sep  8 21:34 99-laptop-mode.rules

-rw-r--r-- 1 root root    462 Aug 26 09:09 99-nvidia.rules

```

```
# lsusb 

Bus 002 Device 003: ID 5986:0315 Acer, Inc 

Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub

Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 001 Device 003: ID 276d:1116  

Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
```

I have the same issue for different mouses type.

----------

## Logicien

You can try to disable the autosuspend mode of usbcore. If usbcore is in module, add a file like /etc/modprobe.d/usbcore.conf with the line

```
options usbcore autosuspend=-1
```

if you have one, rebuild your initramfs to include the file. If usbcore is in the kernel image, you can disable autosuspend on the kernel command line

```
usbcore.autosuspend=-1
```

----------

## Xywa

I don't have usbcore (or I can't find) in my kernel 3.16.1   :Sad: 

----------

## Xywa

 *Logicien wrote:*   

> You can try to disable the autosuspend mode of usbcore. If usbcore is in module, add a file like /etc/modprobe.d/usbcore.conf with the line
> 
> ```
> options usbcore autosuspend=-1
> ```
> ...

 

Ok. I have found it.

Device Drivers -> USB support -> support for Host-side USB (it is called CONFIG_USB but as module usbcore).

I have compiled it in kernel.

Where is a file with?

```
usbcore.autosuspend=-1
```

I was trying this:

http://unix.stackexchange.com/questions/91027/how-to-disable-usb-autosuspend-on-kernel-3-7-10-or-above

 *Quote:*   

> echo -1 >/sys/module/usbcore/parameters/autosuspend

 

but still the same... I have bought a brand new mouse with usb cable, when the red light in mouse is gone, mouse is gone (usually after 3 seconds)...

----------

## kernelOfTruth

you guys, by chance, have laptop-mode-tools installed ?

lol - for me during startup the keyboard and mouse suspended pretty soon, too, which can be a real problem if you need to enter passphrases or have an interactive startup

http://fitzcarraldoblog.wordpress.com/2013/02/26/how-to-prevent-a-usb-mouse-auto-suspending-in-linux-when-a-laptops-power-supply-is-disconnected/

notice that since at the end of the year not the file

/etc/laptop-mode/conf.d/usb-autosuspend.conf

is used anymore but

/etc/laptop-mode/conf.d/runtime-pm.conf 

instead:

https://wiki.archlinux.org/index.php/Laptop_Mode_Tools#USB_autosuspend

 *https://wiki.archlinux.org/index.php/Laptop_Mode_Tools#USB_autosuspend wrote:*   

> Tip: USB autosuspend functionality has been moved from the usb-autosuspend module to the runtime-pm module. Make sure to replace usb-autosuspend with pm-runtime on /lib/udev/rules.d/99-laptop-mode.rules.

 

therefore usbcore.autosuspend=-1 does not work anymore - I'm still searching for the command to append to the kernel at bootup to disable runtime selectively for usb devices ...

meanwhile the below solution (blacklist) works for me:

example for blacklist items of runtime-pm.conf :

```
AUTOSUSPEND_RUNTIME_DEVTYPE_BLACKLIST="usbhid usb-storage uas"
```

```
AUTOSUSPEND_RUNTIME_DEVID_BLACKLIST="046d:c52b 045e:00db 2516:001d 2516:0002 05e3:0608"
```

```
# Enable Runtime autosuspend feature?

# Set to 0 to disable

CONTROL_RUNTIME_AUTOSUSPEND=1
```

probably should be set to

```
# Enable Runtime autosuspend feature?

# Set to 0 to disable

CONTROL_RUNTIME_AUTOSUSPEND=0
```

if you're having issues with devices

hope that helps

----------

## Xywa

 *Xywa wrote:*   

> 
> 
> I was trying this:
> 
> http://unix.stackexchange.com/questions/91027/how-to-disable-usb-autosuspend-on-kernel-3-7-10-or-above
> ...

 

Sorry. This works (I said before it did not work for me)

 *Quote:*   

> echo -1 >/sys/module/usbcore/parameters/autosuspend

 

but only for any new USB devices. So I had plug off and plug in my USB mouse (as it was connected before that command), and after that everything works perfectly. And you have to do this manually every time you restart the system.

I have to check what kernelOfTruth said and will try this. So what paramets should be in /etc/laptop-mode/conf.d/runtime-pm.conf file to have the same like echo -1 >/sys/module/usbcore/parameters/autosuspend?

/etc/laptop-mode/conf.d/runtime-pm.conf

 *Quote:*   

> #
> 
> # Configuration file for Laptop Mode Tools module runtime-pm
> 
> #
> ...

 

----------

## kernelOfTruth

like in the post above yours - there seems to be 2 ways:

to either disable autosuspend (runtime_autosuspend) globally

or do it via the 

blacklist

----------

## Xywa

 *kernelOfTruth wrote:*   

> like in the post above yours - there seems to be 2 ways:
> 
> to either disable autosuspend (runtime_autosuspend) globally
> 
> or do it via the 
> ...

 

Many thanks, after couple of months everything works fine now   :Razz: 

[SOLVED]

----------

