mi-vigem icon indicating copy to clipboard operation
mi-vigem copied to clipboard

Shared vs exclusive HID access

Open dancol90 opened this issue 5 years ago • 3 comments

Hi! mi-360 developer here. Nice project!

I saw that you don't enforce exclusive access to the HID devices when you open them, hence reverting to the standard shared mode. This leaves the Xiaomi Gamepad visible and accessible to the applications and games along with the virtual XBox controller.

Have you ever noticed some incompatibilities with some game leaving two game devices simultaneously available? Have you ever had problems with exclusive access too?

dancol90 avatar Jun 07 '20 13:06 dancol90

Hi Daniele! Nice to meet you! Thanks for your project!

Actually, I didn't test my project in many games, just in couple platformers I played recently. I'm aware of the issue you describing and I see 2 devices in Steam client or in Gamepad Tester (https://html5gamepad.com/). But it doesn't bring any problems in games I've played.

I've read about different solutions described on the README page of HidGuardian (https://github.com/ViGEm/HidGuardian) and I suspect that this problem has no easy solution. I also suspect that exclusive capture of HID device is possible only in kernel mode (but I'm not sure, though). However, this is subject for research.

grayver avatar Jun 07 '20 23:06 grayver

Here is interesting reading on the subject: https://github.com/signal11/hidapi/issues/302

grayver avatar Jun 07 '20 23:06 grayver

No, there's no easy solution. I found this MSDN page that also confirms that exclusive access is not viable for HID devices.

Since last version of mi-360, it will fallback to shared access if exclusive is not available, but it doesn't feel like the right thing to do

dancol90 avatar Jun 16 '20 10:06 dancol90