b25cb4a90fa676302f09e577b1cf54b1fcc94177
The previous fix used canonical Off (mode 0x05) everywhere we wanted the trigger to feel released \u2014 pre-race per-frame, idle timeout, shutdown. Per Sony's docs (Nielk1 Rev 6) mode 0x05 "actively returns the trigger stop to the neutral position". Re-asserting it 60 times/sec from main thread, propagated by pydualsense's BG thread to the controller at ~250 Hz, made the trigger motor audibly whine as the firmware repeatedly snapped the (already-neutral) trigger back to neutral. Right answer: hybrid. One-shot 0x05 on the in-race \u2192 not-in-race transition (and on the telemetry-idle timeout) so the firmware actually retracts the motor; mode 0x00 (TriggerModes.Off, no-op clear) for steady-state pre-race / idle frames so we're not yelling RESET in the firmware's ear forever. Implementation: prev_in_race tracks the last frame's race state. Steady non-race frames call _apply_normal (mode 0x00); the first frame after a race-end transition calls _apply_off (mode 0x05). pydualsense's BG thread holds the 0x05 in memory long enough (one main-thread frame = ~16ms = ~4 BG iterations) to publish it to the controller before main switches the in-memory state to 0x00. Restores _apply_normal and DS_MODE_NORMAL that the previous commit deleted. Updates divergence #4 in the module docstring.
My NixOS configs ✨
Hosts
- mreow: My personal Framework 13 laptop
- yarn: Machine I usually just play games on. Boots into SteamOS-like interface.
- muffin: Homeserver, runs various services.
Desktop/Laptop
What do I use?
Browser: Firefox 🦊 (actually Zen Browser :p)
Text Editor: Doom Emacs
Terminal: ghostty
Shell: fish with the pure prompt
WM: niri
Background
- Got my background from here and used the command
magick input.png -filter Point -resize 2880x1920! output.pngto upscale it bilinearly
Description
Languages
Nix
80%
Python
15.7%
Emacs Lisp
2.4%
Shell
1.9%