sdl2gdx icon indicating copy to clipboard operation
sdl2gdx copied to clipboard

[sdl2gdx 1.0.4] Failed loading libusb-1.0.dll

Open alyrow opened this issue 4 years ago • 12 comments

Hello, Well the flashing window is back, ~~but I know how to fix that now~~. But I have observed that in the traceback :

EXTRACTED LOC C:\Users\____\AppData\Local\Temp\5687545216180750193.tmp
Joystick 0: XINPUT:Xbox 360 Controller
joystick org.libsdl.SDL_Joystick@917bcaf controller org.libsdl.SDL_GameController@916b7df
connected SDL GameController ShanWan PS3/PC Wired GamePad instance:0  guid: 030000005e0400008e02000000007801 v 0
NATIVE METHOD: loading from  "C:\Users\____\AppData\Local\Temp\5687545216180750193.tmp"
             result 64  Failed loading libusb-1.0.dll: The specified module could not be found

Is it normal ?

Best regards.

alyrow avatar Apr 23 '20 12:04 alyrow

According the docs, SDL on Windows should be using hid.dll. libusb is only used on Linux. libusb-1.0.dll is not linked in the binary so I guess it is attempting to load it dynamically. Could be because I had it installed in the build environment, or could be it just tries it in all cases.

Does the controller work?

Does this error cause a crash?

Does this error repeat more than once?

What happens if you supply libusb-1.0.dll in the current directory?

electronstudio avatar Apr 23 '20 13:04 electronstudio

It seems to be something that was changed in SDL 2.0.12. They went from disabling libusb on windows to enabling it but loading it dynamically. So I would guess things will still work without it, but perhaps work better if you supply it. If that's not the case then I could attempt to disable it completely.

electronstudio avatar Apr 23 '20 13:04 electronstudio

Yes the controller works, no crash but this occurs only when I close the game. Put libusb-1.0.dll only makes it disappear.

(Off topic : the flashing window is back... Even the zip version doesn't fix...)

alyrow avatar Apr 23 '20 14:04 alyrow

In that case I don't think it's a problem. Possibly I should add libusb to the distribution if SDL if using it to improve controller detection.

If you can send me a version of the project with the flashing window I will take a look at it.

electronstudio avatar Apr 23 '20 14:04 electronstudio

Thanks : this is the zip. The flash occurs randomly. Sorry, texts are not in english but it is not problematic. If you want to use the controller to browse the cards, you need to press XBox/PS button then A/X then use buttons indiqued on cards. (Keyboard doesn't work for the moment)

alyrow avatar Apr 23 '20 15:04 alyrow

Here is how it looks for me: https://www.youtube.com/watch?v=qkpCOc290-I&feature=youtu.be

It doesn't flash. Can you send me a video of it flashing?

electronstudio avatar Apr 23 '20 16:04 electronstudio

Strange, it blinks for me : https://youtu.be/jfLtk3zjRlk

But with Github action, I have made a jar and this jar version doesn't flash.

alyrow avatar Apr 24 '20 07:04 alyrow

Even placing libusb-1.0.dll in java.library.path doesn't make the message go away.

morvael avatar Aug 30 '21 08:08 morvael

Cannot get joystick rumble working. Only difference between running directly in C (which works) vs in java is this error.

isXander avatar Apr 03 '23 10:04 isXander

What OS and what controller are you using?

electronstudio avatar Apr 03 '23 16:04 electronstudio

Fiddling with SDL hints fixed my issue. The SDL test had a window open which was probably the problem as I hadn't set SDL background hint (I was not using controller manager)

isXander avatar Apr 04 '23 10:04 isXander

result 550 Failed loading libusb-1.0.dll: The specified module could not be found.

I'm using W11 with x64 and I did all the steps that were told in this page and I can't fix it

Juancb28 avatar Aug 01 '24 22:08 Juancb28