-
-
Notifications
You must be signed in to change notification settings - Fork 839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Random key repeating when under high load #545
Comments
Similar issue here. Not 100% sure if it's Karabiner either. But it's one more sample :) |
Same issue here, I've had it happen twice now (once with left arrow, once with volume-down -- both while machine was cranking, fans spinning, etc). |
Same thing here. It’s happening quite often for me on an older 2010 MacBook Air. |
Same here and it's happening really often, even under light CPU usage. When using Chrome and ctrl-tabbing to next tab, it seems that the ctrl-tab combination stays "pressed" for a while and it jumps five tabs ahead instead of one. I've also noticed when text editing, the space key gets "stuck" at times. Only modification I've enabled is Karabiner-Elements version: 0.90.79 |
Karabiner-Elements leaves the key repeat handling to macOS since v0.90.69. |
@tekezo I can’t test definitively whether it is Karabiner, because my keyboard still stops working entirely when I quit Karabiner, but I think it may be Karabiner rather than macOS because I don’t remember it starting to occur after a macOS update. |
I'm experiencing this too, and I think it started after either the most recent or the second most recent Karabiner update. I don't think I've installed any macOS updates recently. |
I'm seeing the same. Using my 60% (GON NerD) standing on top of my MacBook keyboard. Using Karabiner to disable the internal MacBook keyboard. Under high load it seems like turning off the internal keyboard seems to cut out as some keypresses from the internal keyboard get registered and at some point I get the stuck key issue. Only restarting the MacBook solves the stuck key issue for me. |
This happens to me frequently and turning off karabiner-elements makes the issue go away. |
I'm having this issue and it is 100% due to karabiner-elements. I absolutely love being able to tweak keyboard to exactly what I want, but if it's going to put in a bunch of random letters at random times, I can't use it! Is there any work on a fix? |
It's pretty bad - consistently seeing this behavior several times a day. Turning off karabiner-elements fixes the issue. |
I have this issue too, mbp 2015, on heavier load it becomes a real problem as pressing a key will result in random amount of repeats. |
So... any updates on this? @tekezo? Anything we can do to help out? |
Any chance we can get an update on this of some kind? It's getting really, really frustrating to have all my programs quit because karabiner keeps repeating key commands like "cmd-q" |
I have the same issue on new Macbook 13" Early 2015. I'm suspecting Karabiner and since I've disabled it, issue is gone. Karabiner version: 0.90.86 |
Had this issue all time time since using Karabiner Elements. Began to use it very early when the only way to config was through editting config file. Same as others. After I quit Karabiner issue is gone. Currently Karabiner version: 0.90.86 |
I've had this happen to me a few times now. Occasionally I get a lag when typing, and worst sometimes delete seems to get stuck and keeps deleting things until I hit the control key (for some reason). I been unable to identify any pattern behind this happening. Does not happen when Karabiner Elements is not running. Keyboard: CMStorm (no additional software installed) |
I'm uninstalling, too, until this thread wraps up. I'm seeing this behavior roughly 2x week, most often after coming back from sleep (which might just be a type of high load condition). If there's logging I can enable to rule out Karabiner, I'll try it! I love using my Caps key for vim escape. I'll miss this. This SO overflow seems loosely related: https://apple.stackexchange.com/questions/13708/disabling-the-keep-pressed-function-of-os-x-sticky-keys |
The issue is definitely related to CPU load—on a newer machine it rarely occurs but on an older 2010 MacBook Air it happens almost constantly when the CPU has a load and it makes Karabiner unusable. |
@tekezo any update here? Anything we can do to help out? This has become completely unusable for me =/ |
Same here MBP 15" Mid '14 |
This is really becoming unusable. I'm completely reliant on having my Caps = Ctrl/Esc otherwise I would uninstall this. Currently, I just have come to expect 1-2 catastrophic key repeats every day now where a sticky key will do something like CMD-Q every single app I have open. Any sort of update would be appreciated. |
Is a full list of previous releases available somewhere? I was going to try reinstalling previous releases to try to narrow down the release that introduced this problem, in the hope that it would help make the fix more obvious for @tekezo, but I don’t see any way to get the previous releases easily unfortunately. |
@jessejanderson You can remap Caps to Ctrl/Esc without Karabiner. This dialog opens up after clickin "Modifier Keys…" I'm using Karabiner only to remap £ with ~ on my EU keyboard. Not a big deal, so I keep it uninstalled until it's fixed. |
@daniula thanks but I actually need Karabiner to map Caps to Ctrl AND Esc. |
Any news on this one? Having the same problem :/ |
Also having this problem. |
I'd totally overlooked the Mac Keyboard menu shortcut, @daniula. That does everything I need: Caps->Esc. Thanks! |
@saagarjha |
I appreciate the rapid response, as well as your initiative to get this issue resolved! To go into more detail about what needs to be done regarding blocking the main thread, I'd suggest writing your code with realtime constraints in mind. If you haven't done this before, I'd suggest doing some research on how this is done; often you can find some high-quality articles that focus on realtime audio but should apply here as well. In short, you should not be making any blocking calls on the main thread–so disk I/O, mutexes, etc. are certainly off the table. For audio things like allocating memory (e.g. |
Unfortunately, it seems that this is still an issue. Here's a new sample:
Seems like $ echo "int main() { while (1) {} }" | clang -x c -o while -
$ sudo echo # So that the next sudo doesn't ask for a password
$ for i in `seq 1 100`; do ./while &disown ; done; sleep 5; sudo sample `pgrep karabiner_grabber` > sample.txt; killall while Doing the above with Karabiner not running works as expected, with no key repeats. |
I can confirm @saagarjha sampling method also triggers the issue in my machine. Here's the stack.
|
Wow, that's a much more interesting sample!
@tekezo, yeah, it looks like |
Thank you for feedbacks! Note: |
You mean something like a higher nice value? I don't see anything out of the ordinary here for hidd, so is there some other mechanism that macOS might be using here?
I see this issue occur even when there aren't a whole lot of processes. I can try making a multithreaded test and seeing what happens… EDIT: I created a multithreaded test case: #include <pthread.h>
void *wait(void *foo) {
while (1) {
}
}
int main() {
pthread_t threads[100];
for (int i = 0; i < 100; ++i) {
pthread_create(&threads[i], NULL, wait, NULL);
}
pthread_join(*threads, NULL);
return 0;
} This one causes a repeat to occur immediately (as in, the key event that comes from pressing enter to run the command gets held on to and repeated). Interestingly, the sample has very little of note:
|
I changed the karabiner_grabber process priority at v12.0.12. The main change is adding DetailI confirmed your issue with this code. I also confirmed the problem is reproduced without Karabiner-Elements at high concurrency. (e.g., 100 processes on my machine) Thus, this issue with high CPU usage is a macOS architecture limitation. The above change is one of the way to do it. |
WOOT! This seems to have fixed the issue, at least for me (And I was able to reproduce it VERY easily). I pegged my CPU to the point where typing is being delayed and I'm not getting any repeated characters, yay!!! |
Yes, this seems to have fixed it! The fact that you needed to add set the daemon to Interactive might explain the odd sample I had above: launchd was just pausing karabiner_grabber, which is why it wasn't doing any meaningful work. Anyways, I'll use this for a couple days and use it as I was previously; I'll let you know how it continues to perform. Great work! |
This does seem to be entirely fixed (running v12.1). Thank you so much @tekezo 🙌 |
Haven't had an issue since the last patch!
… On 31 May 2018, at 18:40, Ryan Tuck ***@***.***> wrote:
This does seem to be entirely fixed (running v12.1). Thank you so much @tekezo <https://github.com/tekezo> 🙌
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#545 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AApcaC9PLgNN1qI7I7s5AG5JUlGxNqp-ks5t4GNcgaJpZM4LeTSf>.
|
Ok, so after using this for a week the issue has mostly disappeared, except for one infrequent case involving the function keys (the brightness and volume keys are the easiest to see, because their results are immediately visible on the screen). Interestingly, in this case, the load is rather low until the key is pressed, when it spikes and causes the key to repeat. It's pretty rare and hard to reproduce, which has the upside that it's not really annoying, but the downside that it's hard to fix; let me know if you can figure out what's going on here. |
I just ran into this issue again (under high multi-threaded cpu load) even though the grabber process has a high niceness level now. What was interesting was the fact that while the cpu load stayed relatively stable, the issue only appeared very regularly about every 5 seconds (either repeating or not reacting to input for about half a second). Without karabiner enabled input worked flawlessly. Interesting however: if i put load on the cpu by spawning a bunch of yes > /dev/null processes, it does not trigger this issue at all. So I would say it is probably related to IO / Kernel activity of some sort that still triggers the issue. Did some checking and it appears there are some apis to get real time behaviour for threads (Interactive only increases process priority with no guarantees) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Trying to work around the issue noted in the comment: pqrs-org/Karabiner-Elements#1645 Possibly also related to: pqrs-org/Karabiner-Elements#545 Seems that under high CPU load (which might be happening at wake-up time) Karabiner may be exacerbating a tendency of the OS to jam the keyboard. I've had a number of hard-resets as a result of this lately: https://wincent.com/snippets/1159 The commands used to enable/disable here taken from: https://github.com/tekezo/Karabiner-Elements/blob/b38990db3/src/share/launchctl_utility.hpp#L18-L43
I want to add that I've also a repeated key problem, but it's not because of Karabiner (I have it installed but it wasn't always running when it happened). Also, it doesn't seem to be related with a specific keyboard (or at least the "external" key triggers), as I've tried both disabling the built in keyboard with karabiner and disconnecting my external keyboard and it doesn't fix it. |
For me, the issue still shows and only applies to filtered devices. I have key remaps only for the internal MacBook keyboard, and only that one is affected. It's mostly happening when opening the laptop and filling the password field. |
This issue is happening for me, but only with my external Apple Bluetooth keyboard. When it happens, I'm forced to switch back to my M1 MacBook's built-in keyboard, and then I restart the MacBook to get the external keyboard to work properly without key repeats. |
I'm having the same problem, and with external bluetooth keyboard, similar to svicalifornia. |
Im also having this issue. With built-in keyboard. As soon as I quite Karabiner no more problems. It only happens in Apple apps? I have the keys repeated on Terminal or Safari quite often (once a minute almost) but I can't get it repeated while writing on Sublime. |
Confirming that I still see this issue multiple times a day in 2022. In addition, the repeat is sometimes actually delayed until after other keys are pressed. For example if I type the word "disappoint" it might show up as "disappointo" as the "o" is duplicated but not until after the "int" characters are registered. Usually the repeat is clustered, like "disappooint". I've seen this happen with clusters of keypresses, sometimes up to 3. Perhaps totally coincidentally, it seems to happen the most with the "O" key involved. The number of repeats is usually 1 but it can be more than that, I've seen keys repeat 3 times before. Symptoms seem to be worse when CPU-intensive apps are open like video streaming. |
I'm still trying to narrow down if this is definitely Karabiner or something else, but I've noticed if my machine is under high CPU load that typed character often get "stuck" - pressing a key makes it repeat multiple times even though I'm not holding it down.
Has anyone else seen this?
The text was updated successfully, but these errors were encountered: