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: RGBCommander issue with Led-Wiz+GP as second device?  (Read 6228 times)

0 Members and 1 Guest are viewing this topic.

gray_space

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:June 07, 2023, 05:08:46 pm
  • I want to build my own arcade controls!
RGBCommander issue with Led-Wiz+GP as second device?
« on: May 11, 2020, 01:42:24 pm »
I've got a cabinet with two Led-Wiz controllers: a Led-Wiz32 (set as device #1) and a Led-Wiz+GP (set as device #2). This is running on a 64-bit Linux system (not a RPi). I've actually reproduced the problem using several systems running Ubuntu 18.04,  in addition to the mini-ITX board running Ubuntu 20.04  I have in the cabinet now.

So far, I have been able to get the two Led-Wiz controllers configured and have RGBCommander put on a light show when Attract Mode starts. Yay! Lights from both controllers are flashed, so they are both appears to be working.

The problem is, whenever RGBCommander  does anything with the LEDs on the Led-Wiz+GP, the "GP" part of the controller boards (i.e. the gamepad) disappears from the system. This is a problem, as all my admin buttons are hooked up as buttons on this controller.

Here's a demo from the command line using rgbcmdcon:

Code: [Select]
$ ls /dev/input/js*
/dev/input/js0  /dev/input/js1
$ rgbcmdcon
 _____ _____ _____                               _         
| __  |   __| __  |___ ___ _____ _____ ___ ___ _| |___ ___
|    -|  |  | __ -|  _| . |     |     | .'|   | . | -_|  _|
|__|__|_____|_____|___|___|_|_|_|_|_|_|__,|_|_|___|___|_| 
RGBcommanderConsole 0.1.0.1 linux
a *nix arcade cabinet led and joystick driver - GUI dev tool
Copyright 2015-2017 Gijsbrecht De Waegeneer
compilation date Dec 25 2017 17:33:45

connected to localhost:2724 RGBcommander linux build 0.4.0.5
set,button,P1_COIN,Red
<data bool="true"/>
^C
$ ls /dev/input/js*
/dev/input/js0

The P1_COIN button is attached to the Led-Wiz/GP controller. Note that after exiting rgbcmdcon, there is only one js device in /dev/inputs. I don't see anything weird in the Linux logs. In fact, I see nothing in the logs around the time I run the commands on the console... not even something acknowledging that one of the joystick devices just disappeared from the system. I've looked at dmesg, kern.log, and syslog. Nothing seems to notice this.

The rgbcommnder log also doesn't see all that odd...

Code: [Select]
11/05/20 12:30:55 [WARNING] [startListening] selectserver: bind failed, error: 98
11/05/20 12:33:01 [INFO] [startListening] selectserver: new connection from 127.0.0.1, socket 13
11/05/20 12:33:31 [INFO] [startListening] eot detected on socket - clearing socket buffer 13
11/05/20 12:33:31 [INFO] [startListening] processing command  set,button,P1_COIN,Red
11/05/20 12:33:31 [INFO] [processCmd] #args is 4
11/05/20 12:33:31 [INFO] [processCmd] set
11/05/20 12:33:31 [INFO] [processCmd] button
11/05/20 12:33:31 [INFO] [processCmd] P1_COIN
11/05/20 12:33:31 [INFO] [processCmd] Red
11/05/20 12:33:31 [INFO] [write] board initialisation -> SUCCESS
11/05/20 12:33:35 [INFO] [startListening] selectserver: socket 13 disconnected

Any ideas on what's wrong?

ZoOl007

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 161
  • Last login:August 02, 2020, 12:03:38 pm
    • RGBcommander
Re: RGBCommander issue with Led-Wiz+GP as second device?
« Reply #1 on: May 14, 2020, 03:17:41 pm »
Hi,

you're out of luck I guess. It has never been tested on a Led-Wiz/GP and it is not on the hw compatibility list.
I do not own such a board. The daemon apparently recognizes it otherwise you won't have leds lit so they must be similar... too similar actually because it's not a Led-Wiz but a Led-Wiz/GP and one should assume they would both have a different identifier... not so it seems.
The daemon happily writes data to all pins, also to the ones where the joystick is attached and that seems to break something.
I can't tell you more without buying such a board and invest time to investigate and implement support for it.

There's no use in trying. It'll never work. You could consider purchasing a PacLED64 and move your leds to it and keep the joystick on the gp. Or perhaps a 2nd Led-Wiz.
I developed it mainly on Ultimarc boards and Mahuti did the testing on a Led-Wiz. Multi-board support should logically work fine as the hardware is nicely abstracted away but it's never been tested by myself.

kind regards.

gray_space

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:June 07, 2023, 05:08:46 pm
  • I want to build my own arcade controls!
Re: RGBCommander issue with Led-Wiz+GP as second device?
« Reply #2 on: May 16, 2020, 02:29:23 pm »
Thanks for the reply. That's a shame. Unfortunately, I didn't do enough research when choosing hardware for my cabinet. I saw that there was Linux support for the Led-Wiz, and assumed the whole product line was supported.

I'll likely just try moving the inputs off of the Led-Wiz+GP to a cheap USB input controller.

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: RGBCommander issue with Led-Wiz+GP as second device?
« Reply #3 on: July 06, 2020, 03:34:14 am »
I've recently been working on this problem. The solution has to do with  the need within LIBUSB to specifically claim an interface after detaching the kernel driver, then releasing the claim and then attaching the kernel driver again after control messages have been sent.

I have been trying to sort out this same problem for the GpWiz49 as well as the LedWiz+Gp on and off for the last few years. I  the last few days I finally found a simple working solution of a few lines of code. While I havent tested the LedWiz+Gp with my solution, I have tested and corrected the same problem on the GpWiz49. I have some test code for the LW+GP laying around and a working LedWiz+GP, so I'll be making tests for this soon. 

Whether or not that code will work with how RGBCommander works or whether ZoOl007 will have time to implement it... that's another story. At the very least l will likely end up with some kind of simple utility to pass light commands to the LW+GP and still have a working joystick. That utility will be incredibly basic, but probably good enough to get some use out of that controller.
« Last Edit: July 06, 2020, 01:32:11 pm by mahuti »
Raspberry Pi, AttractMode, and Skeletor enthusiast.

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: RGBCommander issue with Led-Wiz+GP as second device?
« Reply #4 on: July 06, 2020, 12:23:52 pm »
I set up a test, and it looks like I can drive the lights, while leaving access to the joystick in tact.

This is a quick test I built based on RGBCommander's code

https://github.com/mahuti/setledwiz

once installed, you can run the test like so:

setledwiz 1

And it'll light everything up to a purple-ish color without killing the joystick. The thing that makes it possible is the kernel attach thing I mentioned. I'm not sure how RGBCommander's built, so it may not be able to release the joystick. I don't know. If it can, the method to do so is pretty simple. In the code, this is what does it.

Claim 1 specific interface, otherwise it grabs both the control and the data interface.

Code: [Select]
rc = libusb_detach_kernel_driver(devicehandle, J_INTERFACE);
            libusb_claim_interface(devicehandle,J_INTERFACE);

Release and reattach.

Code: [Select]
libusb_release_interface(devicehandle, J_INTERFACE);
   rc = libusb_attach_kernel_driver(devicehandle, J_INTERFACE);
   libusb_free_device_list(devices, 1);
   cleanup(context, devicehandle);
   return EXIT_SUCCESS;
« Last Edit: July 06, 2020, 01:34:24 pm by mahuti »
Raspberry Pi, AttractMode, and Skeletor enthusiast.