[PR #2271] [MERGED] usbd: Implement libusb passthrough #2615

Closed
opened 2026-02-27 22:00:36 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/2271
Author: @deReeperJosh
Created: 1/29/2025
Status: Merged
Merged: 3/31/2025
Merged by: @georgemoralis

Base: mainHead: usbd-libusb


📝 Commits (8)

  • c3e4db9 usbd: Implement libusb passthrough
  • 5310a1a clang-format
  • a8e864b only do kernel activities on non-windows
  • 1485f85 use variable to represent "fake" windows kernel driver
  • b3feada Merge branch 'main' into usbd-libusb
  • 8190657 Merge branch 'main' into usbd-libusb
  • f02405e Merge branch 'main' into usbd-libusb
  • d583ec6 Merge branch 'main' into usbd-libusb

📊 Changes

6 files changed (+475 additions, -247 deletions)

View changed files

📝 .gitmodules (+3 -0)
📝 CMakeLists.txt (+2 -1)
📝 externals/CMakeLists.txt (+5 -0)
externals/libusb (+1 -0)
📝 src/core/libraries/usbd/usbd.cpp (+328 -184)
📝 src/core/libraries/usbd/usbd.h (+136 -62)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/2271 **Author:** [@deReeperJosh](https://github.com/deReeperJosh) **Created:** 1/29/2025 **Status:** ✅ Merged **Merged:** 3/31/2025 **Merged by:** [@georgemoralis](https://github.com/georgemoralis) **Base:** `main` ← **Head:** `usbd-libusb` --- ### 📝 Commits (8) - [`c3e4db9`](https://github.com/shadps4-emu/shadPS4/commit/c3e4db92c3485d19411eef747c96528b9b3acd39) usbd: Implement libusb passthrough - [`5310a1a`](https://github.com/shadps4-emu/shadPS4/commit/5310a1a0357ac98e24c9a307db3ffb15da209dcc) clang-format - [`a8e864b`](https://github.com/shadps4-emu/shadPS4/commit/a8e864b171a98b3495c29bd22944c683b038353d) only do kernel activities on non-windows - [`1485f85`](https://github.com/shadps4-emu/shadPS4/commit/1485f85a4d15c33f84603b849a4d404f9507735a) use variable to represent "fake" windows kernel driver - [`b3feada`](https://github.com/shadps4-emu/shadPS4/commit/b3feada3a6e29de0e4a66e542d460367d4bd8113) Merge branch 'main' into usbd-libusb - [`8190657`](https://github.com/shadps4-emu/shadPS4/commit/8190657feb417a15d8cae884f39848065d5f5c3b) Merge branch 'main' into usbd-libusb - [`f02405e`](https://github.com/shadps4-emu/shadPS4/commit/f02405e20506c5871808541ac6ebecb6b416bb9b) Merge branch 'main' into usbd-libusb - [`d583ec6`](https://github.com/shadps4-emu/shadPS4/commit/d583ec63c563a349e1f2155139da9ba13c386b22) Merge branch 'main' into usbd-libusb ### 📊 Changes **6 files changed** (+475 additions, -247 deletions) <details> <summary>View changed files</summary> 📝 `.gitmodules` (+3 -0) 📝 `CMakeLists.txt` (+2 -1) 📝 `externals/CMakeLists.txt` (+5 -0) ➕ `externals/libusb` (+1 -0) 📝 `src/core/libraries/usbd/usbd.cpp` (+328 -184) 📝 `src/core/libraries/usbd/usbd.h` (+136 -62) </details> ### 📄 Description 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](https://man.freebsd.org/cgi/man.cgi?query=libusb&apropos=0&sektion=0&manpath=FreeBSD+9.0-RELEASE&arch=default&format=html)), 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](https://discord.com/channels/1080089157554155590/1258386683691274361/1328011710958669824), 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](https://zadig.akeo.ie/) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:00:36 +03:00
Sign in to join this conversation.
No milestone
No project
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.

Dependencies

No dependencies set.

Reference
starred/shadPS4#2615
No description provided.