run.sh: pads plugged in during play reach the game #129

Manually merged
github merged 1 commit from github-bot/gh-129 into main 2026-12-02 05:12:54 +00:00 AGit
Owner

@⁠skalel on GitHub · 2026-12-01 23:22 UTC · original
skalel:fix/pad-hotplug → main · +3 −0 · 1 files · 1 commits · merged 2026-12-02 05:12 UTC

A controller plugged in after the game starts, or one that goes to sleep and comes back, is never seen again until the game is restarted.

run.sh starts Wine under unshare -rnm. SDL, which Wine's bus driver gets its pads from, hears of new ones from udev by a netlink socket, and those messages do not reach another network namespace. With SDL_JOYSTICK_DISABLE_UDEV=1 it watches /dev/input by inotify instead. The variable is set before run.conf is read, so SDL_JOYSTICK_DISABLE_UDEV=0 there turns it off.

Checked

With an XInput probe run through run.sh in place of the game (Proton-CachyOS), and a virtual Xbox 360 pad (uinput):

before after
pad there before the start seen seen
pad plugged in later never seen seen
pad goes and comes back never seen again seen again

The same probe under unshare -rm (no network namespace) sees the pad without the variable.

In the game (Series S, a USB pad in its X-Box mode): started without it and plugged in later, in two sessions. The log has input device device=0 connected=true about a second after the kernel saw the pad. Before this change, the same pad plugged in 13 s after the game had opened was never connected.

Not tested

  • In the game: a pad that goes and comes back, and Switch mode.
  • Bluetooth, and pads read over the HID API (#50).
  • Wine without Proton.

#77 is about another cause (a DualSense that XInput does not list).

🤖 Generated with Claude Code

**@⁠skalel** on GitHub · 2026-12-01 23:22 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/129) `skalel:fix/pad-hotplug` → `main` · +3 −0 · 1 files · 1 commits · merged 2026-12-02 05:12 UTC A controller plugged in after the game starts, or one that goes to sleep and comes back, is never seen again until the game is restarted. `run.sh` starts Wine under `unshare -rnm`. SDL, which Wine's bus driver gets its pads from, hears of new ones from udev by a netlink socket, and those messages do not reach another network namespace. With `SDL_JOYSTICK_DISABLE_UDEV=1` it watches `/dev/input` by inotify instead. The variable is set before `run.conf` is read, so `SDL_JOYSTICK_DISABLE_UDEV=0` there turns it off. ## Checked With an XInput probe run through `run.sh` in place of the game (Proton-CachyOS), and a virtual Xbox 360 pad (uinput): | | before | after | |---|---|---| | pad there before the start | seen | seen | | pad plugged in later | never seen | seen | | pad goes and comes back | never seen again | seen again | The same probe under `unshare -rm` (no network namespace) sees the pad without the variable. In the game (Series S, a USB pad in its X-Box mode): started without it and plugged in later, in two sessions. The log has `input device device=0 connected=true` about a second after the kernel saw the pad. Before this change, the same pad plugged in 13 s after the game had opened was never connected. ## Not tested - In the game: a pad that goes and comes back, and Switch mode. - Bluetooth, and pads read over the HID API (#50). - Wine without Proton. #77 is about another cause (a DualSense that XInput does not list). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
SDL hears of new pads from udev by a netlink socket, which does not reach the
network namespace run.sh starts Wine in: a pad plugged in later, or one that
goes to sleep and comes back, was never seen. SDL_JOYSTICK_DISABLE_UDEV=1 has it
watch /dev/input by inotify instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 23:27:51 +00:00
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-12-01 23:24 UTC · original · edited 2026-12-01 23:26 UTC

Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-01T23:26:34.024869Z 441eb1a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@⁠codex review" or "@⁠codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-12-01 23:24 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/129#issuecomment-7329307216) · edited 2026-12-01 23:26 UTC <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"441eb1a77b7bd455a2a98c118f336e6bf3932baa","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-12-01T23:26:34.024869Z">2026-12-01T23:26:34.024869Z</relative-time> | `441eb1a` | PR opened | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@⁠codex review" or "@⁠codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
github manually merged commit d044248659 into main 2026-12-02 05:12:54 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.