I recently purchased the Xtension Arcade 32" Emulator Edition and had nothing but trouble trying to configure the controller on a Raspberry Pi with prebuilt images (as well as Launchbox). I struggled for weeks until I found a solution (which isn't anywhere on the internet apparently).
Rec Room Masters uses a Mini-Ipac inside the Xtension controller, but it does not use the available "Gamepad Enabled" firmware which can see the controller as two separate Gamepad controllers when flashed and configured instead of just the keyboard. Firmware that starts with 1.4x is not gamepad enabled. Firmware that starts with 1.3x is. Luckily, the firmware can be easily flashed over USB. Note that only the last number determines how new the firmware is. 1.39 is the newest firmware that is gamepad enabled (1.49 is newest with keyboard only).
To do so:
Download WinIpac v2
https://www.ultimarc.com/download.html
Download the MiniIpac firmware (same page) Use the newest 2016+ firmware for 2016+ Miniipacs. Please check to see if your controller/miniipac is 2016+ before flashing or you will brick the ipac.
Run Winipacv2 as administrator and choose the "flash firmware" option with Miniipac1.39 firmware. It will install software/drivers and you will need to go back into winipacv2 again. You may need to unplug/replug in the controller after driver installation.
Click Flash firmware again if the program does not automatically bring up the flash utility. Flash the miniipac 1.39 firmware. Once complete, exit and go back into Winipac v2. You may need to unplug/replug in the controller again after flashing. FW will now show as 1.39.
Next, save a copy of your current config. The tool immediately overwrites any change, so having a default config saved saves a lot of headaches. Next, I will include a gamepad config in the post you can import/load to save time (later tonight), or you can assign buttons on your own.
If you want to change on your own, change each 1SWX and 2SWX pin from key to Gamepad. Assign Button 1 to 8 to the 8 main buttons (for both Player 1 and 2). Button 9 for Coin One (my Select), Button 10 for Start. I have a working coin slot in my xtension arcade, so assigning select as coin 1 allows me to use coins for both consoles and Mame.
I leave the other buttons alone. Doing this allows them to function in Mame as keyboard keys as they did before (hitting Menu brings up the Mame menu). I use a hotkey, so to exit most retroarch emulators I hold Coin 1 and the Exit button.
Now I no longer have the nightmare of trying to config every individual emulator (and game with config overrides). This has made things so much easier and painless, and the option to revert back to the original config is a quick import away.
This really should have been an option out of the box. It's nice seeing 2 gamepads appear and act independently when doing an ES controller config. I tested both sides and it works without issue across multiple emulators. It should allow games like SFV to function correctly without hacks as well.
I have not tested the trackball, but since the trackball settings were untouched, Mame should still function with it. I actually haven't been able to get the trackball working at all yet... still figuring out which control setting I need to modify and which axis to use.
Hope this helps others that can't stand the default keyboard only config which caused issues.