Mouse clicks, sometimes also keyboard, stop; cursor OK

Everything about X, Gnome, KDE, ... and everything running on it

Mouse clicks, sometimes also keyboard, stop; cursor OK

Postby jg_telensa » 2017-05-18 14:47

(Mods, please feel free to move this to a more appropriate board if needed. This appears to me to be a driver/window manager/X issue, so this seems the best forum.)

Background:
  • Jessie 32bit (Linux (machine name) 3.16.0-4-686-pae #1 SMP Debian 3.16.43-2 (2017-04-30) i686 GNU/Linux), fully up to date.
  • Default WM; 9 virtual desktops across two screens (in case that's relevant).
  • Dell mouse; Zoostorm keyboard; both through a USB hub.
Once or twice a solid 8-hour day, my system stops listening to mouse clicks. The cursor still moves when I move the mouse, but no button clicks or mouse-wheel operations have effect. Unplugging the mouse, waiting, and reconnecting it makes no difference. Neither does unplugging the mouse from the USB hub and plugging it into one of the direct USB ports. Hitting CTRL-ALT-F1 to drop to text mode, then CTRL-ALT-F7 to return to graphical mode does not restore mouse clicks.

The only non-destructive (i.e. without forcing a reboot or a logout, trashing everything I've got open) way to recover the full mouse function is to hit the keyboard chord I've got set up to lock the screen. Within the lock screen, and thereafter, the mouse works fully again. This is annoying, but it's an effective workaround.

Unfortunately, sometimes (perhaps once in ten) the keyboard is also ignored at the same time, making the lock-unlock dance ineffective. At that point, all I can do is ssh in and command a reboot. I haven't been able to find a command that would restore mouse and keyboard functionality non-destructively.

The lock-unlock dance suggests to me that a USB or HID driver, or something within the HID handling in the window manager, has got itself into a state, and locking the screen forces a driver reset, putting the world back to rights.

I've Googled the heck out of this, and nothing seems to match exactly the behaviour I'm seeing. Solutions I've seen suggested for vaguely similar misbehaviours don't seem to work in this case.

Folks, I'm up for suggestions - help!

In case it's helpful, I've attached the output from lspci -vv.

Thanks -- Jon
jg_telensa
 
Posts: 6
Joined: 2017-05-18 14:17

Re: Mouse clicks, sometimes also keyboard, stop; cursor OK

Postby phenest » 2017-05-18 15:05

jg_telensa wrote:I've Googled the heck out of this

jg_telensa wrote:Folks, I'm up for suggestions - help!

We need to know what you've already tried, so we don't repeat anything.
NEC Spirit 550 P4 3.8GHz HT - 2GB RAM - nVidia 7600GT - Pioneer BDR-209DBK
ASUS Sabertooth P67 i7 3770K - 32GB RAM - 2x nVidia 660GTX SLI'd
User avatar
phenest
 
Posts: 1571
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Mouse clicks, sometimes also keyboard, stop; cursor OK

Postby orythem27 » 2017-05-18 15:12

Maybe next time it "crashes", you could ssh in and use `journalctl -r` to try to locate any recent message that looks like an abnomaly to you. This might help you obtail more keywords to be put in to search engines.
User avatar
orythem27
 
Posts: 252
Joined: 2017-05-11 07:59
Location: P.R. China

Re: Mouse clicks, sometimes also keyboard, stop; cursor OK

Postby jg_telensa » 2017-05-19 09:35

phenest wrote:We need to know what you've already tried, so we don't repeat anything.


Apart from the list of things I've already mentioned?

Well, there's pages and pages of near-miss search results that relate to using a keyboard (typically Microsoft branded) that has media keys, which appear to cause the mouse driver to believe a mouse click has started but not completed. This doesn't apply: the Zoostorm keyboard I'm using is very Windows-vanilla, with no media keys, just the usual Windows / Menu keys. FWIW, I've got the numeric keypad keys mapped to the virtual desktops in what would be a 3x3 arrangement if only Debian would allow me to consider them in anything but a 1x9 vertical strip. (But that's a grouch for another day.)

I had tried doing the modprobe dance (individually modprobe -r usbhid, hid_generic and hid, in that order, then modprobe them back, in reverse order), over an SSH session. Without the modprobe -r hid, this made no difference. With it, the mouse refused to play at all (cursor included), even after I tried the lock-unlock dance. Another lock-unlock dance, and it came back, working properly. I think I offended its feelings.

There were many other tests (e.g. service gdm restart) that succeeded in nuking the window manager and all its windows completely (as I'd expected). This is not a desirable outcome.

It's not a swap thrash. top shows I'm running wholly within the 8GB RAM - in fact, I've over 2GB free - and not touching the 16GB available swap. There are no slow-downs during the loss of mouse clicks: keyboard response remains snappy.

Switching virtual desktops changes only what's on the screens. :)

orythem27 wrote:Maybe next time it "crashes", you could ssh in and use `journalctl -r` to try to locate any recent message that looks like an abnomaly to you. This might help you obtail more keywords to be put in to search engines.


Thanks - this is relevant. I found the following lines in the journal:

Code: Select all
May 19 10:27:26 machine-name gnome-session[6862]: Gjs-Message: JS LOG: pushModal: invocation of begin_modal failed
May 19 10:26:46 machine-name gnome-session[6862]: Another user connected to the server, forcing the disconnection of the current connection.
May 19 10:26:46 machine-name gnome-session[6862]: ERRINFO_DISCONNECTED_BY_OTHER_CONNECTION (0x00000005):

The Gjs-Message line also appears in a number of other Debian bugreps (#767280, #768911 for instance) referencing similar mouse (mis)behaviour - interesting, but with no useful tips. I don't even have gnome-do installed, so that's not the source. It's also unclear whether the message is related to the cause or the effect of the misbehaviour. An interesting discussion relating to Gnome-Shell at https://github.com/simonthechipmunk/jumptooverview/issues/1 may be relevant, but it's hard for me to see how I could apply its conclusions. It does appear to be a Gnome problem that's been extant for maybe four years, reported not just on Debian but also Fedora (http://forums.fedoraforum.org/archive/index.php/t-299502.html), but without any resolution I've been able to find thus far. Interestingly, I've not found one of these bugreps that also mentions the keyboard sometimes going away as well, but I'm sure that there's something in this.
Last edited by jg_telensa on 2017-05-19 13:24, edited 2 times in total.
jg_telensa
 
Posts: 6
Joined: 2017-05-18 14:17

Re: Mouse clicks, sometimes also keyboard, stop; cursor OK

Postby jg_telensa » 2017-05-19 13:20

Oh - I should add that there's also a metric cr*p-tonne of "gnome-session[something]: (gnome-shell:7020): mutter-WARNING **: STACK_OP_RAISE_ABOVE: window 0x8c01200016 not in stack" messages in the journal too, but this seems pretty Debian-standard at the moment, so I'm assuming they're not relevant; I remember the same with a previous client. Seems to be a known issue that no-one's doing anything about, but I'll throw it into the mix. These messages just flow constantly, and do not seem to coincide in any respect with the mouse-click issue.
jg_telensa
 
Posts: 6
Joined: 2017-05-18 14:17

BIG BREAKTHROUGH!

Postby jg_telensa » 2017-05-26 15:04

OK, so I've been doing a lot more experimentation.

Even when the keyboard appears non-responsive within X11, I can still use CTRL-ALT-F1 to get down to text mode, as previously mentioned. Repeatedly entering and (CTRL-ALT-F7) leaving text mode does not regain either mouse clicks or keyboard within X11.

However - I have both Acrobat Reader and Opera running, both up-to-date.

If I killall acroread, whilst in text mode, that gets me back mouse clicks when I return to X11.

If I then return to text mode and killall -9 opera, this gets me back the keyboard too when I go back to X11.

This appears to be the solution:
  • If it's just the mouse clicks, then doing the lock-unlock dance does the job.
  • If it's both mouse clicks and keyboard (bar CTRL-ALT-F1), then the sequence above appears to fix it.

I'd love to understand why this problem occurs, but it at least admits of an answer now.
jg_telensa
 
Posts: 6
Joined: 2017-05-18 14:17

Re: Mouse clicks, sometimes also keyboard, stop; cursor OK

Postby phenest » 2017-05-26 15:19

I wonder if this has anything to do with focus. A window can be on top and be active, but not necessarily have focus. If it does not have focus, it does not receive keyboard input. As far as the mouse goes, I'm certain that mouse events would be generated, but not passed to anything.

Your experimentation suggests that focus is being regained.

I can't see if you mentioned what DE you're using, but you mentioned GDM, so assuming Gnome. Not relevant, but need to know to help with solutions.

Has this been an issue since you installed Jessie?
NEC Spirit 550 P4 3.8GHz HT - 2GB RAM - nVidia 7600GT - Pioneer BDR-209DBK
ASUS Sabertooth P67 i7 3770K - 32GB RAM - 2x nVidia 660GTX SLI'd
User avatar
phenest
 
Posts: 1571
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Mouse clicks, sometimes also keyboard, stop; cursor OK

Postby jg_telensa » 2017-05-26 15:33

Thanks, @phenest. Yes, I'm using Gnome, stock settings.

I suspect you may well have something there, about focus. I use "Attached Modal Dialogs" ON, "Automatically Raise Windows" ON, "Resize with Secondary-click" OFF, "Focus Mode" Sloppy, for what it's worth. Nothing particularly fancy in other settings that I can recall.

I've had this problem since I received a pre-configured Jessie desktop at the start of the year. The keyboard outage is rarer, but the mouse-click loss is 1-3 times a day, I'd say.
jg_telensa
 
Posts: 6
Joined: 2017-05-18 14:17

Re: Mouse clicks, sometimes also keyboard, stop; cursor OK

Postby phenest » 2017-05-26 15:45

jg_telensa wrote:I use "Attached Modal Dialogs" ON, "Automatically Raise Windows" ON, "Resize with Secondary-click" OFF, "Focus Mode" Sloppy

Did you get that from Gnome Tweak Tool? Have you checked in dconf-editor for other settings that might not be default?
NEC Spirit 550 P4 3.8GHz HT - 2GB RAM - nVidia 7600GT - Pioneer BDR-209DBK
ASUS Sabertooth P67 i7 3770K - 32GB RAM - 2x nVidia 660GTX SLI'd
User avatar
phenest
 
Posts: 1571
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Mouse clicks, sometimes also keyboard, stop; cursor OK

Postby jg_telensa » 2017-05-26 16:06

phenest wrote:Did you get that from Gnome Tweak Tool?


Yep.

phenest wrote:Have you checked in dconf-editor for other settings that might not be default?


Not until now. However (as a primarily low-level dev who doesn't spend that much time at the WM level) it's not clear to me how to winnow out which settings aren't default, so I'd appreciate your guidance there, please. There's an awful lot of settings to check!

Is there some way to filter them for non-defaults, other than meticulously going through every one, looking to see if the "Set to Default" button's greyed out or not?

(BTW, I'm about to head home; back at work Tues, so no hurry to reply today. I appreciate any and all help as offered!)
jg_telensa
 
Posts: 6
Joined: 2017-05-18 14:17

Re: Mouse clicks, sometimes also keyboard, stop; cursor OK

Postby phenest » 2017-05-26 16:16

When you open dconf-editor, press Ctrl-F to do a search. Type your search criteria, such as "focus", and click the down-arrow next to the search box to cycle through the results. Look for anything related and whether it's default setting is on/off.

More ideas:

Do you use any extensions such as maximus?

What happens if you change the setting for Attach Modal Dialogs to OFF? This is based on the error you reported:
Code: Select all
Gjs-Message: JS LOG: pushModal: invocation of begin_modal failed

Does using Alt-Tab to switch between programs regain focus?

Does restarting the shell with Alt-F2 and "r" (for restart) regain the focus?

Is this related or helpful?
https://bugs.freedesktop.org/show_bug.cgi?id=77037

Or any combinations of the above?

EDIT: Or maybe this?
https://major.io/2015/07/06/allow-new-windows-to-steal-focus-in-gnome-3/
NEC Spirit 550 P4 3.8GHz HT - 2GB RAM - nVidia 7600GT - Pioneer BDR-209DBK
ASUS Sabertooth P67 i7 3770K - 32GB RAM - 2x nVidia 660GTX SLI'd
User avatar
phenest
 
Posts: 1571
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Mouse clicks, sometimes also keyboard, stop; cursor OK

Postby phenest » 2017-05-26 16:31

jg_telensa wrote:Oh - I should add that there's also a metric cr*p-tonne of "gnome-session[something]: (gnome-shell:7020): mutter-WARNING **: STACK_OP_RAISE_ABOVE: window 0x8c01200016 not in stack" messages in the journal too, but this seems pretty Debian-standard at the moment, so I'm assuming they're not relevant; I remember the same with a previous client. Seems to be a known issue that no-one's doing anything about, but I'll throw it into the mix. These messages just flow constantly, and do not seem to coincide in any respect with the mouse-click issue.


https://mail.gnome.org/archives/commits-list/2014-September/msg04244.html

I wouldn't like to comment on whether it's related to your issue or not.
NEC Spirit 550 P4 3.8GHz HT - 2GB RAM - nVidia 7600GT - Pioneer BDR-209DBK
ASUS Sabertooth P67 i7 3770K - 32GB RAM - 2x nVidia 660GTX SLI'd
User avatar
phenest
 
Posts: 1571
Joined: 2010-03-09 09:38
Location: The Matrix


Return to Desktop & Multimedia

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable