Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: How-To: Using GroovyGameGear GPWiz 49-Way & GpWiz40 encoder in Linux  (Read 7027 times)

0 Members and 1 Guest are viewing this topic.

mahuti

  • Wiki Master
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 2757
  • Last login:March 02, 2022, 09:51:19 pm
  • I dare anything! I am Skeletor!
Just wanted to share. Using the GPWiz 49-Way encoder and the GPWiz40 encoder was not possible for me for a long time, because both joysticks sent 8-bit positional data instead of 16-bit. Meaning all of the control action would basically happen in the top-left quadrant... it looked like you're only moving top left, regardless of your position with the stick. I know others have discovered how to use these, but I thought I'd share my write up here for anyone else that likes these encoders and wants to use them on a Linux / Raspberry Pi box.

HID Quirks need to be added to handle the GGG Hardware. This is specifically how to do it on a Raspberry Pi, but I'd guess it's similar on other flavors of Debian. You'll need to know the board ID's of the hardware you're using. GPWiz-49 uses 0007, and up. Not sure about all RotoX boards, but the first is 0035

1. Create (or edit) /etc/modprobe.d/usbhid.conf with the following: (0007 1st 49-way board ID, 0008 2nd 49-way board ID, 0035 1st GPWiz40 board ID)

Code: [Select]
options usbhid quirks=0xFAFA:0x0007:0x00000020,0xFAFA:0x0008:0x00000020,0xFAFA:0x0035:0x00000020
2. Edit the the boot script and add the HID quirk to it:

Code: [Select]
sudo pico /boot/cmdline.txt
Add this to that file (with a space after any existing items)

Code: [Select]
usbhid.quirks=0xFAFA:0x0007:0x00000020,0xFAFA:0x0008:0x00000020,0xFAFA:0x0035:0x00000020
3. Add a UDEV rules to allow access to this device without ROOT privileges
see here for more details

Create the rule file
Code: [Select]
sudo pico /etc/udev/rules.d/50-set49mode.rules
4. in the UDEV rule add this:

Code: [Select]
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="fafa", ATTRS{idProduct}=="0007", MODE:="666"
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="fafa", ATTRS{idProduct}=="0008", MODE:="666"
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="fafa", ATTRS{idProduct}=="0035", MODE:="666"

5. Once the file is saved, reload UDEV to take advantage of it.

Code: [Select]
sudo udevadm control --reload
Once that's done, you can may want to restart and then  test your joystick using jstest. You can find the list of available joysticks using

Code: [Select]
ls /dev/input
Your joystick will be js0, js1, js2... something like that. If you only have on plugged in, then it'll likely be js0. Once you identify your joystick, test it using jstest.

Code: [Select]
jstest /dev/input/js0

You should see values range from -32k - 32k (or so... ) when you move the stick around. If you change modes, the values shown will change. For instance, in the diagonal 4-way mode (GGG mode 5) it will only show 32k values and center 0 value, where the 49way mode (GGG mode 1) will show a range of values as you move the stick.
« Last Edit: August 20, 2020, 10:29:19 am by mahuti »
Raspberry Pi, AttractMode, and Skeletor enthusiast.

keilmillerjr

  • Trade Count: (+5)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1847
  • Last login:October 06, 2023, 10:20:39 pm
  • Web Developer.
Re: How-To: Using GroovyGameGear GPWiz 49-Way & GpWiz40 encoder in Linux
« Reply #1 on: August 19, 2020, 02:47:49 pm »
Is there a method to switch ways on Linux?

mahuti

  • Wiki Master
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 2757
  • Last login:March 02, 2022, 09:51:19 pm
  • I dare anything! I am Skeletor!
Re: How-To: Using GroovyGameGear GPWiz 49-Way & GpWiz40 encoder in Linux
« Reply #2 on: August 19, 2020, 04:17:35 pm »
Yes.

There have been a few utilities for setting the mode on the GGG 49Way board. I've shared a python version before, Mark Alston has a perl script floating around that will change it dynamically.  I made a standalone utility called "set49mode" based on some work by RGBCommander, available on Github. And in the last few days I helped Meduza to get LEDSpicer working with both the GGG 49Way board and the GPWiz40 Board with Rotary support.

Here's my simple utility
https://github.com/mahuti/set49mode
just pass it one of the modes and it'll change all GGG 49 way boards to that mode.

Here's Meduza's LEDSpicer app, which is more full featured and includes automation of mode selection
This supports multiple joysticks.
http://forum.arcadecontrols.com/index.php/topic,163406.0.html

Here's Mark Alston's app written in perl with automation of mode selection
https://github.com/markalston/set49mode

With regard to the GGG GPWiz40 with rotary support, I have written a standalone script but haven't released it. I may, but there's little interest. In any case, LEDSpicer does support it... it supports multiple sticks as well.
« Last Edit: October 06, 2020, 02:40:23 pm by mahuti »
Raspberry Pi, AttractMode, and Skeletor enthusiast.