Light Gun (Sega Master System) on lr-genesis-plus-gx for RetroPie
-
@mediamogul said in Light Gun (Sega Master System) on lr-genesis-plus-gx for RetroPie:
@dankcushions said in Light Gun (Sega Master System) on lr-genesis-plus-gx for RetroPie:
what is the purpose of the dolphin bar?
The DolphinBar eliminates the need for any drivers. It not only contains the two necessary infrared lights, but it also pairs directly with the WiiMote's Bluetooth and translates the data into standard USB absolute mouse coordinates and USB keyboard input. It also has a mode that will translate the data to standard USB Joystick input, which is not only useful for the Wiimotes, but also any number of controller accessories that can connect to the bottom ports. For example, when they become more widely available, I plan on picking up four NES controllers for the NES classic and connecting them to the Pi in this way, allowing for what will essentially be four first party Nintendo controllers that are "wireless".
I wonder how that works on a dual monitor setup as a mouse? I have 3 monitors in my bedroom (two running from a PC which I may add Linux to that mix, and one close to the ceiling that runs Chromecast/Apple TV), I want to be able to control the dual monitors from WiiMote. All the Windows 10 drivers for my WiiMote didn't seem to work right, at best they would only detect the buttons and not the IR Camera in FreePIE (which is the MOST important feature to me, also I can't find GlovePIE since they stopped development), if they would detect at all (I think I only got FreePIE working, all others failed to connect). I haven't tried a Linux setup yet on those because reading through docs and forum posts it looks like there's only button support in the drivers? I don't know, hopefully they have that working. I want to be able to use the IR Camera on a WiiMote as a RETRO_DEVICE_LIGHTGUN, I've even got a Cabela's Rifle enclosure for the WiiMote.
-
@johne79 said in Light Gun (Sega Master System) on lr-genesis-plus-gx for RetroPie:
@dankcushions said in Light Gun (Sega Master System) on lr-genesis-plus-gx for RetroPie:
@johne79 said in Light Gun (Sega Master System) on lr-genesis-plus-gx for RetroPie:
It's actually an easy fix, unfortunately ekeeke the developer is of the mindset that from a design perspective only an absolute pointer touchscreen should be used, and in a perfect world where there are no driver issues with Linux recognizing touchscreen devices that's great, but in my experience that's not the case so I respectfully disagree.
i'm sort of with ekeeke here. the retroarch udev driver should be able to translate from an absolute device to a relative device and vice versa, if either doesn't exist. i've done this in mame2003 for one purpose.. i would personally prefer to fix it in udev driver eventually, then it helps all cores.
that said, when i got someone to test with a wii mote and sensor bar and a debug version of mame2003, they weren't getting any updates to RETRO_DEVICE_MOUSE, _POINTER, or _LIGHTGUN. this is for some other fault of the udev driver, and in this case you will not be able to work around it without looking into the driver.
There's one caveat to that, and that's that I've found out that a mouse can report ABS_X and ABS_Y without having INPUT_ID_TOUCHSCREEN=1. In fact, trying to set the latter via a udev rule on this particular touchscreen (AR1100 on an Adafruit 5" HDMI Backpack Touchscreen) caused it to stop working in X11, but it was reporting ABS just fine.
What I did before the crash on Sunday was modify the RetroArch code to include ABS_X/Y in the mouse input handling, and translate those coordinates to relative for use in lightgun apps. I used 0,0 as a fixed starting point, and it seems to work fine as long as you're not using both a relative and absolute device at the same time, if you do the coordinates wrestle with each other a bit until one takes over the other it looks like.
I'm coming back around to the code, I've had a monster of a week trying to do some home improvements on my home office including some furniture building, trying to drum up some business, getting a dedicated Debian box up and running, ensuring next time that I have a more stable coding environment and don't stupidly do the code manipulation on the Pi itself since they can be a bit "accident" prone (I've broken 2 RPI's already, one was due to an accidental wiring when I first started learning GPIO, the other was due to about a 3 foot accidental drop), and a host of other things.
In fact I could never get any device to properly detect as a touchscreen, that was a point of frustration for weeks, and no one anywhere could or would give me a hand on that. At the end of the day I think the user needs a better way via an option in RetroArch to specify what device(s) to use as pointers and that should all be handled upstream in RetroArch rather than the core dictating the usage of a device, since it can break functionality unless you go and haphazardly waste money on potentially expensive hardware like ~$100 on AimTrak guns for one or two cores. So you say use RETRO_DEVICE_LIGHTGUN in the core code, but RetroArch lets you pick whether to use an absolute or relative positioning device, and handles all the coordinate translation, and you get a "best of both worlds" situation creating a win both for RetroArch and the core developers.
interesting! i think we're on similar pages.
there's one issue that RETRO_DEVICE_MOUSE/POINTER/LIGHTGUN only handles one device of the same type each (i think if you have multiple mouse/etc devices then they fight, as you say). they should be able to handle N devices, like RETRO_DEVICE_JOYPAD or whatever. issue logged for this: https://github.com/libretro/RetroArch/issues/3443
Also a small note, that Dolphinbar probably failed to detect anything for the same reason my touchscreen was failing, because it's giving absolute positioning and it's detected as a mouse not as a touchscreen, which currently in RetroArch will just skip through the switch/case statement (and I fixed that until my MicroSD's unfortunate demise on Sunday).
I don't know what the actual criteria is for udev to properly detect hardware as a touchscreen at the hardware level, surely I'm hoping it's not specific vendors/product IDs in the HID.
yeah i think fully understanding this part is crucial. if it's a udev problem, then the problem should be reported to udev upstream. if its a udev driver problem, then it's fixable in libretro. i suspect the case statement is faulty, but i don't fully understand the info that udev provides about a device to fix it. there must be SOME sort of reliable information about whether a device is abs or not... you'd hope.
i don't think it should be up to the user to specify whether something is abs or not.. ideally, anyway!
-
@johne79 Thanks John! Currently updating everything to 4.2 so I'll try tweaking with this again when that finishes.
-
@johne79 I've got a little cheap gun enclosure for my Wiimote, just a white plastic one that cost like 8 bucks on Amazon haha. Works great in AdvMame for me, and a ton cheaper than Aimtrak.
-
@johne79 I found the gun cursor setting in Retroarch GUI but it just turned the cursor on, and I still can't move it from center. Do I have to tweak more to calibrate the gun through different settings? I even turned the Player One in retroarch to "MS Light Phaser" but that didn't seem to fix anything.
-
@johne79 There is now a bounty building up for mouse enhancements to the libretro API: https://www.bountysource.com/issues/43321776-multiple-mice-support
Specifically it's about adding support for multiple mice. I remembered you getting pretty far into this analysis of what could be improved in that regard so I just wanted to point the bounty out to you. In case you might be tempted to try for it :)
-
Hi @johne79. I just wanted to mention that @casdevel from the libretro forums and github has added multi-mouse support to RetroArch's udev input driver.
If you are interested in that feature, or if you would like to see if casdevel could help address the need some cores have for absolute coordinates, here's where the discussion is happening: https://github.com/libretro/RetroArch/pull/5010
-
This is great news! It looks as though the PR was merged and casdevel is now considering solutions for absolute coordinates. I may be able to retire my hacked Wii very soon. It's served me very well, but it'll be nice to have a light gun setup that's a bit more portable.
-
@mediamogul what do you think about starting a new thread for people who are experimenting with multiple mouse-type input devices? Right now I only have RetroArch access on Windows, but with the Windows raw input driver the 2-player mouse input experience is already 90% perfect .
-
what do you think about starting a new thread for people who are experimenting with multiple mouse-type input devices?
I think that's a great idea. I'm very excited about this whole advancement. Myself, I have two USB arcade guns, as well as a Dolphin Bar, so I won't be able to fully kick the tires on this until absolute coordinates are worked out, but I look forward to trying this latest addition out with a few traditional mice.
-
@mediamogul If I understand the latest post from casdevel then he feels that as of now there RetroArch and the input drivers should be making those relative/absolute translations. He invites github issues if this isn't working and lists some steps to take in order to prepare to write up a good issue in that same post.
Also I have started a thread for people experimenting with multiple mice: https://retropie.org.uk/forum/topic/10952/experimental-multiple-mice-support-in-retroarch-cores-lightguns-spinners-steering-wheels
-
Good to Know. I'm about to head off to see Journey, so I'll do some testing on this with all the applicable cores in the coming week. I of course don't see that it should, but if this fix here somehow manages to solve the coordinates issue as well, it would be fantastic. If not, then I'd love to see a proper issue be raised. I'll even throw in a decent bounty on it. It would really be nice to finally have proper light gun support in RetroArch and RetroPie by extension.
-
@mediamogul Have fun, and let me know what you find out. I'll put a couple of bucks onto a bounty if it takes one more to get this smoothed out across the cores.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.