Please do not post a support request without first reading and following the advice in

Error after updating retropie-setup to 4.4.9 (a161774a)

  • Global Moderator

    Nevermind, I managed to reproduce the error. It seems that the update to joy2key might have something to do with it.
    @psyke83 Can you take a look at the error reported by @hiulit ?
    I get the same error on a stock RetroPie 4.4, installed from scratch and updated to the latest master. Started raspi-config, got the error and the gamepad doesn't work.
    If i revert to 6ebb8150 then the error is gone.
    I only have 1 gamepad configured (USB,2-axis 8-button gamepad .cfg) in /opt/retropie/configs/all/retroarch-joypads)

    input_device = "USB,2-axis 8-button gamepad  "
    input_driver = "udev"
    input_l_btn = "4"
    input_load_state_btn = "4"
    input_start_btn = "7"
    input_exit_emulator_btn = "7"
    input_down_axis = "+1"
    input_r_btn = "5"
    input_save_state_btn = "5"
    input_right_axis = "+0"
    input_state_slot_increase_axis = "+0"
    input_select_btn = "6"
    input_left_axis = "-0"
    input_state_slot_decrease_axis = "-0"
    input_up_axis = "-1"
    input_a_btn = "0"
    input_b_btn = "1"
    input_reset_btn = "1"
    input_enable_hotkey_btn = "6"
    input_x_btn = "2"
    input_menu_toggle_btn = "2"
    input_y_btn = "3"

    Everything else is the default on a RetroPie 4.4 image.

  • @mitu Doesn't the error say index out of range? My Wii controller threw it and it has like 4 configurations(accelerometer, IR, controller, blah) but only 6 buttons on the js1 and it doesnt work. Are the buttons out of range? is there really 8 buttons on the js0?

    But I mostly agree, I didn't get this pre-update, although I never got a chance to use the wii controller, because the PS3 driver used to kick it off before it could sync.

  • Global Moderator

    @Efriim I don't think it's specific to the controller used. I don't get an error if the autoconfig folder is empty - on my Ubuntu test machine for instance, where only a keyboard is used.
    For the PS3 one, remove the ps3driver and install the sibling sixaxis driver. This uses the Linux BT stack and it will allow you to pair and register other BT controllers - like the Wii controller.

  • I synced the wii controller again, triggering joy2key in retropie menu triggers the error.
    I don't have a Nintendo Wii config in /opt/retropie/configs/all/retroarch-joypads, I emptied the directory, and I still get the error. Only when the wii controller is connected.

    Do you know what folder joy2key references for fds file descriptors? other than /dev/input/

  • Global Moderator

    @Efriim Well, let's take it one step at a time. If you want to get rid of the error in this topic, checkout a later revision of the RetroPie-Setup script

    cd $HOME/RetroPie-Setup
    git checkout 6ebb8150

    then take it on from here.
    To revert to the normal RetroPie-Setup branch (once the error in this topic is resolved), just run

    cd $HOME/RetroPie-Setup
    git checkout master

  • Global Moderator

    Thanks for letting me know @mitu. It looks like your config is not being detected and falls back to the main retroarch config which doesn't have any mappings. Will work on a fix soon.

  • Global Moderator

    Please let me know if this fixes the issue:

    @mitu - although I'm confident the above will resolve the errors, I think that we might have highlighted the issue that joy2key (even when reverted to the commit you specified) isn't utilizing your mappings for that controller correctly, and falling back to retroarch.cfg instead. I can try to troubleshoot that in more detail if you can confirm that my suspicion is correct.

    You said that you only have one gamepad configured; the error triggers if an unconfigured or partially mapped controller is connected, so if you also had a different, unmapped controller connected, then the script doesn't need any further fixing beyond the current PR.

  • Global Moderator

    @psyke83 The PR seems to work, thank you.

    Indeed, I have 3 /dev/input/jsX devices present, but only 1 of them was configured - the one I mentioned (USB,2-axis 8-button gamepad , mapped to /dev/input/js0). The configuration was done from Emulationstation, without any other external edits.

    There's one more message (probably related to the signal handling updates for joy2key) that appears now every time joy2key starts

    Exception OSError: (9, 'Bad file descriptor') in <module 'threading' from '/usr/lib/python2.7/threading.pyc'> ignored

    It stays in the background (doesn't clutter the dialog boxes), but it doesn't appeared before. Also reported here.

    Thank you. We can debug further if you like, so let me know if you want to be to test other things.

  • Global Moderator


    Unfortunately I can't reproduce this error. Can you isolate whether it's triggered by a specific controller in particular? I only have two PS3 controllers, and I can't trigger the error with none, one or both connected.

  • Global Moderator

    @psyke83 said in Error after updating retropie-setup to 4.4.9 (a161774a):

    Unfortunately I can't reproduce this error. Can you isolate whether it's triggered by a specific controller in particular?

    I use only 1 controller (the one I mentioned), though there are 3 /dev/input/jsX entries from the other 2 controllers. If I unplug the other 2 controllers (which actually it's just a 2SNES-to-USB adapter without any controllers connected), I still get the same Exception OSError: (9, 'Bad file descriptor') ..., so it doesn't look like it's related to a particular controller.
    I'm on a fully updated Raspbian Stretch, maybe there's something from a package update.

    I tried (on the master branch) to reproduce the original error (the one reported by @hiulit) without the other 2 controllers connected and it seems ok - the problem appears only when I have the other (un-configured) 2 controllers connected.

  • Global Moderator


    Would it be possible for you to isolate the part of the script triggering the warning via some manual edits? See:

    In the three instances where I replaced except: with a more specific exception, you could change one back to a naked exception and see if it eliminates the warning. If I could at least know which one of the three is the trigger, it should help me evaluate the exact origin of the error. Thanks!

  • @psyke83
    Line 163.
    OSError and ValueError both throw exceptions individually, if one of them is a parent, probably ValueError.

  • Global Moderator

    @psyke83 thanks, I'll do some testing tonight, don't have access right now to the system.

  • Global Moderator

    @psyke83 OK, I get the same thing as @Efriim (thanks for testing !).
    If I replace the named exception on line 163, I don't get the error.

    Now, just to recap what are the conditions in which it happens:

    • I have 1 gamepad configured in ES and with a .cfg file in the autoconfig folder ( USB,2-axis 8-button gamepad .cfg, there are 2 spaces at the end of the device name). It's a iBuffalo SNES controller. It's mapped at /dev/input/js0.
    • I also have plugged in a dual SNES to USB adapter (raphnet technologies Dual SNES to USB v2.2) which produces 2 more gamepads (/dev/input/js1 and /dev/input/js2), although only 1 SNES gamepad is plugged in (that's normal). This one doesn't have any configuration in ES or in the RA's autoconfiguration folder.
      Here's the listing (/proc/bus/input/devices):
    I: Bus=0003 Vendor=0583 Product=2060 Version=0110
    N: Name="USB,2-axis 8-button gamepad  "
    P: Phys=usb-3f980000.usb-1.4/input0
    S: Sysfs=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0/0003:0583:2060.0001/input/input0
    U: Uniq=
    H: Handlers=js0 event0
    B: PROP=0
    B: EV=1b
    B: KEY=ff 0 0 0 0 0 0 0 0 0
    B: ABS=3
    B: MSC=10
    I: Bus=0003 Vendor=289b Product=0057 Version=0101
    N: Name="raphnet technologies Dual SNES to USB v2.2"
    P: Phys=usb-3f980000.usb-1.2/input0
    S: Sysfs=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.0/0003:289B:0057.0008/input/input5
    U: Uniq=102739
    H: Handlers=js1 event1
    B: PROP=0
    B: EV=1b
    B: KEY=ffff 0 0 0 0 0 0 0 0 0 0 0 0 ffff 0 0 0 0 0 0 0 0 0
    B: ABS=3
    B: MSC=10
    I: Bus=0003 Vendor=289b Product=0057 Version=0101
    N: Name="raphnet technologies Dual SNES to USB v2.2"
    P: Phys=usb-3f980000.usb-1.2/input1
    S: Sysfs=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.1/0003:289B:0057.0009/input/input6
    U: Uniq=102739
    H: Handlers=js2 event2
    B: PROP=0
    B: EV=1b
    B: KEY=ffff 0 0 0 0 0 0 0 0 0 0 0 0 ffff 0 0 0 0 0 0 0 0 0
    B: ABS=3
    B: MSC=10

    NOW, if I remove the 2SNES adapter, and I'm left with only the iBuffalo gamepad (the configured one), then there is no error.

    My guess is that the script tries to map the /dev/input/js1 and /dev/input/js2 through a RA auto-configuration file, which doesn't exist, and falls back to the RA's default config (/opt/retropie/configs/all/retroarch.cfg, which is stock 4.4 RetroPie) and it fails to map the buttons there.

    I think that if you have 2 identical gamepads you wouldn't run into this issue, since they're both mapped by the same RA auto-configuration file. Maybe starting xboxdrv on the 2nd controller (and giving it a different name) would enable you to reproduce the error. That is if you don't have a spare gamepad you could plug in.

  • Wii Motion Plus controller stand alone.
    It has no retroarch config or listing in /dev/input/by-id/

    It has several event handlers, for the accelerometer, IR, controller, motionplus?.
    The main controller input has three Handlers; a kbd, js, event.

    The controller doesn't work anyway, I thought that it was becuase of the error, and then learn these controllers wont work without additional setups. It seems close to working, the evtest buttons work, the jstest shows the same buttons working, minus the dpad which is being handled as a keyboard event.

  • Global Moderator

    @Efriim They won't work straight out without extra software - But IMHO they're terrible as controllers compared to other gamepads - might worth it if they'd work as light-guns (i.e. detected as mice).

  • @mitu It says there are three methods, I think they all use a different driver to access the bluetooth stack. It also says that the polling methods for finding and syncing the bluetooth are poorly written to terrible. I lost interest.
    There is a IR sensor that you can buy for windows machines/linux boxes the 'dolphinbar' setting it up allows one to use the IR sensor on the wiimote as a mouse or whatever. The controllers are okay if you only need a handful of buttons, megadrive, nintendo, gba. The wii classic controllers are more like a modern gamepad and they attach to the wiimote.

    Even if I did get one of the methods to work, I don't know if it will hinder my ps3 controller, or that the wii classic controller will function. I give up on it, I wish it worked out of the box, or a script module.

  • Global Moderator

    @Efriim Ah, so you want it for the classic controller(s) - you can get an USB adapter for that, without resorting to the wiimote as an intermediary. Pretty nifty if you have any of the classic minis Nintendo released a while ago (in addition to the Wii (U) ones).
    Something like this.

  • @mitu
    that is nifty, and I could use it on any usb.

    The main problem I'm facing right now is my powersupply. I have a RetroFlag case and Overclocked to a maximum, but if I use a USB port for charging, I get undervolt warnings. I think maybe if I get 5.2V power supply as opposed to my 5.0V long cable it will solve it. But I'm not sure about this either, I may have to resort to a lower Overclock, or perhaps just disabling force_turbo.
    Didn't mean to derail the thread.
    I haven't had any new problems with the update.

  • Global Moderator


    I still haven't had luck reproducing the issue, unfortunately. I tried masking a controller via xboxdrv, writing a python script to emulate a dummy joystick via uinput and I even dug out an old PS2 clone controller that has a USB connection, but I couldn't reproduce the issue with the combination of two controllers connected but only one mapping set up.

    Is it possible that your SNES to USB adapter is the source of the problem because it emits joystick nodes for devices that aren't connected? Try to unplug your mapped iBuffalo gamepad (and/or any other mapped controllers) to see if you can trigger the error just when you have the unmapped SNES to USB adapter connected.

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.