Desktop briefly becomes unresponsive when typing on 2 keyboards at the same time

Bug #1777708 reported by Mikkel Munch Mortensen on 2018-06-19
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
meta-gnome3 (Ubuntu)
Undecided
Unassigned

Bug Description

I'm running Ubuntu 18.04 and Gnome 3.28.1 with all the latest updates from the repos.

If I connect 2 (or more) keyboards to my computer and type on both at the same time, the desktop briefly becomes unresponsive. More keypresses increase the time of unresponsiveness.

E.g. when typing a full sentence in gedit or the terminal, only very few characters show up on the screen (I guess up until something is pressed on both keyboards at the same time), then everything freezes. Then after a while (some seconds), all the characters show up. And the desktop becomes responsive again.

Symptoms: During the freeze, windows stop updating their content. If seconds are enabled on the clock at the top middle, these freeze too. But I'm still able to move the mouse pointer around during the freeze without any problems.

The back story:

I got an ergonomic keyboard (R-Go Split Keyboard) yesterday, and quickly noticed the issue. But initiallly I thought it was an issue with the keyboard, and the problem wasn't that bad. But as I've gotten more used to the keyboard since yesterday and started picking up a proper typing speed, things got worse.

The keyboard is technically two separate cabled USB keyboards each with only about half of they keys of a normal keyboard (or at least that's very much my impression).

After getting the suspicion that this was a software issue, not a hardware issue, I tried typing on my old Logitech keyboard (Unifying Receiver) along with one of the R-Go halves: Same issue. Then I tried each of the halves without the other (as in "single" keyboard typing): No issue. Then I connected another Logitech keyboard (separate UR), typed on both Logitechs: Same issue.

Some further observations:

1) Nothing of significance in my syslog.
2) If I drop to a non-graphical shell, there's no problem. I suspect this issue is related to X.org or Gnome, but I'm in no position to say anything credible about that.
3) Also no problems when connecting the R-Go keyboard to a Windows or a MacOS machine.

Let me know if there are any logs I can provide or things I can run to produce useful debug output.

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1777708/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
Mikkel Munch Mortensen (3xm) wrote :

> It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it

Sure! But I have no qualified guess.

I did some additional testing today, which may be helpful to others, but confused me a bit more:

I installed Plasma, and here the problem doesn't seem to be there. It feels like there's a slight delay when typing a lot of things at the same time, but it might just be Plasma's way of working. I haven't used it before, so I can't really say whether the slight delay is just how things work or is related to this issue.

But I also found out that I'm able to start a Wayland based Gnome session. Doing that, there's absolutely no problem with they keyboard. All multi-keyboard typing is shown instantly and no UI freeezing.

Based on this, I'm a bit confused about what package to file this bug against, as Plasma (as far as I know) runs on top of X, and Gnome works fine without X.

Pedro Palhares (pdimh) wrote :

I'm glad I found this, because it affects me too. I have the Same problem in gnome, but the problem is not present in plasma. I tried gnome with other OS and the bug didn't occur either.

It is very annoying and I could not find a workaround.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ubuntu:
status: New → Confirmed
Pedro Palhares (pdimh) wrote :

This bug can be easily triggered by typing with two keyboards, Everytime you switch from one keyboard to the other, there is a lag. If you type fast enough you can even freeze the application. Other way to trigger this bug is to use xbindkeys with xautomation, everytime i try to simulate keyboard typing, the lag is there.

It happens with XOrg and Gnome, doesnt happen in wayland. The problem is i cant use wayland with NVidia driver.

Same happens to me.

Mikkel Munch Mortensen (3xm) wrote :

Now that other have marked themselves as affected, I'm trying to add a package, hoping that it will increase the chance that someone will look into it, although I'm not sure this is a Gnome bug (as mentioned earlier).

affects: ubuntu → meta-gnome3 (Ubuntu)
Pedro Palhares (pdimh) wrote :

After being annoyed by this bug for a long time, i started digging and found a workaround. Today i found that the bug is only present when i'm using certain keyboard layouts ("Portugues (Brasil)") and was not present when i changed the layout to EUA and language to English (need to set them both to English).

