No meaningful joystick names since 2.0.9? (Windows 10)

Before 2.0.9, SDL_JoystickName would return a meaningful brand name for my game controllers, such as “Xbox One Controller” and “Mocute”. Now I just get “X-Input” and “Gamepad”. Am I missing something?

Also since 2.0.9, SDL_GameControllerOpen is producing a “Unexpected controller element” every time, even though it returns non-NULL.

I filed a bug here:

https://bugzilla.libsdl.org/show_bug.cgi?id=4430

…feel free to CC yourself on it!

Is this also related to that new HID input code?

TBH, so far that code doesn’t seem very mature…

Yes, I believe this happened when the HID stuff was merged.

I agree Daniel. I wasn’t going to say anything before, but the new HID stuff has a lot more bugs than the previous implementation. Before, it worked well enough and I was able to by-pass the old bugs. Now, it’s broken on Android - I can’t use it.

1 Like

The Android implementation is shipping in the Steam Link app and seems to work well there. What bugs are you running into?

The HIDAPI controller code should only trigger for a certain known set of controllers, and should fall back to the normal code path for everything else. Is that not happening in your case? Can you debug and find out where those simplistic names are coming from?

I’m testing against about 15 different game controllers and getting some odd results.

On Android I was getting controllers not being seen at all, some controllers only producing axis events, and app exiting prematurely when controllers were unplugged and plugged; none of this happened on 2.0.8. I need to revisit my Android build with the latest HG build and give a more detailed report.

I’ll do some digging and debug the Windows build and see what’s up with the names. I don’t really know how the HIDAPI works, and I didn’t know it runs parallel to SDL’s existing input stuff - that’d explain the large jump in file size :wink: .

Revisiting this bug. Android issues were due to HIDAPI not being loaded on KitKat and Bluetooth hot-plugging triggering a restart - both resolved now. Not sure what was causing the axis-only bugs though, but it seems ok now.

Still getting generic names from SDL_JoystickName(), but at least there’s nothing game-breaking. I disabled HIDAPI with SDL_HINT_JOYSTICK_HIDAPI and I get the same result. I don’t have a build set up where I can step through SDL2’s code, so I can’t say what’s happening. I’d say leave this for now - it’s not too important.

I’m on SDL 2.0.10 and we still get the generic “XInput Controller” for Xbox One or Xbox 360 controllers on Windows.

If you disable XInput we can get some sort of more accurate name from SDL_JoystickName, but in this case the right trigger and the guide buttons don’t seem to work correctly.

It would be good to see the names fixed again soon.