Kaynağa Gözat

fix(haptics): don't relay 0x82 stops -- the real puck never sends them

Second half of matching the reference puck's actuator stream. sniff1.json shows
the real puck's only haptic frames are `82 01 01 f7`, re-sent ~every 18ms in
keep-alive bursts that just stop -- it NEVER sends a 0x82 stop (gain 0); the
controller's haptic auto-decays when the keep-alives stop. OpenPuck relayed
Steam's stop frames verbatim, and per this file's own header every extra 0x82
frame is an audible click on the controller.

Drop 0x82 stop frames (01 01 00) at the relay choke point and let the haptic
decay like the real puck does. Separate commit from the 0x81 removal so the two
can be A/B'd independently.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Jariullah Safi 4 ay önce
ebeveyn
işleme
f5c3fc979f
1 değiştirilmiş dosya ile 9 ekleme ve 0 silme
  1. 9 0
      OpenPuck/haptics.cpp

+ 9 - 0
OpenPuck/haptics.cpp

@@ -338,6 +338,15 @@ void rfConnFlushRelay(uint8_t ch, uint8_t s1)
 	while (g_rqTail[cur] != g_rqHead[cur]) {
 		RelayMsg &m = g_rq[cur][g_rqTail[cur]];
 
+		// 0x82 stop (gain 0): drop it. The real puck NEVER sends a 0x82 stop (sniff1.json) -- its haptic is
+		// keep-alive `82 01 01 f7` re-sent ~every 18ms and simply auto-decays when the frames stop. Relaying
+		// Steam's stop frames is an extra on-air actuator frame the reference never emits, and per this file's
+		// header every extra 0x82 is an audible click. Drain without TX; the haptic decays on its own.
+		if (m.rid == 0x82 && m.len >= 3 && m.data[0] == 0x01 &&
+		    m.data[1] == 0x01 && m.data[2] == 0x00) {
+			g_rqTail[cur] = rqNext(g_rqTail[cur]);
+			continue;
+		}
 		// rid 0 = entry voided by hapticCancelPendingOn -> skip
 		if (m.rid) {
 			uint8_t rl = m.len;