After some digging i found out the culprit is the ScrollLock key and that can be fixed by editing the layout file, which in my case is found at /usr/share/X11/xkb/symbols/br. The only modification i did was to remove or comment the line: modifier_map Mod3 { Scroll_Lock };
After that, set the language and layout back to Portugues (Brasil) and the problem was gone!

No more delays between typings.

PS: I tried this on Fedora, i will try this on ubuntu tomorrow.

Pedro Palhares (pdimh) wrote :

The only problem is the scroll lock key is no longer useful, but i dont use it, anyway.

PS: The keyboard layout which the bug is not present is US and not EUA like i said.

Mikkel Munch Mortensen (3xm) wrote :

Interesting findings, Pedro. How did you come up with that? What led you in this direction? Did you have a change to try this in Ubuntu yet?

However, this fix doesn't work for me. Switching from Danish layout to English does not get rid of the lag (I tried both US and UK English layouts; don't know if there's a difference).

Pedro Palhares (pdimh) wrote :

Did you set the language to English as well? I've tried in Ubuntu and it worked as well.

BUT I just found out that my solution may not solve your problem. Although it removes the lag between keypresses, if you type two keys at the same type (which happens when you type too fast), there is a small lag. In my case, i don't see any problem, because the secondary keyboard is for a very specific use.

Also, i looked at /usr/share/X11/xkb/symbols/dk file, and looks like the Scroll Lock isn't mapped there.

Mikkel Munch Mortensen (3xm) wrote :

>Did you set the language to English as well?

Yes, I always use the English interface, if that is what you mean.

> if you type two keys at the same type (which happens when you type too fast) (...)

So, if you're hammering away on the keyboards at the same time, do you still get the freeze, even with your fix? (Please, test it!)

> i looked at /usr/share/X11/xkb/symbols/dk file, and looks like the Scroll Lock isn't mapped there.

Right. It may inherit it from some of the other, more general layout files, though. But still:_ Switching to English layout didn't work for me either.

Pedro Palhares (pdimh) wrote :

> So, if you're hammering away on the keyboards at the same time, do you still get the freeze, even with your fix? (Please, test it!)

Yes, the fix i did solved the lag everytime i switched keyboards. The problem is a small lag still happen if i hit the two keyboards at the same time. As i only type on one keyboard at a time, it doesn't bother me, but it will prabably bother you.

Pedro Palhares (pdimh) wrote :

I realized if i set the layout "Portugues (Brasil)" without patching the file, the problem is even worse.

Dominik (misc-dominik-lindner) wrote :

I have exactly the same problem with an R-go split keyboard. Makes Ubuntu basically unusable unfortunately. Changing the keyboard layout doesn't help anything.

Mikkel Munch Mortensen (3xm) wrote :

> I have exactly the same problem with an R-go split keyboard

Great to see some confirmations!

For anyone skimming the comments, I'd like to emphasise that this is _not_ an R-Go specific issue. It can be reproduced by typing on any 2 connected keyboards at the same time. So it's a more general problem, which just happens to manifest itself for users of the R-Go keyboard(s).

Bobby Steed (ltlbsteed) wrote :

I too have issues with keyboard input lag on Ubuntu 18.04. I've made sure I'm current on all updates, I'm using the US layout and my language is set to English.

In my case I am using a KeyMouse Track (which the OS recognizes as two separate keyboards) but I have confirmed that it isn't related to the keyboard devices - two Logitech G810 keyboards plugged in simultaneously exhibit the same behavior.

As others have described, there is significant lag when pressing keys from two keyboards in an alternating fashion, and the faster you press the keys, the longer the delay before anything shows up on-screen once you stop typing. If only keys from one device are pressed, there is no discernible lag even if both keyboards are still plugged in.

Hopefully we can get some traction on this. I don't think Wayland is a viable option for me as I have an nVidia graphics card and I also have to use Skype for work... and I don't really want to switch to Plasma either.

Mikkel Munch Mortensen (3xm) wrote :

To anyone responding to this issue because it also affects them: Remember to click "This bug affects me" at the top of this page, to increase the likelihood that somebody will dig into the problem some day. Thanks! :)

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers