mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-05 13:20:11 +00:00
The 10.672 ms timer took a block only when it fired, so audio arriving in blocks smaller than 32 haptic frames (16 from a 256-frame legacy port) regularly found fewer than 32 frames and the report was skipped; catching up after falling behind sent two reports back to back and left a ~21 ms hole. The controller, asked to queue only 16 frames, then ran dry, and the haptics dropped out about once per second on hardware. The stream thread now waits on a condition variable until two blocks are buffered and sends one, so reports follow the audio clock, and report 0x32 asks the controller to queue 64 frames (21 ms) to absorb Bluetooth jitter and the difference between the title's rate and the controller's crystal. Closing the stream wakes the waiting thread before the join. Co-authored-by: seradavid <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>