batocera-linux / batocera.linux

batocera.linux
https://batocera.org
Other
1.96k stars 513 forks source link

Sinden Lightgun not recognized properly on Steam Deck / Batocera v39/v40 Butterfly #11251

Open mdeguzis opened 6 months ago

mdeguzis commented 6 months ago

Batocera build version

39 2024/03/04 10:11

Your architecture

Steam Deck, x86_64 (SteamOS)

Your Graphic Processor Unit(s) (GPU)

Integrated

Issue description

When I connect my Sinden lightgun, since I connected it to a Steam Deck, I got a pop up that says two controllers are connected, hold A on whatever. I thought the lightgun was preconfigured per https://wiki.batocera.org/emulators:lightgun_games#sinden_lightgun? I did see in controller and bluetooth settings that I could make P1's controller the lightgun, but I only want it to use the lightgun when plugged in. Is that issue for Sinden 1.9... https://github.com/batocera-linux/batocera.linux/issues/9830 Not sure how to confirm my firmware. Pretty sure it's the latest, I did connect it to a Windows VM the other day

According to mods on Discord, it should just show up normally in the main menu under Controllers.

Detailed reproduction steps

  1. Installed Batocera 39
  2. Plugged in Lightgun. Lightgun not detected automatically
  3. Upgraded to Batocera 40 dev "Buttefly"
  4. Plugged in Lightgun. Lightgun not detected automatically
  5. I also tried plugging the Lightgun directly into the Steam deck instead of the Dock I am using.

Details of any attempts to fix this yourself

Before using Batocera, these udev rules I made on a fork of the Sinden Linux driver worked at picking up my lightgun with udev rules and starting a systemd service: https://github.com/mdeguzis/sinden-lightgun-linux/blob/2.05/udev/99-sinden.rules

SUBSYSTEM=="input", KERNEL=="event*", ACTION=="add", ATTRS{name}=="Unknown SindenLightgun Mouse", MODE="0666", ENV{ID_INPUT_MOUSE}="0", RUN+="/usr/bin/systemctl start sinden-lightgun.service"
SUBSYSTEM=="input", KERNEL=="event*", ACTION=="remove", ATTRS{name}=="Unknown SindenLightgun Mouse", MODE="0666", ENV{ID_INPUT_MOUSE}="0", RUN+="/usr/bin/systemctl stop sinden-lightgun.servi

Details of any modifications you have made to Batocera.

None

Logs and data

evtest:

[root@BATOCERA /userdata/system]# evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:    Power Button
/dev/input/event1:    Lid Switch
/dev/input/event10:    HD-Audio Generic HDMI/DP,pcm=7
/dev/input/event11:    HD-Audio Generic HDMI/DP,pcm=8
/dev/input/event12:    HD-Audio Generic HDMI/DP,pcm=9
/dev/input/event13:    FTS3528:00 2808:1015 UNKNOWN
/dev/input/event14:    Steam Deck
/dev/input/event15:    Steam Mouse
/dev/input/event16:    Dell Dell USB Keyboard
/dev/input/event17:    DP-1
/dev/input/event18:    Unknown SindenLightgun Keyboard
/dev/input/event19:    Unknown SindenLightgun Mouse
/dev/input/event2:    Power Button
/dev/input/event20:    Unknown SindenLightgun
/dev/input/event3:    AT Translated Set 2 keyboard
/dev/input/event4:    Video Bus
/dev/input/event5:    acp5x Headset Jack
/dev/input/event6:    Valve Software Steam Deck Controller
/dev/input/event7:    Valve Software Steam Deck Controller
/dev/input/event8:    FTS3528:00 2808:1015
/dev/input/event9:    HD-Audio Generic HDMI/DP,pcm=3
Select the device event number [0-20]: 

USB devices:

$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 04f2:b685 Chicony Electronics Co., Ltd Chicony USB2.0 Camera
Bus 001 Device 003: ID 8087:0aaa Intel Corp. Bluetooth 9460/9560 Jefferson Peak (JfP)
Bus 001 Device 006: ID 16c0:0f39 Van Ooijen Technische Informatica SindenLightgun
Bus 001 Device 005: ID 16d0:1098 MCS SindenCamD
Bus 001 Device 004: ID 0424:2512 Microchip Technology, Inc. (formerly SMSC) USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

lsusb (verbose): lsusb-verbose.txt

Firmware (Checked via Windows VM):

Sinden Lightgun-Player2 COM3 Colour: RED
Camera Name: SindenCam D Manufacture Date: 150224141428 UniqueID: 1872138343
Firmware Version: V1.9
CalibrationX: 1.98
Calibration Y: -0.17
Latest Firmware version is V1.9
Higher than V1.6 only required if pedal or joystick mode.

image

The top shows "Unknown Sindenlightgun detected". I did a shutdown/reboot, same. Also my start (top right on the Deck), opens the manufacturer menu, not the main menu. I temporarily connected a keyboard to show the menu. Same result as the screenshot

batocera-support-20240315104710.tar.gz

nadenislamarre commented 6 months ago

the file was not generated while the gun was plugged.

Tovarichtch commented 6 months ago

Did you make a custom rules within Batocera? Batocera has its own driver and rule, just to understand.

mdeguzis commented 6 months ago

the file was not generated while the gun was plugged.

Whoops sorry. I'll generate a new support file when I'm back from the weekend.

Did you make a custom rules within Batocera? Batocera has its own driver and rule, just to understand.

Nope. The only thing I did was copy my ROMs and bios in. What I referenced from my driver fork was from SteamOS testing.

mdeguzis commented 6 months ago

Here's a support file generated while the lightgun was plugged in: batocera-support-20240317161326.tar.gz

nadenislamarre commented 6 months ago

