r/Keychron • u/ImaginaryPlan3985 • Jan 18 '25
keychron latency
Hey all!
I recently broke my beloved logitech g915 tkl and I guess I have to replace it... I have my eye on the k13 pro, but looking at rtings for the latency and comparing it with my g915, it's pretty bad. We're talking like 4.5 ms vs 10 ms latency, and me playing cs2, where proper movement and such is vital, I do kind of need a pretty low latency.
However, I read this comment from a guy on here (https://www.reddit.com/r/Keychron/comments/15tlb71/comment/jwsq8lj/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button) and it seems you can optimize the polling rate. Anyone else who've flashed their firmware and done a test to see? I hope that's the case!
Reading further in that comment chain, someone has suggested that the latency issue is no more since a later firmware version, anyone who can confirm this?
2
u/PeterMortensenBlog V Jan 18 '25
Re "looking at RTINGS.com for the latency": That is probably this review
1
u/ArgentStonecutter K Pro Jan 18 '25
The k13 pro is a QMK board and unless keychron has done something stupid that means it's got a 1kHz scanning rate.
1
u/Ok-386 Jan 18 '25
I never bothered measuring/figuring out the latency in ms. You could check the lemokey which is supposed to be their gaming brand, and value for money the P1 Pro series is probably the best board globally available (assuming one's ok with 75%, heavy board).
There's now HE version too, but is about 50 bucks more expensive.
You haven't mentioned your budget, but P1 Pro is probably cheaper than g915, and you get much better board overall, high speed wifi, etc. Tho, it could be that latency measured in ms isn't as good. As I said I haven't checked it b/c I'm not into competitive gaming (esp at highest level vere few ms might make a difference).
1
u/PeterMortensenBlog V Jan 18 '25 edited Mar 15 '26
OK, I tried using DEBUG_MATRIX_SCAN_RATE for a K Pro series keyboard, K10 Pro (using the latest firmware, compiled from source (2025-01-17. 3FD443), and capturing the output with hid_listen (also compiled from source)).
The result was about 400 Hz for the static RGB mode ("Solid colour"). Though it may not be representative, as I have (static) per-key RGB.
I think the base rate is actually 500 Hz, but sometimes the interval is about 10 ms, which results in an average of 400 Hz. Thus, the worst case may be 10 ms.
Debug output:
It was slightly lower for some RGB animation modes:
"Band spiral"
Interestingly, it was higher, about 600 Hz, for some of them (I think it was "Jellybean raindrops" and "Pixel rain"):
The lowest were "Reactive multiwide" and "Reactive multi Nexus":
Turning RGB light off (Fn + Tab) had the highest rate:
Source code file changes
To file 'config.h', add this line:
To file 'rules.mk', add this line:
The output was captured with
hid_listen.Conclusion
The (keyboard) scan rate for a K Pro series keyboard should contribute less than 2.5 ms to the latency, though the worst case may be about 10 ms.
References
3
u/strykerbw Feb 03 '25 edited Feb 03 '25
I did a deep dive into this recently to optimize my Keychron V3 so I'll post my findings.
Getting good keyboard latency involves optimizing a few components.
Clocks
There are two clocks you should know. One is USB polling rate and the other is matrix scan frequency.
The USB polling rate determines how often the keyboard responds to system requests and the matrix scan determines how often the keyboard detects changes in keys. Your key latency is going to be bottlenecked by the slower of these two speeds. You also generally want the matrix scan frequency to be greater than USB polling rate.
Recent Keychrons advertise a USB polling rate of 1khz. Indeed, QMK (the open source software that Keychron uses to allow users to customize their keyboards) set the default USB polling rate at 1khz since sometime in 2022. So USB polling rate is already set correctly assuming you bought the keyboard recently.
The trickier thing to optimize is the matrix scan frequency. You won't even know what your keyboard's scan frequency is unless you enable some flags in QMK to see debug statements and flash your firmware with the resulting binary. I used the latest master version of the qmk_firmware code, where the Keychron V3 code is merged upstream. What I found was that my Keychron V3 actually has 1,000hz matrix scan frequency with RGB lighting enabled and turned on. With RGB lighting off (but enabled), it jumps to 1,500hz. In other words, RGB adds a huge amount of lag to matrix scan frequency. Other options also affect the scan frequency, but from what I've seen, RGB lighting was the biggest factor. I can imagine that if you have complicated RGB logic, it might lag even more.
Debounce algorithm
Mechanical keys have jitter and random noise in their function that can send multiple signals to the keyboard. If the keyboard interprets all these signals literally, you will often get double presses and chatter. The firmware attempts to prevent these spurious signals. On QMK keyboards, the default algorithm is to defer, which waits for a window of time (5ms by default) and only sends signals if it finds that the key is down by the end of the window.
I tested this feature by setting the window to be very high. Indeed, defer algorithms have a huge delay before a key makes it to the computer. To optimize this layer, you want to choose an eager algorithm and potentially a smaller window. An eager algorithm always lets the first signal through and only blocks subsequent signals.
However, you may create double presses and chatter if you are too aggressive with these settings, so you may need to experiment with the values.
Switches
This part may be obvious, but if your key switches have a high actuation distance, you will need to press farther to send a signal, which adds latency.
Summary
Since the latest QMK code seems to already imply a high matrix scan frequency for my V3, it may be the case that firmware updates have already fixed a big part of Keychron's latency issue.
That said, I will list what you can try to optimize for even better latency.
Without building a new binary:
With building a new binary:
I believe the rtings.com article on the poor latency characteristics of the V series is due to not optimizing these components. They were testing on the V1, which came out quite a long time ago.
2
u/PeterMortensenBlog V Jan 18 '25 edited Jan 18 '25
Re "the latency issue is no more since a later firmware version": That is probably this comment (my emphasis):
Presumably, that frequency is the scan rate.
Though the (USB) polling rate could still be low. This RTINGS.com review measured a latency of 20 ms for the V series (near "Single-key latency"). Or maybe they measured with some RGB animation enabled (the default one?).
Scan rate vs. polling rate explained.
QMK now has a script to show the polling rate.
1
u/UnecessaryCensorship Jan 18 '25
I have seen some indication more recent firmware has increased the latency in order to cope with sub-par factory switches.
In theory, you can compile your own firmware to do whatever you want. Just be aware that many of the Keychron boards force you to use their custom version of QMK and not the canonical source tree.
If you are a serious gamer and these things are important to you, make sure you purchase a board that can run firmware compiled from the canonical QMK source tree.
1
u/PeterMortensenBlog V Feb 22 '25 edited Apr 07 '25
The DEBUG_MATRIX_SCAN_RATE result (matrix scanning rate, not to be confused with the USB polling rate) for the V Max series (tested on V6 Max):
1060 Hz - 1750 Hz, depending on the RGB animation mode.
A typical value is 1600 Hz, including for the static mode ("Solid colour"):
Though I am not 100% sure if it can be trusted. The ratio to the V5 result (1000 Hz) is suspiciously close the microcontroller clock ratio between the V Max series and V series.
3
u/[deleted] Jan 18 '25
[removed] — view removed comment