GPIO Controls causing Pi to lock up

Having trouble with your GBZ build? Ask your questions here!
Post Reply
User avatar
infinitLoop
Posts: 536
Joined: Mon Dec 24, 2018 11:46 am
Location: Portland, OR
Has thanked: 222 times
Been thanked: 199 times
Contact:

GPIO Controls causing Pi to lock up

Post by infinitLoop » Sun Aug 25, 2019 11:19 am

.

man, i hope someone else has had this happen. i haven't been able to find anything online anywhere around it. (always fun to try researching something, only to find that you seem to be the only person this is happening to...)

In short.. when using GPIO-based controls (Retrogame overlay), pressing certain buttons causes the Pi to stutter and/or lock up. If no button is pressed, everything seems to just keep running fine, but pressing (certain) buttons causes the stutter, and mashing the buttons enough, and holding them, can cause it to just lock up completely until the buttons are released, then its back to normal.

This is driving me a little crazy... This is the third GBZ this has happened on, and I can't for the life of me figure out what is causing this issue. The first two times I finally just gave up and put a microcontroller and usb hub in the build to do the controls, but i'd really like to figure out what is causing this and fix it.

It seems to be the face buttons on the common ground button board that typically cause it. I don't think it's happened with L1/R1 or a hotkey. But, at least a couple directions on the D-pad as well as at least two or so of the A/B/X/Y buttons do seem to do it. It doesn't seem like all of them do it though.

things that didn't work...
I've tried moving the button inputs that seem to be causing it to different GPIO pins. I've tried using different, or thicker, wires on those inputs from the board, and/or the ground connection. I've cleaned the pads and board with alcohol. I've swapped out the silicone pads with different ones, and "premium" ones. I've swapped out the button board completely with a totally different one - even one from a completely different manufacturer / design.

i have had plenty of success doing GPIO controls, so (i think) i know the basics at least. it seems like a hardware issue, but i'm not really doing anything different from when i've had it working, and i don't know what else to test/try/check. nothing seems to be bridged. i've also tried other software like GPIONext and OneForAll in the past, but when i am able to get that other software working it didn't solve it. i haven't tried different software yet on this latest one.

other build notes...
the first one this happened on was using an SPI ili9341 screen, but the two more recent ones were using composite screens, so that does not seem to be related (the first time, i thought it might have been messing with the SPI bus).
For audio, they are all over the map - one was PWM, one was i2C, and one was USB audio.
They all had an ADS-1x15 hooked up to SDA/SCL, running something like hoolyhoo's battery monitor script, but disabling it has no effect.
software-wise, i think that i've tried Retropie 4.3, 4.4, and 4.5 and they all seem to have the issue. i usually do most of my testing with super mario bros (nes) and super mario kart (snes). there isn't any other software loaded, and i'm not doing anything unusual in any other settings anywhere.

any suggestions on other things to try are welcome. if someone wants to see it happening, i can upload a video too.

thanks
.
.

User avatar
infinitLoop
Posts: 536
Joined: Mon Dec 24, 2018 11:46 am
Location: Portland, OR
Has thanked: 222 times
Been thanked: 199 times
Contact:

Re: GPIO Controls causing Pi to lock up

Post by infinitLoop » Sun Aug 25, 2019 12:30 pm

.. something to note, that i just tried.. i disabled retrogame and just played a game with a usb keyboard. pushing and mashing the face buttons had no effect at all while retrogame was disabled...

so... seems to point to something with where/how retrogame is reading the GPIO inputs maybe?

User avatar
tinkerBOY
Posts: 710
Joined: Tue May 30, 2017 4:00 am
Has thanked: 294 times
Been thanked: 206 times

Re: GPIO Controls causing Pi to lock up

Post by tinkerBOY » Thu Aug 29, 2019 6:10 am

I have a few similar issues reported by users who bought my v2 and v1 controller boards but everything was solved by cleaning the contact pads and/or replacing the silicon.

Read the replies at viewtopic.php?f=44&t=6206.

