RPCS3 / rpcs3

PlayStation 3 emulator and debugger
https://rpcs3.net/
GNU General Public License v2.0
15.36k stars 1.91k forks source link

[Feature request] USB passthrough hotplug #15074

Open sanjay900 opened 9 months ago

sanjay900 commented 9 months ago

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 commented 6 months ago

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 commented 6 months ago

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 https://github.com/libusb/libusb/pull/1406

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