Skip to content

GPIO Controllers not working anymore on v41 and v42 #14582

Description

@TobiasDax

Batocera build version

batocera-bcm2711-41-20241217

Your architecture

Raspberry Pi 4 B

Your Graphic Processor Unit(s) (GPU)

integrated

Issue description

I haver built an arcade station with two integrated controllers.
They are just basic switches that are wired up to the GPIO Pins of my raspberry pi 4 and the system worked great on Batocera v39.

Now i wanted to update and since the boot partition was to small i created a new boot drive with v41 (BTW the raspberry torrent download link links to v41 and not v42)

On v41 only 2 Buttons per controller are recogniced, i checked a lot of stuff but did not really make any headway into why.

Then i found this reddit post of people having similar issues: https://www.reddit.com/r/batocera/comments/1nk6vx3/pi4_b_gpio_arcade_controls_not_working_on/?show=original

something about how batocera handles gpio has changed and i would love for it to go back to how it was :)

For now i will downgrade to v40 and hope that it works

Detailed reproduction steps

Creasted a new boot device with v41 and now my controllers are no longer working

Details of any attempts to fix this yourself

worked through some stuff with AI, here is an AI summary of what i did:

Investigation Steps

1. Verified Driver Loading

cat /proc/bus/input/devices

Result: Two GPIO controllers detected (GPIO Controller 1 and GPIO Controller 2) at /dev/input/event4 and /dev/input/event5

2. Checked Driver Configuration

dmesg | grep -i "gpio\|mk_arcade"

Result: Driver mk_arcade_joystick_rpi loading correctly with default GPIO mappings:

  • Controller 1: GPIOs 4, 17, 27, 22, 10, 9, 25, 24, 23, 18, 15, 14, 2
  • Controller 2: GPIOs 11, 5, 6, 13, 19, 26, 21, 20, 16, 12, 7, 8, 3
  • Peripheral base address: 0xfe000000 (Pi 4 address)
  • Pad types: 1 and 2

3. Tested GPIO Response with evtest

evtest /dev/input/event4

Result: Only 3 inputs working from physical button presses

4. Systematic GPIO Pin Testing

Manually shorted individual GPIO pins to ground while monitoring with evtest:

Working GPIOs:

  • GPIO 4 → ABS_Y (joystick axis)
  • GPIO 14 → ABS_Y (joystick axis)
  • GPIO 15 → ABS_Y (joystick axis)
  • GPIO 18 → BTN_NORTH
  • GPIO 2 → BTN_MODE

Non-responsive GPIOs:

  • GPIO 17, 27, 22 (should be joystick directions)
  • GPIO 10, 9, 25, 24, 23 (should be action buttons)
  • GPIO 3 (tested, no response)

5. Checked Configuration Files

cat /userdata/system/batocera.conf | grep -i gpio

Configuration found:

controllers.gpio.enabled=1
controllers.gpio.args=map=1,2

6. Module Information

modinfo mk_arcade_joystick_rpi | grep parm

Available parameters:

  • map: Enable or disable GPIO layouts (array of int)
  • gpio: Custom GPIO numbers for Joystick 1 (array of int)
  • gpio2: Custom GPIO numbers for Joystick 2 (array of int)

Additional Notes

  • The pinctrl output shows all GPIOs are configured as inputs with appropriate pull-up/pull-down resistors
  • Physical wiring has not changed and worked previously
  • Issue appeared immediately after Batocera system update

Details of any modifications you have made to Batocera.

uncommented the conf options to activate the GPIO controller

Logs and data

see above

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions