You are not logged in.

#1 2014-12-14 02:20:33

CubeGod
Member
Registered: 2013-07-09
Posts: 120

Mouse stops working after being left alone

My issue is: If I don't use my mouse for an extended period of time (especially if afk, happenes when at the computer too though) it stops working and I need to replug it for it to work, the time seems to range from 2 seconds to half an hour or more without any real logic to it.

Expected behavior: the mouse should remain functional even after not being used for a variable amount of time.

Originally I suspected it was because it uses 5V 100mA but after examining my previous mouse and the USB spec I can conclude that is not the case as this behavior was not expressed with my previous mouse, further this behavior remains even after I move it from the usb hub to one of the ports on the computer.

A quick $lsusb later and I have the device id

Bus 002 Device 085: ID 056a:00dd Wacom Co., Ltd Bamboo Pen (CTL-470)
Bus 002 Device 048: ID 0d8c:013c C-Media Electronics, Inc. CM108 Audio Controller
Bus 002 Device 047: ID 0421:026a Nokia Mobile Phones N97 (mass storage)
Bus 002 Device 026: ID 05e3:0608 Genesys Logic, Inc. Hub
Bus 002 Device 095: ID 1b1a:7004  
Bus 002 Device 092: ID 413c:2003 Dell Computer Corp. Keyboard
Bus 002 Device 072: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 002 Device 071: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 005: ID 04f2:b1d6 Chicony Electronics Co., Ltd CNF9055 Toshiba Webcam
Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

1b1a:7004 seems to be an unknown device (seeing that it works fine on windows and mac based computers I can conclude that the hardware isn't faulty)

Perhaps linux doesn't realize it requires 100mA? Or maybe it isn't getting 12MB/s speed but instead only 1.5?

Very well, #udevadm can tell me this.

  looking at parent device '/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1.1/2-1.1.1.2':
    KERNELS=="2-1.1.1.2"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{devpath}=="1.1.1.2"
    ATTRS{idVendor}=="1b1a"
    ATTRS{speed}=="12"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bMaxPacketSize0}=="8"
    ATTRS{busnum}=="2"
    ATTRS{devnum}=="95"
    ATTRS{configuration}==""
    ATTRS{bMaxPower}=="100mA"
    ATTRS{authorized}=="1"
    ATTRS{bmAttributes}=="a0"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{maxchild}=="0"
    ATTRS{bcdDevice}=="0110"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{quirks}=="0x0"
    ATTRS{version}==" 1.10"
    ATTRS{urbnum}=="11120"
    ATTRS{ltm_capable}=="no"
    ATTRS{manufacturer}==" USB  Mouse "
    ATTRS{removable}=="fixed"
    ATTRS{idProduct}=="7004"
    ATTRS{bDeviceClass}=="00"
    ATTRS{product}==" USB  Mouse "

Well... apparently my theories are all incorrect, the LEDs stop pulsing when the mouse 'dies' and just remain on so at least I can conclude it doesn't power down.
Any assistance would be greatly appreciated.

Offline

#2 2014-12-14 04:19:50

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Mouse stops working after being left alone

Within the /sys path for this device, is it set to autosuspend? 

cat /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1.1/2-1.1.1.2/power/autosuspend 

Offline

#3 2014-12-14 08:56:50

CubeGod
Member
Registered: 2013-07-09
Posts: 120

Re: Mouse stops working after being left alone

$ cat /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1.1/2-1.1.1.2/power/autosuspend 
2

I would assume yes (however the fact that it works so randomly would suggest that either the feature is really quite dodgy to begin with or outright broken)
I wonder if it's as simple as just echoing a 0 on there.

Offline

#4 2014-12-15 00:58:01

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Mouse stops working after being left alone

Try it. There is also the autosuspend_delay_ms as well.  Though I am not sure why you would be getting such randomness with the timeout.

If it works, you could simply write a super simple udev rule to set it properly.  Otherwise a tmpfiles.d snippet would probably also suffice.

Offline

#5 2014-12-16 17:22:33

CubeGod
Member
Registered: 2013-07-09
Posts: 120

Re: Mouse stops working after being left alone

okay, it's 0 now, which should disable the autosuspend unless I misunderstand how the numbers are read (I'll try -1 if that doesn't work, if it still doesn't work I'll just be confused)

