feat(libSceUsbd): report a USB stack with no devices attached #1350
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1350"
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 gjonn on 2026-10-08T00:03:08Z.
What
libSceUsbdexported only a dummy function. A title and its bundledlogiWheel.prximport 30 of its functions (a libusb-style API) to look for steering wheels. This implements the host as a USB stack with no devices attached:sceUsbdInit()succeeds andsceUsbdExit()does nothing.sceUsbdGetDeviceList(list)stores an empty null-terminated array and returns 0 devices;sceUsbdFreeDeviceListaccepts that array and throws for any other pointer.sceUsbdHandleEventsTimeout(timeout)validates thetimeval(seconds and microseconds as 64-bit fields, microseconds below 1000000), waits for the timeout because no event can arrive, and returns 0. The title's USB event threads call it in a loop with 500 ms, so returning at once would spin.NotImplemented.Error values use
SCE_USBD_ERROR_INVALID_ARG(0x80240002). The module gets a CMakeLists so the test can be registered.Tested
guest_usbdtest (empty list, invalid arguments, the timeout wait, a device call throws) passes.sceUsbdHandleEventsTimeout; start-up continues.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 github-actions[bot] on 2026-10-08T00:03:30Z.
Progress report (
fae39c6→53b3da5)📉 System libraries: 84.73% (-0.68%, +5 implemented, +25 declared functions)
✅ 5 implemented
sceUsbdExitsceUsbdFreeDeviceListsceUsbdGetDeviceListsceUsbdHandleEventsTimeoutsceUsbdInit🆕 25 declared as stubs
sceUsbdAllocTransfersceUsbdAttachKernelDriversceUsbdCancelTransfersceUsbdCheckConnectedsceUsbdClaimInterfacesceUsbdClosesceUsbdControlTransfersceUsbdEventHandlingOksceUsbdFillInterruptTransfersceUsbdFreeConfigDescriptorsceUsbdFreeTransfersceUsbdGetActiveConfigDescriptorsceUsbdGetBusNumbersceUsbdGetConfigDescriptorsceUsbdGetDeviceAddresssceUsbdGetDeviceDescriptorsceUsbdGetStringDescriptorsceUsbdKernelDriverActivesceUsbdOpensceUsbdRefDevicesceUsbdReleaseInterfacesceUsbdResetDevicesceUsbdSetConfigurationsceUsbdSubmitTransfersceUsbdUnrefDeviceImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-08T11:37:22Z.
Checked build + full ctest (449/449) after rebasing on current main;
guest_usbdpasses and doesn't even link without the change. Signatures,timevalhandling and the sleepingHandleEventsTimeoutmatch KytyPS5 and shadPS4 (SCE_USBD_ERROR_INVALID_ARG= libusb invalid param as mapped there).Only conflict was the TechnicalDebt line next to the Hmd2/Mbus ones; I rebased and moved it a few lines away. Merging once CI is green on the rebased head.