Skip to content
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

darp8 keyboard debounce too lax resulting in multiple chharacters #509

Open
uSpike opened this issue Jan 19, 2024 · 12 comments · May be fixed by system76/ec#433
Open

darp8 keyboard debounce too lax resulting in multiple chharacters #509

uSpike opened this issue Jan 19, 2024 · 12 comments · May be fixed by system76/ec#433

Comments

@uSpike
Copy link

uSpike commented Jan 19, 2024

  • Model: darp8
  • BIOS version: 2024-01-10_6c402c3
  • EC version: 2024-01-10_6c402c3
  • OS: ubuntu 20.04
  • Kernel: 6.6.6-76060606-generic

Keys are sommetimes repeated when typing normally. Typing in this issue is intentionally noot coorrected.

Steps to reproduce

Type a bunch of text and eventually kkeys will be repeated.

Expected behavior

OOne press of the key will result in one character typed.

Actual behavior

Sometimes two characters are typed.

Additional info

Probably related to #471

@uSpike
Copy link
Author

uSpike commented Jan 19, 2024

@leviport mentioned system76/ec#405 (review) that they could nnoot tell the difference between two different debounce settings? Is it possible that this is another Clevo change since yoour engineering samples? Also it seems that some letters are more susceptible to repeats such as "o"

@uSpike
Copy link
Author

uSpike commented Jan 19, 2024

Indeed it seems that "o" and keys pressed before/after are repeated most often:

The brown fox jumps over the lazy dog
The brown fox jumpps over the lazy dog
The brroown foox jumps over the lazy dog
The brown foox jumpps over the lazy dog
The brown foox jumps over the lazy doog
The brown fox jumps over the lazy dog
The brown foox jumps over the lazy dog
The brown fox jumps over the lazy dog
The broown fox jumps over the lazy dog
The broown fox jumps over the lazy dog
The broown foox jumps over the lazy doog
The brown foox jumps over the lazy dogg

@leviport
Copy link
Member

I doubt it's a hardware difference. Keyboard debounce is a highly subjective setting. When we had it set to 5ms, I didn't notice any repeats. Changing it to 10ms fixed it for most. Typing styles vary widely across different individuals.

Are you comfortable building and flashing EC on your machine? I'd be curious whether changing it back to 15ms is sufficient for you. Since 5ms doesn't cause repeated keystrokes for my typing style, the testing I can do myself is quite limited.

@uSpike
Copy link
Author

uSpike commented Jan 19, 2024

15ms is better,, but i'll try 20

diff --git a/src/board/system76/common/kbscan.c b/src/board/system76/common/kbscan.c
index 4d3b650..a5ef0a7 100644
--- a/src/board/system76/common/kbscan.c
+++ b/src/board/system76/common/kbscan.c
@@ -21,7 +21,7 @@
 #endif // KM_NKEY
 
 // Debounce time in milliseconds
-#define DEBOUNCE_DELAY 10
+#define DEBOUNCE_DELAY 15
 
 // Deselect all columns for reading
 #define KBSCAN_MATRIX_NONE 0xFF
The quick brown fox jumps over the lazy doog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy doog
The quick brown fox jumps over the lazy dog
The quick brown fox jumpps over the lazy dog
The quick brown fox jumps over the lazy doog
The quick brown fox jumps over the lazy doog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog

@uSpike
Copy link
Author

uSpike commented Jan 19, 2024

20ms seems to do the trick, I can type over 10 lines with no repeats.

Could y'all be convinced to up the value to 20ms?

uSpike added a commit to uSpike/ec that referenced this issue Jan 19, 2024
I found that a debounce time of 10ms was causing very frequent
twice-registered keys with my typing style.  After setting the
debounce time to 20ms I find that no repeated characters occur
when typing 10 line of text.

Ref: system76/firmware-open#509
Signed-off-by: Jordan Speicher <jordan@jspeicher.com>
@ShabazzKing
Copy link

I hhave the same problem with darp7, since I have bought this machine. I thought it's a haardware issue, so I didn't open the issue. Please System76, fix this problem by setting debounce even to 30 ms.

@leviport
Copy link
Member

leviport commented Apr 1, 2024

@ShabazzKing have you tried 20ms? We don't want to go too high, or quick presses will get ignored.

@ShabazzKing
Copy link

ShabazzKing commented Apr 1, 2024

@leviport

@ShabazzKing have you tried 20ms? We don't want to go too high, or quick presses will get ignored.

No, because I'm not able to compile firmware byy myself, I don't have enough expperience. I can only compile userspace programs, like VLC media player or Strawberry. But of course, I suspect, that 20 ms will do the work.

@uSpike
Copy link
Author

uSpike commented Apr 3, 2024

I've been using 20ms for some time now and while I do get repeated characters, they are infrequent enough as to not be annoying. Maybe a couple per day.

I find it incredible that anyone could use this hardware with the settings at 10ms. I understand there are differences in typing style but even if I'm careful and slow when typing I get a lot of repeated characters.

@leviport
Copy link
Member

leviport commented Apr 3, 2024

We're finding that debounce time is highly subjective. 15ms was originally the value, but we had reports of skipped keystrokes, which is why we went to 5ms. Then 5ms was too short for many, and 10ms was the new value.

Having tried the whole range myself, I don't seem to have issues with any of them. I only got repeats when I moved the debounce time down to 2ms, and I didn't get skipped keys until I moved it above 30ms (I think I tried 45 or so, but I forget).

If there's no perfect default that we can settle on, we may have to make this an end-user configurable setting.

@aescgar
Copy link

aescgar commented May 3, 2024

If there's no perfect default that we can settle on, we may have to make this an end-user configurable setting.

This is absolutely the right answer, if doable. Thehre can be a sane default while still allowing useres to set their own tweaks. As you can see, I would also benefit from having this as a customizable setting.

@uSpike
Copy link
Author

uSpike commented May 4, 2024

I agree that making it user configurable is the best solution. Use case: I needed to use my wife's laptop (same model) and immediately I had lots of repeated chars. So many that it was difficult to do what I needed which was simple terminal commands to upgrade packages and things. No way am I going to flash firmware to use her machine for a few minutes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants