pop-os / pop

A project for managing all Pop!_OS sources
https://system76.com/pop
2.43k stars 84 forks source link

Wake from suspend, keyboard misses keys #1800

Open markwylde opened 3 years ago

markwylde commented 3 years ago

Distribution (run cat /etc/os-release): NAME="Pop!_OS" VERSION="21.04" ID=pop ID_LIKE="ubuntu debian" PRETTY_NAME="Pop!_OS 21.04" VERSION_ID="21.04" HOME_URL="https://pop.system76.com" SUPPORT_URL="https://support.system76.com" BUG_REPORT_URL="https://github.com/pop-os/pop/issues" PRIVACY_POLICY_URL="https://system76.com/privacy" VERSION_CODENAME=hirsute UBUNTU_CODENAME=hirsute LOGO=distributor-logo-pop-os

Related Application and/or Package Version (run apt policy $PACKAGE NAME): I'm not sure. It's whatever does the login screen.

Issue/Bug Description: When awaking the machine on a system76 Oryx Pro, the login screen appears. I then start typing in my password, but randomly some keys will be missed.

So for example, if my password is "testing", I'll type it in, and maybe the inputted value will be "tstig".

Is there any way to fix this. Maybe blocking the input field until the system is actually ready.

Steps to reproduce (if you know): This happens for me around 1 in 3 awakes.

  1. Suspend the laptop
  2. Awake the laptop
  3. Immediatly enter your password
  4. Click the reveal
  5. The password is partially complete

Expected behavior: That every key I press will put the key into the text field.

Other Notes:

I should also mention:

  1. I've completely reinstalled pop-os twice.
  2. I've tried both 20 and 21
  3. It's been happening ever since I got the machine 6 months ago, but I'm only reporting it now.
bflanagin commented 3 years ago

Thanks for the report @markwylde. Since you own one of our laptops you can talk directly to our support team about the issue. https://support.system76.com/ depending on the solution they may need to update this issue, so be sure to mention it in your support request.

mtimofiiv commented 2 years ago

This happens to me. The issue even persists after restarts. It's not just the passwords, it's all keyboard input. I booted into recovery mode, and it was there too.

It also happened once when I wasn't coming out of suspend but when I was running a Steam game (using a controller, not the keyboard to play). When I quit and returned to the keyboard I found it was glitched like this.

Basically some of the keys at least fail to register input, sometimes they register it late, and sometimes work just fine. For me, it seems the letters "e" and "s" are most affected although I see it in many other letters.

Modifier keys like the Shift sometimes work and sometimes they don't register, and the other key either, making things like <Ctrl>+<v> really hard to do, and typing in your sudo password into the command line? Forget it.

So if I type "hey friends" I might get "hyns".

I have been in touch with support already (this is a System 76 Gazelle), and I will update what has been told to me here if a solution is found.

markwylde commented 2 years ago

Even if you could just show a loading spinner, or disable the input until it's actually ready, it would save a lot of frustration.

mtimofiiv commented 2 years ago

Hey @markwylde, you have a Nvidia card in your Oryx machine, right?

There's a lot of topics in this repo but also in Ubuntu places about Nvidia drivers + hardware basically messing up things after suspends. The issues include:

I have experienced all 3 personally. Never in iGPU mode.

I upgraded to the 515 version of the Nvidia drivers, and haven't seen any issues yet, however I also haven't suspended and closed the lid yet, given the unpredictable nature of some of these problems and how I just don't want to waste a whole morning trying to undo this keyboard issue by trying a bunch of things. I will test when I have more time.

You might think "wtf do graphics drivers have to do with the keyboard?" but this post here on the Nvidia forums describing similar issues describes keyboard input issues in addition to black screen and kernel panic. This post on Askubuntu says to use the band-aid fix of removing using systemd suspend in favour of the older driver callback method on driver version 510 as well.

jdr53 commented 1 month ago

It's three years later - did this ever get resolved? Several months ago I started having a similar problem. First, the Backspace key, then over the space of a couple of days, three or four more keys failed to respond. Reboot, power cycling, etc. did not help. So I bought a replacement keyboard for my Oryxpro, directly from System76. Installed it, and it has been running OK for about a month but is starting to do the same thing in the past couple of days. So far, it is limited to the "w" key (and note: EVERY time I need a "w" I have to cut-and-paste it from somewhere else, such as a web page, document, etc. So far, about a half-dozen times in this post). I've tried "kernelstub" to add 8041 reset and other commands based on a post on a different site. I've tried changing graphics from nvidia to integrated to hybrid, re-seating the keyboard connectors, powering off (completely) and back on. Tried various methods to suspend (by timeout, by menu key, by Fn-F12 hot-key). Tried reboot (warm) and full shutdown/startup. Tried vacuum around the keys with a nylon over the end of the hose to avoid sucking off keycaps.Nothing helps.

It seems unlikely it's a software problem - other keys connected to the scan lines that run through the cables on the back of the keyboard to the motherboard work (for now at least). That seems to imply that row / column scanning is done on the mainboard, not on the keyboard itself. There is no indication of excess heat, loose cables, or slipping of the really tiny clips that hold the cables in place - though again, that seems unlikely to be the cause, since many other keys share the row and column scan lines that go to the mainboard.

Any suggestions would be greatly appreciated!

I've contacted System76 again (their service has been great over the past few years) but haven't heard anything back yet, several days after first reaching out to them. Mainboard going flaky? Odd nvidia interaction? Another keyboard gone bad? Something else? I can't tell. But looking around various forums this problem is apparently not unique to System76 machines (although there are quite a few posts about the problem on System76).

mtimofiiv commented 1 month ago

@jdr53 it is most likely a hardware issue - not OS, 3rd party driver, etc. This is the conclusion I have come to after extensive testing. Your case might be different of course, I only speak for myself. I'm curious if you have the same identical observations though.

I've been in contact with System76 support about it as well, and they also believe it is hardware related - however due to where I live, shipping a laptop back to them for repairs is not feasible. So I've kind of just lived with it.

First of all, keyboard input drops happen in regular OS, in old kernel, and in recovery mode. I even get it on reboot at times, when it happens during disk decryption step before the OS is even active.

I don't believe it's actually related to the actual keyboard itself. In fact, it seems to be related to the power system. Whenever my keyboard starts dropping inputs after waking, the battery indicator on the top right is replaced with the power icon, which suggests to me the battery is temporarily cut off as well.

There are times when the input drops start while the computer is actively being used as well - in that case, the battery percentage is dropped to 0% even if it was at 99% before in the battery indicator. This is how I know my keyboard is screwed up before even typing anything - by the battery percentage up top-right.

Lastly, I have found that often, shutting down the machine and unplugging the power cable and starting the computer on battery seems to instantly fix the issue. Plugging the cable back in after retains proper keyboard functionality.

This seems to happen most to me when I place my laptop on non-solid surfaces like a couch. Or, when I have my laptop in my bag on the way somewhere and it gets bumped slightly.

So my overall conclusion is that the connection with the battery as well as the keyboard are adjacent and are affected by the battery wiggling in its housing and causes the keyboard to drop inputs. Perhaps the keyboard connection lacks proper shielding? I don't know, I'm not versed enough in electronics/engineering to be able to accurately identify the possible issue here.

Anyways, if that sounds like your case, then you're probably in the same boat as me.

jdr53 commented 1 month ago

Thanks for the quick response, mtimfiiv. It does seem like a hardware problem, but then since multiple keys are connected to the row and column scanning chip it would seem that all of the keys on a given row or column would fail together. That isn't the case now and wasn't with the former keyboard (that I replaced about a month ago).

Your idea about powering down, restarting, checking the "w" key, and then plugging the power back in was intriguing and an idea I hadn't heard before. Unfortunately, it didn't help.

Like you, the key (currently just one) drops every time. After a cold start, after Suspend/Resume, etc. Unlike you, there are no odd indications from the battery. Right now it's at 92% again, after the shutdown and on-battery startup. It's going up as I expect.

Temperature hasn't been a problem as far as I can tell. CPU and GPU are usually in the 40-50 C range. In the past I had "lifters" on the rear corners of the laptop to improve airflow and give a friendlier typing angle. It is exceedingly rare that the machine is not on a hard surface with good airflow. That has improved: I bought a Klim laptop base with USB fan not too long ago (the fan is powered from my multi-power USB soldering iron supply, not from the laptop, since it pulls about 0.7 A). Before, I usually had CPU and GPU temps around 40-50 C, occasionally higher such as if doing CAD stuff. Now it's usually in the 35-40 C range.

I'm tempted to put the original keyboard back into the machine and see if it starts dropping the backspace, "w", "3", and other keys that failed before the replacement. Those tiny black cable holders are a real pain though, so for now I'll wait and see if System76 has any other ideas.

Thanks again for the reply!