RetroPie, Ultimarc I-Pac Ultimate I/O Game Console, RGB Commander and xboxdrv

About two years ago, I was inspired by my partner Sté to put together my own arcade game console with buttons, two joysticks, blinky LEDS and make it Raspberry Pi and RetroPie-based.

It was a great project to start during the COVID-19 Pandemic, but I ran into an issue when one of the vendors sent me the wrong cables. I finally got around to sorting this out and got the controller up and running.

I’m putting this together so that anyone who wants to do something similar with RetoPie can do so. There were some hoops I had to jump through to get this working, mainly around drivers that were no longer available, but re-found courtesy of the Internet Archives.

Here is where I picked up the parts:

  • Game Room Solutions – Who designed the console box and artwork
  • Ultimarc – I went with the Classic RGB Illuminated buttons and went with the I-Pac Ultimate I/O which acts as a keyboard, Xbox 360 Controller, or dInput. I also wanted illuminated joysticks.
  • Raspberry Pi 4 – The guts of the system – 4gb spec.
  • Crucial X8 4Tb SSD – I wanted something fast, relatively low power, and efficient for space. I also have curated a significantly large image of games from the 70s to early 2000s. Previously I was using a WD 4Tb My Passport which does the trick and thankfully I was able to copy the image to the SDD.
  • Atolla USB Hub – While it seems I can power the SDD from the Raspberry Pi directly, I wanted to make sure I had a powered USB hub to help with power.
  • Various cables
    1. USB A-USB C cable for power to the Raspberry Pi from the USB hub
    2. Power cable for the Ultimate I/O board to power LEDs
    3. Micro USB-USB A for the Ultimate I/O board for cotrol
    4. Micro HDMI to HDMI and with a female to female converter to hook up to my TV

A lesson learned

I originally bought a set of buttons and a controller from Amazon or Aliexpress, and while it sort of worked, I ran into an issue with keyboard emulation. From what I recall, I couldn’t use two of these controllers at the same time for the two different sides, or something else. It’s been a while. I know I also had some issues with powering the LEDs on those buttons.

I was also frustrated because the buttons were really brittle so taking off the switches broke the harness that the switch sits in.

Setting it up

When ordering the Ultimate I/O board make sure you go with the 4.8 mm switch connector. The buttons had 4.8 mm connectors, not the 2.8 mm which are for the Goldleaf connectors. I had ordered the 4.8 mm harness with mine, and Ultimarc sent me the 4.8 mm and 2.8 mm version.

Wiring is not too hard, but a few tips:

  • Make a note of where you’re connecting your LEDs for the buttons as you’ll need the port numbers for programming/configuration later
  • Pay attention to the switch harness and what wire goes to which button as they are specific
  • Buttons for Joysticks and Buttons themselves often have two connectors – for the signal wire. I found that you want to connect the signal wire to the terminal closest to the ground. Otherwise it assumes the switch is closed when you’re not pressing the button rather than open:

Keyboard or Xbox 360 Mode?

The Ultimarc I/O board can switch between multiple modes – Keyboard, dInput, and Xbox 360 mode. I didn’t explore much with dInput mode as I’ve had good experiences with both Keyboards and Xbox controllers with RetroPie.

There is once big caveat – If you use Xbox mode, you cannot control the LEDs on the board. As I understand it, Microsoft locks down the abilities of boards that emulate Xbox controllers in their protocols, and so you cannot control the LEDs.

That said, two controllers are clearly visible in Xbox mode and it works well. Just be sure to program the triggers to the proper Coin and Start buttons if you use this mode. If you’re not using LEDs, this could work for you.

Now, what is the challenge if you use Keyboard mode with RetroPie? Well…out of the box, you can only setup the keyboard as a single player device, you can’t have two distinct set of controllers and control them as Player 1 and 2 separately.

If you try to setup both sides, you end up wiping out the controls for the other player. So if I setup Player 1 and then setup Player 2, I end up wiping out the Player 2 controls.

Attempt #1: xboxdrv

Update 2023-08-31: I thought xboxdrv to the rescue, but it actually didn’t work. Sure enough, it turned my keyboard into an Xbox controller, but only one controller, not two.

So you can’t say one part of the keyboard is player 1, and another part is player 2. ARGH!

Here is what I had previously written:

xboxdrv allows you to setup a single keyboard-like device as two controllers (nope!). So your device still acts like a keyboard, and the driver converts the keypresses as if it were an Xbox controller. Perfect for what I needed so I can control the LEDs and have two controllers.

The RetroPie documentation is great is covered what I needed, as is the manpage for xboxdrv.

Ultimately what got me over the hurdle was the –next-controller command. Here is the command line I ended up using for the base configuration of my Ultimate I/O:

sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
    --evdev /dev/input/by-id/usb-Ultimarc_I-PAC_Ultimate_I_O_4-event-kbd \
    --silent \
    --detach-kernel-driver \
    --force-feedback \
    --deadzone-trigger 15% \
    --deadzone 4000 \
    --mimic-xpad \
    --dpad-as-button \
    --evdev-keymap KEY_LEFTCTRL=a,KEY_LEFTALT=b,KEY_SPACE=x,KEY_LEFTSHIFT=y,KEY_Z=lb,KEY_X=rb,KEY_C=tl,KEY_V=tr,KEY_3=guide,KEY_1=back,KEY_5=start,KEY_UP=du,KEY_DOWN=dd,KEY_LEFT=dl,KEY_RIGHT=dr \
--ui-axismap lt=void,rt=void,x1=void,x2=void,y1=void,y2=void \
  --next-controller \
    --evdev-keymap KEY_A=a,KEY_S=b,KEY_Q=x,KEY_W=y,KEY_I=lb,KEY_K=rb,KEY_J=tl,KEY_L=tr,KEY_8=guide,KEY_6=back,KEY_2=start,KEY_R=du,KEY_F=dd,KEY_D=dl,KEY_G=dr \
    --ui-axismap lt=void,rt=void,x1=void,x2=void,y1=void,y2=void \
    &

This works perfectly for what I wanted. Definitely use the by-id approach as that guarantees the Ultimarc Game Controller is used rather than any other plug and play device.

Nope, that did not work – I suspect I had my keyboard plugged in at the time.

A real shame, because if someone could get the OS to interpret two different parts of the keyboard as a joystick, then that would be awesome.

Attempt #2: Update retroarch.cfg

Ultimately, I had to follow the page on Keyboard controllers at Retopie and setup retroarch.cfg for all systems to use the keyboard as player 1 and player 2. This works well with Retroarch and definitely, two people can play head to head with the controller AND I can use the RGB lights.

There’s a problem though. What if I wanted to play a game like Gauntlet with four people, two on the controller, and two on wireless joysticks?

It seems that for now, I’m a bit out of luck unless I use a tool like Retropie Joystick Selection and force a joystick to be used for player 3 and 4. It’s kludgy but it works. It would be nice if this were available through the Emulation Station UI so I don’t have to login to my Raspberry Pi to make the changes.

Now, for practicality sake, how many people will actually use the controller directly versus using wireless controllers? Most people will likely play games with wireless controllers as our living room is in a bit of an odd layout with the couches perpendicular to the television.

Wireless Controllers?

Of course! I want friends to be able to play games like Gauntlet – very much a favourite – which supports up to 4 players. This was a big deal when Atari came out with the game, and very much my kind of D&D-like game to throw virtual quarters at.

I’m using 8BitDo SN30s and Ultimates in my build. The Ultimates will be the primary controllers for player 1 and 2, with the SN30s for player 3 and 4, or if preferred, someone can use the SN30s.

How about that LED Lighting?

Ultimarc suggests using RGB Commander, however clicking the link, RGB Commander no longer exists. Doing a search, RGB Commander is nowhere to be found.

Welcome to the Internet Wayback Machine – You can download version 4.0.5 here, which was the last version.

Details can be found here.

Much thanks to Gijsbrecht De Waegeneer – if there is a way I can support you in the future, I’d like to through a donation, or some other means. Even if I could host or even take over the code, it’s clear there is demand for RGB Commander.

RBG Commander has two config files:

  • rgbcmdd.xml which defines the actual behaviour of the LEDs and RGB Commander
  • Animation files in the rgba folder

Some tips about RGB Commander:

  • You can setup a static pattern, you don’t always have to use an Animation
  • When creating your own RGBA file, use three values to set RGB
  • When you start programming the RGB values on the right side, I have noticed that I had to program the values not in R, G, B triplets but in B, G, R – I’m double checking to make sure I’ve not plugged in my LEDs backwards on the board
  • It’s not hard to program but will take some experimenting with the setup to understand which LED is represented by each triplet
  • I’ve not linked the application up to specific emulators and tested that, yet

I left the default animation on boot up of the Ultimate I/O card as-is – It’s almost like it’s linked to boot up of RetroPie, which it really isn’t, it isn’t like it’s a progress indicator per se, but you know RetroPie is fully loaded when my default animation starts playing. Neat!

Next up is figuring out how to get buttons to show up in the various emulators.

What else?

If you want to add external USB-based hand held controllers you can. IDs for the devices, i.e. which is the first, second, third or fourth controller seems to be determined based on the order in which they are connected to the USB hub. Play around with this on your hub. I could actually be quite wrong.

Conclusion

This has been an epic project, a bit delayed, but I got it done and I’m super pleased with the results.

This completely replaces a Raspberry Pi 400, USB hub and wireless controllers I had setup as part of my home entertainment setup and puts everything into a very accessible, expandable box. It also frees up the living room Raspberry Pi 400 for other projects.

What’s Next? I’m not planning on putting this in its own arcade cabinet as I already have an AtGames Legends Ultimate with AwesomeSaUCE and CoinOpsX. I am thinking of getting a wide IKEA Lack TV Bench or Coffee Table to put the console on as it’s a bit difficult to sit on the floor comfortably although it does give me significant modern 80s retro vibes and memories.