Odd Retrogame behaviour

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Mark_McQ
 
Posts: 4
Joined: Sat Jul 31, 2021 11:19 am

Odd Retrogame behaviour

Post by Mark_McQ »

I'm having a weird problem with Retrogame, which I've set up on a Pi Zero running Retropie. The install and config has all gone fine, and technically my buttons all do what they're supposed to, but they only work if I boot the system up with certain USB devices plugged in.

At first I noticed it with my keyboard, and I checked the troubleshooting steps on the Retrogame guide and the '/etc/udev/rules.d/10-retrogame.rules' file is present, and opening it in nano shows that everything is correct. But I've also found the same the same thing if I have my USB hub plugged in during boot. Even if the USB keyboard isn't attached, as long as the hub is plugged in (And there's not even anything plugged into the hub), the controls will work fine. I can unplug the hub (or keyboard) when the system is running, and my controls will still respond. If I restart EmulationStation after unplugging either of those, it still works. But if I reboot the system, back to no response again.

I've reinstalled Retrogame and redone the pin config from scratch but I'm still getting the same behaviour. Not sure how to proceed next, this is the very last thing I need to sort to finish a handheld I've built.

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Odd Retrogame behaviour

Post by adafruit_support_mike »

That sounds like a USB enumeration issue.

Are you using the keyboard for input? Our PiGrrl projects map GPIO pins to key inputs and avoid needing a keyboard completely.

User avatar
Mark_McQ
 
Posts: 4
Joined: Sat Jul 31, 2021 11:19 am

Re: Odd Retrogame behaviour

Post by Mark_McQ »

I was using the keyboard for stuff in the console. I tried the option in Retropie to wipe all the control definitions and then restarted the system without the keyboard attached so that Retropie would default to the control mapping screen, but it's still not recognising the GPIO controls on their own.

How would I remove all the traces of the Retrogame files and configs from the system? I'd like to try a full clean reinstall, but I'll do it over SSH this time instead of from the console so that the keyboard is out of the loop entirely.

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Odd Retrogame behaviour

Post by adafruit_support_mike »

It’s easiest to nuke it from orbit.. write a fresh install of Retropie onto the SD card, then install Retrogame onto that.

As you said, logging in through an ssh connection will give you a command line without creating device files for a physical keyboard, which Retrogame might slurp in automatically.

User avatar
Mark_McQ
 
Posts: 4
Joined: Sat Jul 31, 2021 11:19 am

Re: Odd Retrogame behaviour

Post by Mark_McQ »

Still having issues with a clean install. Emulation Station still isn't seeing the GPIO buttons. If I run the retrogame command from the terminal it returns this:

retrogame: Config file is '/boot/retrogame.cfg'
retrogame: Loading config
retrogame: virtual key 105 assigned to GPIO23
retrogame: virtual key 106 assigned to GPIO24
retrogame: virtual key 103 assigned to GPIO25
retrogame: virtual key 108 assigned to GPIO16
retrogame: virtual key 30 assigned to GPIO27
retrogame: virtual key 48 assigned to GPIO22
retrogame: virtual key 45 assigned to GPIO05
retrogame: virtual key 21 assigned to GPIO06
retrogame: virtual key 57 assigned to GPIO26
retrogame: virtual key 28 assigned to GPIO19
retrogame: virtual key 38 assigned to GPIO20
retrogame: virtual key 19 assigned to GPIO13
retrogame: debug level 99
retrogame: Pin config failed. Try 'sudo retrogame' ?
retrogame: Unloading config

User avatar
Mark_McQ
 
Posts: 4
Joined: Sat Jul 31, 2021 11:19 am

Re: Odd Retrogame behaviour

Post by Mark_McQ »

Managed to find the issue. I commented out all the button assignments and then re-enabled them one-by-one, testing them afterwards, and found the issue was GPIO25. Moved the wire to another pin and everything is working perfectly now.

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Odd Retrogame behaviour

Post by adafruit_support_mike »

Glad to hear you got it working. That was a good troubleshooting process.

Happy hacking!

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”