libsdl-org / SDL

Simple Directmedia Layer
https://libsdl.org
zlib License
9.89k stars 1.83k forks source link

SDL 2.28.1 fault with YuZu #7909

Closed lovelygfj closed 10 months ago

lovelygfj commented 1 year ago

SDL 2.28.1 fixed the issue of the third-party controller (BETOP) not being recognized in NS compatibility mode. However, when working with YUZU, the controller is initially recognized but after approximately 3 minutes of gameplay, all buttons become unresponsive. Switching from fullscreen to windowed mode, or from windowed mode to fullscreen, restores normal functionality for another 3 minutes. Additionally, when switching SDL versions for the first time, YUZU initially detects the gamepad as BETOP NS mode, but subsequently identifies it as a Switch Pro controller, without ever recognizing it as BETOP again. I'm not sure whether I should report this issue to SDL or YUZU. If you could assist in investigating this matter, I would greatly appreciate it.

lovelygfj commented 1 year ago

V2.0.20 works perfect in YuZu

slouken commented 1 year ago

Can you post an Amazon link to the exact product you're using?

lovelygfj commented 1 year ago

Can you post an Amazon link to the exact product you're using?

https://www.amazon.com/dp/B0BL3BYYVZ?ref_=ast_sto_dp

slouken commented 1 year ago

Okay, I have this controller, and I plugged it in and it shows up as a DirectInput device when wired or connected via Bluetooth, and as an Xbox 360 controller when connected via the dongle.

How are you connecting the controller and setting whichever mode you're trying to test?

lovelygfj commented 1 year ago

My system is Win 11 Pro, I use wire to connect PC in "NS gamepad model (blue light)", controller in YuZu EA setting menu will recognized as “Switch Pro controller” and motion function is works well. but after load game and play for severial mins (2-3 min), then the gamepad have no response anymore. But I found switch "window / full screen model" will re-activate the gamepad. e.g if no response in full screen model, then press F11 switch to window model, gamepad will have response, after 3 mins no response in window model, press F11 switch to full screen, also have response too.

slouken commented 1 year ago

How do you get in NS mode?

Here's is the manual for the Beitong Asura 3S Multi Mode, which is what you linked above: https://game.cdn.betophall.com/ckfinder/userfiles/files/%E8%8B%B1%E6%96%87%E7%94%B5%E5%AD%90%E8%AF%B4%E6%98%8E%E4%B9%A6/%E8%AF%B4%E6%98%8E%E4%B9%A6/%E7%AB%AF%E6%B8%B8%E6%89%8B%E6%9F%84/user%20manual-%20Asura%203S%20game%20controller%20Multi-mode%20-%20BTP-2650NS%20-%20V2_0.pdf

I am able to switch between Xbox 360 mode and BFM mode, but not Nintendo Switch mode...?

lovelygfj commented 1 year ago

page 4 Connect to NS image you can use this mode to connect with PC via cable directly. gamepad also will be recognized as switch pro controller.

slouken commented 1 year ago

Thank you, I was able to switch it to NS mode. Bluetooth: Pairing completes but the controller doesn't stay connected. I was able to reproduce this on Windows and macOS. On Linux once the pairing is complete the computer locks up. On Steam Link, the pairing completed and the controller worked fine. USB: The controller works perfectly and shows up in yuzu as Nintendo Switch Pro Controller 0

One thing that may be affecting my results, I updated to the latest version of the controller firmware, from 1.0.2 to 1.05.

slouken commented 1 year ago

So, back to your original bug, I don't have yuzu configured with any firmware or games, so I can't reproduce your issue. What you could do is build SDL from source using Visual Studio, drop the DLL that you built into the yuzu directory, and then attach the debugger to yuzu and see what's happening.

lovelygfj commented 1 year ago

Thank you, I was able to switch it to NS mode. Bluetooth: Pairing completes but the controller doesn't stay connected. I was able to reproduce this on Windows and macOS. On Linux once the pairing is complete the computer locks up. On Steam Link, the pairing completed and the controller worked fine. USB: The controller works perfectly and shows up in yuzu as Nintendo Switch Pro Controller 0

One thing that may be affecting my results, I updated to the latest version of the controller firmware, from 1.0.2 to 1.05.

Yes, use USB cable to connect works well, and shows as "Nintendo Switch Pro Controller 0", but I do have seen this gamepad recognized as "Beitong .... NS mode" once. I don't know why. and it cannot reproduced when recognized as "Nintendo Switch Pro Controller 0" I use YuZu to play TOTK but I don't think it was affected by any game rom. if it's not SDL fault, then maybe it's because YuZu adaption fault. But as I mentioned, when I use 2.0.20 DLL, then very thing works perfect.

slouken commented 1 year ago

If you want, we can try debugging this over Zoom. If you'd like to do that, go ahead and install Visual Studio community edition, grab the latest SDL code, and shoot me an e-mail at slouken@libsdl.org to coordinate.

lovelygfj commented 1 year ago

If you want, we can try debugging this over Zoom. If you'd like to do that, go ahead and install Visual Studio community edition, grab the latest SDL code, and shoot me an e-mail at slouken@libsdl.org to coordinate.

I'm so sorry, I wish but I don't think I have enough knowledge and time to do this. What I experienced is: even you don't load any game, there is still a chance to reproduce falut if you stay in controller setting menu. I will let you know when I'm fully prepared. Thank you so much.

german77 commented 1 year ago

SDL is independent on games. So anything emulated shouldn't affect the rest of the input. The weird part is that Switching from fullscreen to windowed mode should have zero effect on controllers.

Vibration can cause issues which might explain why he reports issues within 3 minutes while in game. I moved vibration into it's own thread because it was locking emulation as it simply took too long to execute.

I can provide some homebrew if it's required to do some testing.

slouken commented 1 year ago

That's weird, SDL already rumbles on a separate thread. Where did you see the lockup happening?

german77 commented 1 year ago

Xbox one. This was back when we where using sdl 2.0.18.

slouken commented 1 year ago

Ah, that makes sense. Rumble is on a separate thread for HIDAPI, but not for XInput.

slouken commented 12 months ago

Is this still an issue for you?

slouken commented 10 months ago

We're releasing SDL 2.30 soon and haven't heard back, so I'm going ahead and closing this for now. Feel free to add more information and reopen it if you're still having this issue.