Main > Linux
Aimtrak light gun and Ubuntu
MacGyver:
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:
--- Code: ---$xinput list
~Ultimarc Ultimarc id= 9 [floating slave]
~Ultimarc Ultimarc id=20 [floating slave]
--- End code ---
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:
--- Code: ---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
--- End code ---
The official docs say to use this in mame.ini:
--- Code: ---lightgun_index1 "Ultimarc ATRAK Device #1"
lightgun_index2 "Ultimarc ATRAK Device #2"
lightgun_index3 "Ultimarc ATRAK Device #3"
lightgun_index4 "Ultimarc ATRAK Device #4"
--- End code ---
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:
--- Code: --- 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;
--- End code ---
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:
--- Code: ---ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="d209", ATTRS{idProduct}=="1601", ATTR{product}="ATRAKDevice#1"
--- End code ---
It works in that it matches and should work but doesn't.
This works:
--- Code: ---ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="d209", ATTRS{idProduct}=="1601", ENV{ID_VENDOR_ENC}="ATRAKDevice#1"
--- End code ---
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)
MacGyver:
Just in case anyone finds this thread with the same problem, the issue was the age of my guns and the firmware they had.
They were on 1.15 from around 8 years ago, and it was like I thought, they made some changes and improvements to the firmware since then (who would have thought :) ) , I emailed Andy and even though he no longer even had that old hardware on hand to test he was able to compile a new version that output a distinctive model when polled, and it worked perfectly.
Now xinput outputs like this:
--- Code: ---Ultimarc ATRAK Device #1 id=9 [floating slave]
Ultimarc ATRAK Device #2 id=20 [floating slave]
--- End code ---
The official MAME instructions (https://docs.mamedev.org/advanced/linux-lightguns.html) now work as they should but the portion "Configure Xorg inputs" will break them in Daphne/Singe because it makes them floating and no longer part of the main mouse, both guns will work just fine under an X11 compiled version of MAME (non SDL and after version 0.206) with that part sipped.
Skip this part to keep Daphne Singe working:
--- Code: ---In /etc/X11/xorg.conf.d/60-aimtrak.conf we will need:
Section "InputClass"
Identifier "AimTrak Guns"
MatchDevicePath "/dev/input/event*"
MatchUSBID "d209:160*"
Driver "libinput"
Option "Floating" "yes"
Option "AutoServerLayout" "no"
EndSection
--- End code ---
Thank you Andy at Ultimarc for always being there for us. :cheers:
meduza:
I Confirm this is working on Ubuntu 20.04 with mame 220
alxld:
Can you provide a link to the updated firmware? My guns are still both showing up as "~Ultimarc Ultimarc", and given their age, I think I need the same update you did.
Also, do you have any details on getting MAME compiled for X11? I've looked around and can't find any information.
MacGyver:
Holy late reply Batman.
make -j4 NO_USE_XINPUT=0
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version