|
| 1 | +## T500RS USB FFB Protocol (observed) |
| 2 | + |
| 3 | +This page documents the packet formats and ordering used by the T500RS when driven via the USB interrupt endpoint (0x01 OUT). It mirrors the style of docs/FFBEFFECTS.md for other wheels. |
| 4 | + |
| 5 | +Key rules |
| 6 | +- Little‑endian for 16‑bit fields |
| 7 | +- DMA‑safe buffer length 32 bytes; typical messages are 2, 4, 9 or 15 bytes |
| 8 | +- EffectID semantics (CRITICAL): |
| 9 | + - All Report 0x01 main‑effect uploads MUST use EffectID = 0x00 on T500RS |
| 10 | + - Report 0x41 START/STOP also uses EffectID = 0x00, except the init‑time STOP for autocenter which targets a fixed ID (15) |
| 11 | + - Using per‑effect IDs with 0x01 breaks playback (constant force fails completely) |
| 12 | + |
| 13 | +Report glossary |
| 14 | +- 0x01 main upload (15 bytes) |
| 15 | + - Layout (unknown bytes kept for completeness): |
| 16 | + - b0 id = 0x01 |
| 17 | + - b1 effect_id = 0x00 (MUST) |
| 18 | + - b2 type: 0x00 constant; 0x20..0x24 periodic/ramp |
| 19 | + - b3 0x40 |
| 20 | + - b4 0xff (or duration L for ramp path) |
| 21 | + - b5 0xff (or duration H for ramp path) |
| 22 | + - b6 0x00 |
| 23 | + - b7 0xff |
| 24 | + - b8 0xff |
| 25 | + - b9 0x0e (parameter subtype) |
| 26 | + - b10 0x00 |
| 27 | + - b11 0x1c (envelope subtype) |
| 28 | + - b12 0x00 |
| 29 | + - b13 0x00 |
| 30 | + - b14 0x00 |
| 31 | +- 0x02 envelope (9 bytes) |
| 32 | + - b0 0x02, b1 0x1c, b2 0x00 |
| 33 | + - b3..4 attack_length (le16) |
| 34 | + - b5 attack_level (0..255) |
| 35 | + - b6..7 fade_length (le16) |
| 36 | + - b8 fade_level (0..255) |
| 37 | +- 0x03 constant level (4 bytes) |
| 38 | + - b0 0x03, b1 0x0e, b2 0x00 |
| 39 | + - b3 level s8 (−127..127) |
| 40 | +- 0x04 periodic params (8 bytes) |
| 41 | + - b0 0x04, b1 0x0e, b2 0x00 |
| 42 | + - b3 magnitude u7 (0..127) |
| 43 | + - b4 offset = 0, b5 phase = 0 |
| 44 | + - b6..7 period (le16, ms) |
| 45 | +- 0x04 ramp params (9 bytes) |
| 46 | + - b0 0x04, b1 0x0e |
| 47 | + - b2..3 start (le16), b4..5 cur_val (le16), b6..7 duration (le16), b8 0x00 |
| 48 | +- 0x05 condition params (11 bytes) |
| 49 | + - set 1 (coeff/saturation): b0 0x05, b1 0x0e, b2 0x00, b3 right_strength, b4 left_strength, b9/b10 subtype values vary by type (spring vs damper/friction) |
| 50 | + - set 2 (deadband/center): b0 0x05, b1 0x1c, b2 0x00, b3 deadband, b4 center, b9/b10 subtype values |
| 51 | +- 0x40 config (4 bytes) |
| 52 | + - 0x40 0x04 enable/disable autocenter, 0x40 0x03 set autocenter strength, 0x40 0x11 set range (le16), etc. |
| 53 | +- 0x41 start/stop/clear (4 bytes) |
| 54 | + - id=0x41, effect_id=0x00 (MUST), command=0x41 START or 0x00 STOP, arg=0x01 |
| 55 | + - Exception: init‑time STOP for autocenter uses effect_id=15 |
| 56 | +- 0x42 apply/apply‑like, 0x43 gain |
| 57 | + |
| 58 | +Effect upload and play ordering |
| 59 | +- Constant (FF_CONSTANT) |
| 60 | + 1) 0x02 envelope |
| 61 | + 2) 0x01 main (type=0x00, effect_id=0x00) |
| 62 | + Play: 0x03 level, then 0x41 START (effect_id=0x00) |
| 63 | +- Periodic (FF_SINE/FF_SQUARE/FF_TRIANGLE/FF_SAW) |
| 64 | + 1) 0x02 envelope |
| 65 | + 2) 0x01 main (type=0x20..0x24, effect_id=0x00) |
| 66 | + 3) 0x04 periodic params (magnitude/period) |
| 67 | + 4) 0x01 main (type repeated, effect_id=0x00) |
| 68 | + Play: 0x41 START (effect_id=0x00) |
| 69 | +- Condition (FF_SPRING/FF_DAMPER/FF_FRICTION/FF_INERTIA) |
| 70 | + 1) 0x05 coeff/saturation (0x0e) |
| 71 | + 2) 0x05 deadband/center (0x1c) |
| 72 | + 3) 0x01 main (type reflects subkind, effect_id=0x00) |
| 73 | + Play: 0x41 START (effect_id=0x00) |
| 74 | +- Ramp (FF_RAMP) |
| 75 | + 1) 0x02 envelope |
| 76 | + 2) 0x04 ramp params (device behaves like hold of start level with duration) |
| 77 | + 3) 0x01 main (type=0x24, effect_id=0x00) |
| 78 | + Play: 0x41 START (effect_id=0x00) |
| 79 | + |
| 80 | +Notes |
| 81 | +- All 0x01 uploads must use EffectID=0x00. This was validated on hardware; using per‑effect IDs causes constant force to fail completely and can break other effects. |
| 82 | +- 16‑bit values are little‑endian (lo byte first). |
| 83 | +- Magnitudes/levels are expected in device ranges (0..127 for periodic magnitude, s8 for constant level). Scaling helpers in code perform conversions from Linux ranges. |
| 84 | +- Autocenter is disabled by zeroing spring coefficients via 0x05 messages and/or via 0x40 commands, then explicitly stopping autocenter (ID 15) during init. |
| 85 | + |
0 commit comments