d3xMachina / BetterJoy

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

[BUG] #8

Closed Heeervas closed 9 months ago

Heeervas commented 10 months ago

Describe the bug Joycon is detected as horizontal, when I click on it to change to vertical app crashes.

Expected behavior Not to crash, and I'm able to use both.

Controller (please complete the following information):

d3xMachina commented 10 months ago

Hello, can you run the attached version here to reproduce the crash : BetterJoy_Debug.zip and upload the latest dump (dmp extension) located in "%LOCALAPPDATA%\CrashDumps" (you can copy and paste this in the Windows Explorer bar) with a name starting with "BetterJoy.exe" so I can see what's causing the crash.

Heeervas commented 10 months ago

Okay, I was testing in a VM, now on my actual PC, it seemed like it connected, but it was unable to maintain the connection.

So I was having a log like this:

Error while reading calibration data.
Resetting connection.
Could not connect Right joycon (reset calibration). Dropped.
Left joycon disconnected.
Left joycon connected.
Using Bluetooth.
ReadSPI error
Using factory left stick calibration data.
Using factory sensors calibration data.
Error while reading calibration data.
Resetting connection.
Could not connect Left joycon (reset calibration). Dropped.
Right joycon disconnected.
Right joycon connected.
Using Bluetooth.
ReadSPI error
Using factory right stick calibration data.
Using factory sensors calibration data.

in an infinite loop.

Heeervas commented 10 months ago

BetterJoy.exe.23748.dmp BetterJoy.exe.2320.dmp BetterJoy.exe.7176.dmp

I have tested these three

d3xMachina commented 10 months ago

The crash is caused by an access to an invalid handle after failing to connect,

It look like your controller has the vendor ID and product ID of an original nintendo controller but doesn't have the calibration commands working.

This should work :

Tell me if it works or if you still have crashes.

Heeervas commented 10 months ago

I was able to connect them both, now they show in vertical position, but they connect/disconnect several times per second, log:

Using Bluetooth.
Dropped.
Starting poll thread.
Left joycon disconnected.
Left joycon connected.
Using Bluetooth.
Starting poll thread.
Dropped.
Right joycon disconnected.
Right joycon connected.
....

I have saw some videos and I tested myself and they are for example not recognised as 1 controller on iPad/iPhone, could it be that just this model is not compatible somehow?

d3xMachina commented 10 months ago

Can you use this version BetterJoy_Debug.zip and wait for a few reconnect attempts before closing it and upload the debug.log file created where the executable is ? I just added the log file with infos about what datas the controllers are sending.

Heeervas commented 10 months ago

debug.log

Here you go :)

d3xMachina commented 10 months ago

Your controller might not support the report mode used to retrieve the inputs here (Standard full mode). It doesn't seem to respond on subcommands. It stays in the default report mode (Simple HID mode) which is currently not supported. I could add the support for this mode for thirdparty controllers, It should not be too hard but I don't know how to get the IMU (gyroscope + accelerometer) datas in this mode, so motions would not be functionnal. The main issue is that the packet sent for this mode doesn't match what I get on an official joycon...

For now, can you start betterjoy, press multiple times the buttons on the dpad and move the analog so I can see if the packets sent are correct when not in the default state, and if there are I should be able to make it work. Then link the new "debug.log".

Use this version (I added more logs, all packets from the controller are logged now and I disabled the disconnection when no correct packet is received) : BetterJoy_Debug.zip

d3xMachina commented 9 months ago

Duplicate of #7