Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOL]Mouse problem - Is it a strong power save on USB ports?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Xywa
Veteran
Veteran


Joined: 23 Jul 2005
Posts: 1631
Location: /mnt/Gentoo/Europe

PostPosted: Mon Jul 14, 2014 9:26 am    Post subject: [SOL]Mouse problem - Is it a strong power save on USB ports? Reply with quote

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
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1523

PostPosted: Mon Jul 14, 2014 12:00 pm    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
Xywa
Veteran
Veteran


Joined: 23 Jul 2005
Posts: 1631
Location: /mnt/Gentoo/Europe

PostPosted: Wed Jul 16, 2014 7:46 am    Post subject: Reply with quote

blakdeath wrote:

maybe you have a similar file under udev rules dir?


I have only this:
Code:
$ 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
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Wed Jul 16, 2014 8:04 am    Post subject: Reply with quote

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)
Back to top
View user's profile Send private message
EmaRsk
Apprentice
Apprentice


Joined: 07 Sep 2004
Posts: 158
Location: Italy

PostPosted: Thu Jul 17, 2014 9:52 am    Post subject: Reply with quote

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:
Code:
# 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.
Back to top
View user's profile Send private message
Xywa
Veteran
Veteran


Joined: 23 Jul 2005
Posts: 1631
Location: /mnt/Gentoo/Europe

PostPosted: Wed Sep 17, 2014 11:50 am    Post subject: Reply with quote

Code:
# 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



Code:
# 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.
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Wed Sep 17, 2014 2:24 pm    Post subject: Reply with quote

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
Code:
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
Code:
usbcore.autosuspend=-1

_________________
Paul
Back to top
View user's profile Send private message
Xywa
Veteran
Veteran


Joined: 23 Jul 2005
Posts: 1631
Location: /mnt/Gentoo/Europe

PostPosted: Tue Sep 30, 2014 10:39 am    Post subject: Reply with quote

I don't have usbcore (or I can't find) in my kernel 3.16.1 :(
Back to top
View user's profile Send private message
Xywa
Veteran
Veteran


Joined: 23 Jul 2005
Posts: 1631
Location: /mnt/Gentoo/Europe

PostPosted: Tue Oct 07, 2014 1:23 pm    Post subject: Reply with quote

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
Code:
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
Code:
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?
Code:
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)...
Back to top
View user's profile Send private message
kernelOfTruth
Watchman
Watchman


Joined: 20 Dec 2005
Posts: 6111
Location: Vienna, Austria; Germany; hello world :)

PostPosted: Thu Oct 09, 2014 11:14 pm    Post subject: Reply with quote

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 :

Code:
AUTOSUSPEND_RUNTIME_DEVTYPE_BLACKLIST="usbhid usb-storage uas"


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


Code:
# Enable Runtime autosuspend feature?
# Set to 0 to disable
CONTROL_RUNTIME_AUTOSUSPEND=1


probably should be set to

Code:
# Enable Runtime autosuspend feature?
# Set to 0 to disable
CONTROL_RUNTIME_AUTOSUSPEND=0


if you're having issues with devices


hope that helps
_________________
https://github.com/kernelOfTruth/ZFS-for-SystemRescueCD/tree/ZFS-for-SysRescCD-4.9.0
https://github.com/kernelOfTruth/pulseaudio-equalizer-ladspa

Hardcore Gentoo Linux user since 2004 :D
Back to top
View user's profile Send private message
Xywa
Veteran
Veteran


Joined: 23 Jul 2005
Posts: 1631
Location: /mnt/Gentoo/Europe

PostPosted: Sat Oct 11, 2014 12:11 pm    Post subject: Reply with quote

Xywa wrote:

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)...


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
#
# For more information, consult the laptop-mode.conf(8) manual page.
#


###############################################################################
# Runtime Power Management Settings
# ---------------------------------
#
#__COMMENT If you enable this setting, laptop mode tools will automatically enable
#__COMMENT the Runtime Power Management feature for all devices.
#__COMMENT
#__COMMENT NOTE: Some devices claim they support autosuspend, but implement it in a
#__COMMENT broken way. This can mean keyboards losing keypresses, or optical mice
#__COMMENT turning their LED completely off. If you have a device that misbehaves,
#__COMMENT add its DEVICE ID to the blacklist section below and complain to your
#__COMMENT hardware / device driver contact
#
################################################################################

# Enable debug mode for this module
# Set to 1 if you want to debug this module
DEBUG=0

# Enable Runtime autosuspend feature?
# Set to 0 to disable
CONTROL_RUNTIME_AUTOSUSPEND=1

# Set this to use opt-in/whitelist instead of opt-out/blacklist for deciding
# which devices should be autosuspended.
# AUTOSUSPEND_USE_WHITELIST=0 means AUTOSUSPEND_*_BLACKLIST will be used.
# AUTOSUSPEND_USE_WHITELIST=1 means AUTOSUSPEND_*_WHITELIST will be used.
AUTOSUSPEND_USE_WHITELIST=0

# The list of Device IDs that should not use autosuspend. Use system commands or
# look into sysfs to find out the IDs of your devices.
# Example: AUTOSUSPEND_DEVID_BLACKLIST="046d:c025 0123:abcd"
AUTOSUSPEND_RUNTIME_DEVID_BLACKLIST=""

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

# The list of Device IDs that should use autosuspend. Use system commands or
# look into sysfs to find out the IDs of your devices.
# Example: AUTOSUSPEND_DEVID_WHITELIST="046d:c025 0123:abcd"
AUTOSUSPEND_RUNTIME_DEVID_WHITELIST=""

# 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"
AUTOSUSPEND_RUNTIME_DEVTYPE_WHITELIST=""

# Trigger auto-suspension of the deivce under conditional circumstances
# Warning: DO NOT CHANGE THESE DEFAUTLS UNLESS YOU KNOW
BATT_SUSPEND_RUNTIME=1
LM_AC_SUSPEND_RUNTIME=1
NOLM_AC_SUSPEND_RUNTIME=1

# Auto-Suspend timeout in seconds
# Number of seconds after which the USB devices should suspend
AUTOSUSPEND_TIMEOUT=2
Back to top
View user's profile Send private message
kernelOfTruth
Watchman
Watchman


Joined: 20 Dec 2005
Posts: 6111
Location: Vienna, Austria; Germany; hello world :)

PostPosted: Mon Oct 13, 2014 2:59 pm    Post subject: Reply with quote

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
_________________
https://github.com/kernelOfTruth/ZFS-for-SystemRescueCD/tree/ZFS-for-SysRescCD-4.9.0
https://github.com/kernelOfTruth/pulseaudio-equalizer-ladspa

Hardcore Gentoo Linux user since 2004 :D
Back to top
View user's profile Send private message
Xywa
Veteran
Veteran


Joined: 23 Jul 2005
Posts: 1631
Location: /mnt/Gentoo/Europe

PostPosted: Thu Oct 16, 2014 6:22 am    Post subject: Reply with quote

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

blacklist


Many thanks, after couple of months everything works fine now :P
[SOLVED]
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum