xenia icon indicating copy to clipboard operation
xenia copied to clipboard

SDL2 seems to be compiled without support for external controller mapping support

Open 13xforever opened this issue 2 years ago • 5 comments

Validation

  • [X] I've read the FAQ.
  • [X] The Xenia build used is from the master branch (not MLBS/AlexVS/Canary/pull requests, etc.)
  • [X] This issue isn't for tech support (help with Xenia).
  • [X] If this issue occurs in a specific game, I've done analysis to locate the faulty subsystem of the emulator and a potential reason in it.
  • [X] I've checked if this issue hasn't already been reported.
  • [X] My device meets the minimum requirements: https://github.com/xenia-project/xenia/wiki/Quickstart#system-requirements
  • [ ] (If building) I have read the building doc: https://github.com/xenia-project/xenia/blob/master/docs/building.md

Describe what's going wrong

Xenia is built with SDL2, which supports custom controller mappings via environment variable override or custom gamecontrollerdb.txt (which xenia even has an option for).

But in reality, it only applies built-in profiles and ignores any custom mappings in either environment variable, or in the specified db file. I'm not sure if it's relevant, but in log the order of operation is wrong: it applies the controller profile, and then tries to load custom mappings. But then it says it loaded 0 profiles from gamecontrollerdb.txt, so idk.

Describe what should happen

Xenia should load custom controller profiles first, then try to configure the controllers. Or there should be an explicit button remapping option.

If applicable, provide a callstack here, especially for crashes

No response

If applicable, upload a logfile and link it here

gamecontrollerdb.txt xenia.log image

13xforever avatar Mar 09 '23 09:03 13xforever

Slightly off-topic, but you can reverse a Switch Pro Controller's mapping with the environment variable SDL_GAMECONTROLLER_USE_BUTTON_LABELS set to 0. It should work on Xenia too.

SuperSamus avatar Jul 30 '23 12:07 SuperSamus

Tthis is not an acceptable workaround, as it affects all applications that use sdl, and it will break correctly applied configuration

13xforever avatar Jul 30 '23 12:07 13xforever

Tthis is not an acceptable workaround, as it affects all applications that use sdl, and it will break correctly applied configuration

I mean you only apply it to Xenia, it only affects Xenia.

gardotd426 avatar Dec 02 '23 02:12 gardotd426

Mapping controllers using gamecontrollerdb.txt works fine i just tested it, you need to ensure your controller GUID is correct otherwise SDL will not update the mapping. HID = "sdl" must be set in the config too.

Third-party tools may give the wrong GUID for your controller such as SDL2 Gamepad Tool in my case. I would recommend using https://github.com/AntiMicroX/antimicrox which gives the correct GUID for my controller.

AdrianCassar avatar Mar 21 '24 16:03 AdrianCassar