Sinden Setup Guide

Sinden Software Install and setup
You will need to get the software for Sinden Lightgun to work with your systems by visit at Sindenlightgun.com and download the latest drivers for Raspberry Pi or Windows. Once your download is completed. Do the following...

Youtube Video
YouTube video if you don't want to read all this text :) Made by Titchgamer.

https://youtu.be/RfUJHUjqXC8

Window Systems:
Extract the file for Windows from the provided archive that you had downloaded. Connect the Sinden Lightgun into the USB port, Run the Windows software file Lightgun.exe where you have extracted to. Plug the Sinden Lightgun into the USB port. Run the Windows file Lightgun.exe where you had extracted from the provided archive.

Sinden Lightgun Documentation V1.0 07/09/20

This is a very early draft version to get everyone up, running, as quickly as possible.

Extract the file for Windows from the provided archive that you had downloaded. Connect the Sinden Lightgun into the USB port, Run the Windows software file Lightgun.exe where you had extracted to. Plug the Sinden Lightgun into the USB port. Run the Windows file Lightgun.exe where you had extracted from the provided archive.

Firstly, upgrade firmware is a good idea, to go into  “Select Lightgun” and select your lightgun from the list . Then select  upgrade firmware. Make sure you don’t disconnect from the USB port while the firmware is updating and best just to leave your PC alone till it finishes. Updating the firmware takes about 30 seconds.

Next step, make sure your TV is on game mode. Also, go into your windows mouse settings and make sure the speed  is at the maximum. Then go  into cursor offset, enter your approx tv size and click calculate. Then save. This is because the software takes into account the offset between the camera barrel and the sights so the sights remain very accurate regardless of distance.

Now go to  the Configuration screen so you can see what is happening. Click start in the top right. Click the back right side button on the lightgun to generate a border. With any luck, it should work straight away and control the cursor accurately.

If it is not picking up the border very well you need to adjust the settings. The 2 most important are contrast and brightness. If the border is too dim and not showing on the rightyou need to increase brightness and contrast. If the border is bright but the background is too bright then you need to lower them.

If you can see the border well on the left screen but not clearly on the right, try increasing the color of the radius border a bit to say 250.

You can experiment with some of the profiles at the bottom  which use a combination of settings to experiment with. See if you can find a good setup for your environment.

If your tv is dim from power-saving mode backlight setting it is best to put it on normal brightness as this makes everything simpler although it shouldn’t be a requirement.

You need to use the video screen on the right to work out what it is seeing that is working and what is not. An example is that the border is merging with the background, if that happens the lightgun can’t track the border.

This is the purpose of the outer black border. If your background behind the tv is not bright white or you have a dark bezel on your TV/cabinet you probably don’t need the outer black border and it can be disabled under the border tab. The black outer border especially helps with sunlight.

In general, you don’t need to change the other camera settings. If you click “Camera Controls” you can change the brightness and contrast with the slider and see what effect it is having in realtime.

To perform calibration goto<software, buttons, icon, window?> alignment and use the arrows to line up the cursor with the sights and save.

“Only match where pointing” really helps the tracking if you have a lot of background light noise like sunlight but offscreen reload doesn’t work.

If you want the software to automatically connect on launch then tick the auto start checkbox.

If your video processing performance is poor >10ms, you may want to reduce the resolution to 320x240. Disabling the video preview helps also “Show Raw Video”, “Show Processed Video” and “Show Rectangle”. With a lower resolution, you may need a slightly thicker border than with high resolution.

Under the border tab, you can choose the border colors. It makes sense for the outer border to always be black. The primary border color is also used by the software to track as it looks or a match of that color. Light Blue RGB 0,255,255 works quite well but needs to be quite thick compared to white.

If you have a 4:3 game, you can choose this option to draw the border around the 4:3 game screen which looks better.

<name of the software or window>Under the cursor offset tab, you may need to tick the Aspect Ratio 16:9 to 4:3 button. You don’t need this for Mame, but you might for something like Mednafen. It<name of the object?> all depends on where the game thinks MouseX Zero is. Mame thinks it is the left side of the game, other games might think it is the very left of the full screen. Games and emulators that take over the full screen but play in 4:3 like Sega Model 2 emulator and also PC games shouldn’t need any 4:3 adjustment because everything has gone to 4:3.

