Skip to content

fix(libSceVideoOut): add APS5_NO_WGI to turn off SDL's Windows.Gaming.Input backend - #7005

Merged
oneandonlydean merged 3 commits into
boykopovar:mainfrom
TheSovietWaffle:fix/videoout-disable-sdl-wgi
Oct 19, 2026
Merged

oneandonlydean merged 3 commits into
boykopovar:mainfrom
TheSovietWaffle:fix/videoout-disable-sdl-wgi

Conversation

@TheSovietWaffle

@TheSovietWaffle TheSovietWaffle commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

What

On Windows, VideoOutDriver keeps SDL's Windows.Gaming.Input joystick backend on by default. When APS5_NO_WGI is set, it sets SDL_HINT_JOYSTICK_WGI to 0 at SDL_HINT_DEFAULT priority before SDL_InitSubSystem, next to the existing SDL_HINT_DIRECTINPUT_ENABLED line, following the other APS5_NO_* switches. The Windows game controllers entry in docs/dev/debt/libSceVideoOut.md describes the opt-out: what it fixes, what it drops (racing wheels, arcade and flight sticks, HID pads without an HIDAPI driver, Xbox One/Series trigger rumble) and the host where the fault was seen.

On that Windows 10 host the WGI backend faults a few seconds into every run, in every title I ran:

FATAL: unhandled exception 0xc0000005 on thread 3792 ''
  rip 0x00007ffecc230a84 Windows.Gaming.Input.dll+0x10a84
  read of 0x0000000000000000
  stack return address candidates:
    [rsp+0x28] libSceAgcDriver.prx+0x669f51
    [rsp+0xc8] libSceVideoOut.prx+0x8362
    [rsp+0x158] libSceVideoOut.prx+0x8ab5

[rsi] holds the tail of SDL's SDL_JOYSTICK_ARCADESTICK_DEVICES_EXCLUDED hint name. Device Manager on this host lists Nefarius Virtual Gamepad Emulation Bus (OK) and Oculus Virtual Gamepad Emulation Bus (Error); I have not established which, if either, triggers the fault.

Tested

Windows 10 Pro 22H2 (19045), Ryzen 7 7800X3D, RTX 3080 (NVIDIA 617.42), WinLibs GCC 15.2.0 r7, Release.

Title Build Runs Faults at Windows.Gaming.Input.dll+0x10a84
EVO Player (PPSA99039), catalog 0.12.0 main 26 26
EVO Player this PR, default 3 3
EVO Player this PR, APS5_NO_WGI=1 3 0
Onimusha: Way of the Sword (PPSA27836) WGI off many 0; reaches the title screen and the story
  • pad_input, pad_input_mapping, pad_keyboard_mouse, pad_sdl, guest_pad and guest_pad_vibration_mode pass on this head.
  • Earlier results on this PR (WGI off by default): a wired Xbox 360 controller is still opened as XInput Controller #1; @screamm's RTX 4070 / Windows 11 cross-check and @cadenasynyster's DualSense over Bluetooth check are in the comments.
  • tools/check_conventions.py --base origin/main passes.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none (EVO Player PPSA99039 and Onimusha PPSA27836 start on this host with APS5_NO_WGI; no bring-up discussion)
  • GPUs tested: NVIDIA RTX 3080, 617.42, Windows 10 Pro 22H2 (19045)
  • AI-assisted: yes

🤖 Generated with Claude Code

…d off

On a Windows 10 host with virtual gamepad buses, SDL's WGI backend
faults at Windows.Gaming.Input.dll+0x10a84 a few seconds into every
run (EVO Player PPSA99039: 26 of 26 runs). XInput and HIDAPI still
cover Xbox and DualSense controllers. Set at default priority, like
DIRECTINPUT, so SDL_JOYSTICK_WGI=1 turns it back on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 674 core/libs/prx/libSceVideoOut/src/VideoOutDriver.cpp
PR 4040 docs/dev/debt/libSceVideoOut.md
PR 5021 core/libs/prx/libSceVideoOut/src/VideoOutDriver.cpp
PR 6879 core/libs/prx/libSceVideoOut/src/VideoOutDriver.cpp
PR 6977 docs/dev/debt/libSceVideoOut.md
PR 7201 core/libs/prx/libSceVideoOut/src/VideoOutDriver.cpp
PR 7332 core/libs/prx/libSceVideoOut/src/VideoOutDriver.cpp
PR 7690 docs/dev/debt/libSceVideoOut.md

@github-actions github-actions Bot added the prx label Oct 17, 2026
@screamm

screamm commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Cross-validation on Windows 11 Pro 26220, NVIDIA RTX 4070 (596.21), MinGW GCC 15.2, PR head 9c5920b9f, built together with #6956 (disjoint files) on main 5f61879a9 (clean merge). Before-runs used a build of 3b10c7ef0; the SDL/VideoOut/Pthread/Time sources are identical between the two.

  • Full build and libs: pass.
  • pad_input, guest_pad, guest_pad_vibration_mode, pad_sdl, pad_input_mapping, pad_keyboard_mouse, --repeat until-fail:3: 3 of 3 pass each (run twice, once on a busy host).
  • EVO Player PPSA99039, relinked, 60 s per run, no stop line in any run. Checking the process modules every 3 s: on main, Windows.Gaming.Input.dll is loaded 22 s and 33 s into the two runs with a complete sample (two earlier runs: by 20 s and by 50 s), together with xinput1_4.dll. With this PR it is never loaded in the two complete runs (62 s and 57 s; xinput1_4.dll is loaded at 27 s and 32 s), and with SDL_JOYSTICK_WGI=1 set on the PR build it is loaded again (26.6 s). So the hint takes effect and the environment variable turns it back on, as the description says.
  • Your fault (Windows.Gaming.Input.dll+0x10a84) does not occur on my host with or without the PR (no virtual gamepad buses here), so I cannot confirm the 26/26 -> 0 result, only that the title runs normally with WGI off.
  • No gamepad was attached here (XInputGetState 0-3 all "not connected"), so I could not check that a pad still opens and reads through XInput; that rests on your Xbox 360 check.
  • ctest -j8 --timeout 120 -E '^agc_driver_|^video_out_flip': 855 of 877 pass, 2 skipped, 20 timeouts on a host with other builds running; all 20 pass on serial reruns (conventions/tooling tests and four libkernel tests), none touches this line.
  • tools/check_conventions.py --base origin/main and git diff --check: pass.

