fix(libSceVideoOut): disable legacy DirectInput enumeration on Windows #1596

Closed
neuralsin wants to merge 1 commit from upstream-pr/1596 into main
neuralsin commented 2026-10-08 14:03:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by neuralsin on 2026-10-08T14:03:15Z.


Summary

On Windows systems with composite or virtual vendor HID devices (such as Corsair iCUE devices, SteelSeries headsets/mice, NZXT controllers, or ITE RGB controllers), SDL's DirectInput joystick enumeration in sceVideoOutOpen can block indefinitely inside HidD_GetProductString during DirectInput8Create. Because every title opens video-out through sceVideoOutOpen, titles fail to progress beyond initialization on affected systems.

This sets SDL_HINT_DIRECTINPUT_ENABLED to "0" in VideoOutDriver and PadInput before initializing SDL_INIT_GAMECONTROLLER. Modern controllers (DualSense, DualShock 4, Xbox, and compatible pads) remain fully supported through SDL's XInput and HIDAPI backends without hanging on non-gamepad HID devices.

Closes #1042.

Checklist

  • Code passes python tools/check_conventions.py --base origin/main
  • Verified compilation and pad test suite pass cleanly (pad_sdl_tests, video_out_flip_tests)
  • Documentation updated in docs/user/INPUT_MAPPING.md
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4787983742 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1596). Originally posted by [neuralsin](https://github.com/neuralsin) on 2026-10-08T14:03:15Z. --- ### Summary On Windows systems with composite or virtual vendor HID devices (such as Corsair iCUE devices, SteelSeries headsets/mice, NZXT controllers, or ITE RGB controllers), SDL's DirectInput joystick enumeration in `sceVideoOutOpen` can block indefinitely inside `HidD_GetProductString` during `DirectInput8Create`. Because every title opens video-out through `sceVideoOutOpen`, titles fail to progress beyond initialization on affected systems. This sets `SDL_HINT_DIRECTINPUT_ENABLED` to `"0"` in `VideoOutDriver` and `PadInput` before initializing `SDL_INIT_GAMECONTROLLER`. Modern controllers (DualSense, DualShock 4, Xbox, and compatible pads) remain fully supported through SDL's XInput and HIDAPI backends without hanging on non-gamepad HID devices. Closes #1042. ### Checklist - [x] Code passes `python tools/check_conventions.py --base origin/main` - [x] Verified compilation and pad test suite pass cleanly (`pad_sdl_tests`, `video_out_flip_tests`) - [x] Documentation updated in `docs/user/INPUT_MAPPING.md`
MarcZX10 commented 2026-10-09 08:50:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T08:50:56Z.


I checked this against open PR #1050, which changes the same Windows DirectInput hint for issue #1042. Please coordinate with that author/maintainers so only one PR carries this fix; #1050 already uses SDL_SetHintWithPriority(..., SDL_HINT_DEFAULT), preserving the documented SDL_DIRECTINPUT_ENABLED environment override.

One code detail: the PadInput.cpp hint appears redundant in the current call path. VideoOutDriver initializes SDL_INIT_GAMECONTROLLER before PadInput::openFirstAvailableController is reached, so setting the hint in PadInput cannot affect that first initialization. If this PR is the one retained, please either remove that duplicate or show a call path where PadInput initializes the subsystem first. The docs addition is useful, but should state that DirectInput-only controllers may no longer be detected.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6077650793 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1596#issuecomment-6077650793). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T08:50:56Z. --- I checked this against open PR #1050, which changes the same Windows DirectInput hint for issue #1042. Please coordinate with that author/maintainers so only one PR carries this fix; #1050 already uses `SDL_SetHintWithPriority(..., SDL_HINT_DEFAULT)`, preserving the documented `SDL_DIRECTINPUT_ENABLED` environment override. One code detail: the `PadInput.cpp` hint appears redundant in the current call path. `VideoOutDriver` initializes `SDL_INIT_GAMECONTROLLER` before `PadInput::openFirstAvailableController` is reached, so setting the hint in `PadInput` cannot affect that first initialization. If this PR is the one retained, please either remove that duplicate or show a call path where PadInput initializes the subsystem first. The docs addition is useful, but should state that DirectInput-only controllers may no longer be detected.
oneandonlydean commented 2026-10-09 08:53:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T08:53:08Z.


Closing: #1050 sets the same hint for #1042 and is waiting on a run on a machine that hangs. If you have such a machine, a result on #1050 would help.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6077682127 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1596#issuecomment-6077682127). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-09T08:53:08Z. --- Closing: #1050 sets the same hint for #1042 and is waiting on a run on a machine that hangs. If you have such a machine, a result on #1050 would help.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!1596
No description provided.