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

Getting Trackball to work with MAME



  • @jvinga1 I gave that wiki link because it was updated and the new edits might not yet be in the prettier Docs. Check the logs, yes. The index in MAME might not match the numbers in Linux from your cat command.



  • @jvinga1 also I can’t speak to doing binds in retroarch GUI. That’s not what the wiki nor the post about the new MAME2003 changes describe. You need to tell the core what device to map to what player, and we were doing it with core options in the config files based on details from the logs. You wanna do it some other way that’s fine, but my trackball works.



  • Thanks again for the fast reply. I'll be happy to check the logs, but I need a little help getting retroarch to run in verbose mode. The only way I know how to run it is from the GUI. I thought I could type it at the shell prompt, but it's not recognized.

    As far as retroarch GUI, the Wiki actually does say to do that. It has a section "setting mouse indexes via the RetroArch GUI" and then one under it "setting mouse indexes via retroarch.cfg. In any case, I found how to edit the cfg file and it responds the same either way. I confirm this because if I manually edit the cfg file, then go check the GUI, it shows my change.

    I'll grab logs if I can get some help with that, but I should point out that I tried the mouse index at 0 through 5 and none of them show input when I try to use the retroarch GUI to select User 1 Right Analog X+.

    Would you mind opening your retroarch GUI to check if it responds to your trackball?

    For reference, I don't have any game controllers, just the arcade cabinet controls hooked to a controller that emulates a keyboard (sorry, the name escapes me at the moment). So EmulationStation just sees the joysticks and buttons as keyboard keys and does not recognize any game controllers. There's nothing else hooked to my Pi3 except the trackball. I substituted a mouse in the same port and get the same results.

    Any other ideas? There's a ton of stuff in that thread that seems like it doesn't apply as it's related to sharing multiple controllers, but maybe I'm missing something big in trying to figure out what applies and what does not.



  • @jvinga1 As described in the thread I linked, to record logs you need to start the game in verbose mode using the runcommand, and then use ssh to access /dev/shm/runcommand.log. There you will find references to the mouse devices that the core is seeing and their indices, although your troubleshooting kinda makes that irrelevant if you have tried all of them, but perhaps it has not been in the context of other correct settings.

    I am glad you grabbed the latest image. Are you using that now? It was recent updates to lr-mame2003 where these ideas apply and it is important to be on the same page if we are troubleshooting.

    It sounds like we might have similar configurations. I run a four-player cocktail cabinet using a keyboard controller (IPAC4) for all joysticks and pushbuttons, plus I have the Ultimarc UTrak trackball and a pair of TurboTwist2 spinners. SO, I have three analog devices that appear as two separate "mouse" inputs. The recent update to mame2003 made my spinners or my trackball unusable depending on which game I was running. But using core option configs for the ROMs that need it I was able to get everything sorted. In fact, it works better now that I have no overlap.

    I don't really have an easy way to bring up the RGUI, as it is something I never configured for my cabinet. I disabled hotkeys. I don't really know the menus in there anyway since I never use it.

    If we still cannot get a working config for you, you can always try AdvanceMAME which is much more explicit about analog inputs in its configuration and it always works great with analog.



  • Oh, now I see what you mean about runcommand - just pressing a key before the game loads and choosing to load it in verbose mode. See, told you I was a beginner at this!

    Here are the lines from the log:
    [INFO] [udev] Adding device /dev/input/event3 as type ID_INPUT_KEYBOARD.
    [INFO] [udev] Adding device /dev/input/event0 as type ID_INPUT_KEYBOARD.
    [INFO] [udev] Adding device /dev/input/event1 as type ID_INPUT_MOUSE.
    [INFO] [udev] Adding device /dev/input/mouse0 as type ID_INPUT_MOUSE.
    [INFO] [udev] Adding device /dev/input/event2 as type ID_INPUT_MOUSE.
    [INFO] [udev] Adding device /dev/input/mouse1 as type ID_INPUT_MOUSE.
    [INFO] [Joypad]: Found joypad driver: "udev".
    [WARN] [udev]: Full-screen pointer won't be available.

    I don't know if these lines are helpful to you to know what's loading or not:
    [INFO] [Config]: loading config from: /opt/retropie/configs/arcade/retroarch.cfg.
    [INFO] Config: appending config "/dev/shm/retroarch.cfg"
    [INFO] Loading dynamic libretro core from: "/opt/retropie/libretrocores/lr-mame2003/mame2003_libretro.so"

    Yes, I'm still using the 4.3 image I downloaded and installed fresh last night.

    Does the above help? It's definitely different from what the wiki says to expect for udev.



  • @jvinga1 These log entries are consistent with what I saw and another user shared in the thread I linked above. I should update the example block in the wiki page so it is a closer/exact match.

    This would lead me to make sure I have the core option enabled in /opt/retropie/configs/all/retroarch-core-options.cfg with the line

    mame2003-mouse_device = "mouse"
    

    and add/adjust lines in my /opt/retropie/configs/arcade/retroarch.cfg

    input_player1_mouse_index = "0"
    

    and if that doesn't work, try index 1.
    Actually, I use per-game configs for this, as my player1 mouse varies depending on if it is a spinner/driving game or a trackball game.



  • Well, I was feeling like it was getting close and this would do it, but no luck. First, the mame2003 line for retroarch-core-options.cfg was already in there.

    I added the input line to retroarch.cfg, but still did not have luck when running Centipede or Marble Madness. I edited and changed the index from 0 to 1 with no effect.

    Next, I thought I'd try an ROM specific setting. So I started the game and hit tab for the runcommand menu. From there I selected the option to edit the rom-specific retroarch config. The little editor opened to a blank file. I entered the in input_player1_mouse_index = "0", then ran the game. No luck. Edited again with index of 1 and still no luck.

    Here are any lines from the log file that I thought might be involved in any way:

    Executing: /opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-mame2003/mame2003_libretro.so --config /opt/retropie/configs/arcade/retroarch.cfg "/home/pi/RetroPie/roms/arcade/marble.zip" --verbose --appendconfig /dev/shm/retroarch.cfg'|'"/home/pi/RetroPie/roms/arcade/marble.zip.cfg"
    
    [INFO] RetroArch 1.6.7 (Git 8e8bdaa)
    
    [INFO] [Config]: loading config from: /opt/retropie/configs/arcade/retroarch.cfg.
    [INFO] Config: appending config "/dev/shm/retroarch.cfg"
    [INFO] Config: appending config "/home/pi/RetroPie/roms/arcade/marble.zip.cfg"
    [INFO] Loading dynamic libretro core from: "/opt/retropie/libretrocores/lr-mame2003/mame2003_libretro.so"
    [INFO] [overrides] no core-specific overrides found at /home/pi/.config/retroarch/config/MAME 2003/MAME 2003.cfg.
    [INFO] [overrides] no game-specific overrides found at /home/pi/.config/retroarch/config/MAME 2003/marble.cfg.
    [INFO] Shaders: preset directory: /home/pi/.config/retroarch/shaders/presets
    [INFO] Shaders: no game-specific preset found at /home/pi/.config/retroarch/shaders/presets/MAME 2003/marble.cgp.
    [INFO] Shaders: no game-specific preset found at /home/pi/.config/retroarch/shaders/presets/MAME 2003/marble.glslp.
    [INFO] Shaders: no core-specific preset found at /home/pi/.config/retroarch/shaders/presets/MAME 2003/MAME 2003.cgp.
    [INFO] Shaders: no core-specific preset found at /home/pi/.config/retroarch/shaders/presets/MAME 2003/MAME 2003.glslp.
    

    and a bunch of lines like this:

    [INFO] 	RetroPad, User 1, Button "B (bottom)" => "Button 1"
    [INFO] 	RetroPad, User 1, Button "Y (left)" => "Button 2"
    [INFO] 	RetroPad, User 1, Button "Select" => "Insert Coin"
    [INFO] 	RetroPad, User 1, Button "Start" => "Start"
    [INFO] 	RetroPad, User 1, Button "D-Pad Up" => "Joystick Up"
    [INFO] 	RetroPad, User 1, Button "D-Pad Down" => "Joystick Down"
    [INFO] 	RetroPad, User 1, Button "D-Pad Left" => "Joystick Left"
    [INFO] 	RetroPad, User 1, Button "D-Pad Right" => "Joystick Right"
    [INFO] 	RetroPad, User 1, Button "A (right)" => "Button 4"
    [INFO] 	RetroPad, User 1, Button "X (up)" => "Button 3"
    
    [INFO] [udev] Adding device /dev/input/event3 as type ID_INPUT_KEYBOARD.
    [INFO] [udev] Adding device /dev/input/event0 as type ID_INPUT_KEYBOARD.
    [INFO] [udev] Adding device /dev/input/event1 as type ID_INPUT_MOUSE.
    [INFO] [udev] Adding device /dev/input/mouse0 as type ID_INPUT_MOUSE.
    [INFO] [udev] Adding device /dev/input/event2 as type ID_INPUT_MOUSE.
    [INFO] [udev] Adding device /dev/input/mouse1 as type ID_INPUT_MOUSE.
    [INFO] [Joypad]: Found joypad driver: "udev".
    
    [INFO] Saved core options file to "/opt/retropie/configs/all/retroarch-core-options.cfg"
    
    

    Any other ideas before attempting to jump to AdvanceMAME? I hate to jump ship and figure out how to go install and configure a different emulator when the games all run well under this one.



  • Okay, installing AdvancedMame was pretty easy - found it on the retropie menu and installed 1.4.

    I never could get the AdvancedMAME mouse testing command to run so I just moved on to editing the config files, all as described in the wiki (https://github.com/RetroPie/RetroPie-Setup/wiki/Spinners,-Trackballs,-Lightguns,-and-other-Mouse-Devices).

    I left the Marble Madness ROM in the Arcade folder, but went to the runcommand menu when starting it and changed the emulator for that ROM to AdvancedMame. It works! I changed Centipede to use AdvancedMAME in the same way it it works too, so I'm in business.

    Thanks so much for your help! Too bad it would not work under Mame2003, but that's okay since this works for the two games I wanted working the most. I might go try a driving game now as suggested in the Wiki. Thanks again.



  • @jvinga1 I am torn. On the one hand, congrats for getting the AdvanceMAME config working. It can actually be a little harder! But on the other hand, I really think there is light at the end of the 2003 tunnel. I am actually pretty excited about the recent analog developments in this version of MAME because I like the RetoArch shaders so much more than what I can get out of AdvanceMAME. Still, I am glad you will at least have a working trackball. Sorry we could not get it sorted in the other one.



  • @jvinga1 The only thing I can think to double check is if maybe you have conflicting entries in the cascade of retroarch configs. For example, if you specify mame2003-mouse_device = "mouse" or input_player1_mouse_index = "X" in more than one location, the setting will be overridden the closer the config gets to the ROM. In other words, it will load core options /opt/retropie/configs/all/retroarch-core-options.cfg but then it will append the /opt/retropie/configs/all/retroarch.cfgand any repeat here will override, followed by arcade and finally rom specific configs. This is handy, especially when using a default and multiple emulator cores, but confusing if troubleshooting after you may have added or changed a setting in one of them.



  • I've been following along here, trying to get my system going, thanks for all of the notes.

    I finally got it going with 2003 - some tips:

    Instead of using of using the trackball to test the input, I was just using the mouse, seemed to make things a little easier.

    What finally got it working was something I didn't see listed here, in the

    • \retropie\configs\all

    directory, in the

    • retroarch-core-options.cfg

    file, I had to enable this option, then it started working immediately.

    mame_current_mouse_enable = "enabled"

    Thanks again for the notes, hope this helps someone!



  • @ajacks504 said in Getting Trackball to work with MAME:

    I had to enable this option, then it started working immediately.
    mame_current_mouse_enable = "enabled"

    Interesting. I am not familiar with that option, but I am glad it worked for you. Where did you see this suggested? Perhaps we need to include that option in the wiki.



  • I had same results as jvinga1, had both of these options set:

    mame2003-mouse_device = "mouse"
    input_player1_mouse_index = "0"

    and I was sure about my index, so i just started searching anything with a mame in it, and a mouse setting, if it was disabled, I enabled it, seemed to work for me.



  • @ajacks504 This worked for me! I didn't have any trouble getting my trackball to be recognized as soon as I plugged it in, but couldn't get MAME to see it as an input device. I tried lots of changes to various config files with no luck. As soon as I enabled this option, my trackball started working.
    This post is the only place I found in the internet that mentioned this setting for the retroarch-core-options.cfg file. Not sure how you figured out that option was even available but I'm glad you did. Thanks!



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.