Homepage › Forums › RetroPie Project › Controller Configuration in RetroPie › Only recognizing one port of a two port USB controller adapter
- This topic has 21 replies, 2 voices, and was last updated 9 years, 3 months ago by geauxwave.
-
AuthorPosts
-
08/02/2015 at 19:10 #103193geauxwaveParticipant
Has anyone run into this issue? I bought a Mayflash Sega Saturn controller adapter. It has two ports, but my Pi is only picking up one of the ports. It accepts input from both of the ports and treats them as js0 (confirmed in jstest).
I have two other adapters–a Mayflash SNES adapter and a playstation adapter–both of which have two ports each, and both ports are properly recognized by the Pi.
Any ideas on how to get the Pi to see the two ports as individual joypads?
This may be relevant… when I run jstest on the controllers from the working SNES adapter, the test behaviour is different than that of the Saturn adapter. For the SNES, it lists the axes and the button numbers one time, and as I press them, the values simply change and change back (on/off). However, when i test the Saturn controller, it seems to list the axes and button numbers every time i press something, creating pages of output, instead of simply changing the values of the initial list of axes and buttons. Hopefully that makes sense. I’ve included a screenshot below. I was thinking that maybe these controllers are seen as different kinds of controllers or something, and by changing the way the Saturn controller is recognized, perhaps i could get it to behave like the SNES adapter and it would recognize both ports. I don’t know, just throwing out ideas.
08/02/2015 at 20:31 #103208geauxwaveParticipantGood news, after further investigation of the test results, it appears that even though both ports are recognized as the same controller, the axes and button numbers are different on the two controllers. This means I can make it work by mapping the proper buttons in retroarch.cfg. Here’s a diagram i made for the Saturn controllers…
I still need to setup my retroarch.cfg files and do some testing, but I did do some quick testing in MAME. Unfortunately, MAME was not recognizing the input from controller #2. Perhaps it only recognizes up to 15 buttons? (anyone know?) It saw my direction buttons on controller #1 as…
Up = J1 Joybutton 12
Down = J1 Joybutton 14
Left = J1 Joybutton 15
Right = J1 Joybutton 13Not a huge deal, I guess. If needed, I can just use PS2 controllers for MAME. The Pi recognizes that adapter as two joysticks.
Have to take a break for a while, but will update on the progress when i get back to it later tonight.
08/02/2015 at 20:36 #103210geauxwaveParticipantAccording to this post, it looks like MAME is coded to only recognize up to 16 buttons per joystick…
https://www.raspberrypi.org/forums/viewtopic.php?p=659112#p659112Anyone know how to change this? I’ll search around for a solution.
08/02/2015 at 20:47 #103213choccyhobnobParticipantThere is a patched copy of mame here https://drive.google.com/file/d/0B2TfYq5Awz_jWExLS2RpMHhnalE/view?usp=sharing that works for me with 2 PS3 controllers.
Squid (mame4all author) says that the latest version of the mame source is fixed for this issue but I recompiled and it still didn’t work for me, the binary at the above link does.
Put the binary in /opt/retropie/emulators/mame4all/
08/02/2015 at 23:34 #103230geauxwaveParticipantCool, thank you for this! I’m having trouble getting it to work though. MAME fails to start any games. Do I put the “mame” and “mame.cfg” files in /opt/retropie/emulators/mame4all? or just the one mame file?
Thanks
[quote=103213]There is a patched copy of mame here https://drive.google.com/file/d/0B2TfYq5Awz_jWExLS2RpMHhnalE/view?usp=sharing that works for me with 2 PS3 controllers.
Squid (mame4all author) says that the latest version of the mame source is fixed for this issue but I recompiled and it still didn’t work for me, the binary at the above link does.
Put the binary in /opt/retropie/emulators/mame4all/
[/quote]
08/03/2015 at 04:12 #103266geauxwaveParticipantI figured out why MAME wasn’t starting. I forgot to change the file permissions to execute. Duh. So, MAME works now with the new binary you provided, but it still does not recognize the buttons on my second controller, unfortunately.
08/03/2015 at 14:30 #103282geauxwaveParticipantDo you know for sure that this patched copy increases the button limit of 16 per joystick?
Here is a topic confirming the 16 button limit, and also talking about a fix for a related issue–PIFBA (NeoGeo etc) needs one joystick per player…
https://github.com/RetroPie/RetroPie-Setup/wiki/Troubles-with-the-Xin-Mo-Controller[quote=103213]There is a patched copy of mame here https://drive.google.com/file/d/0B2TfYq5Awz_jWExLS2RpMHhnalE/view?usp=sharing that works for me with 2 PS3 controllers.
Squid (mame4all author) says that the latest version of the mame source is fixed for this issue but I recompiled and it still didn’t work for me, the binary at the above link does.
Put the binary in /opt/retropie/emulators/mame4all/
[/quote]
08/03/2015 at 14:55 #103283geauxwaveParticipantI found another MAME patch that allows for more buttons (link below). This works, but it only allows for up to 22 buttons. I actually need 32 buttons. MAME recognizes the directional buttons of controller 1 as button #’s 12, 13, 14, and 15. So I’m assuming the d-pad on controller 2 is #’s 28, 29, 30, 31 (with a starting number of 0, that’s 32 total).
I’m going to try and contact the guy who made this patch, and see if he would be kind enough to up the number to 32, if that’s even possible. Man, I’m so close, but so far away!
08/03/2015 at 15:21 #103287choccyhobnobParticipantThe name.cfg file is symlinked to /opt/retropie/configs/mame4all/ to keep it all consistent, don’t overwrite the symlink or the default command line won’t pick up the correct config file.
I don’t know how many buttons that version of mame supports, it fixed my PS3 controller issue with the number of axis but I’m not using some screwy usb hub thing that makes 2 controllers look like a single one. Have you considered that your problem may be a hardware one?
08/03/2015 at 15:38 #103288geauxwaveParticipantThanks, I did see that it was a symlink. I actually got it working once I realized I had to give the executable the proper permissions (thank you again for posting), but for whatever reason it doesn’t pick up the input of controller 2. I don’t think it’s a hardware issue because I tried out another patched version of MAME (link posted above) that stated it allowed for up to 22 buttons, and with that MAME recognized the input of controller 2 up to button #22. Unfortunately I need it to recognize 32 buttons. :/
In the end, I guess I could just buy a second Saturn adapter, and only use the first port on each of them. Seems like a bit of a waste though (of money and USB ports, lol). That would also require me to use a hub if I wanted to keep a wireless keyboard hooked up, since that would be 4 adapters (2x Saturn, SNES, and PSX).
08/03/2015 at 15:51 #103290geauxwaveParticipantIn case anyone needs it, here is the button mapping I used in the megadrive retroarch.cfg file. It works great. Special thanks to user Feederchain for the help. His Sega Genesis adapter behaves the same way as my Saturn adapter (both ports treated as one joystick).
input_player1_joypad_index = “0”
input_player2_joypad_index = “0”input_player1_a_btn = “2”
input_player1_b_btn = “1”
input_player1_y_btn = “0”
input_player1_x_btn = “4”
input_player1_l_btn = “3”
input_player1_r_btn = “6”
input_player1_start_btn = “9”input_player1_up_btn = “h0up”
input_player1_down_btn = “h0down”
input_player1_right_btn = “h0right”
input_player1_left_btn = “h0left”input_player2_a_btn = “18”
input_player2_b_btn = “17”
input_player2_y_btn = “16”
input_player2_x_btn = “20”
input_player2_l_btn = “19”
input_player2_r_btn = “22”
input_player2_start_btn = “25”input_player2_up_btn = “h1up”
input_player2_down_btn = “h1down”
input_player2_right_btn = “h1right”
input_player2_left_btn = “h1left”08/03/2015 at 18:00 #103304choccyhobnobParticipantDo you have a link to the version of came that you used with the extra button support?
08/03/2015 at 18:03 #103305geauxwaveParticipantYes, here you go… https://github.com/ian57/Raspicade-mame4all-xinmo
[quote=103304]Do you have a link to the version of came that you used with the extra button support?
[/quote]
08/03/2015 at 18:53 #103308choccyhobnobParticipantThanks. I’ve increased the number of allowed buttons from 22 to 34, that should be enough. I checked the max axis and its set to 28, so that enough for the PS3 as well. It’s compiling on my Pi now, I’ll let you know if it compiles ok
08/03/2015 at 18:54 #103309geauxwaveParticipantWow, thanks!!
[quote=103308]Thanks. I’ve increased the number of allowed buttons from 22 to 34, that should be enough. I checked the max axis and its set to 28, so that enough for the PS3 as well. It’s compiling on my Pi now, I’ll let you know if it compiles ok
[/quote]
08/03/2015 at 20:35 #103313choccyhobnobParticipantOK Well it compiled and I’ve tested that it at least works with my setup. Keep your old version just in case you need to revert for some reason.
Edit: Removed link to non-working name build
Let me know if it works :)
08/03/2015 at 21:05 #103315geauxwaveParticipantThank you for doing this! It ALMOST worked, lol. MAME fires up just fine, and it detects every button on the second control pad…except for the directional buttons. I can’t imagine the button #’s would be any greater than 34, but I don’t know. Do you think perhaps axes 10 and 11 need to be enabled? Even though MAME sees the d-pad presses as JoyButton #’s instead of JoyAxis, the jstest results show Axes 10 and 11 firing when I press controller 2’s d-pad.
Whether you’re able to continue working on it or not, thank you VERY much for your efforts. Very generous of you, and I really appreciate it.
[quote=103313]OK Well it compiled and I’ve tested that it at least works with my setup. Keep your old version just in case you need to revert for some reason.
http://choccyhobnob.com/?d=441
Let me know if it works
[/quote]
08/03/2015 at 22:35 #103322choccyhobnobParticipantIt works ok for me with snes controllers plugged in but not with PS3 controllers. Oh well it was worth a try!
I enabled 28 axis and 34 buttons so I think we can say its not a lack of inputs that is keeping it from working!
08/03/2015 at 22:36 #103324choccyhobnobParticipanthmm!
08/03/2015 at 23:04 #103326geauxwaveParticipantThank you again for giving it a shot!
08/03/2015 at 23:47 #103330geauxwaveParticipantJust an idea, but I wonder what would happen if you modified the MAME build that you used to get your PS3 controllers working (the one to which you linked originally in this thread), and increased the number of allowed buttons in that one to 34?
I have no idea what I’m talking about, so it may not be possible or feasible, or a high enough probability of success to be worth the time and effort. Just throwing out ideas!
Again, I appreciate the help you’ve already given, so no worries if you don’t want to mess with it any further. I completely understand.
[quote=103322]It works ok for me with snes controllers plugged in but not with PS3 controllers. Oh well it was worth a try!
I enabled 28 axis and 34 buttons so I think we can say its not a lack of inputs that is keeping it from working!
[/quote]
08/06/2015 at 03:54 #103512geauxwaveParticipantUpdate: I contacted the guy who made the MAME patch that allowed for up to 22 buttons, and he was kind enough to make a custom kernel for me that made it so the adapter was recognized as two separate controllers instead of one. This was a perfect solution! It not only solves the MAME issue, but all other emulators, such as gngeo. I’m not sure if he has an account on here, but his github profile is: https://github.com/ian57 . All credit goes to him!
Since it was working perfectly, I went ahead and mounted the Sega Saturn ports in my NES case–the first step in my custom build. These ports fit almost perfectly into the NES port holes. I only had to dremel out about one mm to make them fit. If anyone is curious, the adapter is the Mayflash SS Controller Adapter for PC USB (amazon link).
I’m happy to say this issue is resolved for me. Thank you again choccyhobnob for your help! I really appreciate the efforts.
-
AuthorPosts
- The forum ‘Controller Configuration in RetroPie’ is closed to new topics and replies.