Skip to content
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

[Juyao 2] Homemade arcade gamepad problem(detected&working) #9

Closed
claricerogue opened this issue Mar 23, 2021 · 11 comments
Closed

[Juyao 2] Homemade arcade gamepad problem(detected&working) #9

claricerogue opened this issue Mar 23, 2021 · 11 comments
Labels
Controller Controller related issue good first issue Good for newcomers help wanted Extra attention is needed question Further information is requested

Comments

@claricerogue
Copy link

I don't have so much experience with retropie and controller config so sorry if it's a basic config problem.
I have two usb homemade arcade controllers. Both work with emulation station and arcade games but when i run a makecode game, unless it works during the game, I can't exit with the start-hotkey buttons, I have to use the keyboard ctrl/ and then both gamepads miss the configuration for all retropie, and I have to reset the machine. If I only reset emulastation, it shows the makecode's last game screen, as if it continue running but controllers or keyboard doesn't work any more.
When I reset, pads get the correct config again.
Do I have to config the controllers by command line? If so, the mcairpos controller config affects the retropi controller config?

@Vegz78
Copy link
Owner

Vegz78 commented Mar 23, 2021

I don't have so much experience with retropie and controller config so sorry if it's a basic config problem.

No prob, controller support is not basic at all... ;-)

I have two usb homemade arcade controllers.

Which make and model of parts?

Both work with emulation station and arcade games but when i run a makecode game, unless it works during the game, I can't exit with the start-hotkey buttons, I have to use the keyboard ctrl/ and then both gamepads miss the configuration for all retropie, and I have to reset the machine.

McAirpos uses raw Linux input subsystem events with mapping to MakeCode inputs and sadly is not integrated with the setups in RetroPie/EmulationStation, all though that would have been a better solution(but grew a little weary when I got it to work).

Many controllers should work out the box with standard config as shown in the readme, but if not, may require a little tinkering.

Have/Could you try the XBox controller that you mentioned earlier over USB as a first test? Worked for me.

If I only reset emulastation, it shows the makecode's last game screen, as if it continue running but controllers or keyboard doesn't work any more.

It seems that the controllers are recognized, but inputs not mapped correctly. If you only connect one controller, the keyboard should stay mapped and you should be able to exit with ESC while you figure it out.

The whole McAirpos started as a launcher to exit and clear this screen/console freeze, game pad support was added later as a hack, leaving a little work to the user, as integration with RetroPie/Recalbox etc., or supporting every controller type is a much larger project.

But I would like to help as much as I can so we can build a knowledge base in the issues section and maybe users could share their working config files here for others with similar setups.

Do I have to config the controllers by command line? If so, the mcairpos controller config affects the retropi controller config?
Probably, but McAirpos configs are completely independent from RetroPie which should not be affected.

It might be easier to exit RetroPie to the Linux console and launch games manually with launCharc game_file.elf while you figure this out.

These posts might help you and contain info I would need from you to be able to help with the configs:

#6 (comment)

#6 (comment)

@Vegz78 Vegz78 added help wanted Extra attention is needed question Further information is requested labels Mar 23, 2021
@claricerogue
Copy link
Author

I've tested with xbox gamepad and work ok, even start+hotkey combo, so it's my gamepad config. I'm going to check the link and see what can i make. My controller is this one, unless it's a dual controller I have two working as mono controller because I've read that retropie doesn't support this kind of connection.
https://es.dhgate.com/product/for-4-8-connector-juyao-2-players-pc-ps-3/387652783.html

@Vegz78
Copy link
Owner

Vegz78 commented Mar 23, 2021

I've tested with xbox gamepad and work ok, even start+hotkey combo,

Great, that’s a start!

so it's my gamepad config. I'm going to check the link and see what can i make.

If it’s possible to reconfigure the gamepad’s wires/config to something that works with McAirpos already, that may be a way. Pretty heavy the first time to mess with uinput-mapper’s arcade.py and nice to avoid it if possible.

Another option, if your controller setup is fixed and they only have EV_KEY(on or off) buttons and stick inputs(not variable EV_ABS), is to use the launCharc nomap option and attemp to set up your controller as GPIO inputs OR EV_KEY scan code inputs directly in /sd/arcade.cfg, like in some of these official Makecode game hardware configs: https://github.com/microsoft/uf2-linux/tree/master/cfg

My controller is this one, unless it's a dual controller I have two working as mono controller because I've read that retropie doesn't support this kind of connection. https://es.dhgate.com/product/for-4-8-connector-juyao-2-players-pc-ps-3/387652783.html

Would need evtest and /home/pi/McAirpos/McAirpos/uinput-mapper/input-read -v -p /dev/input/eventX for your gamepads to make any sense of them, and don’t know about mono vs dual, unfortunately.

Good luck and hope to hear back from you with the solution and working configs/description for others to use!

@claricerogue
Copy link
Author

16165410760556305309219919396759

@claricerogue
Copy link
Author

I have this config. Is it supported by your mapping? Thanks

@claricerogue
Copy link
Author

I have tries launCharch with nomap and gamepad doesn't work, without nomap works the joystick and A/B but can't exit. Start, select and hotkey doesn't work and ctrl+z hangs the system.

@Vegz78
Copy link
Owner

Vegz78 commented Mar 23, 2021

Now we’re making progress!

I have this config. Is it supported by your mapping? Thanks

Not immediately supported(since it doesn’t work...), but recognized as a controller from the scan code “BTN_SOUTH”.

It can, however easily be modified to work, if you know which of those scan codes for each controllers are/you want to be:
left, right, up, down, button A, button B, start button, select and home/menu.

Try with evtest and press all those and make notes.

This image is one of the two controllers on event5, right?

Then(if any EV_ABS inputs, which is probable) you could try to edit McAirpos/uinput-mapper/configs/arcade1.py and 2.py(1 and 2 gamepads).

Inputs to modify are on left side of :, like “ABS_X:”.

Or, if stuck, I could give it a try tomorrow based on all the needed scan codes for stick and buttons for both controllers. Too late here now.

@Vegz78
Copy link
Owner

Vegz78 commented Mar 23, 2021

I have tries launCharch with nomap and gamepad doesn't work, without nomap works the joystick and A/B but can't exit. Start, select and hotkey doesn't work and ctrl+z hangs the system.

Ok, great! 66.6% there, only 33.3% to go, then.

Then run without nomap and you only need to find(evtest) the actual scan codes for the start, select and hotkey buttons on your controllers, and change only all occurrences of those three(BTN_START:, BTN_SELECT: and BTN_MODE:) accordingly in the same two arcade.py files.

Or, make sure your gamepads actually outputs scan code BTN_START when pressing start button etc. The scan codes are present in the image you uploaded here, so I don’t really understand at the moment why it doesn’t work right out of the box... ;-)

@Vegz78
Copy link
Owner

Vegz78 commented Mar 24, 2021

Did you find the scan codes for your controllers for start, select and mode in evtest?

@Vegz78 Vegz78 changed the title Homemade arcade gamepad problem (Juyao 2)Homemade arcade gamepad problem Mar 24, 2021
@claricerogue
Copy link
Author

claricerogue commented Mar 25, 2021 via email

@Vegz78
Copy link
Owner

Vegz78 commented Mar 25, 2021

I am glad that it works for you now, and thanks for confirming and your compliment! If you could please award a new start for the McAirpos repository, I would appreciate it. Happy retro game making and playing! ;-)

@Vegz78 Vegz78 closed this as completed Mar 25, 2021
@Vegz78 Vegz78 changed the title (Juyao 2)Homemade arcade gamepad problem (Juyao 2)Homemade arcade gamepad problem(detected&working) Mar 25, 2021
@Vegz78 Vegz78 added the good first issue Good for newcomers label May 21, 2021
@Vegz78 Vegz78 changed the title (Juyao 2)Homemade arcade gamepad problem(detected&working) [Juyao 2] Homemade arcade gamepad problem(detected&working) Sep 2, 2021
@Vegz78 Vegz78 added the Controller Controller related issue label Sep 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Controller Controller related issue good first issue Good for newcomers help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants