Main > Linux

Aimtrak light gun and Ubuntu

(1/3) > >>

DOX1842:
Hey everyone! So I have a retropie x86 setup running ubuntu and I was hoping to get my aimtrak working with it. When I connect the gun it works like a mouse except the cursur is super sensitive. I loaded up the 3rd party calibration program and it doesnt even detect my gun! I tried it on my windows laptop just to make sure it wasnt a hardware issue and it works ok. I played some time crisis for a while and to be honest, the accuracy was kind of off but it  did alright. I was wondering if anyone has any tips with getting this to work with linux as I do not use my windows pc to run emulators.

MacGyver:
Might try adjusting the acceleration (sensitivity and digital speed) for the analog control in MAME, however, if it works like all the other Linux SDL versions, adjusting "Mouse1 X&Y" for the gun might screw up any spinners and trackballs that are also "Mouse1 X&Y".

SDL has been promising for nearly a decade that they would be adding multiple mouse support to "the next release" so don't hold your breathe at them fixing it if adjusting one screws up the others.

[edit]
That's not really very fair of me, SDL is free software worked on by volunteers, it's just frustrating to those of us that have been waiting a long time to free our cabinets from Windows.

kiall:
Reviving an old thread, but .. I got these working flawlessly.

Details here: https://github.com/mamedev/mame/pull/4698

The PR was merged AFTER 0.206 was released, so will be part of MAME from 0.207 on.

TLDR: Multiple guns working, perfect accuracy (within what the guns themselves allow for), etc.

MacGyver:
Can confirm.  I just compiled a .220 version following the instructions on the Git page and both guns work perfectly under Linux.
I've copied kiall's instructions from there to here in case those go away.


--- Quote from: kiall on March 08, 2019, 08:52:19 am ---Reviving an old thread, but .. I got these working flawlessly.

Some extra tips in case anyone finds this PR on how to get these AimTrack lightguns working on Linux:

MAME Build:

Make sure MAME has been compiled with XInput support -

--- Code: ---make -j4 NO_USE_XINPUT=0

--- End code ---

in mame.ini:

--- Code: ---lightgun                  1
lightgun_device           lightgun
lightgunprovider          x11
offscreen_reload          1
# If you have more than 1 gun, you must use the ID instead of name.
# The ID's can be found with `xinput list`. Note: The ID's are NOT
# predictable. IDs are assigned in the order the devices are detected.
# If you have multiple guns, I would highly recommend leaving them and
# all other input devices (mouse, keyboard, etc) plugged in at all times.
lightgun_index1           "Ultimarc Ultimarc"
#lightgun_index2           18
#lightgun_index3           19
#lightgun_index4           20

--- End code ---

sudo nano /etc/udev/rules.d/65-aimtrak.rules

--- Code: ---# Set mode & disable libinput handling to avoid X11 picking up the wrong interfaces/devices.
SUBSYSTEMS=="usb", ATTRS{idVendor}=="d209", ATTRS{idProduct}=="160*", MODE="0666", ENV{ID_INPUT}="", ENV{LIBINPUT_IGNORE_DEVICE}="1"

# For ID_USB_INTERFACE_NUM==2, enable libinput handling.
SUBSYSTEMS=="usb", ATTRS{idVendor}=="d209", ATTRS{idProduct}=="160*", ENV{ID_USB_INTERFACE_NUM}=="02", ENV{ID_INPUT}="1", ENV{LIBINPUT_IGNORE_DEVICE}="0"

# For each gun, assign a predictable symlink. These are unused, but can be helpful when debugging.
SUBSYSTEM=="input", ATTRS{idVendor}=="d209", ATTRS{idProduct}=="1601", ENV{ID_INPUT}=="1", SYMLINK+="input/gun1"
SUBSYSTEM=="input", ATTRS{idVendor}=="d209", ATTRS{idProduct}=="1602", ENV{ID_INPUT}=="1", SYMLINK+="input/gun2"
SUBSYSTEM=="input", ATTRS{idVendor}=="d209", ATTRS{idProduct}=="1603", ENV{ID_INPUT}=="1", SYMLINK+="input/gun3"
SUBSYSTEM=="input", ATTRS{idVendor}=="d209", ATTRS{idProduct}=="1604", ENV{ID_INPUT}=="1", SYMLINK+="input/gun4"


--- End code ---

sudo nano /etc/X11/xorg.conf.d/60-aimtrak.conf
or (since Ubuntu 10.10)
sudo nano /usr/share/X11/xorg.conf.d/60-aimtrak.conf

--- Code: ---Section "InputClass"
Identifier "AimTrak Gun 1"
MatchDevicePath "/dev/input/event*"
MatchUSBID "d209:1601"
Driver "libinput"
Option "Floating" "yes"
Option "AutoServerLayout" "no"
EndSection

Section "InputClass"
Identifier "AimTrak Gun 2"
MatchDevicePath "/dev/input/event*"
MatchUSBID "d209:1602"
Driver "libinput"
Option "Floating" "yes"
Option "AutoServerLayout" "no"
EndSection

Section "InputClass"
Identifier "AimTrak Gun 3"
MatchDevicePath "/dev/input/event*"
MatchUSBID "d209:1603"
Driver "libinput"
Option "Floating" "yes"
Option "AutoServerLayout" "no"
EndSection

Section "InputClass"
Identifier "AimTrak Gun 4"
MatchDevicePath "/dev/input/event*"
MatchUSBID "d209:1604"
Driver "libinput"
Option "Floating" "yes"
Option "AutoServerLayout" "no"
EndSection


--- End code ---

Original details here: https://github.com/mamedev/mame/pull/4698

The PR was merged AFTER 0.206 was released, so will be part of MAME from 0.207 on.

TLDR: Multiple guns working, perfect accuracy (within what the guns themselves allow for), etc.

--- End quote ---



Thanks for the fix kiall.  :cheers:

MacGyver:
Correction, mine work until I reboot, then something about the udev rules are wrong and the guns completely disappear. If you exclude the udev rules then both guns work, only their IDs are random following a reboot and you will have to fix mame.ini before playing.

I'm guessing that this method and the official version that is similar to this must have worked at some point, just trying to figure out why it doesn't work anymore.

I can see a way of scripting this to build a correct mame.ini every time, but it has to be simpler than that.

Navigation

[0] Message Index

[#] Next page

Go to full version