A button registering double sometimes

Post Reply
Panja
Posts: 17
Joined: Wed Feb 15, 2017 2:47 am
languages_spoken: english
ODROIDs: Odroid Go Advance
Has thanked: 0
Been thanked: 0
Contact:

A button registering double sometimes

Post by Panja » Mon Mar 02, 2020 8:56 pm

My A button registering double entries sometimes. Let's say 2 or 3 presses out of the 10 are registering double.
Already opened up the device and cleaned the silicon/rubber membranes and also the PCB with cleaning alcohol (96%).

Any one have an idea how to fix this?

jahuu
Posts: 6
Joined: Tue Mar 03, 2020 2:46 am
languages_spoken: english
ODROIDs: OGA
Has thanked: 3 times
Been thanked: 1 time
Contact:

Re: A button registering double sometimes

Post by jahuu » Tue Mar 03, 2020 2:53 am

..have this as well (1-2 of 10).
Using Stock Image.


First Post so Hi@all :D
Really nice toy and many thanks to all developers.

Panja
Posts: 17
Joined: Wed Feb 15, 2017 2:47 am
languages_spoken: english
ODROIDs: Odroid Go Advance
Has thanked: 0
Been thanked: 0
Contact:

Re: A button registering double sometimes

Post by Panja » Tue Mar 03, 2020 4:50 am

I'm having it on RetroArena and Emuelec. I don't think it's a software issues.

User avatar
shareef
Posts: 127
Joined: Sun Aug 12, 2018 4:29 pm
languages_spoken: english, italian, spanish
ODROIDs: odroid-go, odroid-go advance
Has thanked: 37 times
Been thanked: 13 times
Contact:

Re: A button registering double sometimes

Post by shareef » Tue Mar 03, 2020 6:50 am

Yes it's happening to me as well as many others. Very frustrating when navigating the UI and when playing games, and I'm not sure it can be fixed with software :cry:

There's another thread about it here: viewtopic.php?f=196&t=37946

crashoverride
Posts: 4948
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 286 times
Contact:

Re: A button registering double sometimes

Post by crashoverride » Tue Mar 03, 2020 7:31 am

shareef wrote:
Tue Mar 03, 2020 6:50 am
I'm not sure it can be fixed with software
If the issue is that the switches need to be "debounced", that can certainly be done in software. The kernel driver would be the best place to do it so its applied to all software. Other options include adding "debounce" to libgo2.

As an example, the buttons can be 4X over-sampled [1 / (60 * 4)]. Each sample is then bit shifted into a integer. When the lower 4 bits are all zero, the button is released. When the lower 4 bits are all one, the button is pressed. Any other value means the state is undefined (bouncing). Note the 1/60 value is the response time required for most emulators (60 FPS).

deerwings
Posts: 165
Joined: Mon Oct 08, 2018 9:11 am
languages_spoken: english
ODROIDs: Odroid Go, Odroid Go Advance
Has thanked: 3 times
Been thanked: 13 times
Contact:

Re: A button registering double sometimes

Post by deerwings » Tue Mar 03, 2020 7:41 am

crashoverride wrote:
Tue Mar 03, 2020 7:31 am
shareef wrote:
Tue Mar 03, 2020 6:50 am
I'm not sure it can be fixed with software
If the issue is that the switches need to be "debounced", that can certainly be done in software. The kernel driver would be the best place to do it so its applied to all software. Other options include adding "debounce" to libgo2.

As an example, the buttons can be 4X over-sampled [1 / (60 * 4)]. Each sample is then bit shifted into a integer. When the lower 4 bits are all zero, the button is released. When the lower 4 bits are all one, the button is pressed. Any other value means the state is undefined (bouncing). Note the 1/60 value is the response time required for most emulators (60 FPS).
I think debouncing is the problem, though it's odd that it's only the A button that seems to exhibit this behavior. It almost acts as if it's polling at a slightly faster rate than the other buttons, but it's one of those things that's hard to nail down. If this can be updated in future builds, then I think it'd be a great idea. I would be concerned at the impact it might have on button latency, however. This also only seems to be an issue when not in emulation, I believe Retroarch has a default setting that already handles debouncing.

