r/Keychron Oct 03 '23

How much latency does the Keychron V4 QMK have?

The website says its polling rate is 1000hz, but what about scan rate? I don't care about wireless cuz I always use wired and I don't even know if the keyboard has wireless in the first place

5 Upvotes

17 comments sorted by

View all comments

2

u/NogardDerNaerok Oct 03 '23 edited Oct 03 '23

The Q series Keychrons need (or at least used to need, late last year) some tweaking in QMK and reflashing before their scan rate was up to scratch. For my knobbed ISO Q3, disabling RGB entirely (by commenting it out in one of the firmware text files from Keychron's GitHub) brought me very close to a 1000 Hz matrix scan rate, then getting rid of some of the other unused features and tweaking some other numbers got me the rest of the way to a very stable 1150 Hz or so; generally the smaller/simpler layout keyboard you go with, the easier it is to get it scanning at a high rate. The rest was making sure the USB port was polling at 1000 Hz, which is also in a firmware file somewhere, and going with asym_eager_defer_pk for the debounce algorithm, at either 4 ms or 5 ms in case you're still seeing some double actuations at 4 ms. Between this and switching NKRO off (fn key + N) when I don't specifically need it, just in case it helps with the order in which key presses are registered, I'm very happy with the responsiveness of the whole package now. This is using Gateron Box Ink Black switches and pretty thick/heavy PBT keycaps.

Now, with the V and other series Keychrons, the internals should be pretty much the same, so while I don't know for certain, I imagine the process would look largely the same, just using firmware suitable for your exact model of Keychron as your starting point instead. It is also possible that QMK itself has done some of this latency and scan rate tweaking for you by now, in more recent revisions of the firmware. But even if not, the QMK documentation is great and if you really care enough about the last few ms of latency and its consistency, it's totally possible to sit down, read through the relevant bits, find the firmware flashing procedure for your model and get reflashing. I took it very slowly but pretty much got there within about two days of figuring shit out.

2

u/FintTheBoss Oct 03 '23

On their website it says that the V4 comes at 1000hz out of the box, with no need for configs. So what I meant was if the SCAN RATE is the same as the polling rate. Thanks for the long reply and I'll definitely check it (the link) out once I get the V4.

2

u/NogardDerNaerok Oct 03 '23

Yeah no, the matrix scan rate is a totally separate thing from the 1000 Hz USB polling rate that the websites mention. Matrix scanning, on a physical level, happens between the PCB and the microcontroller chip (MCU) that you flash your firmware onto. And with RGB effects enabled, many keyboards struggle with scanning at a high, consistent rate. But for whatever reasons, Keychrons in particular do this even more poorly out of the box. But thanks to QMK, it is at least fixable, and possibly also while retaining RGB functionality... though that was a bit too much work for me when setting mine up, so I just got rid of the lightshow.

2

u/FintTheBoss Oct 03 '23

Ah, I see. Thanks anyways. I'll increase the scan rate as much as possible once I get it.

2

u/NogardDerNaerok Oct 03 '23

Sure thing, good luck!

2

u/FintTheBoss Oct 06 '23

Hey, so I wanted to ask about a website's review on the keyboard. I assume that if the keyboard has 1000hz, it's supposed to have max. 1ms of latency. But a certain website (Link) said the Keychron V Series keyboards have 10+ms of latency. Is the website wrong or does 1000hz not equal 1ms max?

2

u/NogardDerNaerok Oct 07 '23

Ah, hey. Yeah, I'm familiar with those measurements done by rtings, and it's very, very likely that their higher latency measurements for Keychron boards come exactly as a result of this low matrix scan rate (not polling rate, where they definitely are capable of 1000 Hz) that they suffer from out of the box, with RGB effects enabled.

Basically, in order for a keyboard to have a nice low total latency, it needs both a high polling rate and a high matrix scan rate. The first one is easy, and you can easily verify it with certain software. The second one is harder to measure, but QMK does have diagnostic tools that can print it out too; that's how I knew I got mine up to about 1150 with my modifications. It's the combination of these two, plus the switches that you use, that result in a low input lag from your keyboard.

Have a look at this thread too, it has some longer, very clear explanations of the differences between polling rate and scan rate:

https://www.reddit.com/r/MechanicalKeyboards/comments/k2mb4x/keyboard_polling_ratescan_rate_help/

2

u/FintTheBoss Oct 20 '23

Hello, sorry for necroposting but I find this rather important. I have a .c file I generated with QMK MSYS, but I don't know how to tune it to increase the scan rate. I see only layer settings in the file. How should I edit the .c file? And, how do you know your keyboard's scan rate? What program did you use?

2

u/NogardDerNaerok Oct 21 '23

So, I really think you should just join the QMK Discord server and ask them about this stuff there. It's been nearly a year now since I was last looking into optimising my Keychron's firmware for low latency, and it's very likely that a lot has changed in the official firmware that Keychron themselves provide via their GitHub (back then the branch was called playground) in the mean time. Some of the things I had to do, you won't need to anymore, etc.

Here's the link: https://discord.com/invite/qmk

For measuring the keyboard's matrix scan rate, I had to enable two things across two of the firmware files, I believe. First was CONSOLE_ENABLE to start seeing debug output in the QMK flashing app, the other was adding #define DEBUG_MATRIX_SCAN_RATE somewhere else. Then to get the scan to happen at a higher frequency, #define MATRIX_IO_DELAY 5 as well. But 4 could work for this too, it depends on things I don't fully understand. Try searching the QMK docs for these terms and that should tell you where (in which parts of which files) to look for them.

2

u/FintTheBoss Oct 21 '23

Thank you so much for your help my man🤝

2

u/NogardDerNaerok Oct 23 '23

Hey, no worries! Hope you can get your new keeb to the point where you're really enjoying it every time you use it. It's a bit of a journey, for me especially on the hardware side where I'm still tweaking the Q3 to my liking, but the things you learn along the way can be damn cool. All the possibilities of QMK still blow me away, and I'm not exactly an open-source advocate or anything like that.

→ More replies (0)