run.sh: allow udev netlink hotplug for controllers connected after launch #296

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

@⁠outcome on GitHub · 2026-12-03 07:40 UTC · original
outcome:fix/controller-hotplug → main · +1 −4 · 1 files · 1 commits · open

A controller connected after the game starts is not detected because run.sh forces SDL onto inotify (SDL_JOYSTICK_DISABLE_UDEV=1) and runs non-Proton Wine inside unshare -rnm (whose -n network namespace blocks udev netlink events).

With SDL_JOYSTICK_DISABLE_UDEV=1, SDL's inotify fallback can race udevd applying uaccess ACLs on newly created /dev/input/event* nodes and miss the controller. Since Proton runs already skip unshare -rnm, removing SDL_JOYSTICK_DISABLE_UDEV=1 and dropping -n (unshare -rm) for non-Proton runs lets udev netlink deliver hotplug events after device permissions are ready.

Checked

  • In-game under GE-Proton11-14 with a GameSir Cyclone 2 connected after launch:
    • Green mode (Xbox / XInput): detected and accepted.
    • Red mode (Switch Pro): detected and accepted.
    • Blue mode (DualShock 4): detected and accepted.

Not tested

  • Wine without Proton (unshare -rm path).
  • Bluetooth controllers plugged in/paired after launch.
  • Using dinput
**@⁠outcome** on GitHub · 2026-12-03 07:40 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/296) `outcome:fix/controller-hotplug` → `main` · +1 −4 · 1 files · 1 commits · open A controller connected after the game starts is not detected because `run.sh` forces SDL onto `inotify` (`SDL_JOYSTICK_DISABLE_UDEV=1`) and runs non-Proton Wine inside `unshare -rnm` (whose `-n` network namespace blocks `udev` netlink events). With `SDL_JOYSTICK_DISABLE_UDEV=1`, SDL's `inotify` fallback can race `udevd` applying `uaccess` ACLs on newly created `/dev/input/event*` nodes and miss the controller. Since Proton runs already skip `unshare -rnm`, removing `SDL_JOYSTICK_DISABLE_UDEV=1` and dropping `-n` (`unshare -rm`) for non-Proton runs lets `udev` netlink deliver hotplug events after device permissions are ready. ## Checked - In-game under GE-Proton11-14 with a GameSir Cyclone 2 connected after launch: - Green mode (Xbox / XInput): detected and accepted. - Red mode (Switch Pro): detected and accepted. - Blue mode (DualShock 4): detected and accepted. ## Not tested - Wine without Proton (`unshare -rm` path). - Bluetooth controllers plugged in/paired after launch. - Using dinput
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-03 07:41:12 +00:00
Author
Owner

@⁠Luxuride on GitHub · 2026-12-04 12:09 UTC · original

Yes, please — this is the correct root cause for hotplug, and it is four deleted lines. One paragraph is missing.

What I verified:

  • run.sh:104-106 on main is the comment that justified -n (udev netlink is namespaced, so a controller plugged in after launch never delivered its event and SDL fell back to /dev/input polling). Deleting the isolation is right; deleting the explanation leaves the next reader thinking the namespace is still there.
  • git grep SDL_JOYSTICK_DISABLE_UDEV main -- run.sh still hits on main, so nothing else has landed this. Not a duplicate of the non-systemd memory-cap PRs.
  • The trade is real and undocumented: with -n gone the title runs in the host network namespace and has network access. Nothing in docs/ says so. Add one sentence where the namespace mode is described.

Two small asks:

  1. Say it in the PR body too — "the title is no longer network-isolated" — and, if you are willing, a one-line opt-out (VICTORY_ISOLATE_NET=1 re-adding -n). Costs nothing, keeps the isolation for people who want it. If you would rather not carry a switch for this, say that instead; either is fine, silence is not.
  2. The PR body should say what you tested it with: which pad, plugged before or after launch, and whether it appears in the F1 menu.

173 commits behind, merges clean. With the paragraph added I would take it this week.

**@⁠Luxuride** on GitHub · 2026-12-04 12:09 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/296#issuecomment-7411053398) Yes, please — this is the correct root cause for hotplug, and it is four deleted lines. One paragraph is missing. What I verified: - `run.sh:104-106` on `main` is the comment that justified `-n` (udev netlink is namespaced, so a controller plugged in after launch never delivered its event and SDL fell back to `/dev/input` polling). Deleting the isolation is right; deleting the explanation leaves the next reader thinking the namespace is still there. - `git grep SDL_JOYSTICK_DISABLE_UDEV main -- run.sh` still hits on `main`, so nothing else has landed this. Not a duplicate of the non-systemd memory-cap PRs. - The trade is real and undocumented: with `-n` gone the title runs in the host network namespace and has network access. Nothing in `docs/` says so. Add one sentence where the namespace mode is described. Two small asks: 1. Say it in the PR body too — "the title is no longer network-isolated" — and, if you are willing, a one-line opt-out (`VICTORY_ISOLATE_NET=1` re-adding `-n`). Costs nothing, keeps the isolation for people who want it. If you would rather not carry a switch for this, say that instead; either is fine, silence is not. 2. The PR body should say what you tested it with: which pad, plugged before or after launch, and whether it appears in the F1 menu. 173 commits behind, merges clean. With the paragraph added I would take it this week.
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/296/head:github-bot/gh-296'
git switch 'github-bot/gh-296'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-296'
git switch 'github-bot/gh-296'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-296'
git switch 'github-bot/gh-296'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-296'
git switch 'main'
git merge --squash 'github-bot/gh-296'
git switch 'main'
git merge --ff-only 'github-bot/gh-296'
git switch 'main'
git merge 'github-bot/gh-296'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.