meduzapat / LEDSpicer

LEDSpicer a LED Animator and Controller for Linux
GNU General Public License v3.0
32 stars 13 forks source link

IPAC Ultimate IO Mode Switching issue #16

Closed mc2programmer closed 1 year ago

mc2programmer commented 1 year ago

Using Current Source Release 0.5.5 IPAC I/O latest firmware 50+

ledspicerd will not find my ultimateio if I am in dinput mode it only works in keyboard mode.

Noted here: https://www.ultimarc.com/control-interfaces/i-pacs/i-pac-ultimate-i-o/

Error: Program terminated by error: Failed to open device 0xd209:0x410 id 1

After some research it seems that when I change modes it is actually changing the ID from d209:0410 to d209:0412 I do not see a Product for the 0412 and the code that handles the change doesn't seem to address the Product ID

Bus 002 Device 011: ID d209:0410 Ultimarc I-PAC Ultimate I/O ---- keyboard Bus 002 Device 010: ID d209:0412 Ultimarc I-PAC Ultimate I/O ---- dinput Bus 002 Device 012: ID 045e:028e Microsoft Corp. Xbox360 Controller ---- xinput Bus 002 Device 013: ID d209:0412 Ultimarc I-PAC Ultimate I/O ---- dinput(user set) Bus 002 Device 014: ID 045e:028e Microsoft Corp. Xbox360 Controller ---- xinput(user set)

Bus 002 Device 015: ID d209:0412 Ultimarc I-PAC Ultimate I/O idVendor 0xd209 Ultimarc iManufacturer 3 Ultimarc iProduct 2 I-PAC Ultimate I/O iConfiguration 2 I-PAC Ultimate I/O iInterface 2 I-PAC Ultimate I/O iInterface 2 I-PAC Ultimate I/O iInterface 2 I-PAC Ultimate I/O iInterface 2 I-PAC Ultimate I/O [root@BATOCERA /userdata/system/ledspicer]# lsusb -v |grep Ulti Bus 002 Device 016: ID d209:0410 Ultimarc I-PAC Ultimate I/O idVendor 0xd209 Ultimarc iManufacturer 3 Ultimarc iProduct 2 I-PAC Ultimate I/O iConfiguration 2 I-PAC Ultimate I/O iInterface 2 I-PAC Ultimate I/O iInterface 2 I-PAC Ultimate I/O iInterface 2 I-PAC Ultimate I/O

I do not know c++ very well, but a work around for my need to use dinput mode, was to change the #define tag to be 0x412 however for a more permanent solution an if statement could be implemented somewhere to check for the different unicodes of this particular board If I figure this out I will create a pull.

This could be because I am working on Batocera, and I just realized my UDEV file got deleted after reset. Added init.d to make sure it gets copied over.

meduzapat commented 1 year ago

you will need also to copy the compiled libraries from /usr/lib/ledspicer (they need to be on the same directory on both systems because they are plugins, loaded on demand) you can do the udev for the usb, or add the user to the usb group, or run it as root

mc2programmer commented 1 year ago

Yeah I got that, LEDSpicer pretty good about giving errors as to what locations things need to be at. I think a lot of the problems I have are just because of the Restrictive nature of Batocera. I got everything working except for the AlsaAudio and PulseAudio plugins. Could also be a permission issue or the fact that the OS is using pipewire. I had to do a few things that are out of scope. I will close this because I do not think this is really an issue with LEDSpicer

meduzapat commented 1 year ago

Very interesting, I know is a hard to make it work in some sysmtes, made it work on MisTEr and needed special steps, technically, it should work anywhere. I was never able to test the ALSA driver in deep, I know the pulse audio (PA) works fine, but not every system brings PA, we can maybe test the ALSA audio there 🤔 I will be on the slack channel if you need some help!

mc2programmer commented 1 year ago

Tested this on several system and still get the same error Error: Program terminated by error: Failed to open device 0xd209:0x410 id 1 So the work around still remains only way for me to fix this for now is to edit

src/devices/Ultimarc/Ultimate.hpp

ln 32 - #define IPAC_ULTIMATE_PRODUCT 0x0410 ln 32 + #define IPAC_ULTIMATE_PRODUCT 0x0412

but that ID will change depending on what Mode the Ultimate I/o is in once I change this re-compile and just copy over the new UltimarcUltimate.so it works... So going to leave this open and see if I can implement that if statement to check for the other ID's

I think what you already have is close but it increased the interface by 1 I think the only reason to change the interface would be if you had multiple Ultimate I/O's interface = IPAC_ULTIMATE_INTERFACE + 1;

mc2programmer commented 1 year ago

Well after toying with this for a few weeks the issue I was having had to do with the .config file device name="UltimarcUltimate" boardId="1"

I have to set boardID="3" so that it will detect as 0xd209:0x412 but now I have another question.... is their a way to set/force "Game Controller mode detected"

// Detect Game Controller mode (will shift the interface by one). if ((descriptor.bcdDevice & 0x40)) { LogInfo("No Game Controller mode detected"); interface = IPAC_ULTIMATE_INTERFACE; } else { LogInfo("Game Controller mode detected"); interface = IPAC_ULTIMATE_INTERFACE + 1; }

with batocera I need to be able to force "Game Controller mode detected" in order for it to detect 2 controllers. Is it possible to set this in the .config or elsewhere?

meduzapat commented 1 year ago

Excellent, good to know you found the correct IDs, let me know if you have any other issue. The game controller mode is detected automatically by LEDSpicer, you need to activate that mode on the hardware using the Ultimarc setup program provided by them, I did that with mine. More details here http://www.ultimarc2.com/winipacv2.html

Let me know if you need something else.