I have also investigated this before and can easily duplicate or simulate the stutter issue with my old GPIO based GBZ by semi pressing a button or pressing a button with a dirty contact pads under.
New! tinkerBOY PowerSwitch v1.0 with Safe Shutdown
Game Boy Zero Controllers available @ tinkerBOY.xyz * Support
tinkerBOY Controller v3.0 - built-in usb controller, usb audio, and usb hub
tinkerBOY Controller v2.0 - GPIO buttons and builtin PWM Audio and Amplifier
tinkerBOY Controller v1.1 - simple pcb button
* DPI Adapter - better display for GBZ
* keyboard converters - IBM XT/AT Soarer's Converter | ADB to USB Converter

User avatar
tinkerBOY
Posts: 710
Joined: Tue May 30, 2017 4:00 am
Has thanked: 294 times
Been thanked: 206 times

Re: GPIO Controls causing Pi to lock up

Post by tinkerBOY » Thu Aug 29, 2019 6:13 am

Im not 100% sure but i think it has also something to do with debouncing on the retrogame software.
New! tinkerBOY PowerSwitch v1.0 with Safe Shutdown
Game Boy Zero Controllers available @ tinkerBOY.xyz * Support
tinkerBOY Controller v3.0 - built-in usb controller, usb audio, and usb hub
tinkerBOY Controller v2.0 - GPIO buttons and builtin PWM Audio and Amplifier
tinkerBOY Controller v1.1 - simple pcb button
* DPI Adapter - better display for GBZ
* keyboard converters - IBM XT/AT Soarer's Converter | ADB to USB Converter

User avatar
tinkerBOY
Posts: 710
Joined: Tue May 30, 2017 4:00 am
Has thanked: 294 times
Been thanked: 206 times

Re: GPIO Controls causing Pi to lock up

Post by tinkerBOY » Thu Aug 29, 2019 6:18 am

Another way to test is use a tactile switch on a button that makes the stutter issue. Just solder the other pin of the tactile switch to the GPIO that corresponds to the button and solder the other pin to any GND.
New! tinkerBOY PowerSwitch v1.0 with Safe Shutdown
Game Boy Zero Controllers available @ tinkerBOY.xyz * Support
tinkerBOY Controller v3.0 - built-in usb controller, usb audio, and usb hub
tinkerBOY Controller v2.0 - GPIO buttons and builtin PWM Audio and Amplifier
tinkerBOY Controller v1.1 - simple pcb button
* DPI Adapter - better display for GBZ
* keyboard converters - IBM XT/AT Soarer's Converter | ADB to USB Converter

User avatar
infinitLoop
Posts: 536
Joined: Mon Dec 24, 2018 11:46 am
Location: Portland, OR
Has thanked: 222 times
Been thanked: 199 times
Contact:

Re: GPIO Controls causing Pi to lock up

Post by infinitLoop » Thu Aug 29, 2019 8:15 am

tinkerBOY wrote:
Thu Aug 29, 2019 6:13 am
Im not 100% sure but i think it has also something to do with debouncing on the retrogame software.
yeah, i wish the debounce was easier to control on retrogame. GPIONext lets you set that in its settings, but isn't as easy to get up and running, in my experience. that is definitely something that has helped on the ones that i've switched to pro micro controls with the other ones. and i agree, most of the time this is dirty or bad conductive pads (man, where do you get good, inexpensive pads?!).

for this one, what actually seems to have fixed it (so far) was moving the audio connections. like a lot of the boards, the ones i was using have the audio-in near the top, then come out near the headphone and speaker. i found disconnecting that actually solved the stutter/lockup for some reason, so i just ran the wires down over the board, instead of routing through it, and voila, no more lockup. i don't really know why though, since those connections seem isolated on the board, and not bridged. something is leaking somewhere i guess.



.

kylegp
Posts: 3
Joined: Sat Jan 22, 2022 5:52 am

Re: GPIO Controls causing Pi to lock up

Post by kylegp » Sat Jan 22, 2022 6:34 am

I've got this exact issue right now and it's driving me nuts. All buttons work fine if I have audio disconnected or disabled in software.

If I enable audio, audio works but then the buttons don't respond properly and cause the stutter or lock up as long as the button is held. USB keyboard doesn't exhibit any problems. This is on menus, in games, etc.

It can't be the pads because the buttons work flawlessly without audio.

I have the tinkerBoy 2.0.1 board.

I've already tried routing the audio wire differently and tried different pwm pins but the result is the same.

Tomorrow I'll try thicker wire for the audio and some tactile buttons directly to see if the behaviour is the same...

Any other ideas would be extremely appreciated.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest