"Couldn't open joystick #0" when opening retroarch-joyconfig

Home Forums RetroPie Project Everything else related to the RetroPie Project "Couldn't open joystick #0" when opening retroarch-joyconfig

RetroPie has a new website and forum. Please visit https://retropie.org.uk/ for the new site. The new forum is located at https://retropie.org.uk/forum/. This forum is left here as a read-only archive.

This topic contains 7 replies, has 3 voices, and was last updated by Profile photo of trimmtrabb trimmtrabb 3 years ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #5974
    Profile photo of denny2k2
    denny2k2
    Participant

    Hi all,

    I am trying to set up a wired 360 controller. I have it working in emulationstation menu no problem, can scroll, select roms etc. I am now trying to set it up for gameplay. I have tried going to the “Input Configuration” menu from emulationstation. It recognises my controller and I run through the prompts. I select all 3 emulators, map my buttons and when I try and save I get the message “Script Error!”.

    So I tried going into retroarch-joyconfig from command line and I get the error “Couldn’t open joystick #0”.

    Any ideas how I can solve this issue and get my xbox 360 wired controller working for gameplay? Do I need to perhaps need to manually enter the key maps in retroarch.cfg via FTP?

    Many thanks in advance.

    #5975
    Profile photo of denny2k2
    denny2k2
    Participant

    Hmm. Further progress but still not working. I have been scouring the forums for similar problems and have ran:

    jstest /dev/input/js0

    It wouldn’t let me. So I tried

    jstest /dev/input/js1

    Out of courisotiy and it showed my wired controller!

    So I bastardised someone elses retroarch.cfg and manually entered my button numbers and ended up with this:

    input_player1_joypad_index = "1"
    input_player1_a_btn = "0"
    input_player1_b_btn = "1"
    input_player1_y_btn = "2"
    input_player1_x_btn = "3"
    input_player1_start_btn = "9"
    input_player1_select_btn = "8"
    input_player1_l_btn = "4"
    input_player1_r_btn = "5"
    input_player1_up_axis = "-1"
    input_player1_down_axis = "+1"
    input_player1_left_axis = "-0"
    input_player1_right_axis = "+0"
    input_player1_l2_btn = "6"
    input_player1_r2_btn = "7"
    input_player1_l3_btn = "11"
    input_player1_r3_btn = "12"
    
    input_player2_joypad_index = "2"
    input_player2_a_btn = "0"
    input_player2_b_btn = "1"
    input_player2_y_btn = "3"
    input_player2_x_btn = "2"
    input_player2_start_btn = "7"
    input_player2_select_btn = "6"
    input_player2_l_btn = "4"
    input_player2_r_btn = "5"
    input_player2_up_axis = "-1"
    input_player2_down_axis = "+1"
    input_player2_left_axis = "-0"
    input_player2_right_axis = "+0"
    input_player2_l2_btn = "6"
    input_player2_r2_btn = "7"
    input_player2_l3_btn = "11"
    input_player2_r3_btn = "12"
    
    input_enable_hotkey_btn = "8"
    input_exit_emulator_btn = "9"

    Note: I changed input_player1_joypad_index = “1” to 1 instead of 0 as 0 wasn’t my controller.

    I thought I was onto a winner! Loaded a rom, and nothing worked…until I tried the new hotkey to exit of Start and Select…AND IT WORKED.

    So, it seems that it just isnt reading my controller as Player 1 is that correct? As the hotkeys to exit would apply to any controllers rather than player1 input?

    Ahhh! Just as I thought I was getting somewhere, I am stuck again. Any help would be appreciated.

    I am pretty much a n00b when it comes to Pi and coding – so I hope some of this at least made a little sense?

    Thanks again.

    #5976
    Profile photo of trimmtrabb
    trimmtrabb
    Participant

    Hi, did you install xboxdrv via the setup script or manually? I’m not sure exactly what the script configures but if you run sudo nano /etc/rc.local check the last line reads:

    xboxdrv –trigger-as-button –id 0 –led 2 –deadzone 4000 –silent &
    sleep 1

    If you have found the solution to your problem please mark the topic as resolved.

    #5977
    Profile photo of drapetomania
    drapetomania
    Participant

    Yikes! I’m having the same problem–I just registered to say so! and I can confirm that I’m using –id 0 as well. I’m new to this–could it have something to do with the fact that the xbox controller is using the second/bottom usb port (if that goes top-to-bottom)!

    #5985
    Profile photo of denny2k2
    denny2k2
    Participant

    Hi Trimmtrab,

    I tried it manually with no success and then ran the setup script, so technically both?

    The last line reads:
    xboxdrv --daemon --id 0 --led 2 --deadzone 4000 --silent --trigger-as-button --next-controller --id 1 --led 3 --deadzone 4000 --silent --trigger-as-button --dbus disabled --detach-kernel-driver & exit 0

    Does anything look out of place with that?

    Thanks for your help!

    Drapetomania, I’m using a usb hub, so I might try swapping the usb to a different usb socket and see what happens.

    #5987
    Profile photo of trimmtrabb
    trimmtrabb
    Participant

    Try removing the other pad from that config so there’s just id 0

    If you have found the solution to your problem please mark the topic as resolved.

    #5988
    Profile photo of denny2k2
    denny2k2
    Participant

    Further update. I edited the /etc/rc.local and used the code:

    xboxdrv –trigger-as-button –id 0 –led 2 –deadzone 4000 –silent &
    sleep 1

    When I launched a ROM. WE HAD SUCCESS! Xbox controller worked great. Had a spot of Double Dragon and Mario. Brilliant! Just before I was going to mark this as solved I decided to reboot, just in case…

    Now the controller won’t work in emulationstation at all, not even to change between the emulators and choose a ROM and strangle enough, neither does my usb keyboard now. Although Alt+F4 still allows me to access the console.

    How odd…

    #6005
    Profile photo of trimmtrabb
    trimmtrabb
    Participant

    I think Emulation Station is expecting input from js1, try deleting /.emulationstation/es_input.cfg and reboot to reset the ES controls

    If you have found the solution to your problem please mark the topic as resolved.

Viewing 8 posts - 1 through 8 (of 8 total)

Forums are currently read only - please visit the new RetroPie forums at https://retropie.org.uk/forums/

Skip to toolbar