Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GPIO slow init on startup
#1
Hello!

I was able to make the GPIO work with the built in tz_service on a banana pi m2 zero. However I'm facing an issue with slow init of the service/script.

On startup I'm just staring at emulationstation. It is fully loaded, but the buttons are not responding. A good minute needs to pass so I be able to use the controller.
It is not a big issue, I just consider it as an additional boot time.

What frustrates me is that when I start a game it seems like retroarch is resetting or reinitializing the service/script again and I need to wait for a good minute again until I can use the GPIO buttons ingame.

Somebody please give me some tips where should I start getting to the bottom of this issue.
Reply
#2
i cannot reproduce this, for example, with an orange pi pc plus, so there are probably power issues, since the bpi zero is an oven. Did you check temperature etc? some more logs would help

sudo journalctl -xb
dmesg
sudo armbianmonitor -m
Reply
#3
Actually I didn't thought about the power issue as if I connect a Dualshock 4 it works flawlessly. Even with the GPIO controller connected. I can use the PS controller directly after the boot and move around in the menu, but still need to wait that good one min for the GPIO to work.

Thanks for the tips. I will try with a bigger power adaptor as if I remember I'm using one with just 5V/1A and bpi zero needs 5V/2A, so it easily can be a power issue. I will gather the logs when I got home.
Reply
#4
Tried with bigger power supply, but with no avail. Below are the output of logs.

Temperatures seems to be normal, little throttle.
Also I noticed I'm in the wrong forum as I'm using 4.2. Sorry for that. Can this be moved?

journal
dmesg
armbianmonitor
Reply
#5
Soo. Running the script directly from /etc/rc.local and disabling the tz_gpio service solved the issue in Emulationstation. It instantly worked after boot.

However starting up a game still resets it and need to wait there again. It should be some service blocking it from start right?
Reply
#6
check this thread, maybe it's related to network. http://orangepi.club/showthread.php?tid=2447
Reply
#7
(12-03-2018, 03:58 PM)alexkidd Wrote: check this thread, maybe it's related to network. http://orangepi.club/showthread.php?tid=2447

Thanks. I restored the tz_gpio.service. I tried to disable ethernet, but I still have the issue. Now I'm used systemd-analyze blame(output below). It was obviously the bluetooth service, so I disabled it with systemctl disable. Now the controller is working instantly in emulationstation like when I started it from etc/rc.local, but the issue is still there when I start a game.

Code:
        40.188s ap6212-bluetooth.service
         4.590s nmbd.service
         4.160s armbian-hardware-monitor.service
         3.781s samba-ad-dc.service
         2.634s NetworkManager.service
         1.849s armbian-ramlog.service
         1.667s systemd-logind.service
         1.619s systemd-modules-load.service
         1.617s smbd.service

Edit: It seems like it has something to do with the button binds in retroarch as they are not recognized as I binded them in emulationstation. The main issue seems to be that through the GPIO it is recognized as an arcade joypad and it has default binds in libretto and that is what used in retroarch instead of the binds in emulationstation. Editing input_player1_ things in retroarch.cfg doesn't seem to effect anything. Anyhow main issue solved.
Reply
#8
figured out a bug in the automapping routine. GPIO cfg (tz_gpio_xxxx.cfg) must be edited , so buttons be a number less. If select is btn7, change to btn6 and so on
Reply
#9
(12-04-2018, 11:20 PM)alexkidd Wrote: figured out a bug in the automapping routine. GPIO cfg (tz_gpio_xxxx.cfg) must be edited , so buttons be a number less.  If select is btn7, change to btn6 and so on

Thank you! Will try it out. I have a feeling now that starting the events array in tz_gpio_controller.py with BTN_JOYSTICK instead of the BTN_0 has something to do with this. The automapping assumed that the 0th element was the BTN_0 right?
Reply
#10
probably, i will tweak this into next release
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  RetrOrangePi 4.1 - Orange Pi Zero GPIO - Getting GPIO to work bharathram21391 15 2,374 05-15-2018, 04:58 PM
Last Post: alexkidd
  GPIO (one more time) znoxx 1 556 05-13-2018, 11:39 AM
Last Post: alexkidd
  GPIO... indevor 18 4,323 02-28-2018, 07:02 PM
Last Post: indevor
  GPIO config mauricio-ramos 2 948 02-26-2018, 02:34 AM
Last Post: canadien
  Enable GPIO - Failed to fetch Padova 7 1,957 02-15-2018, 10:22 PM
Last Post: alexkidd
  OPI ZERO - HOW TO FIX overscan, slow fps on games mourgolukos 0 752 12-25-2017, 09:47 PM
Last Post: mourgolukos

Forum Jump:


Users browsing this thread: 1 Guest(s)