aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAndre Brait <[email protected]>2024-10-06 10:50:39 +0200
committerGitHub <[email protected]>2024-10-06 21:50:39 +1300
commit7f475b590a1c497ca77c818cd295a94c606b7e6e (patch)
treec75ac7e9383990217f6c5dec0b34c515d05f8c9f /docs
parenta322107cb7b347a8c2020fcab5b9505c328daa24 (diff)
downloadqmk_firmware-7f475b590a1c497ca77c818cd295a94c606b7e6e.tar.gz
qmk_firmware-7f475b590a1c497ca77c818cd295a94c606b7e6e.zip
Tweak OS detect, add OS_DETECTION_SINGLE_REPORT (#24379)
* Default OS_DETECTION_DEBOUNCE bumped from 200ms to 250ms * Add OS_DETECTION_SINGLE_REPORT to prevent undesired multiple reports * Prevents random stability issues on ARM MacBooks after switching via KVM * Works for every device I could test, including ARM MacBooks * Disabled by default to keep current behavior * Add Troubleshooting section on documentation * Tweak reset logic to prevent a freeze with some KVMs The USB stack on ARM MacBooks is more similar to that of iOS and, for some reason, it seems to like sending packets that influence the OS detection and results in a second OS_MACOS report being sent at a random period of time after plugging the keyboard back. This does not always happen and the consequences of this vary based on what the user is doing in the callback, but since this is not obvious and it's hard to debug, I've decided to add a flag for those affected by such issue. The stability issue I had in mine was a combination of factors and I found the actual cause being my own bad math when changing the default layer, but this change alone is also confirmed to fix it. Lastly, soem KVMs seem to leave the USB controlled in a suspended state when cold-booting Windows, meaning the keyboard would hang and the reset logic would not work. This tunes it so that it can get out of such state. Also retested for compatibility with my old KVM to ensure the logic works for both.
Diffstat (limited to 'docs')
-rw-r--r--docs/features/os_detection.md30
1 files changed, 23 insertions, 7 deletions
diff --git a/docs/features/os_detection.md b/docs/features/os_detection.md
index d0556d2549..880e88d4b9 100644
--- a/docs/features/os_detection.md
+++ b/docs/features/os_detection.md
@@ -70,17 +70,33 @@ The process is done in steps, generating a number of intermediate results until
We therefore resort to debouncing the result until it has been stable for a given amount of milliseconds.
This amount can be configured, in case your board is not stable within the default debouncing time of 200ms.
-## KVM and USB switches
-
-Some KVM and USB switches may not trigger the USB controller on the keyboard to fully reset upon switching machines.
-If your keyboard does not redetect the OS in this situation, you can force the keyboard to reset when the USB initialization event is detected, forcing the USB controller to be reconfigured.
-
## Configuration Options
-* `#define OS_DETECTION_DEBOUNCE 200`
+* `#define OS_DETECTION_DEBOUNCE 250`
* defined the debounce time for OS detection, in milliseconds
+ * defaults to 250ms
* `#define OS_DETECTION_KEYBOARD_RESET`
- * enables the keyboard reset upon a USB device reinitilization, such as switching devices on some KVMs
+ * enables the keyboard reset upon a USB device reinitilization
+ * this setting may help with detection issues when switching between devices on some KVMs (see [Troubleshooting](#troubleshooting))
+* `#define OS_DETECTION_SINGLE_REPORT`
+ * allows the report callbacks to be called only once, when the OS detection result is considered stable
+ * subsequent changes in the detection results, if any, are ignored
+ * this setting may help with delayed stability issues when switching devices on some KVMs (see [Troubleshooting](#troubleshooting))
+
+## Troubleshooting
+
+Some KVMs and USB switches may cause issues when the OS detection is turned on.
+Here is a list of common issues and how to fix them:
+
+* **Problem**: _keyboard won't redetect the OS when switching between machines using a KVM_
+ * **Explanation**: some KVMs keep the USB controller powered on during the switch and OS
+ detection happens when the USB device description is being assembled.
+ * **Solution**: use `OS_DETECTION_KEYBOARD_RESET` to force the keyboard to reset upon switching.
+* **Problem**: _keyboard OS detection callback gets invoked even minuted after startup_
+ * **Explanation**: some OSes, notably macOS on ARM-based Macs, may cause this behavior.
+ The actual cause is not known at this time.'
+ * **Solution**: use `OS_DETECTION_SINGLE_REPORT` to suppress repeated callback invocations.
+
## Debug