Lightgun buttons are changeable in the software but the default is: Trigger = Left Mouse

Offscreen = Right Mouse

Pump Action = Right Mouse

Left Front = Right Mouse

Back Left = Middle Mouse

Front Right = Keyboard 1

Offscreen = Keyboard 5

Back Right = Show/Hide Border

Dpad = Keyboard Up/Down/Left/Right

Border:
Sinden Lightgun software is the best way to add a border. It automatically adjusts the aim to track the exact border. The thickness of the white border doesn’t matter for alignment but the thickness of the outer black border does. You might not need the outer black border based on your environment. I don’t use it as a standard.

If the Sinden Lightgun software is not able to add the border over your game/emulator then you can usually add the border in the emulator/frontend. So Mame, RetroArch, Sega M2 Emulator, and Hyperspin are all good with this. Border samples were included in the archive.

Alternatively, you can run your game/emulator in a full screen “window” which usually helps with the border overlay.

Borderless Gaming utility and/or windowed borderless gaming can also help. So the game looks full screen but is a window which allows you to add a border over easier.

The plan over time is to get a good border solution that works well for everything across all hardware.

2 Player:
You need 2 different folders to run 2 different instances of the software, 1 for each lightgun.

Windows 7,8:
For Windows 7 and 8, you may need a driver for the lightgun. In Device Manager, you will probably find Sinden Lightgun listed somewhere with an error. Please use the INF file in the windows driver folder in the archive. For Windows 8 you may need to disable driver signing while you install. A signed driver is a work in progress, sorry about the inconvenience.

Camera Glitching/tearing:
If you experience glitching/tearing of your raw video like in the video clip bellow please try a different USB port.

Some front case ports have been found to not provide enough power to run the gun correctly. This can be also due to noise from PSU power cables running parallel with front USB cable and this cable not shielded. USB in back of your computer will connect directly into your motherboard which should not cause this issue.

https://youtu.be/33tohFjn6g8

Multiple Monitors / Displays:
Windows interprets the lightgun coordinates across the whole combined display if you have an extended desktop, so if you have the border on Screen 1 and you are 75% across, windows may map that to halfway across the second display. However, you can change X Offset in cursor offset tab. So if you have 2 monitors the same size, if you set that to 0.5 then it should line up nicely on the left monitor if it is the one showing the border.

Offscreen Reload Issues:
Be careful that you don’t have a double offscreen reload activated, for example in Mame it has its own implementation and so does the Sinden Lightgun software, so if you are doing offscreen in the Sinden Lightgun software and in Mame then they can get in each other's way. Also, if you are a bit close to the display try moving further back and seeing if it works.

AutoStart:
If you tick this then the lightgun will automatically begin processing on application load. You can also add autostart as a command-line parameter to the executable file.

Sleep Mode
If enabled then if there is no button pushed on the lightgun for that period of time it will stop processing frames to save computer resource. Additionally it will remove the dynamic border if that option is selected. Pushing any input / button will awaken it.

Alignment your gunsight:
The Alignment tab is to fine-tune your mouse alignment to the gunsight on the target. At some point, the mouse will get hidden behind the gunsight. The lightgun software does not have any tools to show where is your mouse is while you are looking through the gun sight. There is an easy way to see where your mouse is at while you are looking into the gunsight.

This is the gunsight as you are looking into.

Use your Sinden lightgun and aim at the window desktop and pull and hold the trigger. Move your aim down and move to the right or left side of the screen. You should see the highlight. Use that highlight for X/Y to align to the gunsight. The picture below, As you see the highlight where the line draw x/y is at from the gunsight. That is the perfect alignment. In real life, it is very hard to do when the arrow is shaking but it should be close as possible if you wanted perfect.



The other picture is very common to people had that never learn about guns to show as not correctly align to the gunsight.



Youtube Video
YouTube video if you don't want to read all this text :) Made by Titchgamer.

https://youtu.be/RfUJHUjqXC8

Driver installation Windows 7 & 8
Now that your Window system is able to install the unsigned driver. This is the following steps to install the unsigned Sinden Lightgun driver.


 * 1) - Now navigate to Device Manager (Windows+R and devmgmt.msc)


 * 1) - Select the Sinden device and Right Click + Update Driver (See image 4 below)


 * 1) - Select Browse and "Let Me choose from list"W7_sindendriver3.png


 * 1) - Leave on 'Show All Devices' and click 'Next'W7_Show_All.png


 * 1) - Click on button "Have Disk" W7_Have_Disk.png


 * 1) - Browse to the .inf file include in the Sinden Software download 1.2 W7_SindenDriver.png

Note, its probably best to reset the Group Policy settings back to default after the driver is installed

Disable driver signature enforcement
' Windows Starter Edition, Home and Home Premium do not include gpedit.msc. '

Currently the driver is unsigned and contained as a .inf file in the software release. Here is a work around

I enable the ability to install unsigned device drivers in group policy. (OR run windows in Test Mode)


 * 1) - Hit Windows+R


 * 1) - Type gpedit.msc (image1 below)W7_Group_Policy.png

User Configuration >>> Administrative Templates >>> System >>> Driver Installation. On the right panel, double click on 'Code signing for device drivers'.
 * 1) - Navigate to the location in Image2 below.

Click on 'Enabled' then click button 'Apply'. That part is done. You can click on 'OK' button.
 * 1) - Changes the settings seen in Image3 below)


 * 1) - Restart your PC

Disable driver signature enforcement
Currently the driver is unsigned and contained as a .inf file in the software release. Here is a work around that is partly not the same as Windows 7.


 * 1) - On your Computer, right click the Microsoft Windows Start button and select Search from the list.
 * 2) - Type “startup options” to start searching for programs. Click on “Change advanced startup options”
 * 1) - Click on “Restart Now” under “Advanced Startup”
 * 1) - Click on “Troubleshoot”
 * 1) - Click on “Advanced Options”
 * 1) - Click on “Startup Settings”
 * 1) - Click “Restart” and your system going to reboot.
 * 1) - The menu will come before windows 8 start loading. Press 7 or F7 on your keyboard to disable driver signing.

Windows will now loading without driver signature enforcement. You will be able to install unsigned Sinden Lightgun driver. This is the end of disable driver signature enforcement steps. The driver signature enforcement will turn back ON when you reboot the Windows 8 after you install the driver. There is no need to go back to change the setting again. Read under Driver installation Windows 7 & 8 to continue to add unsigned lightgun driver.

Raspberry Pi - How to set up, run and calibrate.
A quick guide aimed (pun intended) at new users

Things you will need
A Raspberry Pi

This is a credit card sized single board computer. In this tutorial I will be using a Raspberry Pi 4 with 4GB of ram

A SD card

This is a small memory card that will be used for storage

A keyboard

There is some typing to do so a USB or Bluetooth keyboard is essential.

A Sinden Light Gun

Although it is possible to set up the system with the gun you will need one to test it.

A game controller (optional)

Retro pie is designed to be navigated with a game pad. You can configure it to be navigated with keyboard controls but it is not as intuitive

A Windows PC with an SD card reader

There are ways of setting the pi up without this but to make things a simple as possible youll need a PC

Installing Retropie
On your windows PC go to https://retropie.org.uk/download/ and download the latest version of Retropie. This will be a .zip file (you will need winzip or winrar to open it)

Inside the .zip file will be an image file with the extension “.img” extract this file to the hard drive on your windows PC

Now we need to write that image onto the SD card.

Download the pi image writer from https://www.raspberrypi.org/software/ and load it up

Click the button that says “choose OS” scroll to the very bottom of the list and click on “use custom” and locate the image file you downloaded from retropie.

Click the button that says “choose SD” and select your SD card.

Click “write”

Those of the British persuasion might want to put the kettle on now.

Once the process is complete remove you SD card from your windows PC and pop it in your pie.

Install the Sinden software on your Pi

Connect power and also your monitor, game controller and keyboard.

Power up your pie.

The first screen you see after loading will tell you a gamepad is connected and you need to configure it. Follow the instructions on screen. (remember your hotkey, I always set it to the central xbox button on my controller)

Installing Sinden software
The next step is to connect your pi to the internet you can do this by setting up the inbuilt Wi-Fi on the pi but I just pop a network cable in the pie and the other end in my router.

Then we need to give the windows pc remote access to the pi:

Select Retropie from the main screen (it’s the only option) and then select “raspi-config”

Select option 3 “interface options”

Enable option 2 “remote command line access using SSH”

Exit the menu.

Once that is done return to your windows PC and install WinSCP from

https://winscp.net/eng/index.php

this is FTP (file transfer protocol) software that will let us drag and drop file from our windows pc to the pi (if they are on the same network)

download the driver software from Sinden

https://www.sindenlightgun.com/drivers/

this is another .zip file so extract it somewhere on you windows PC.

Load winSCP and star a new session

Hostname “retropie”

Username “pi”

Password “raspberry”

You might get a security warning but just ignore it.

The screen should now show your PC’s file system on the left and the Pi’s on the right

Copy the folder called “lightgun” from the Sinden archive in the “Pi-Arm” folder to the /home/pi/ directory on the pi.

Return to the pi.

Weirdly we have to install a game before we do anything else. Wolfenstein 3d (if you were born after the year 2000 its like CoD that you Dad plays). We have to do this to create a “ports” directory on the pi.

Go to retropie setup in the main retropie menu

Manage packages>Manage optional packages>wolf4sdl

Install the game

Exit and restart the pi

You should now have two menus “retropie“ and “ports”

On the main retropie screen press F4 on you keyboard. This will take you to a command prompt.

Type :

“cd Lightgun”

and hit return to get into the Lightgun directory (this is case sensitive)

The type:

“chmod +x setup-lightgun.sh” (this changes the permission to access the file)

Then:

“./setup-lightgun.sh”

After a few minutes the installation will complete

Then do the same with the “retropie-setup.sh” file:

“chmod +x setup-retropie.sh” (this changes the permission to access the file)

Then:

“./setup-retropie.sh”

Then type

“emulationstation” to return to the graphic user interface.

Plug in your lightgun

Go to the “ports” menu and select “SINDENLIGHTGUNTESTP1”

You should get a black screen with a white boarder and be able to move the cursor with the gun.

Move the cursor to the bottom right to exit.

Installing Duck Hunt
Find a Duck Hunt rom (for legal reasons I cant be more specific)

Copy the duckhunt rom from your pc to the hom/pi/Retopie/roms/nes/ directory on your pi

Restart your pi

Go into Ports and select SINDENLIGHTGUNSTARTP1

You should now have a NES menu in retropie go into it and start duck hunt

Bring up the menu with hotkey+x

Go to options and check that the zapper mode is set to lightgun

While in this menu set show advanced system options to on

Go out of this menu and the next option down should be On screen overlayselect this

Set hide overlay in menu to off

Go down to Overlay preset and select SindenBorderWhiteMedium.cfg

You should now see a border

Go out of this menu and select controls

Set the port 1 control device type to Gamepad

Set the port 2 control device type to Zapper

Go up two levels of menu until the title at the top says Main Menu

Select settings

Select Input

Select port 2 binds

Now this is the tricky bit. We want to assign the trigger button but it’s not labelled in fact a load of the buttons are just labelled “n/a”. Well it is about 11 up from the bottom you can see what these inputs are when you press A on the gamepad to assign them. Once you’ve figured out which is the trigger press A and point your gun at the screen and press the trigger. Mouse 1 should appear next to it on the screen.

Go back to the quick menu and select options again. Make sure that “show crosshair is on”

Go back to the main menu and save the configuration

Exit the menu and return to the game

Duck Hunt should now be playable!!!

However you sights are probably way off.

For example if you look down sight and the crosshair is to the left of it you need to raise you x axis value.

You can do this buy loading up WinSCP again and editing the light gun configuration file from your PC.

Goto

home>pi>Lightgun>Player1>LightgunMono.exe.config

just double click on the file and you can edit it from within WinSCP

the lines you need to edit are:

<add key="CalibrateX" value="" />

<add key="CalibrateY" value=””/>

Pop a number between the qotes, save, retart the pi, load sinden and duckhunt see how much the sight is off, repeat.

There’s no quick way of doing this I’ve found.

That should be all you need to do to get started.