Suggestion: docs/dev/debt/libSceVideoOut.md ("Windows game controllers") already lists the DirectInput disable and its SDL_DIRECTINPUT_ENABLED=1 override; the WGI disable has the same trade-off (devices reachable only through WGI, such as Xbox One/Series trigger rumble, are not used) and could be added there with SDL_JOYSTICK_WGI=1.

Not checked: pad input over XInput on a physical pad, Windows 10, Linux/macOS (the line is Windows-only).

Written with Claude Code assistance (validation by a subagent, reviewed in this session).

…in technical debt

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cadenasynyster

Copy link
Copy Markdown
Contributor

DualSense check, since the PR was tested only with a wired Xbox 360 controller:

Windows 11 10.0.26200.9711, RTX 5070 Ti (NVIDIA 617.42), WinLibs GCC 15.2.0 r7, Release. DualSense over Bluetooth, no Steam/DS4Windows running. Head c2f466d merged onto main f3263df (clean merge, no new build errors).

Controller detection, from video_out_flip_tests with a real window, same run on both:

main: Pad: connected game controller: DualSense Wireless Controller (type 7, sensors accel=1 gyro=1, touchpads=1, led=1, trigger rumble=0)
PR:   Pad: connected game controller: DualSense Wireless Controller (type 7, sensors accel=1 gyro=1, touchpads=1, led=1, trigger rumble=0)

So with WGI off, the Bluetooth DualSense is still opened as a game controller with motion sensors, touchpad and LED, as the commit message expects. guest_pad, guest_pad_vibration_mode and pad_sdl pass with the PR.

Not checked: button and stick input in a title, rumble, a wired DualSense, and the WGI crash itself (this host doesn't reproduce it on main).

AI-assisted: yes

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@TheSovietWaffle thanks for the careful crash data, and for the cross-checks from others.

We'd rather not turn Windows.Gaming.Input off for everyone. With it off, Windows loses devices and features only WGI reaches once DirectInput is off: racing wheels, arcade and flight sticks, HID pads with no HIDAPI driver, and Xbox One/Series trigger rumble. Wheels matter for a lot of PS5 titles.

Could you flip it around so WGI stays on by default and an environment variable turns it off for hosts that hit the Windows.Gaming.Input.dll+0x10a84 fault? Please name it in our existing APS5_* style, for example APS5_NO_WGI, following the APS5_NO_* switches, and only set SDL_HINT_JOYSTICK_WGI to 0 in VideoOutDriver when it's set.

Then please update the Windows game controllers entry in docs/dev/debt/libSceVideoOut.md to describe the opt-out: what it fixes, what it drops (name wheels, arcade sticks and flight sticks there), and the host setup where you saw the fault.

@github-actions github-actions Bot added the unblocks title Names a title ID on the Unblocks line label Oct 18, 2026
… with APS5_NO_WGI

Windows.Gaming.Input stays on by default, so racing wheels, arcade and
flight sticks, HID pads without an HIDAPI driver and Xbox One/Series
trigger rumble keep working. Hosts where it faults at
Windows.Gaming.Input.dll+0x10a84 set APS5_NO_WGI to turn it off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@TheSovietWaffle TheSovietWaffle changed the title fix(libSceVideoOut): leave SDL's Windows.Gaming.Input joystick backend off fix(libSceVideoOut): add APS5_NO_WGI to turn off SDL's Windows.Gaming.Input backend Oct 19, 2026
@TheSovietWaffle

Copy link
Copy Markdown
Contributor Author

@oneandonlydean done in a55dc4c53: Windows.Gaming.Input stays on by default, and SDL_HINT_JOYSTICK_WGI is set to 0 only when APS5_NO_WGI is set. The Windows game controllers debt entry now describes the opt-out, what it drops (racing wheels, arcade and flight sticks, HID pads without an HIDAPI driver, Xbox One/Series trigger rumble) and the host where I saw the fault. On that host EVO Player faults 3 of 3 runs by default and 0 of 3 with APS5_NO_WGI=1; the pad tests pass. Title and description are updated to match.

AI-assisted: yes (Claude Code).

@oneandonlydean
oneandonlydean merged commit 0393728 into boykopovar:main Oct 19, 2026
6 checks passed
@xXPBSXx xXPBSXx mentioned this pull request Oct 20, 2026
12 tasks done
adriadam10 pushed a commit that referenced this pull request Oct 21, 2026
The workflow checked out pull_request.base.sha, the base recorded when the
pull request was opened, and ran that revision's check_conventions.py. A rule
merged after a pull request was opened never ran on it: #7005 added
APS5_NO_WGI without an ENVIRONMENT.md row and passed with the checker of
07e7414, which had no env-reference rule.

Check out the current tip of the base branch and pass it as --base; the
checker already diffs from the merge base, so only the pull request's own
changes are checked. A name documented on the base branch after the branch
point now counts as documented unless the pull request removes its row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs prx unblocks title Names a title ID on the Unblocks line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants