Plug and play arcade sticks?
  • Hey! Just bought Raspberry Pi B+, and got it yesterday. Flashed a micro SD card with PiPlay, booted it up, and it seems to work fine. But I didn't think it all through. My keyboard is wireless, and I have no other usb keyboards, so I thought "maybe it recognizes my Hitbox arcade stick, and I can navigate with that?". That didn't really work. I am getting a usb keyboard today to fix that, but it did raise another question for me: I want to have my Pi portable, so that I can bring it to other friends of mine who also have arcade sticks. But will they not be able to plug them in and play with them? Or will my Hitbox settings be saved [between each time I use the Pi], so that I can use my Hitbox to set up my friends arcade sticks?
  • Once you save the controls you should be good. As long as they use the same type of controller the settings will not need to be reconfigured.
  • That sounds reassuring :D
  • I got a keyboard, and changed the controllers to the game systems themselves, but not within the piplay os itself. When i plug out the keyboard, i can not navigate the piplay menu. How can I set up my hitbox as a controller to the manu? ^^ sorry if this is really obvious.
  • no worries, it's not super obvious. You need to edit /home/pi/pimame/pimame-menu/controller.yaml
  • Hm. I don't know if this is a related issue, but it seems the Arcade Stick that comes with the system doesn't automatically have the joystick/arcade stick mapped to navigate the menu. Using a keyboard to enter the Controller Setup app, I know the controls themselves work and register, but it still won't navigate the menu. Editing controller.yaml (in pico/nano) doesn't help much because I'm not sure which values to put in under the JOYSTICK: config.

    (For reference, the arcade stick that came with my PiPlay is a Mayflash PS2/PS3/PC USB Fighting Stick.)

    Little help?
  • try running the 'toggle xbox controller' from the main menu.
  • Hmm. No go there (before and after recalibrating the controls via the controller setup app). Same thing - the joystick/arcade stick can calibrate the controls for the emulators, but no menu love.
  • I should note that the buttons themselves work, but the stick does not. (It also does not seem to work in Cave story at all, but that seems to be keyboard-controlled only, no buttons work there). I haven't tried a gamepad since the only ones I have are Bluetooth or a wireless 360 pad (with pc dongle).
  • After a while, i found out how to edit the controller.yaml file.

    But how do I know what imputs my hitbox have?
    LEFT:
    - pygame.K_LEFT
    - pygame.K_KP4
    - pygame.K_a

    As an example, I have no idea what pygame.K_a means. How do I know what my hitbox imputs translate to within the yaml file?
  • see here http://www.pygame.org/docs/ref/key.html keyboard constants, they are used to represent keys on the keyboard.
  • Thanks ian57, but how do I edit the controller.ymla file so that it understands I want to use the Hitbox? The Keyboard constants are there, but I want the buttons on the Hitbox to be associated with the keyboard constants.
  • use evtest program to see what event it gives and if it is recognised at all. After seeing the hitbox website, i don't think the hitbox will behave like a keyboard, but like a joystick.

    So use jstest to see if your hitbox is recognised and find in the controller.yaml the section related to joystick input.
  • Is there a faq for this? Cause when i google evtest and jstest with piplay, there are quite a few topics about this. And for someone like me, its hard to know what "use evst" means, and how to use it properly :p

    The hitbox does work whe i registrer the buttons at the TAB menu, so I know it gives some output :)
  • So I ran jstest, and suddenly the matrix happened.

    These are the results from my hitbox inputs in jstest:

    Left: 6:-32767
    Down: 7:32767
    Right: 6:32767
    Up: 7:-32767

    LP: 2
    Mp: 3
    Hp: 5
    Lk: 0
    Mk: 1
    Hk: 5:32767
    Ppp: 4
    Kkk: 2: 32767

    Start: 7
    Select: 6
    Home: 8

    So, how do I use this data to configure the controller.yaml?
  • I have also gotten roms to work (why are there a filepath to home/pi/pimame/roms/mame4all when they should be placed in home/pi/pimame/emulators/mame4all-pi/roms ?).

    Now it is just a matter of getting my controller to work. When entering my buttons on my controller in jstest, they all work (see previous post) but some of them do not register when I use the ingame controller config in mame4all. Is there any reason why that is? And help is very much appreaciated :) (oh, and of course, I still have no idea of how to use my controller to controll the piplay menu)

    Edit: Now I am totally mindblown. When I first tried the roms, I put them in the /roms/mame4all folder, and the ones I tried gave me the "files missing" error message. Then I put some of them in the /mame4all-pi/roms folder, and suddenly they worked. So now I deleted the first ones from the /roms/mame4all folder, and put them all in the /mame4all-pi/roms folder, and piplay tells me there are no roms there. So currently, I am putting all the roms, in both the folders. :p #idonteven

    Edit: And indeed, now all the roms work.
  • you need to create a symbolic link. It's a bug that has been addressed and should be fixed in the next update, in the meantime you can do this.

    In command line, type this:
    rm -r /home/pi/pimame/emulators/mam4all-pi/roms
    ln -s /home/pi/pimame/roms/mame4all /home/pi/pimame/emulators/mame4all-pi/roms

    the first line will delete your mame4all-pi/roms folder, the second line will recreate that folder as a symlink (basically like a shortcut in windows) that points to the correct roms folder
  • Thanks :D thanks especially for the detailed description! :D
  • I don't understand why no one is answering my question, so I'll try to write a bit more about it.

    This is the controller.yaml file: (I did not find a spoiler tag, sorry)
    JOYSTICK:

    HORIZONTAL_AXIS: 0

    VERTICAL_AXIS: 1

    DIRECTIONAL:

    LEFT: -1

    RIGHT: 1

    UP: -1

    DOWN: 1

    BUTTONS:

    SELECT: 0

    BACK: 1

    MENU: 2

    Quit: [1,2]

    KEYBOARD:

    UP:

    - pygame.K_UP

    - pygame.K_KP8

    - pygame.K_w

    DOWN:

    - pygame.K_DOWN

    - pygame.K_KP2

    - pygame.K_s

    LEFT:

    - pygame.K_LEFT

    - pygame.K_KP4

    - pygame.K_a

    RIGHT:

    - pygame.K_RIGHT

    - pygame.K_KP6

    - pygame.K_d


    SELECT:

    - pygame.K_RETURN

    - pygame.K_SPACE

    - pygame.K_KP_ENTER


    BACK:

    - pygame.K_ESCAPE

    - pygame.K_2


    MENU:

    - pygame.K_TAB

    - pygame.K_1


    QUIT:

    - "[pygame.K_LCTRL, pygame.K_q]"

    - "[pygame.K_1, pygame.K_2]"



    OPTIONS:
    AXIS_DRIFT_TOLERANCE: .9

    And I posted my results in jstest a few posts up.

    If I want my "home" button on my hitbox to be the "Menu" button in PiPlay menu, how do I go about editing the controller.yaml file?

    Do I just add "- 8" to the Menu section of the controller.yaml file? Since when I ran jstest, the input that reacted was called 8.

    I will even add a video, to illustrate. http://youtu.be/ly8hZjx3sc0

    And then, assuming someone can help me on this topic - will I have to do this same process for every other arcade stick that I want to plug in?
  • ok, so controller.yaml is divided into 2 parts, joystick and keyboard. you will just deal with the upper portion (joystick). set "menu: 8" to set it to your home button. You shouldn't be messing with any of the parts that are underneath the KEYBOARD: identifier
  • I will try this as soln as possible :D thanks for feeding it too me with a teespoon :D
  • So, I did that. And this is the message that I got. http://i.imgur.com/3o8OZDn.jpg

    This is the edit I did to the controller.yaml file

    JOYSTICK:
    HORIZONTAL_AXIS: 6
    VERTICAL_AXIS: 7
    DIRECTIONAL:
    LEFT: -6
    RIGHT: 6
    UP: -7
    DOWN: 7
    BUTTONS:
    SELECT: 7
    BACK: 6
    MENU: 8
    Quit: [6,7]
    BUTTON 1: 2
    BUTTON 2: 3
    BUTTON 3: 0
    BUTTON 4: 1
    BUTTON 5: 5
    BUTTON 6: 4
    BUTTON 7: 5:32767
    BUTTON 8: 2:32767
  • @neigutten - That error is basically saying that the controller.yaml file is loading correctly into the 'contr' variable. The 'yaml' module is very temperamental when it comes to corrent indentation. Make sure that it looks something like this (also, the left/right/up/down has to be values from -1 to +1)

    JOYSTICK:
    HORIZONTAL_AXIS: 6
    VERTICAL_AXIS: 7

    DIRECTIONAL:
    LEFT: -1
    RIGHT: 1
    UP: -1
    DOWN: 1

    BUTTONS:
    SELECT: 7
    BACK: 6
    MENU: 8
    Quit: [6,7]

    KEYBOARD:
    UP:
    - pygame.K_UP
    - pygame.K_KP8
    - pygame.K_w
    DOWN:
    - pygame.K_DOWN
    - pygame.K_KP2
    - pygame.K_s
    LEFT:
    - pygame.K_LEFT
    - pygame.K_KP4
    - pygame.K_a
    RIGHT:
    - pygame.K_RIGHT
    - pygame.K_KP6
    - pygame.K_d
    SELECT:
    - pygame.K_RETURN
    - pygame.K_SPACE
    - pygame.K_KP_ENTER
    BACK:
    - pygame.K_ESCAPE
    - pygame.K_j
    MENU:
    - pygame.K_TAB
    - pygame.K_n
    QUIT:
    - "[pygame.K_LCTRL, pygame.K_q]"
    - "[pygame.K_n, pygame.K_j]"

    OPTIONS:
    AXIS_DRIFT_TOLERANCE: .9
  • I copypasted that into my own controller.yaml, and it booted up fine. The SELECT, BACK, MENU and Quit buttons work fine. But the horizontal and vertical axis buttons do not. I also checked mame4all button config, and all of my buttons register, with the exeption of the horizontal and vertical buttons.

    But also, the two buttons on the bottom row of the 8 normal ones, register as axis buttons.
    The x's are buttons that register as normal buttons, the o's are the buttons that register as axis buttons.
    [ joystick x x x x ]
    [ joystick x x o o ]
  • mame4all is completely independent of controller.yaml. The controller.yaml file is only for the piplay menu. What it sounds like to me, is that something is wired incorrectly. Was this a pre-built controller or did you wire it yourself? I don't really have a whole lot of experience in this area, so if someone else has any ideas?
  • Yes, my next line of troubleshooting is to test with a "normal" stick.

    The one thing that irks me is that when I press the buttons, they show up in jstest as being pressable and are assigned buttons. But PiPlay just don't want to recognize them.
  • I am having the same problem:

    I have a Hori Stick Mini 3 and jstest registers the horizontal axis as 4 and the vertical as 5.

    Those values will not work on either the piplay-menu (controller.yaml) nor any of the emulators.

    Using the controller configuration tool picks up the all directions (up, down, left and right) from the stick but then it just won't work when trying to play a game.

    The stick works just fine on the PS3, Mac and PC.

    Any ideas?
  • Hi

    Thanks for the real good PiPlay distribution.

    I'm not able to use my joystick on the PiPlay menu. It is detected properly by the OS, and it is working flawlessly on the AdvMame emulator. But no luck on the PiPlay menu.

    I'm running the latest PiPlay release: PiPlay 0.8.0 Beta 9. This is my joystick:

    Mayflash USB Universal Arcade Fighting Stick (http://www.amazon.com/Mayflash-Universal-Arcade-Fighting-Playstation-3/dp/B0015PHMFU)

    This is the output of the jstest at rest:

    jstest /dev/input/js0

    Joystick (MY-POWER CO.,LTD. Mayflash Arcade Stick) has 4 axes (X, Y, Hat0X, Hat0Y)
    and 12 buttons (Trigger, ThumbBtn, ThumbBtn2, TopBtn, TopBtn2, PinkieBtn, BaseBtn, BaseBtn2, BaseBtn3, BaseBtn4, BaseBtn5, BaseBtn6).
    Testing ... (interrupt to exit)
    Axes: 0:-32767 1:-32767 2: 0 3: 0 Buttons: 0:off 1:off 2:off 3:off 4:off 5:off 6:off 7:off 8:off 9:off 10:off 11:off


    If I move the stick I see activity in at Axes 2 & 3 (from -32767 to 32767)

    I have modified /home/pi/pimame/pimame-menu/controller.yaml file to use axis 2 & 3 as follows:

    JOYSTICK:
    HORIZONTAL_AXIS: 2
    VERTICAL_AXIS: 3

    DIRECTIONAL:
    LEFT: -1
    RIGHT: 1
    UP: -1
    DOWN: 1

    BUTTONS:
    SELECT: 0
    BACK: 1
    MENU: 2
    Quit: [1,2]


    But no luck. I can't use it in the PiPlay UI.

    I will really appreciate any tip.

    Thanks and regards.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!