-
-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gamepadcontrollers with less than 16 buttons do not get all button functions mapped #1493
Comments
Pasting this here from the closed PR, for continuation: This seems a bit weird to me then, and especially the proposed changes don't look right.
Meanwhile, I did a quick test to recreate this here, with your posted retroarch config. I have a PS4 controller here, which I tested first without any retroarch config enabled, and AmigaTestKit. Then I enabled the retroarch config, and removed the mapping for most buttons, leaving only the left analog for direction, and button A. The tests in AmigaTestKit show that it still works as expected, having all the available buttons from retroarch working. Directional with the Left stick and a single button only. The view in Custom Controls was not correctly showing this, having most dropdowns disabled. That's why I was asking, is this a GUI issue in the end, in Custom Controls? |
I tested also on my side with an XBox 360 Controller.
|
The GUI behavior is expected - it doesn't check the retroarch config for the built-in navigation, it uses a standard internal/default mapping for all joysticks for that. So, even if you had removed some of the lines from your retroarch config file, the GUI would still open the controller with a default mapping and use directional navigation and 2 buttons (for OK/Cancel). |
@Gemba |
Leave it open, please. I guess I can provide more clues. When there is a SDL compliant controller attached which reports less than 15 buttons, this loop does not get the 14th and 15th mapping from the previously done RA controller mapping in A more elaborated fix would be to check which buttons are reported from SDL here and compare them with the ones from the retroarch button names. Edit: |
Coming back to this, after finding some time to set up a fresh Retropie installation here. I tested with Amiberry 7 on it. I used a Competition Pro USB joystick, which only has a D-Pad and 4 buttons. Mapped those all in Retroarch on startup, then tried AmigaTestKit, to see the responses. All mapped buttons function correctly, from what I can see. How did you determine that some buttons did not get mapped, exactly? Maybe I'm missing something. |
Hi again. I have also a model with D-SUB9 which is directly wired to the GPIO and uses BTN_DPAD events with this device tree only driver. This is where I noticed the behaviour in Amiberry. (NB The device tree implementation has most likely a bug when using EV_ABS via GPIO device tree https://forums.raspberrypi.com/viewtopic.php?t=377990 I lost track of it to report it further.) |
@Gemba Game Controller mode is only used if Retroarch is not enabled. |
I'm still not sure what can be done about this. I cannot recreate it here.
Maybe this is an issue only with the GPIO connected gamepad you're testing with? That's one difference I can think of (which I don't have here to test with). |
Heya, I see that the USB Competetion Pro and the GPIO/DB9/Atari Competition Pro do get mapped differently from Emulationstation. This is the USB connected:
This is the GPIO connected:
That explains that the USB still gets mapped properly, as it has axis'es, whereas the gamepad only reports buttons as directions. |
OK, let me see if I can find any controller here that has less buttons and they are mapped as such, instead of axis. |
Here is an option how to recreate with a Gamepad with many buttons (more than needed for Amiberry). I used a 'Logitech RumblePad 2' (USB) but any should do as long as it has four spare buttons to map. I stripped down the EmulationStation config to this below and replaced the "input_left_btn" = "h0left" with "input_left_btn" = "a_spare_button__number" (I used the four shoulder buttons for directions). It reads now:
Then I forged the report from SDL about the axis-count and button count:
|
OK, following your example then: I edited my PS4 controller config, and left only 8 buttons mapped (0-7), replacing the HAT ones:
Then I edited
After that, I run AmigaTestKit, configured to use the controller in CD32 mode (so that I can test more buttons). In other words, I still cannot recreate this. |
Yes, the real d-pad still works also on my side, but try to use the newly assigned buttons to test the issue. (I used jstest to identify the four spare shoulder button numbers for this test.) I changed in the Amiga UI -> Input -> Port 1 (Logitech RumblePad 2) the mode from Default to CD32 pad on the fly (=no persistent configuration) and can still note the absence of button actions (left and right in my case) when using the shoulder buttons. When setting 8 as button count I don't get any input from the shoulder buttons. |
You will obviously only get input from the buttons that were mapped on startup - meaning, only the number of buttons available. In my case, that was 8 buttons total (since I hardcoded it to that), and all of them are mapped as expected. 4 for the D-Pad movement, and 4 for N/S/W/E actions. All of them show up as expected in AmigaTestKit, when CD32 type is selected (both in Amiberry and in AmigaTestKit, of course). Are you trying to use more buttons than detected/set in the Buttons 0-7 on my controller, referred to the D-Pad and N/W/S/E of course. The extra buttons (shoulder buttons, Start, Select, L/R stick buttons and the various axes) are not included in the mapping, so they do nothing. |
The buttons you do assign, are these button numbers from an axis / d-pad or just buttons? Here is my excerpt from the amiberry.log:
This is the output from jstest:
I am using the buttons 4 to 7 for movements. |
Just buttons used, and they were sequential as well (button 0 until button 7). |
Just FTR: Can you share the part of the amiberry.log as it shows the controller detection on your side (same as I did before)? |
I'm always testing with the latest from this repo. Tests were done on RetroPie (installed on top of Bookworm manually) and after that, on Debian12 with only the relevant config files from Retroarch. GCC is 12.2.0 here as well. SDL2 version is 2.26.5 (the one delivered from the repos) This is the relevant extract from the amiberry.log file:
|
I was able to reproduce it even with 7.0.4 Amiberry (with 2.30.8 SDL2), source build from main/HEAD. Only difference is now only the make and model of the USB Gamepad and SDL2. |
I am debugging the changed version directly on the device, so yeah, I'm pretty sure. :) I also think it has something to do with the device you're testing, as no other has reported something like this. I don't think it's related to the SDL2 version, as we've been running this approach for years now, with older versions of SDL2 until the latest ones. Again, no such issue reported until now. Must be some special case that triggers it. |
Sure, the GPIO approach is new and not widespread use, but I would claim it is correct. I would not be that persistent if the gpio-keys setup would also showed this behaviour in Retroarch or with emulators which use the SDL2 Gamepad API, but in these contexts it works as expected (all buttons present). |
FWIW, you should be using 'sdl2-jstest' to examine this situation -> https://github.com/Grumbel/sdl-jstest (some distro repos have it as a package) ....but not debian, so a github clone is best....umm, and if you use that, you need to place the newest gamecontrollerdb.txt in the directory |
The SDL part is fine, thanks anyway @giantclambake . $ sdl2-jstest -l
Found 1 joystick(s)
Joystick Name: 'GPIO Arcade Gamepad 1'
Joystick GUID: 1900de43010000000100000000010000
Joystick Number: 0
Number of Axes: 0
Number of Buttons: 13
Number of Hats: 0
Number of Balls: 0
GameControllerConfig:
Name: 'GPIO Arcade Gamepad 1'
Mapping: '1900de43010000000100000000010000,GPIO Arcade Gamepad 1,a:b0,b:b1,x:b2,y:b3,back:b6,guide:b8,start:b7,leftshoulder:b4,rightshoulder:b5,dpup:b9,dpdown:b10,dpleft:b11,dpright:b12,platform:Linux,crc:43de,' |
I provided another PR, without permanently changing the Even if you can not recreate it, you may recognize by reading the code that the current implementation will never resolve the upper DPAD buttons, when the physical button count is less than 15 and no hat/axis is reported by the gamepad. |
Describe the bug
Gamepadcontrollers which are identified in the gamecontrollerdb.txt but have physically than 16 buttons and do have a RetroPie Gamecontroller *.cfg file do not get all buttons mapped into Amiberry controller.
For example: A gamepad with 13 physical buttons has UP/DOWN mapped but LEFT/RIGHT (the 14th and 15th in the list,
retroarch.cpp::retroarch_button_list[]
) is "cut off"/ not mapped. If a gamepad has 12 physical buttons reported then also DOWN is "cut off" from the mapping.To Reproduce
Steps to reproduce the behavior:
Expected behavior
All buttons (up to 15) defined in Controller.cfg file are mapped into Amiberry
Desktop
Workaround
Remove the RetroPie Gamecontoller.cfg file, then all buttons are mapped as expected.
Additional context
retroarch.cfg
is not geared/utilized to player input mapping. But if it is, the effect is most likely the same.did->buttons
/did->buttons_real
contain the pyhsical buttons, assetup_mapping
is using the full 15 buttons. But for some reason the buttons reported frommap_from_retroarch()
don't end up in the final result.The text was updated successfully, but these errors were encountered: