Commit 7247166
mescon
Auto-restore the rotation range after the SDK's launch-time 90-degree reset
Closes the '90 degrees on game launch' saga with an automatic fix,
built on the usbmon root cause (games' SDK sessions push an operating
range of 90 via a TrueForce interface-2 packet once at session start,
invisible to HID++) and verified end-to-end against a faithful
reproduction of the game traffic: detection to restore in under
100 ms, and the restored range holds while the session streams.
Mechanism: the 20 s range poll already detects the silent change; when
the external value is exactly 90 and the previous value was not, a
pending restore is recorded and retried on every poll tick until it
lands, strikes out, or becomes moot. Safety gates, each earned from a
real incident during development:
- only the known pathology (external change landing exactly on 90) is
restored; any other externally-set value is a game applying its
configured steering lock and is respected;
- desktop mode only, never an automatic mode switch (mode churn under
load is what historically desynced the centre);
- the wheel must be stationary, measured with two on-demand HID++
encoder reads 50 ms apart (the cached position only updates when
the wheel emits input reports, and the raw encoder's centre is
wherever calibration put it, so only deltas are compared - both
discovered the hard way when earlier gates deferred forever);
- restores only ever widen the range, which cannot snap the wheel
against new soft stops;
- at most 3 restores per session, then log and yield; an explicit
wheel_range write supersedes everything.
New sysfs attribute wheel_range_restore (default 1; 0 = the previous
detect-and-report-only behaviour). Also extracted rs50_set_range_hw
from wheel_range_store for shared use, and added gate-visibility
hid_dbg lines used to verify the mechanism live.1 parent 55c5f7e commit 7247166
3 files changed
Lines changed: 304 additions & 41 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
156 | 158 | | |
157 | 159 | | |
158 | 160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
132 | 160 | | |
133 | 161 | | |
134 | 162 | | |
| |||
0 commit comments