Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] USB passthrough hotplug #15074

Closed
sanjay900 opened this issue Jan 21, 2024 · 9 comments · Fixed by #16580
Closed

[Feature request] USB passthrough hotplug #15074

sanjay900 opened this issue Jan 21, 2024 · 9 comments · Fixed by #16580
Labels

Comments

@sanjay900
Copy link
Contributor

sanjay900 commented Jan 21, 2024

Quick summary

It would be nice if USB device passthrough supported hotplug with passthrough.

Details

It would be nice if RPCS3 would detect a device that was plugged in mid-game and pass it through to the emulator, instead of needing to restart the game to pick up new devices.

It could either be implemented by constantly listing devices in the usb device thread or we could actually hook into libusbs detection routines for macos + linux and hook into windows' device detection for device detection there.

@DoubleSpicy
Copy link

Constantly listing usb device list can be performance-hitting,

Instead of hooking directly we might be able to leverage libusb's device hotplug event notification callback function.
https://libusb.sourceforge.io/api-1.0/libusb_hotplug.html

@sanjay900
Copy link
Contributor Author

sanjay900 commented Apr 1, 2024

Constantly listing usb device list can be performance-hitting,

Instead of hooking directly we might be able to leverage libusb's device hotplug event notification callback function. https://libusb.sourceforge.io/api-1.0/libusb_hotplug.html

Yeah thats what we would like to do, but that callback is not yet implemented for windows.

At the moment its probably easiest to wait for
libusb/libusb#1406

What someone could do is write an implementation based on libusbs hotplug, and then operating systems with support would have hotplug.

@doctorduck2000
Copy link

This would be really convenient for stuff like the Skylanders portal, I hope this gets added.

@sanjay900
Copy link
Contributor Author

Sadly that hotplug stuff still hasn't landed in libusb and it doesn't really look like it will land any time soon.

@DoubleSpicy
Copy link

An alternative for now here maybe is to poll usb devices at low frequency for windows, and implement seperately w/ libusb Hotplug for macos/linux.

@sanjay900
Copy link
Contributor Author

That makes sense

@sanjay900
Copy link
Contributor Author

sanjay900 commented Jan 18, 2025

With hotplug, would we disconnect an emulated device if the real device is plugged in?
Say if you plug in a turntable, do we then disable an emulated turntable, or just leave the emulated turntables connected.

@AniLeo
Copy link
Member

AniLeo commented Jan 18, 2025

Turntables are not handled by the game through cellUsbd requiring passthrough of the USB device to the game, they're pads so they're handled by cellPad

@sanjay900
Copy link
Contributor Author

sanjay900 commented Jan 18, 2025

Guitar hero guitars are handled as pads by the games for sure, and don't work with passthrough.
Turntables and Rock band guitars work just fine with passthrough.

I was more asking in general though, would it make sense to disconnect an emulated device if the real device is plugged in?

For now i have not done this, it could probably be added if we wanted though but not sure what the best way to go about that would be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants