Skip to content

ntsync: add PROTON_NO_KERNEL_NTSYNC env switch to force userspace backend - #39

Merged
joshuatam merged 2 commits into
proton_11.0-2from
feat/force-userspace-ntsync
Sep 3, 2026
Merged

ntsync: add PROTON_NO_KERNEL_NTSYNC env switch to force userspace backend#39
joshuatam merged 2 commits into
proton_11.0-2from
feat/force-userspace-ntsync

Conversation

@joshuatam

Copy link
Copy Markdown
Collaborator

What

Adds a runtime escape hatch to the ntsync backend selection: PROTON_NO_KERNEL_NTSYNC=1 makes wineserver skip /dev/ntsync even when the kernel driver is present and working, and initialize the userspace ntsync-android shm backend instead.

Why

For A/B testing of the two backends on devices that have a kernel ntsync driver (e.g. RP6 testing kernels): suspected sync-related game issues can now be checked against the userspace backend with just an env var, no rebuild. (The original motivation — a Unity stuck-analog report — turned out to be unrelated to ntsync, but the switch remains useful for future triage.)

How

  • server_inproc_sync_c.patch: in get_inproc_device_fd(), when the env var is set wineserver opens /dev/ntsync, immediately closes it, and falls through to the ntsync_init() userspace path. Android-only (#ifdef __ANDROID__); non-Android builds untouched.
  • Distinct log line so the forced backend is identifiable in device logs: ntsync: PROTON_NO_KERNEL_NTSYNC set, using userspace ntsync.
  • Backend selection order is now: PROTON_NO_NTSYNCPROTON_NO_KERNEL_NTSYNC → kernel probe → userspace fallback → server-side sync.
  • Documented in android/ntsync_android/README.md; release notes updated.

Verification

  • Full 56-patch train applies cleanly on a pristine tree (0 failures)
  • Full build with the patch: server/wineserver links; zero new warnings (only the 6 pre-existing -Wenum-conversion warnings in inproc_sync.c, unchanged)
  • No behavior change when the env var is unset

…kend

Runtime escape hatch for A/B testing: when set, wineserver skips the
/dev/ntsync kernel driver even if present and working, and initializes
the userspace shm backend instead. Distinct log line so the forced
backend is identifiable in device logs.
@joshuatam
joshuatam merged commit 0971187 into proton_11.0-2 Sep 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant