fix: disable DirectInput joystick enumeration on Windows #1050
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1050"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Tenith01 on 2026-10-07T04:37:36Z.
What
Disables SDL's DirectInput joystick backend on Windows (
SDL_HINT_DIRECTINPUT_ENABLED=0,SDL_HINT_DEFAULTpriority, so theSDL_DIRECTINPUT_ENABLEDenvironment variable still overrides it) beforeSDL_InitSubSystemin theVideoOutDriverconstructor. DirectInput enumeration blocks forever insceVideoOutOpenon machines with some vendor HID devices (Corsair iCUE, SteelSeries). XInput and HIDAPI pads stay; DirectInput-only devices are no longer detected (TechnicalDebt line added).Fixes #1042
Tested
guest_video_out_wqhd_detectionpasses in 0.25 s with this change; the unpatchedmainbuild hangs and times out at 20 s.guest_video_out_wqhd_detectionpasses (machine does not reproduce the hang).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-08T03:25:29Z.
Has this been run on a machine that shows the hang? The Windows tests were skipped, and frankea offered on #1042 to test a change, so a confirmation there would do. Please also fill in the PR template and say which pads stop being detected without DirectInput.
Imported from boykopovar/AnyPS5. Originally posted by WifeInLantern on 2026-10-09T07:24:27Z.
Windows 11 (26200), WinLibs GCC 15.2.0 r7, Release,
BUILD_TESTING=ON, #1050 merged onto current main (clean, 3-line change). It builds andguest_video_out_wqhd_detectionpasses. This machine (18 HID devices) doesn't reproduce the #1042 hang, so that pass doesn't show the hang is fixed; confirmation needs a machine that hangs.On the reviewer's question, from SDL 2.33.0 source: with the hint off,
SDL_DINPUT_JoystickInitreturns 0 withdinput = NULLand the DInput haptic path is skipped. XInput (Xbox pads) and HIDAPI (PS4/DualSense) are unaffected. Devices that stop being detected are DirectInput-only pads not handled by XInput or HIDAPI (generic gamepads, wheels, flight sticks). I haven't tested any such device.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-09T22:04:05Z.
Review: CHANGES_REQUESTED
Thanks. The change itself looks right (hint exists in the bundled SDL2, set before
SDL_InitSubSystem,SDL_HINT_DEFAULTkeeps the env override). What's missing before it can merge:guest_video_out_wqhd_detection, but that machine doesn't reproduce #1042, so it doesn't show the hang is fixed. @frankea offered to test on #1042; please ask for a run with and without the change and post the result here.docs/dev/TechnicalDebt.mdsaying so.What,Testedwith OS and what was checked, the checklist includingAI-assisted:). "Verified syntax correctness" is not a test.Imported from boykopovar/AnyPS5. Originally posted by frankea on 2026-10-10T03:52:31Z.
Tested on the machine that reproduces #1042 (Windows 11 10.0.26200, Ryzen 7 5800X, RTX 4090 driver 616.92, WinLibs GCC 15.2.0 r7, Release,
BUILD_TESTING=ON). NoSDL_*variable is set in the environment.7c28b1a0, base000f2f74):guest_video_out_wqhd_detectionpasses in 0.25 s under ctest, and also exits 0 in 0.14 s when started in the logged-on desktop session viaschtasks /IT.sceVideoOutOpenreturns.mainbuild (0c952fe5) still hangs in the same test and times out at 20 s.Not tested: a DirectInput-only pad, since none is connected here. The branch is 1320 commits behind
mainand was not rebased for this test.Tested with AI assistance (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-10T09:46:25Z.
Follow-up on the requested review items
The report from
frankeaabove now supplies the missing reproducer confirmation: on the affected Windows machine,sceVideoOutOpenreturns with this change under the default environment, while the unpatched build still hangs. That closes the first item in the maintainer's review for the tested head.TechnicalDebt.mdentry with that limitation and theSDL_DIRECTINPUT_ENABLED=1opt-in.000f2f74; current upstreammainisbe403084c.mainand rerun the focused reproducer on the rebased head before merge.My duplicate #2047 was closed in favor of this PR; it included a user-facing
INPUT_MAPPING.mdnote that could also be adapted here. There is no need for a second PR. The current implementation's Windows guard and default-priority hint should remain the active fix.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T08:49:59Z.
Ready to merge from my side, but the PR description fails the conventions check:
Please fill those template lines in (only you can answer AI-assisted); it merges once they pass.
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T16:33:40Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libSceVideoOut/src/VideoOutDriver.cppL261Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T01:02:31Z.
Thanks @Tenith01. Relanded in #5580 with your commit kept and you credited as co-author on the technical debt entry.
Closing in favour of it.
Pull request closed