in your case, there are 3 devices for the sinden, i've to check on mine /dev/input/event18: Unknown SindenLightgun Keyboard /dev/input/event19: Unknown SindenLightgun Mouse /dev/input/event20: Unknown SindenLightgun

if i just check the code, 1) it seems to look only for 2 : test "${NDEVSINPUTS}" = 2 2) "Unknown SindenLightgun" matches no udev rule

so maybe it is normal. the support file doesn't include the sinden logs, can you plug your sinden and send me the files:

/var/log/virtual-sindenlightgun-devices.*log please ?

mdeguzis commented 6 months ago

Strange too that my start button keeps getting remapped to whatever drives the manufacturer menu, I have to remap it on each start. Anyway, idk... I don't have that log file pattern. Could something not be starting to begin with that skips writing this log? I don't think the rule is being processed from /etc/udev/rules.d.

[root@BATOCERA /userdata/system]# ls /var/log/
bluetooth-agent.log  messages  nvidia.log  samba  steamdeckgun.log  Xorg.0.log

I've included messages and steamdeckgun.log.

mdeguzis commented 6 months ago

udevadmin monitoring started right before plugging in the lightgun:

[root@BATOCERA /userdata/system]# udevadm monitor -u
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing

UDEV  [1045.412128] add      /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-1 (usb)
UDEV  [1045.412528] change   /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-1 (usb)
UDEV  [1045.412905] add      /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-1/1-1:1.0 (usb)
UDEV  [1045.413145] bind     /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-1/1-1:1.0 (usb)
UDEV  [1045.413528] bind     /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-1 (usb)
UDEV  [1045.857423] add      /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-1/1-1.1 (usb)
UDEV  [1045.857839] add      /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-1/1-1.1/1-1.1:1.0 (usb)
UDEV  [1045.858683] add      /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-1/1-1.1/1-1.1:1.1 (usb)
UDEV  [1045.859045] bind     /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-1/1-1.1/1-1.1:1.1 (usb)
UDEV  [1045.859073] add      /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-1/1-1.1/1-1.1:1.0/media0 (media)
UDEV  [1046.217653] add      /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-1/1-1.2 (usb)
UDEV  [1046.218121] change   /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-1/1-1.2 (usb)
UDEV  [1046.218546] add      /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-1/1-1.2/1-1.2:1.0 (usb)
UDEV  [1046.218609] add      /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-1/1-1.2/1-1.2:1.1 (usb)
UDEV  [1046.218987] bind     /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-1/1-1.2/1-1.2:1.1 (usb)
UDEV  [1046.219242] add      /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-1/1-1.2/1-1.2:1.2 (usb)
UDEV  [1046.219592] add      /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-1/1-1.2/1-1.2:1.0/tty/ttyACM1 (tty)
UDEV  [1046.219730] add      /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-1/1-1.2/1-1.2:1.2/0003:16C0:0F39.0007 (hid)
UDEV  [1046.219941] bind     /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-1/1-1.2/1-1.2:1.0 (usb)
UDEV  [1046.221822] add      /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-1/1-1.2/1-1.2:1.2/0003:16C0:0F39.0007/input/input25 (input)
UDEV  [1046.221864] add      /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-1/1-1.2/1-1.2:1.2/0003:16C0:0F39.0007/input/input26 (input)
UDEV  [1046.222803] add      /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-1/1-1.2/1-1.2:1.2/0003:16C0:0F39.0007/input/input27 (input)
UDEV  [1046.223564] add      /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-1/1-1.2/1-1.2:1.2/0003:16C0:0F39.0007/hidraw/hidraw4 (hidraw)
UDEV  [1046.296797] add      /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-1/1-1.2/1-1.2:1.2/0003:16C0:0F39.0007/input/input27/js2 (input)
UDEV  [1046.324065] add      /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-1/1-1.2/1-1.2:1.2/0003:16C0:0F39.0007/input/input27/event18 (input)
UDEV  [1046.578564] add      /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-1/1-1.1/1-1.1:1.0/video4linux/video0 (video4linux)
UDEV  [1047.078220] add      /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-1/1-1.2/1-1.2:1.2/0003:16C0:0F39.0007/input/input26/event17 (input)
UDEV  [1047.587657] add      /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-1/1-1.1/1-1.1:1.0/video4linux/video1 (video4linux)
UDEV  [1047.588138] bind     /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-1/1-1.1/1-1.1:1.0 (usb)
UDEV  [1047.588548] bind     /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-1/1-1.1 (usb)
UDEV  [1048.099956] add      /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-1/1-1.2/1-1.2:1.2/0003:16C0:0F39.0007/input/input25/event16 (input)
UDEV  [1048.100313] bind     /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-1/1-1.2/1-1.2:1.2/0003:16C0:0F39.0007 (hid)
UDEV  [1048.100645] bind     /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-1/1-1.2/1-1.2:1.2 (usb)
UDEV  [1048.101029] bind     /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-1/1-1.2 (usb)
Tovarichtch commented 3 months ago

I just got a case very similar to you. The cause was a bad flashing. The user flashed back to 1.08 and to 1.09 once again.

For 1.08: https://www.sindenlightgun.com/software/SindenLightgunSoftwareReleaseV1.08c.zip

mdeguzis commented 3 months ago

I flashed via windows VM, assuming that is ok? I'll give this a shot when I'm back from vacation, ty.

Tovarichtch commented 3 months ago

I flashed via windows VM, assuming that is ok? I'll give this a shot when I'm back from vacation, ty.

I have no idea. The user did it on Windows. Can't say about VM. Maybe thru virtual machine it does a bad flash. If you downgrade with VM and the guns starts working again, then this is a good sign. If not, then perhaps find another way to flash the firmware.

Edit: make sure you disable joystick mode before and after the upgrade.