shadPS4 icon indicating copy to clipboard operation
shadPS4 copied to clipboard

usbd: Implement libusb passthrough

Open deReeperJosh opened this issue 3 weeks ago • 18 comments

Re-opening pull request that I had previously opened on accident to implement libusb passthrough for the USBD library.

It appears that the free bsd build that orbis os is based off of used libusb for it's usb transactions (seen here), so we can use libusb as a submodule, and pass on all functions and parameters directly to libusb.

I can't take full credit for this code, many thanks go to Osyotr in the discord server who posted this code stub, I just needed to add the submodule.

The only major differences from the linked code stub are that I return the return value from libusb if the return code is > 0 (for methods where a return value > 0 is expected), and in the sceUsbdClaimInterface method, I check to see if a kernel driver is active before claiming the interface (required on linux and macos before performing device transactions)

I have tested this as working for Skylanders Trap Team, Skylanders Superchargers and Skylanders Imaginators on MacOS - would like some help testing more usb passthrough games (Lego Dimensions or Disney Infinity) as well as any users on Windows/Linux. Just an FYI that users on Windows will need to install winUSB as a driver for their chosen passthrough device, which can be done using Zadig

deReeperJosh avatar Jan 29 '25 20:01 deReeperJosh