Recalbox Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • recalbox.com
    • Gitlab repository
    • Documentation
    • Discord

    recalbox-config.sh cannot pass the 2nd parameter for custom GPIO mapping to mk_arcade_joystick_rpi.ko

    Testers's corner
    cannot pass 2nd parameter gpio
    2
    2
    1117
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • cheungbx
      cheungbx last edited by

      Re: [Testers wanted: major system upgrade (Pi3b+](KODI 17 and much more ...))

      I happened to encounter a GPIO issues with both the 2018 Xmas beta and the version before that as well.
      There is a bug in the boot up script /recalbox/scripts/recalbox-config.sh that did not pass the second parameter in the recalbox.conf file to the mk_arcade_joystick_rpi.ko.
      You can ssh into the recalbox and type this command to check what parameters have been passed to the mk_arcade_joystick_rpi.ko module when the /recalbox/scripts/recalbox-config.sh is run.
      cat /recalbox/share/system/logs/recalbox.log | grep gpio

      If the parameters are correctly passed, you will see something like this (taken from my recalbox with the waveshare game hat).
      loading module mk_arcade_joystick_rpi args = map=4 gpio=5,6,13,19,21,4,26,12,23,20,16,18,-1
      But if the parameters are not successfully passed, the module will log an error in this log file.

      What version of recalbox are you using ?
      you can type this command to find out
      uname -r
      mine is 4.14.62

      I also tried my methods below successful with the other package I downloaded (those bundled with game roms)
      4.14.62-v7

      I made two posts that you can reference, one for my 2.2" TFT + custom GPIO button set up.
      https://forum.recalbox.com/topic/16295/recalbox-2018-xmas-beta-using-2-2-tft-lcd-and-gpio-buttons

      Another one for the setup for the custom GPIO pins that comes with the waveshare game hat
      https://forum.recalbox.com/topic/16307/recalbox-on-waveshare-game-hat

      I don't have to load another version of the mk_arcade_joystick_rpi.ko. I just use the one that comes bundled with the version of recalbox released.
      Then edit the recalbox.conf to put in the mapping commands.
      e.g. for my waveshare game hat I use the following:

      controllers.gpio.enabled=1
      controllers.gpio.arg=map=4 gpio=5,6,13,19,21,4,26,12,23,20,16,18,-1

      Then edit the script file (/recalbox/scripts/recalbox-config.sh) to also pass the second parameter to mk_arcade_joystick_rpi.ko.

      mount -o remount, rw /

      vi /recalbox/scripts/recalbox-config.sh

      While in Vi Search for the line with extra2=“$4” using the command /extra2=“ , then press ENTER and a to add a line after it.

      extra3=“$5”

      Then Search for the line with map="$extra2” using the command /map=“
      Then change it to
      map="$extra2 $extra3”

      After that, reboot the recall box to take effect of the changes by typing

      shutdown –r now

      If you just want to test if it works before changing all the files, you can SSH into your recalbox, then manually load the mk_arcade_joystick_rpi.ko module with the parameters for the custom GPIO pins using the following commands:

      #unload the GPIO controller module
      rmmod mk_arcade_joystick_rpi
      #load it with the custom gpio mapping of waveshare game hat,note replace 4.14.62 with the version name you found in command 'uname -r'
      insmod /lib/modules/4.14.62/extra/mk_arcade_joystick_rpi.ko map=4 gpio=5,6,13,19,21,4,26,12,23,20,16,18,-1

      Hope this help.

      AlfaJackal 1 Reply Last reply Reply Quote 1
      • AlfaJackal
        AlfaJackal @cheungbx last edited by

        @cheungbx Thanks for your description! Tried that with 4.4.13-v7and always receive a segmentation fault after this:

        # rmmod mk_arcade_joystick_rpi
        # insmod /lib/modules/4.4.13-v7/extra/mk_arcade_joystick_rpi.ko map=4 gpio=5,4,14,22,13,18,21,16,6,20,26,12,18
        

        Have a Pi 3b.

        Any ideas?

        1 Reply Last reply Reply Quote 0
        • First post
          Last post

        Want to support us ?

        71
        Online

        98.7k
        Users

        28.1k
        Topics

        187.0k
        Posts

        Copyright © 2021 recalbox.com