Panja
Posts: 17
Joined: Wed Feb 15, 2017 2:47 am
languages_spoken: english
ODROIDs: Odroid Go Advance
Has thanked: 0
Been thanked: 0
Contact:

Re: A button registering double sometimes

Post by Panja » Tue Mar 03, 2020 5:12 pm

Sorry for opening a second thread about the same issue. Didn't notice the other one.
If a mod/admin can merge the threads together that's fine by me.

Sheae
Posts: 32
Joined: Tue Feb 18, 2020 6:08 am
languages_spoken: english, hungarian
ODROIDs: Odroid Go Advance
Has thanked: 0
Been thanked: 2 times
Contact:

Re: A button registering double sometimes

Post by Sheae » Tue Mar 03, 2020 7:07 pm

To me it happens on the d-pad as well. I don't think it's the A button, I think it's generally the buttons. Either the silicon pads are not that great, or the software debouncing mentioned above. To me its more like 1-2 out of 20 tho.

bmurphr1
Posts: 27
Joined: Mon Feb 17, 2020 5:36 pm
languages_spoken: english
ODROIDs: ODROID Go Advance
Has thanked: 0
Been thanked: 6 times
Contact:

Re: A button registering double sometimes

Post by bmurphr1 » Wed Mar 04, 2020 5:50 pm

I had this issue myself getting double-presses on ABXY until I replaced the stock membranes for the buttons with GBP membranes and they seem to be quite a bit stiffer so that every time I press a button they only get registered once. I had to cut just a little bit of the rubber pad away to get it to fit in the same position as the stock membranes but after I finished the mod even using the stock ABXY buttons worked to help stop the ghosting/double-press issue with the action keys on the right side of the unit. Fortunately I don't have this problem with the D-pad but if I did I'd probably also replace it with the membrane from a GBP to get the stiffer membranes that would prevent this from happening.

My next step is to hot-glue a micro-USB port to the top hear the charging port so that I can charge my device with a normal cable versus the proprietary barrel-type charging plug the OGA comes with. I just have to solder it in line with the charging port and I'll be able to use either cable to juice up the battery and not carry around a spare cable simply to charge the unit. I'm still kind of in awe that HK went with the barrel plus since it wouldn't have taken up much space just to replace the jack with a micro-USB port for power. This might have been done though so that people don't think the additional USB port is capable of USB-OTA support though which logically I can understand. There's also the chance that the barrel plug might hold up better over the long run for people who constantly have to remove and plug the OGA back in for charging.

User avatar
shareef
Posts: 127
Joined: Sun Aug 12, 2018 4:29 pm
languages_spoken: english, italian, spanish
ODROIDs: odroid-go, odroid-go advance
Has thanked: 37 times
Been thanked: 13 times
Contact:

Re: A button registering double sometimes

Post by shareef » Fri Mar 06, 2020 3:50 am

crashoverride wrote:
Tue Mar 03, 2020 7:31 am
shareef wrote:
Tue Mar 03, 2020 6:50 am
I'm not sure it can be fixed with software
If the issue is that the switches need to be "debounced", that can certainly be done in software. The kernel driver would be the best place to do it so its applied to all software. Other options include adding "debounce" to libgo2.

As an example, the buttons can be 4X over-sampled [1 / (60 * 4)]. Each sample is then bit shifted into a integer. When the lower 4 bits are all zero, the button is released. When the lower 4 bits are all one, the button is pressed. Any other value means the state is undefined (bouncing). Note the 1/60 value is the response time required for most emulators (60 FPS).
So, I'm now starting to think this isn't a hardware problem and quite possibly a software problem as you're suggesting crashoverride (yay!).. I've been running a very early build of lakka (this one viewtopic.php?f=194&t=38083) and in the limited game time I've spent on it I have yet to experience a double button press or incorrect dpad movement. I play gameboy picross 2 obsessively (I've been trying to finish it for months lol) and not once has a block been misplaced or added and then quickly removed due to multiple button press while I'm playing it in lakka. I also haven't noticed double presses while I'm navigating the lakka ui. So, is it possible that the lakka guys have implemented the "debouncing" that you're referring to @crashoverride or something similar within their early build? I'll continue testing and report back here. If this is in fact solved it's enough reason for me to use the lakka image over all the rest :mrgreen:

User avatar
shareef
Posts: 127
Joined: Sun Aug 12, 2018 4:29 pm
languages_spoken: english, italian, spanish
ODROIDs: odroid-go, odroid-go advance
Has thanked: 37 times
Been thanked: 13 times
Contact:

Re: A button registering double sometimes

Post by shareef » Fri Mar 06, 2020 6:15 am

Apologies guys, I take it back, I've been able to reproduce the same issue after further testing, both in game and within the lakka ui :cry:

User avatar
odroid
Site Admin
Posts: 34144
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 675 times
Been thanked: 615 times
Contact:

Re: A button registering double sometimes

Post by odroid » Fri Mar 06, 2020 3:48 pm

The bounce noise seems to be input without filtering due to the too fast sampling rate.
Changing the default key scan sampling rate to 100Hz from 500Hz could remove most of double registering problems.

Try this on the command line via SSH.

Code: Select all

sudo su 
echo 10 >  /sys/devices/platform/odroidgo2-joypad/poll_interval
The default value is 2 msec (500Hz sampling rate).

After that we could feel the double registering problem seemed to be gone.
But I have no idea how many people can feel the increased input lag (2msec ---> 10msec). It must be negligible hopefully.
Anyway, we need many users' feedback to have an optimal value.

If you are an OS developer, consider changing the Kernel DTS defined value once we find an optimal value. We will update it too.
https://github.com/hardkernel/linux/blo ... ts#L70-L71

User avatar
shareef
Posts: 127
Joined: Sun Aug 12, 2018 4:29 pm
languages_spoken: english, italian, spanish
ODROIDs: odroid-go, odroid-go advance
Has thanked: 37 times
Been thanked: 13 times
Contact:

Re: A button registering double sometimes

Post by shareef » Fri Mar 06, 2020 4:13 pm

odroid wrote:
Fri Mar 06, 2020 3:48 pm
Try this on the command line via SSH.

Code: Select all

sudo su 
echo 10 >  /sys/devices/platform/odroidgo2-joypad/poll_interval
I've applied this via ssh and with limited testing I can tell already it addresses the issue! I don't notice any discernable input lag that is affecting my gameplay, at least not in gameboy picross 2. I'll continue testing more thoroughly. Thanks @odroid!
Last edited by shareef on Sat Mar 07, 2020 12:13 am, edited 1 time in total.
These users thanked the author shareef for the post:
odroid (Fri Mar 06, 2020 4:45 pm)

Panja
Posts: 17
Joined: Wed Feb 15, 2017 2:47 am
languages_spoken: english
ODROIDs: Odroid Go Advance
Has thanked: 0
Been thanked: 0
Contact:

Re: A button registering double sometimes

Post by Panja » Fri Mar 06, 2020 6:50 pm

I have changed the value to 10 as well. Will be testing it over the weekend and report back.
I noticed that over a reboot the value got changed back to 2, this is on EmuElec.

User avatar
shareef
Posts: 127
Joined: Sun Aug 12, 2018 4:29 pm
languages_spoken: english, italian, spanish
ODROIDs: odroid-go, odroid-go advance
Has thanked: 37 times
Been thanked: 13 times
Contact:

Re: A button registering double sometimes

Post by shareef » Fri Mar 06, 2020 11:29 pm

Panja wrote:
Fri Mar 06, 2020 6:50 pm
I noticed that over a reboot the value got changed back to 2, this is on EmuElec.
I'm not sure about emuelec but in lakka you can simply create an autostart.sh file with the command in it. This file will be executed every time the device starts.

Create an autostart.sh file in /storage/.config directory:

Code: Select all

touch /storage/.config/autostart.sh
Add the command to autostart.sh:

Code: Select all

echo 'echo 10 > /sys/devices/platform/odroidgo2-joypad/poll_interval' >> /storage/.config/autostart.sh
Make autostart.sh executable:

Code: Select all

chmod +x /storage/.config/autostart.sh
Now on every device boot autostart.sh will be executed and the command will be automatically applied to your system.

jahuu
Posts: 6
Joined: Tue Mar 03, 2020 2:46 am
languages_spoken: english
ODROIDs: OGA
Has thanked: 3 times
Been thanked: 1 time
Contact:

Re: A button registering double sometimes

Post by jahuu » Sun Mar 08, 2020 4:37 am

odroid wrote:
Fri Mar 06, 2020 3:48 pm
Changing the default key scan sampling rate to 100Hz from 500Hz could remove most of double registering problems.

Code: Select all

sudo su 
echo 10 >  /sys/devices/platform/odroidgo2-joypad/poll_interval
I am using the base image and added an /etc/rc.local file to the system applying the setting at boot time.

Code: Select all

#!/bin/sh -e
#
# /etc/rc.local
#

# Change OGA Game-Button-Sampling-Rate from 500Hz to 100Hz
# See https://forum.odroid.com/viewtopic.php?f=196&t=38044
echo 10 >  /sys/devices/platform/odroidgo2-joypad/poll_interval

# Add your code before the exit  line
exit 0
I installed the nano Editor for this but some echo commands (see lakka post above) should do the same.

Code: Select all

sudo su
apt install nano
nano /etc/rc.local
chmod +x /etc/rc.local
reboot
Works fine for me.
Last edited by jahuu on Mon Mar 09, 2020 1:57 am, edited 1 time in total.

User avatar
shareef
Posts: 127
Joined: Sun Aug 12, 2018 4:29 pm
languages_spoken: english, italian, spanish
ODROIDs: odroid-go, odroid-go advance
Has thanked: 37 times
Been thanked: 13 times
Contact:

Re: A button registering double sometimes

Post by shareef » Sun Mar 08, 2020 5:42 am

jahuu wrote:
Sun Mar 08, 2020 4:37 am
Works fine for me.
Did you notice an improvement (no more double button registers)?

jahuu
Posts: 6
Joined: Tue Mar 03, 2020 2:46 am
languages_spoken: english
ODROIDs: OGA
Has thanked: 3 times
Been thanked: 1 time
Contact:

Re: A button registering double sometimes

Post by jahuu » Sun Mar 08, 2020 8:33 pm

shareef wrote:
Sun Mar 08, 2020 5:42 am
Did you notice an improvement (no more double button registers)?
Yes, Menu and Games are working quite well for me.

User avatar
shareef
Posts: 127
Joined: Sun Aug 12, 2018 4:29 pm
languages_spoken: english, italian, spanish
ODROIDs: odroid-go, odroid-go advance
Has thanked: 37 times
Been thanked: 13 times
Contact:

Re: A button registering double sometimes

Post by shareef » Sun Mar 08, 2020 11:53 pm

Excellent, and same for me; I haven't had any issues and it's been working perfectly since I applied the same tweak to the lakka image.

User avatar
odroid
Site Admin
Posts: 34144
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 675 times
Been thanked: 615 times
Contact:

Re: A button registering double sometimes

Post by odroid » Tue Mar 10, 2020 11:11 am

Thank you for the valuable feedback.
We've updated our github. I hope OS developers will use the latest kernel source soon.
https://github.com/hardkernel/linux/com ... 3345b50413

User avatar
rooted
Posts: 7626
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 668 times
Been thanked: 179 times
Contact:

Re: A button registering double sometimes

Post by rooted » Thu Mar 12, 2020 4:05 pm

As far as debouncing wouldn't it be proper to have filter caps for the input traces?

User avatar
odroid
Site Admin
Posts: 34144
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 675 times
Been thanked: 615 times
Contact:

Re: A button registering double sometimes

Post by odroid » Thu Mar 12, 2020 5:12 pm

R-C filters are not suitable for gaming devices due to slow response.

User avatar
rooted
Posts: 7626
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 668 times
Been thanked: 179 times
Contact:

Re: A button registering double sometimes

Post by rooted » Thu Mar 12, 2020 9:14 pm

odroid wrote:R-C filters are not suitable for gaming devices due to slow response.
That makes sense, thanks.

Post Reply

Return to “Issues”

Who is online

Users browsing this forum: No registered users and 1 guest