So it looks like they would work just fine if I had the ability to set an attribute "ATTR{product}" on the devices to something custom, but the only things I can set are variables "ENV{ID_VENDOR_ENC}" and xinput (and the xinput subsystem in MAME) doesn't use those.
So when MAME tries to assign the guns they are presented with:
$xinput list
~Ultimarc Ultimarc id= 9 [floating slave]
~Ultimarc Ultimarc id=20 [floating slave]
because the both fields are the same (despite there being a ATTR{configuration} available that is unique on both devices).
Here is what MAME -v spits out using the mame.ini recommendations from the official docs at
https://docs.mamedev.org/advanced/linux-lightguns.html:
Lightgun: Begin initialization
Lightgun mapping: Logical id 1: UltimarcATRAKDevice#1
Lightgun mapping: Logical id 2: UltimarcATRAKDevice#2
Input: Adding lightgun #0: UltimarcATRAKDevice#1 (device id: UltimarcATRAKDevice#1)
0: UltimarcATRAKDevice#1
Evaluating device with name: Virtual core pointer
Evaluating device with name: Virtual core keyboard
Evaluating device with name: Virtual core XTEST pointer
Evaluating device with name: Virtual core XTEST keyboard
Evaluating device with name: Power Button
Evaluating device with name: Video Bus
Evaluating device with name: Power Button
Evaluating device with name: Eee PC WMI hotkeys
Evaluating device with name: Logitech K400 Plus
Evaluating device with name: Logitech K400 Plus
Evaluating device with name: Ultimarc IPAC 2 Ultimarc IPAC 2
Evaluating device with name: Ultimarc IPAC 2 Ultimarc IPAC 2
Evaluating device with name: Ultimarc Ultimarc
Evaluating device with name: Ultimarc IPAC 2 Ultimarc IPAC 2
Evaluating device with name: GGG TurboTwist 2 Spinner
Evaluating device with name: Universal Human Interface Device Universal Human Interface Device
Evaluating device with name: Universal Human Interface Device Universal Human Interface Device
Evaluating device with name: Ultimarc Ultimarc
Evaluating device with name: Universal Human Interface Device Universal Human Interface Device
Evaluating device with name: Trackball/Spinner Interface Trackball/Spinner Interface
Can't find device UltimarcATRAKDevice#1!
Input: Adding lightgun #1: UltimarcATRAKDevice#2 (device id: UltimarcATRAKDevice#2)
1: UltimarcATRAKDevice#2
Evaluating device with name: Virtual core pointer
Evaluating device with name: Virtual core keyboard
Evaluating device with name: Virtual core XTEST pointer
Evaluating device with name: Virtual core XTEST keyboard
Evaluating device with name: Power Button
Evaluating device with name: Video Bus
Evaluating device with name: Power Button
Evaluating device with name: Eee PC WMI hotkeys
Evaluating device with name: Logitech K400 Plus
Evaluating device with name: Logitech K400 Plus
Evaluating device with name: Ultimarc IPAC 2 Ultimarc IPAC 2
Evaluating device with name: Ultimarc IPAC 2 Ultimarc IPAC 2
Evaluating device with name: Ultimarc Ultimarc
Evaluating device with name: Ultimarc IPAC 2 Ultimarc IPAC 2
Evaluating device with name: GGG TurboTwist 2 Spinner
Evaluating device with name: Universal Human Interface Device Universal Human Interface Device
Evaluating device with name: Universal Human Interface Device Universal Human Interface Device
Evaluating device with name: Ultimarc Ultimarc
Evaluating device with name: Universal Human Interface Device Universal Human Interface Device
Evaluating device with name: Trackball/Spinner Interface Trackball/Spinner Interface
Can't find device UltimarcATRAKDevice#2!
Lightgun: End initialization
The official docs say to use this in mame.ini:
lightgun_index1 "Ultimarc ATRAK Device #1"
lightgun_index2 "Ultimarc ATRAK Device #2"
lightgun_index3 "Ultimarc ATRAK Device #3"
lightgun_index4 "Ultimarc ATRAK Device #4"
but because xinput only splits out "Ultimarc Ultimarc" for both guns that won't work.
And if you set them to "Ultimarc Ultimarc", it will complain because of this piece of code in mame's input_x11.cpp:
for(loop = 0; loop < num_devices; loop++)
{
osd_printf_verbose("Evaluating device with name: %s\n", devices[loop].name);
// if only extended devices and our device isn't extended, skip
if (only_extended && devices[loop].use < IsXExtensionDevice)
continue;
// Adjust name to remove spaces for accurate comparison
std::string name_no_space = remove_spaces(devices[loop].name);
if ((!is_id && strcmp(name_no_space.c_str(), name) == 0)
|| (is_id && devices[loop].id == id))
{
if (found)
{
osd_printf_verbose(
"Warning: There are multiple devices named \"%s\".\n"
"To ensure the correct one is selected, please use "
"the device ID instead.\n\n", name);
}
else
{
found = &devices[loop];
}
}
}
return found;
What am I missing here? Why can't I get it to work?
Can someone explain to me how to set the attribute "ATTR{product}" on each to the "ATRAK Device #1" that mame is expecting back.
I have tried making a rule:
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="d209", ATTRS{idProduct}=="1601", ATTR{product}="ATRAKDevice#1"
It works in that it matches and should work but doesn't.
This works:
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="d209", ATTRS{idProduct}=="1601", ENV{ID_VENDOR_ENC}="ATRAKDevice#1"
But is worthless.
Any ideas? I'm thinking that new Aimtraks likely don't have this problem, but mine are old and on firmware 1.15, and I can find no other firmware other than 9.19 and that won't run on my Aimtraks)
(EDIT: I removed a lot of the troubleshooting from this post)