Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

Player 2 controller not working



  • Running Rasbian Jessie and having all packages up-to-date both Jessie and Retropie updated. I have the output of lsusb:

    Bus 001 Device 018: ID 0079:0006 DragonRise Inc. Generic USB Joystick
    Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
    Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    

    and the output of ls /opt/retropie/configs/all/retroarch/autoconfig

     DragonRise Inc. Generic USB Joystick .cfg DragonRise Inc. Generic USB Joystick .cfg.bak2
    DragonRise Inc. Generic USB Joystick .cfg.bak
    

    I have tried to manual add _player2 to the button config so I have 2 .bak files in this dir:
    /opt/retropie/configs/all/retroarch-joypads

    -rw-r--r-- 1 pi pi 605 Dec 7 15:00 DragonRise Inc. Generic USB Joystick .cfg
    -rw-r--r-- 1 pi pi 733 Dec 7 14:24 DragonRise Inc. Generic USB Joystick .cfg.bak
    -rw-r--r-- 1 pi pi 605 Dec 7 14:19 DragonRise Inc. Generic USB Joystick .cfg.bak2
    

    Here is the current .cfg:

    input_device = "DragonRise Inc. Generic USB Joystick "
    input_driver = "udev"
    input_l_btn = "4"
    input_load_state_btn = "4"
    input_start_btn = "9"
    input_exit_emulator_btn = "9"
    input_up_axis = "-1"
    input_a_btn = "2"
    input_b_btn = "1"
    input_reset_btn = "1"
    input_enable_hotkey_btn = "8"
    input_down_axis = "+1"
    input_r_btn = "5"
    input_save_state_btn = "5"
    input_r2_btn = "7"
    input_right_axis = "+0"
    input_state_slot_increase_axis = "+0"
    input_x_btn = "3"
    input_menu_toggle_btn = "3"
    input_select_btn = "8"
    input_y_btn = "0"
    input_left_axis = "-0"
    input_state_slot_decrease_axis = "-0"
    input_l2_btn = "6"
    

    And I have no idea how to move forward now...

    It's a Raspberry Pi 3 Model B Rev 1.2 by the way. And I was trying the playstation emulator which maps the same buttons for player 1 as for player 2.

    I am on this retropie version:

    pi@retropie:~/RetroPie-Setup $ git show
    commit 87773ed5ffcc13cf0e8832baec5e40e26e738385
    Merge: 4a4e971 5e6e8b0
    Author: Jools Wills <buzz@exotica.org.uk>
    Date:   Fri Dec 7 12:04:39 2018 +0000
    
    Merge pull request #2558 from hhromic/fix-permissions
    
    advmame, configedit - fix scriptmodule permissions (755 -> 644)
    

    I also have this log:
    https://imgur.com/a/wC1ClcQ


  • Global Moderator

    Your topic title says that 'Player2 controller is not working', but later on you say

    And I was trying the playstation emulator which maps the same buttons for player 1 as for player 2.

    Does this mean P2 works for PS1 games, having the same buttons, or Player2 doesn't work at all ?

    How did you install the RetroPie system ?



  • I am sorry, title is not correct then. Because I configured the gamepad buttons and they work. but Retropie maps it to player one while we have hard wired buttons for player one already. They are mapped to keys with a C program which runs on boot.
    Installation was just putting an image on a SD card.

    ps: I tried to edit the title, but got an akismet error that it was seen as spam.


  • Global Moderator

    @jp said in Player 2 controller not working:

    Installation was just putting an image on a SD card.

    What image ? What C program ? Can you please respond to the questions asked in https://retropie.org.uk/forum/topic/3/read-this-first, as I mentioned in the beginning ?



  • @mitu I tried to answer all of them. But I am not the owner or builder of the arcade cabinet. I am just trying to get the controller to work for player 2. What questions do you need answered exactly. I have SSH access and can provide you with all the logs.

    I expect it to be one of these images: https://github.com/RetroPie/RetroPie-Setup/releases



  • @jp Unless you have installed the software yourself, it's pointless asking on here because nobody knows what your setup is or how it's configured especially if C is involved! You should ask the creator for ongoing support. Alternatively, you could flash the official image from this site and auto-configure your controls on first boot.


  • Global Moderator

    @jp I'm not going to point a 3rd time to the set of questions in the topic at the top of the forum.
    It looks like you've got a friend that you're trying to help, which purchased a ready-made system loaded with RetroPie. This is in direct violation of the RetroPie's license (non-commercial) and of the software included in the RetroPie image. If that's not the case, then I'd still suggest the same thing as @rbaker's answer - load up a RetroPie image and start from there.



  • Start with a fresh image, configure both sets of controls in ES (do one player's first then the other's). Go into the retroarch configuration menu and set the controller order, you'll likely have something along the lines of Dragonwise USB #0 for player 1 and Dragonwise USB #1 for player 2.



  • Ok I have copy pasted the set of questions and will fill in all answer that I have provided in my previous posts:

    Pi Model or other hardware: Raspberry Pi 3 Model B Rev 1.2

    Power Supply used: (If using a Pi) it's definitely not power related

    RetroPie Version Used (eg 3.6, 3.8.1, 4.1 - do not write latest): commit 87773ed5ffcc13cf0e8832baec5e40e26e738385
    Merge: 4a4e971 5e6e8b0
    Author: Jools Wills buzz@exotica.org.uk
    Date: Fri Dec 7 12:04:39 2018 +0000

    Built From: (Pre made SD Image on RetroPie website, Berryboot, or on top of existing OS etc.. - please provide the filename of any image used) https://github.com/RetroPie/RetroPie-Setup/releases

    USB Devices connected: brandless ps3 looking usb controller

    Controller used: software shows DragonRise Inc. Generic USB Joystick

    Error messages received: usb controller, if configured the keys are mapped to player 1 which is already taken.
    Log found in /dev/shm/runcommand.log (if relevant):
    Guide used: (Mention if you followed a guide)

    File: /opt/retropie/configs/all/retroarch-joypads/DragonRise Inc. Generic USB Joystick .cfg

    Emulator: Only tested it in playstation 1 emulator

    Please don't draw conclusions about a pre-build system being bought. A colleague build it, but he couldn't figure it out and is too busy with other things, so he asked me. I was hoping that providing all logs and info on the official Retropie forum could give me useful pointers. I can't re-install the image, because the pi is build in the cabinet. The SD is not accessible. But why would I do a fresh install when everything is running fine and on the latest commit etc.? The only issue I have is related to a player 2 USB controller which controls get mapped to player 1. I have no 2nd controller to connect to exclude the controller itself. So I was hoping that having SSH access and the knowledge of the community could fix this.

    I will update the post when he can tell me more about the player 1 controls. However, there is no problem with the player 1 controls! So the hardware controls and the configuration and key mapping of that is perfect. It all related to the driver for the controller or the key mapping utility which ignores the hardbound keymaps?

    The hardware buttons are wired to the GPIO of the pi using this guide: https://github.com/recalbox/mk_arcade_joystick_rpi
    https://github.com/recalbox/mk_arcade_joystick_rpi#loading-the-driver

    IMG_20181210_085715.jpg
    IMG_20181210_085725.jpg


  • Global Moderator

    @jp OK, thanks for coming back with the info. So the problem, as I understand better now since you added the info about controllers, is that

    • P1 is the gamepad built into the cabinet
    • P2 should be the PS3 controller
    • P2 is acting as P1, overriding the P1 buttons and joysticks.

    Your postings so far show only 1 gamepad configured (DragonRise Inc. Generic USB Joystick.cfg) in /opt/retropie/configs/all/retroarch-joypads, which I assume is the PS3 controller (?), but they don't show the configuration file for the cabinet's gamepad. Normally, there should have been also an additional .cfg file for the built in gamepad.

    Your problem looks like you'd have the same device name (DragonRise ..) for both gamepads, but if you're using the GPIO connections for the cabinet gamepad, its name should be different.

    To list the available gamepad/inputs/joysticks detected, run cat /proc/bus/input/devices and it should list all input devices.
    To see how many joysticks are detected, run a ls /dev/input/js* and - if 2 gamepads are detected - there should be at least 2 entries for js0 and js1. You can test how they're responding to buttons/joypads using jstest /dev/input/jsX (see this section of the RetroArch controller configuration).
    Lastly, you can enable verbose logging in RetroArch via the Runcommand launch menu and then post the log file created after launching a game - /dev/shm/runcommand.log - on pastebin.com. This should show how many gamepads RetroArch detects and what configuration applies to them.



  • Thank you @mitu for your reply. Your bullet list is accurate!
    I have the output of the two commands:

    pi@retropie:/opt/retropie/configs/all/retroarch-joypads $ cat /proc/bus/input/devices
    I: Bus=0003 Vendor=0079 Product=0006 Version=0110
    N: Name="DragonRise Inc.   Generic   USB  Joystick  "
    P: Phys=usb-3f980000.usb-1.5/input0
    S: Sysfs=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.0/0003:0079:0006.0001/input/input0
    U: Uniq=
    H: Handlers=js0 event0
    B: PROP=0
    B: EV=1b
    B: KEY=fff 0 0 0 0 0 0 0 0 0
    B: ABS=3002f
    B: MSC=10
    
    I: Bus=0003 Vendor=0001 Product=0001 Version=0001
    N: Name="retrogame"
    P: Phys=
    S: Sysfs=/devices/virtual/input/input1
    U: Uniq=
    H: Handlers=sysrq kbd event1
    B: PROP=0
    B: EV=3
    B: KEY=1680 0 3003000 30000000
    
    pi@retropie:/opt/retropie/configs/all/retroarch-joypads $ ls /dev/input/js*
    /dev/input/js0
    

    So the hardwired (to the GPIO) joystick is not listed. Only the ps3 controller. The strange thing is that it did work before. So an update broke it.
    I might have found it by reading the used guide:

    https://github.com/recalbox/mk_arcade_joystick_rpi#auto-load-at-startup

    There it says to make a conf file, but when I open the conf file in nano, it's empty.
    So jstest /dev/input/js0 shows the usb ps3 controller...

    I have no knowledge about mk_arcade_joystick_rpi but it seems to me that there is an error because of the empty configuration file but somehow the joystick does work great????

    empty file:
    sudo nano /etc/modprobe.d/mk_arcade_joystick.conf
    another empty file:
    sudo nano /etc/modprobe.d/raspi-blacklist.conf

    it even seems that there is no mk-arcade* package installed:

    pi@retropie:/opt/retropie/configs/all/retroarch-joypads $ dpkg -s mk
    mk-configure    mkgmap          mklibs          mknfonts.tool   mktemp          mkvtoolnix
    mkcue           mkgmapgui       mklibs-copy     mksh            mktorrent       mkvtoolnix-gui
    

    is the 'tab' autocomplete output...

    However, I did find an xpad-0.4 in /usr/src/ which links to /opt/retropie/supplementary/xpad
    I will try to dig more.

    in sudo nano /etc/modules
    there is just one line: uinput


  • Global Moderator

    Ok, so it seems that the GPIO based joystick is recognized by Emulationstation, but not by RetroArch (where only the PS3 clone gamepad works). Probably this will be listed in the log output (/dev/shm/runcommand.log) of RetroArch.

    An update couldn't have erased any file in /etc/modprobe.d/, those are not part of any upgraded package. It's also normal that there is no mk_arcade_joystick package, since the module is compiled from source (it's an optional package in the drivers section of the RetroPie-Setup), but it should be registered with dkms. Being registered with dkms would re-compile the package on kernel updates, but not configure/re-configure it.

    I think your course of action involves creating a .conf file for the module and checking if the module is correctly loaded, then checking if the /dev/input/js[0,1] input device is created. After any modifications, you should check the RetroArch log file I mentioned in my previous post and see if the gamepad is detected.

    EDIT: looking back over your posts, you mentioned something about a 'C program' to map the cabinet gamepad. I think that program is Adafruit's retrogame. This is why you have a 'retrogame' as an input device, which emulates a keyboard and not a proper gamepad (buttons + joystick). I think that the setup you have doesn't use the mk_arcade_joystick module at all (hence the empty configuration file). RetroArch doesn't see a gamepad, but a keyboard.
    I think you should disable the retrogame service/program and try - as I suggested before - to make the cabinet gamepad work with the kernel module. However, I think that requires you have the proper wiring to the GPIO as it's described in the project's page. You might have to open the cabinet after all to check for this.



  • I have the output of /boot/retrogame.conf

    # Here's a pin configuration for the PiGRRL 2 project:
    
    LEFT       4  # Joypad left
    RIGHT     15  # Joypad right
    UP        17  # Joypad up
    DOWN      18  # Joypad down
    LEFTCTRL  27  # 'A' button
    LEFTALT   22  # 'B' button
    Z         24  # 'X' button
    X         10  # 'Y' button
    SPACE      9  # 'Select' button
    ENTER     25  # 'Start' button
    

    So I know the wiring now. Could you give me a few pointers how to disable retrogame and if I understand it correctly, move to mk_arcade_joystick for the hardware joystick arcade buttons?


  • Global Moderator

    @jp I don't know anything about installing or uninstalling it, since is not part of RetroPie. I suppose it's either a system service that starts it or there's a line in /etc/rc.local that starts it. Looking at their installation howto, I see they're using the /etc/rc.local approach, so you can start there.



  • I have commented out the line in /etc/rc.local which loads the retrogame binary and I am currently installing the mk_arcade_joystick but got an error with kernelheaders...

    https://github.com/recalbox/mk_arcade_joystick_rpi/issues/68

    I am so close, if this works I only have to modprobe it with a config:

    https://github.com/recalbox/mk_arcade_joystick_rpi#loading-the-driver

    sudo modprobe mk_arcade_joystick_rpi map=1 or perhaps custom mapping with the values from the retrogame.conf but will try map=1 first if the kernel-header issue is solved.


  • Global Moderator

    @jp The driver is available from the RetroPie-Setup menu, in the drivers section, try installing it from there (from source) and not directly from the Github repo. After installation, check the module configuration file.



  • I have had some trouble locating the RetroPie-Setup but I have found that I could access it from ssh:
    sudo ~/RetroPie-Setup/retropie_setup.sh
    I found the packaging -> driver menu and installed the package, but I saw an error... it was a fast one, but the menu says it did install:
    a50a5b4e-d3ae-4ceb-a63f-c4974da69d26-image.png

    Hope I can configure buttons now for seperate players :-) will see if the reboot fixed everything. I will update this reply with the results.

    It did not work. Configuring inputs did only notice the USB controller. Not the hardware buttons. Running sudo modprobe mk_arcade_joystick_rpi map=1 from ssh says: modprobe: FATAL: Module mk_arcade_joystick_rpi not found.

    I do see a conf file here: /etc/modprobe.d/mk_arcade_joystick.conf with the modprobe in it. So that part of the install script did run. I also tried to run sudo i2cdetect -y 1 as suggested here https://github.com/recalbox/mk_arcade_joystick_rpi#configuration But i2cdetect is not installed.

    Can I see a log of the output of the driver installation from the retropie-menu?


  • Global Moderator

    @jp said in Player 2 controller not working:

    Can I see a log of the output of the driver installation from the retropie-menu?

    You should find the log files under ~/RetroPie-Setup/logs, they're timestamped with the date when the action was run. If in doubt, clear the folder and re-try your setup action (installing the driver) again.



  • @mitu thank you once again! I have found the log:

    Log started at: Tue 18 Dec 08:39:46 UTC 2018
    
    RetroPie-Setup version: 4.4.4 (87773ed)
    System: Linux retropie 4.14.87-v7+ #1178 SMP Tue Dec 11 14:47:38 GMT 2018 armv7l GNU/Linux
    
    = = = = = = = = = = = = = = = = = = = = =
    Installing dependencies for 'mkarcadejoystick' : Raspberry Pi GPIO Joystick Driver
    = = = = = = = = = = = = = = = = = = = = =
    
    /home/pi/RetroPie-Setup/tmp/build/mkarcadejoystick /home/pi
    
    = = = = = = = = = = = = = = = = = = = = =
    Getting sources for 'mkarcadejoystick' : Raspberry Pi GPIO Joystick Driver
    = = = = = = = = = = = = = = = = = = = = =
    
    git clone --recursive --depth 1 "https://github.com/recalbox/mk_arcade_joystick_rpi" "/opt/retropie/supplementary/mkarcadejoystick"
    Cloning into '/opt/retropie/supplementary/mkarcadejoystick'...
    /home/pi
    
    = = = = = = = = = = = = = = = = = = = = =
    Building 'mkarcadejoystick' : Raspberry Pi GPIO Joystick Driver
    = = = = = = = = = = = = = = = = = = = = =
    
    Error! There are no instances of module: mk_arcade_joystick_rpi
    0.1.5 located in the DKMS tree.
    
    Creating symlink /var/lib/dkms/mk_arcade_joystick_rpi/0.1.5/source ->
                     /usr/src/mk_arcade_joystick_rpi-0.1.5
    
    DKMS: add completed.
    Error! echo
    Your kernel headers for kernel 4.14.87-v7+ cannot be found at
    /lib/modules/4.14.87-v7+/build or /lib/modules/4.14.87-v7+/source.
    /opt/retropie/supplementary/mkarcadejoystick /home/pi
    
    = = = = = = = = = = = = = = = = = = = = =
    Configuring 'mkarcadejoystick' : Raspberry Pi GPIO Joystick Driver
    = = = = = = = = = = = = = = = = = = = = =
    
    modprobe: FATAL: Module mk_arcade_joystick_rpi not found.
    /home/pi
    
    Log ended at: Tue 18 Dec 08:39:51 UTC 2018
    Total running time: 0 hours, 0 mins, 5 secs
    

    So there are two errors:

    • Error! There are no instances of module: mk_arcade_joystick_rpi 0.1.5 located in the DKMS tree
    • Error! echo
      Your kernel headers for kernel 4.14.87-v7+ cannot be found at
      /lib/modules/4.14.87-v7+/build or /lib/modules/4.14.87-v7+/source.
      /opt/retropie/supplementary/mkarcadejoystick /home/pi

    and therefor the final error:

    FATAL: Module mk_arcade_joystick_rpi not found.
    /home/pi

    I tried to update it from retropie-setup and got this log. It does not give the instance module error anymore. But does not solve the kernel header issue and also not the module problem:

    Log started at: Wed 19 Dec 11:55:48 UTC 2018
    
    RetroPie-Setup version: 4.4.4 (87773ed)
    System: Linux retropie 4.14.87-v7+ #1178 SMP Tue Dec 11 14:47:38 GMT 2018 armv7l GNU/Linux
    
    = = = = = = = = = = = = = = = = = = = = =
    Installing dependencies for 'mkarcadejoystick' : Raspberry Pi GPIO Joystick Driver
    = = = = = = = = = = = = = = = = = = = = =
    
    /home/pi/RetroPie-Setup/tmp/build/mkarcadejoystick /home/pi/RetroPie-Setup/logs
    
    = = = = = = = = = = = = = = = = = = = = =
    Getting sources for 'mkarcadejoystick' : Raspberry Pi GPIO Joystick Driver
    = = = = = = = = = = = = = = = = = = = = =
    
    Already on 'master'
    M       dkms.conf
    Your branch is up-to-date with 'origin/master'.
    Already up-to-date.
    /home/pi/RetroPie-Setup/logs
    
    = = = = = = = = = = = = = = = = = = = = =
    Building 'mkarcadejoystick' : Raspberry Pi GPIO Joystick Driver
    = = = = = = = = = = = = = = = = = = = = =
    
    
    ------------------------------
    Deleting module version: 0.1.5
    completely from the DKMS tree.
    ------------------------------
    Done.
    
    Creating symlink /var/lib/dkms/mk_arcade_joystick_rpi/0.1.5/source ->
                     /usr/src/mk_arcade_joystick_rpi-0.1.5
    
    DKMS: add completed.
    Error! echo
    Your kernel headers for kernel 4.14.87-v7+ cannot be found at
    /lib/modules/4.14.87-v7+/build or /lib/modules/4.14.87-v7+/source.
    /opt/retropie/supplementary/mkarcadejoystick /home/pi/RetroPie-Setup/logs
    
    = = = = = = = = = = = = = = = = = = = = =
    Configuring 'mkarcadejoystick' : Raspberry Pi GPIO Joystick Driver
    = = = = = = = = = = = = = = = = = = = = =
    
    modprobe: FATAL: Module mk_arcade_joystick_rpi not found.
    /home/pi/RetroPie-Setup/logs
    
    Log ended at: Wed 19 Dec 11:55:52 UTC 2018
    Total running time: 0 hours, 0 mins, 4 secs

  • Global Moderator

    The problem is that in order to compile the module, you need the Linux kernel headers for the kernel version you're running. You don't have that installed because you probably run rpi-update which updates your kernel + firmware to the testing version distributed by Raspbian, but it doesn't install any kernel headers.
    rpi-update is not recommended for regular updates, you should restore the kernel version which is distributed via apt - from the Raspbian repositories - and retry.


Log in to reply
 

Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.