Perhaps the randomness with the timeout isn't that it times out randomly but that it randomly fails to wake up from being timed out, the shortest I've ever recorded was 2 seconds (happened six times), the longest has been a couple of hours (which could indicate that it does time out and wake up from it most of the time).

I'm confused that the LEDs don't turn off during timeouts though, I'd expect that to be the expected behavior seeing that timeouts are to save power (although 5V 100mA isn't worth saving)

Offline

#6 2014-12-17 03:41:47

CubeGod
Member
Registered: 2013-07-09
Posts: 120

Re: Mouse stops working after being left alone

that did not work. it still timed out and didn't wake up.
autosuspend_delay_ms seems to be 0 as well after I set autosuspend to 0.
Now attempting -1
cat tells me that autosuspend is -1 and autosuspend_delay_ms is -1000

if this works I'll go read the udev man file to figure out how to write rules (wíll report back either way)

Offline

#7 2014-12-17 16:44:50

CubeGod
Member
Registered: 2013-07-09
Posts: 120

Re: Mouse stops working after being left alone

and nothin'

Not sure how to proceed from here, any suggested method for debugging what might be wrong?

Offline

#8 2014-12-18 21:52:19

themusicalduck
Member
Registered: 2011-07-04
Posts: 147

Re: Mouse stops working after being left alone

I experience a similar problem, not sure if it's the same though. It happens with my keyboard too, and reliably seems to happen after a second or so of inactivity. I found that clicking one of the buttons on the mouse would re-enable it (where moving the mouse does not). Re-plugging the mouse and keyboard after boot fixes the problem until I restart.

Anyway, I never found a fix for it. I made a thread about it a while ago here, but I never figured it out in the end. Some of the posts there might give you some ideas of things to try.

Offline

#9 2014-12-19 16:55:37

CubeGod
Member
Registered: 2013-07-09
Posts: 120

Re: Mouse stops working after being left alone

$ sudo echo -1 >/sys/module/usbcore/parameters/autosuspend
bash: /sys/module/usbcore/parameters/autosuspend: Permission denied

ditto for $sudo for i in /sys/bus/usb/devices/*/power/autosuspend; do echo -1 > $i; done

#for i in /sys/bus/usb/devices/*/power/autosuspend; do echo -1 > $i; done

does execute without error but it changes nothing.

the buttons do not wake the mouse which is why this is such a problem (well, the dpi button and LMB, RMB and MMB don't, there are two other buttons but I can't recall if I tested them)

Physically unplugging and re-inserting the mouse and keyboard fixes the problem regardless of any changes. The thing is that I would like it to be working from boot, and not having to replug them.

Obviously not working on my end though seeing I have to replug it every time it dies.
thanks for linking the post though (I had already read it but going through it a second time at least proves it wasn't just a one off that I didn't do it right or something but that it actually doesn't work. Odd that root doesn't have permission to do some things though, seeing that root should have ultimate power).

Offline

#10 2015-01-14 00:42:02

CubeGod
Member
Registered: 2013-07-09
Posts: 120

Re: Mouse stops working after being left alone

