Davidobot / BetterJoy

Allows the Nintendo Switch Pro Controller, Joycons and SNES controller to be used with CEMU, Citra, Dolphin, Yuzu and as generic XInput
Other
3.88k stars 343 forks source link

[BUG] Weird connection issue with a third-party Exlene Pro Controller and BetterJoy (only works in combination with JoyShock Mapper?)) #1115

Open brennyboy opened 1 year ago

brennyboy commented 1 year ago

BUG DESCRIPTION: Hello. I've been having a very weird problem/situation with BetterJoy and a third-party Pro Controller i've bought a while ago. It's a GameCube styled controller from this chinese brand called Exlene (link at the end of the post.)

Long story short: The controller is paired on Windows 10 through Bluetooth 5.0 dongle in Pro Controller mode. BetterJoy kinda picks up the controller but either gets stuck in loop of starting the poll thread and then dropping the connection, OR it goes completely crazy and closes itself while repeating the message "duplicate timestamp enqueued" (the latter happens when i press a button after somehow getting out of the first loop).

Here's the weird part: if i open JoyShock Mapper (or click on its "reconnect controller" option, in case it was already open before), somehow it just works...? Meaning, JoyShock Mapper does something with the connection/pairing that makes it so BetterJoy picks up the connection perfectly and turns it into an Xinput with Gyro server functionality and everything. It just... works perfectly IF i do this. Wtf?

While i've been using the controller normally with this method, it's kinda not ideal as the controller gets disconnected after 5 or so minutes (BetterJoy's disconnect timer configurations don't seem to work on this controller) and i have to turn the controller on again and go back to mouse+kb to click on "Reconnect controller" on JoyShock Mapper to make BetterJoy do its thing again. Sometimes, it even plugs the controller again as a secondary Xinput device, which causes further issues in emulators which were configured around a "first slot" Xinput device.

I'm kind of a noob but i've been digging through both of these softwares souce codes in order to understand them better and maybe modify something so BetterJoy picks the connection without JSM's help, or at least create an IF condition on JSM so it automatically goes in a "reconnect controller" loop if it detects the connection has been dropped.

EXPECTED BEHAVIOR: For BetterJoy to pick up the controller properly and succesfully translate it's inputs into a virtual Xinput device with full gyro functionality, with correct disconnection timer functionality. I've actually had another GC style Pro Controller before, from another brand (DataFrog) and it had a few issues with the disconnect timers not working too, but at least BetterJoy could pick it up and work properly by itself just fine.

CONTROLLER INFO: https://pt.aliexpress.com/item/1005005008909124.html?spm=a2g0o.productlist.main.11.10b265305YcSCe&algo_pvid=c4e23050-9f9d-4840-b7b9-e35ea3f2bc9b&algo_exp_id=c4e23050-9f9d-4840-b7b9-e35ea3f2bc9b-5&pdp_npi=3%40dis%21BRL%21127.82%21104.82%21%21%21182.08%21%21%40211bf12316901546090214808d0774%2112000031328638238%21sea%21BR%210&curPageLogUid=ttcyYb1UTtNC