Input: rumble for the generic pads Linux can rumble (GreenAsia, DragonRise, Zeroplus, ACRUX and others), read directly or behind x360ce #2835

Open
github-bot wants to merge 1 commit from github-bot/gh-2835 into main AGit
Owner

@⁠sonokweii on GitHub · 2026-11-29 17:53 UTC · original
sonokweii:generic-rumble → main · +1214 −21 · 5 files · 1 commits · open

Generic HID pads now vibrate with the title, for the pads Linux's small force-feedback drivers know. A pad gets the title's vibration whether generic reads it or a remapper such as x360ce shows it as an Xbox pad. Only the GreenAsia "2In1 USB Joystick" (0E8F:0003) was tested on hardware; the others follow Linux's drivers byte for byte and are left for owners to confirm.

Why. These pads have motors, but they list no force-feedback actuators, so the vibration is lost both ways:

  • x360ce gets the title's vibration through XInput and drops it.
  • generic reads the pads with no way to run the motors. The README said generic pads do not rumble.

Each family takes a plain HID output report, documented by a small Linux driver.

Pads and protocols (in DEVICES, keyed by vendor and product):

Linux driver Vendor:product Frames
hid-pl 0810:0001, 0810:0002, 0E8F:0003, 0F30:0111 0, 0, strong, weak (0..0x7F; 0F30:0111 0..0xFF in Linux's four-field layout)
hid-gaff 0E8F:0012 51 00 weak 00 strong 00, then FA FE 00 00 00 00
hid-dr 0079:0006 51 00 weak 00 strong 00 00, then FA FE 00…; stop F3 00…; weak 0x0A sent as 0x0B
hid-zpff 0C12:0005, 0C12:0030 00 02 strong weak
hid-axff 1A34:0802, 1A34:F705 strong and weak alternating over every value
hid-emsff 2006:0118 01 weak strong 00 00 00 00
hid-sjoy 6666:8801, 0925:0005, 0925:8888 01 weak-on/off strong
hid-holtekff 1241:5015 effect 01 flags FF FF 10 E0 magnitude, then 02 01 00…; stop 06 00…

The SmartJoy ids that Linux marks HID_QUIRK_SKIP_OUTPUT_REPORTS (6666:8802, 6666:8804, 0925:8866, 0B43:0003) are left out, as is 0079:0011, which hid-dr does not rumble.

How.

  • Module. New gameinput/generic_rumble.rs. The title's threads only store the latest speeds. One worker thread, started at the first rumble, sends a pad its frames when they change, so the title never waits on a pad.
  • Writes. Overlapped WriteFile with the existing WRITE_MS limit (playstation::write): over the interrupt OUT endpoint when the pad has one, else as SET_REPORT, as Linux's usbhid does.
  • Layout check. A pad is driven only if its output report is the flat layout these drivers expect: no output buttons, every value 8 bits, one report id, values filling the report. Any other layout is left alone, with a log line saying why.
  • One vibration per pad. A pad a slot reads through generic gets that slot's vibration. Any other listed pad gets the strongest of the XInput slots', motor by motor, because a remapper hides which pad sits behind which slot.
  • Retries and scanning.
    • A pad that stops taking reports is closed and looked for again every 5 s.
    • With no pad listed, the pads are looked for at the first rumble. After that only when a slot changes hands, at most every 5 s, so a player without such a pad gets no periodic scan.
  • Stopping. stop_rumble() stops the motors for good at the end: these pads keep their last report after the process is gone, and title threads still running could otherwise start them again. A newly opened pad gets its driver's start frames, which stop the motors.
  • VICTORY_GENERIC_RUMBLE=0 leaves every pad's motors alone. README updated.
  • Small changes elsewhere. generic.rs: Handle::open takes open flags, and Handle/Parser are visible to the new module. playstation.rs: write is visible to it. No new crates or features; Cargo.lock and the shader translator are untouched.

Tested.

  • Hardware. GreenAsia 0E8F:0003, Windows 11: the pad vibrates with the output report 00 00 00 7F 7F sent through WriteFile, as this module writes (and through HidD_SetOutputReport). All zeros stops it.
  • In game. An earlier version of this module (XInput route only, 0E8F:0003 only, on an older base f4608f0) ran behind x360ce, and the pad vibrated with the title. This branch's two routes are covered by the unit tests.
  • Unit tests. 18 (cargo test --release -p victory-hle --lib generic_rumble): every protocol's frames, the layout check, the device table, coalescing, the rescan rule and the stop latch.
  • Clippy. cargo clippy -p victory-hle --no-deps --all-targets -- -D warnings reports only the three findings already on main: unnecessary_lazy_evaluations twice in gameinput.rs, and items_after_test_module in lifecycle.rs.

Not covered.

  • No pad other than 0E8F:0003 was tested. Owners of the others: the log line pad rumble: <vendor:product> (<family>) found shows the pad was taken, and a refusal line says why one was left alone.
  • If a pad maker's own force-feedback driver is installed, a remapper may drive the motors too. VICTORY_GENERIC_RUMBLE=0 turns this module off.
  • playstation::stop_rumble has the same end-of-game window (title threads can restart the motors after the stop). It is not changed here.
**@⁠sonokweii** on GitHub · 2026-11-29 17:53 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2835) `sonokweii:generic-rumble` → `main` · +1214 −21 · 5 files · 1 commits · open **Generic HID pads now vibrate with the title, for the pads Linux's small force-feedback drivers know. A pad gets the title's vibration whether `generic` reads it or a remapper such as x360ce shows it as an Xbox pad. Only the GreenAsia "2In1 USB Joystick" (0E8F:0003) was tested on hardware; the others follow Linux's drivers byte for byte and are left for owners to confirm.** **Why.** These pads have motors, but they list no force-feedback actuators, so the vibration is lost both ways: - x360ce gets the title's vibration through XInput and drops it. - `generic` reads the pads with no way to run the motors. The README said generic pads do not rumble. Each family takes a plain HID output report, documented by a small Linux driver. **Pads and protocols** (in `DEVICES`, keyed by vendor and product): | Linux driver | Vendor:product | Frames | |---|---|---| | hid-pl | 0810:0001, 0810:0002, 0E8F:0003, 0F30:0111 | `0, 0, strong, weak` (0..0x7F; 0F30:0111 0..0xFF in Linux's four-field layout) | | hid-gaff | 0E8F:0012 | `51 00 weak 00 strong 00`, then `FA FE 00 00 00 00` | | hid-dr | 0079:0006 | `51 00 weak 00 strong 00 00`, then `FA FE 00…`; stop `F3 00…`; weak 0x0A sent as 0x0B | | hid-zpff | 0C12:0005, 0C12:0030 | `00 02 strong weak` | | hid-axff | 1A34:0802, 1A34:F705 | strong and weak alternating over every value | | hid-emsff | 2006:0118 | `01 weak strong 00 00 00 00` | | hid-sjoy | 6666:8801, 0925:0005, 0925:8888 | `01 weak-on/off strong` | | hid-holtekff | 1241:5015 | effect `01 flags FF FF 10 E0 magnitude`, then `02 01 00…`; stop `06 00…` | The SmartJoy ids that Linux marks `HID_QUIRK_SKIP_OUTPUT_REPORTS` (6666:8802, 6666:8804, 0925:8866, 0B43:0003) are left out, as is 0079:0011, which hid-dr does not rumble. **How.** - **Module.** New `gameinput/generic_rumble.rs`. The title's threads only store the latest speeds. One worker thread, started at the first rumble, sends a pad its frames when they change, so the title never waits on a pad. - **Writes.** Overlapped `WriteFile` with the existing `WRITE_MS` limit (`playstation::write`): over the interrupt OUT endpoint when the pad has one, else as SET_REPORT, as Linux's usbhid does. - **Layout check.** A pad is driven only if its output report is the flat layout these drivers expect: no output buttons, every value 8 bits, one report id, values filling the report. Any other layout is left alone, with a log line saying why. - **One vibration per pad.** A pad a slot reads through `generic` gets that slot's vibration. Any other listed pad gets the strongest of the XInput slots', motor by motor, because a remapper hides which pad sits behind which slot. - **Retries and scanning.** - A pad that stops taking reports is closed and looked for again every 5 s. - With no pad listed, the pads are looked for at the first rumble. After that only when a slot changes hands, at most every 5 s, so a player without such a pad gets no periodic scan. - **Stopping.** `stop_rumble()` stops the motors for good at the end: these pads keep their last report after the process is gone, and title threads still running could otherwise start them again. A newly opened pad gets its driver's start frames, which stop the motors. - **`VICTORY_GENERIC_RUMBLE=0`** leaves every pad's motors alone. README updated. - **Small changes elsewhere.** `generic.rs`: `Handle::open` takes open flags, and `Handle`/`Parser` are visible to the new module. `playstation.rs`: `write` is visible to it. No new crates or features; `Cargo.lock` and the shader translator are untouched. **Tested.** - **Hardware.** GreenAsia 0E8F:0003, Windows 11: the pad vibrates with the output report `00 00 00 7F 7F` sent through `WriteFile`, as this module writes (and through `HidD_SetOutputReport`). All zeros stops it. - **In game.** An earlier version of this module (XInput route only, 0E8F:0003 only, on an older base `f4608f0`) ran behind x360ce, and the pad vibrated with the title. This branch's two routes are covered by the unit tests. - **Unit tests.** 18 (`cargo test --release -p victory-hle --lib generic_rumble`): every protocol's frames, the layout check, the device table, coalescing, the rescan rule and the stop latch. - **Clippy.** `cargo clippy -p victory-hle --no-deps --all-targets -- -D warnings` reports only the three findings already on main: `unnecessary_lazy_evaluations` twice in `gameinput.rs`, and `items_after_test_module` in `lifecycle.rs`. **Not covered.** - No pad other than 0E8F:0003 was tested. Owners of the others: the log line `pad rumble: <vendor:product> (<family>) found` shows the pad was taken, and a refusal line says why one was left alone. - If a pad maker's own force-feedback driver is installed, a remapper may drive the motors too. `VICTORY_GENERIC_RUMBLE=0` turns this module off. - `playstation::stop_rumble` has the same end-of-game window (title threads can restart the motors after the stop). It is not changed here.
Generic HID pads list no force-feedback actuators, so their vibration was
lost both when generic reads them and when a remapper such as x360ce shows
them as an Xbox pad. Each family takes a plain HID output report that a
small Linux driver documents (hid-pl, hid-gaff, hid-dr, hid-zpff, hid-axff,
hid-emsff, hid-sjoy, hid-holtekff). generic_rumble keeps the title's latest
speeds, and a worker sends each listed pad its frames when they change,
with overlapped WriteFile. A pad is driven only when its output report has
the flat layout those drivers expect. VICTORY_GENERIC_RUMBLE=0 turns it off.

Tested on hardware with the GreenAsia 2In1 USB Joystick (0E8F:0003); the
other families follow Linux's drivers.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 17:56:01 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2835/head:github-bot/gh-2835'
git switch 'github-bot/gh-2835'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2835'
git switch 'github-bot/gh-2835'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2835'
git switch 'github-bot/gh-2835'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2835'
git switch 'main'
git merge --squash 'github-bot/gh-2835'
git switch 'main'
git merge --ff-only 'github-bot/gh-2835'
git switch 'main'
git merge 'github-bot/gh-2835'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!2835
No description provided.