update: I can get it working when using a hardwired usb port but it does not work for my usb hub (my old mouse works fine in it and has the same power requirements) even though it only has the keyboard plugged aside from the mouse (doesn't change even when everything gets unplugged).
However using a wired port is not possible as I only have 2 of them and I have need for anything from 3 to 7 ports at any time (I have a hub in each port).

Offline

#11 2015-01-14 02:51:57

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,536

Re: Mouse stops working after being left alone

The  kernel can handle the hub, but no single port. That looks like a mouse problem itself, as long as the keyboard isn't affected.
May it be a wire/contact problem ?
Swapping position, how does it do ?


do it good first, it will be faster than do it twice the saint wink

Offline

#12 2015-01-23 17:48:33

CubeGod
Member
Registered: 2013-07-09
Posts: 120

Re: Mouse stops working after being left alone

UPDATE: It seems that the issue still crops up on the actual port but at a reduced frequency (as concluded by a four day test), this allows me to eliminate the hub as the culprit.

The keyboard or any other usb device is indeed not affected, the wire is most likely fine and so is the contact.

If by swapping position you mean wiggling the wire around or moving the mouse then no, that does not work; re-seating it does work however (and the LEDs still light up when the mouse no longer operates so the cable seems fine).
If, by swapping positions, you mean switching which port it is plugged into then yes, I've tried that and it doesn't work (tried three ports of eight on the hub and both physical ports).

Possible reasons I can think of:
1. the micro controller in the mouse plays nice with windows but not linux.
2. linux's power saving features don't like me.

Offline

#13 2015-01-24 14:57:52

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,536

Re: Mouse stops working after being left alone

Swapping port, e.g. put mouse instead of keyboard.
What is the result of

 lsusb

do it good first, it will be faster than do it twice the saint wink

Offline

#14 2015-01-27 16:10:28

CubeGod
Member
Registered: 2013-07-09
Posts: 120

Re: Mouse stops working after being left alone

I have already tried every port on my hub and all physical ports, switching the port changes nothing.

Bus 002 Device 010: ID 056a:00dd Wacom Co., Ltd Bamboo Pen (CTL-470)
Bus 002 Device 007: ID 0d8c:013c C-Media Electronics, Inc. CM108 Audio Controller
Bus 002 Device 011: ID 1b1a:7004  
Bus 002 Device 005: ID 413c:2003 Dell Computer Corp. Keyboard
Bus 002 Device 004: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 002 Device 003: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 004: ID 04f2:b1d6 Chicony Electronics Co., Ltd CNF9055 Toshiba Webcam
Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

1b1a:7004 being the mouse.
Fyi the reason there are 2 4-port hubs is because my hub is just two 4 port hubs piggybacked (7 upstream usb ports, 1 downstream to connect them internally), I only use 4 of the ports though, the rest are flipped off.

Last edited by CubeGod (2015-01-27 16:14:41)

Offline

#15 2015-01-27 16:45:05

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,536

Re: Mouse stops working after being left alone

Do you have a PS/2 port and an USB-PS/2 adaptor to try ?
Otherwise, try another mouse to see what's going on. Then you will find out where could be the problem. That will mean whether the mouse is strange or the OS is the fault.


do it good first, it will be faster than do it twice the saint wink

Offline

#16 2015-01-27 16:51:21

CubeGod
Member
Registered: 2013-07-09
Posts: 120

Re: Mouse stops working after being left alone

I do not have a PS/2 port as it's a rather low end laptop, my previous mouse broke.
I figure it's the OS since the mouse works fine on my PS3, windows dual boot and on another windows based computer (I also had the opportunity to test it on an old mac and it works there too), I'd sorta guess the hub might be to blame since it happens much more frequently using the hub (voltage drop?) or maybe the usb root hub itself, in which case a voltage drop takes out the device and the linux kernel isn't handling it gracefully (or maybe windows just has some ungraceful hack to get it working).

Offline

#17 2015-01-27 21:25:40

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,536

Re: Mouse stops working after being left alone

So you may have to try the USB hub on another PC, and see.


do it good first, it will be faster than do it twice the saint wink

Offline

#18 2015-01-28 17:54:05

tyggna
Member
Registered: 2015-01-28
Posts: 3

Re: Mouse stops working after being left alone

I'm having the same issue as you, and I figure it's a problem with how the kernel was compiled so I'm compiling my own where I'm disabling the PCIe power management routines altogether, since USB 3 is just routed through the PCI-e bus anyway.

Offline

#19 2015-01-28 18:05:22

tyggna
Member
Registered: 2015-01-28
Posts: 3

Re: Mouse stops working after being left alone

Well, my custom kernel worked, but I found an easier solution:

]$ cat /etc/udev/rules.d/50-usb_power_save.rules
ACTION=="add", SUBSYSTEMS=="*", TEST=="power/control", ATTR{power/control}="on"
ACTION=="add", SUBSYSTEMS=="*", TEST=="power/autosuspend", ATTR{power/autosuspend}="-1"

reboot, and it works fine.

Offline

#20 2015-01-28 21:14:19

tyggna
Member
Registered: 2015-01-28
Posts: 3

Re: Mouse stops working after being left alone

One other thing, with my current setup, the udev solution doesn't always work/survive between reboots and I'm not sure why yet.

Offline

#21 2015-02-01 08:48:51

CubeGod
Member
Registered: 2013-07-09
Posts: 120

Re: Mouse stops working after being left alone

I'll experiment with that tyggna, with some luck it'll work and I can plug my mouse back into my hub.

Offline

Board footer

Powered by FluxBB