-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wiimote support #54
Comments
FYI - wiimote driver uses very different (non-standard too) reporting mechanism than modern drivers (e.g. hid-nintendo) do, making using it trickier than it should be. Maybe I should "just" rewrite linuxmotehook in C++ to avoid said bug. |
that would be awesome, anything that makes it usable would surely help also python seems a good choice: joycond-cemuhook is in python (a single python file!) and it works perfectly thank you |
I have already written https://github.com/v1993/evdevhook, so C++ is a fine option as well (besides, it ensures that there are far less bridges needed which means less places for issues to arise). Strictly speaking, "the right thing" would be to write a new kernel driver for WiiMote that would expose features in standardized way, but I'm not ready to take on that. |
great, I'm available for testing and coding (although I'm more close to C than C++) |
It may take a while for me to have my wiimote in hands, but I'd be down for exploring this! From what @v1993 said it doesn't seem that easy and we're patching old kernel drivers' features together, that could definitely be standardized by default. |
I now have a wiimote here with me, so I might start working on something similar to joycond for xwiimote devices. So it would deal with LEDs, etc but also output cemuhook data. It will take some time until I have anything because I'm taking a lot of different projects at once, though. |
great news, thank you |
To be honest, I'd like to discuss a bit about this implementation. My idea is that it should be a program that uses libxwiimote similarly to what joycond does, assigning evdev devices and handling player leds and whatnot. What should be the default mapping for Wiimote+Nunchuck? Maybe there could be different modes that you could switch using button combinations? |
I think it would be useful to comply with MoltenGamepad layout mimicking xbox, which is recognized correctly in most of the games and it's very smartly chosen.
that could be useful, for example with home+plus and home+minus, but also profile selection from command line parameters would be fine |
I copied over the code from joycond-cemuhook and have something functional here (and I desperately need to cleanup the code). 1- Wiimote: works sideways using mapping from a json file. Motion is assigned for sideways usage.
I'll try to upload it in a new repo even if the code isn't very pretty, because it's already a start and works really well! |
Update: With some spaghetti code, I was able to also make it so connecting a Nunchuk to the Wiimote exposes a secondary device with its own motion. Again, this goes to enforce a design where each controller uses its own cemuhook server. Please let me know you're able to make it work on your end! I'm really hyped for this, even though very few games on Switch actually use motion controls. Nunchuk motion, even being only accelerometer, works perfectly with Mario Kart 8. I wonder if that's also the case for ARMS... |
wow... impressive. I'll test it asap! Btw, I guess the wiimote requires "motion plus"? |
It depends on the game. Mario Kart 8 uses accelerometer only, but I'm certain Splatoon 2 uses the gyroscope for aiming. This is a game-based requirement. |
ah ok, then cemuhook exposes what it finds, just accelerometers (wiimote) or all coordinates (wiimote + motionplus)? I'll try to find some time tonight to test it better, so far I got a |
Yes, it exposes what it finds. That's the case for the Nunchuk, which only registers accelerometers. Seems like this error is related to |
I have 3.8 and 3.9 installed
I see two occurrencies on github: https://github.com/dvdhrm/xwiimote-bindings and https://github.com/BrainTech/xwiimote-bindings |
I had to manually compile xwiimote, due to this issue (I'm on ubuntu devel), and I get errors while compiling xwiimote-bindings (see attched log) |
Try purging any wiimote related packages (xwiimote, libxwiimote2, etc) from your system and try again. I'm also on Ubuntu (21.10), and from my terminal history I had to do this. Maybe it will even make it so the code from my repo just works in your end. |
ok, I've managed to compile xwiimote-bindings, and I've overwritten xwiimote.py with the new one, but sadly it still gives the same error: |
Try also copying the .so generated by xwiimote-bindings in |
yes, the problem is that I've installed xwiimote, xwiimote-bindings, and xwiimote-cemuhook in by setting === Nintendo Wii Remote === but I haven't connected the wiimote yet (I have it at home), now I'm in office |
You got it! This error is because there's no wiimote connected :) |
looking forward to test it then :) thank you! |
Uploading videos for visibility and to show how well it works for me at the moment: WhatsApp.Video.2021-11-01.at.19.01.03.mp4WhatsApp.Video.2021-11-01.at.19.03.08.mp4 |
it mostly works, but I cannot make the nunchuck work. Do I have to enable it somehow? Also, I get several dmesg output:
|
I also get this resource busy message, so I don't think that's the reason why it's not working. Does the program itself detect that the nunchuck is attached? |
I'm not sure, this is the output:
|
Weird... Can you run xwiimote-bindings examples or xwiishow and see the string it shows as extension? It should be exactly "nunchuk". Seems like your system recognized it but somehow my code didn't. |
xwiishow does not see the nunchuck extension, this is weird because I've used the wiimote+nunchuck many times, the last was a few weeks ago and I've never had problems. Now it does not work, I've even tried to reinstall xwiimote from distro packages. |
ok, it seems a problem related to the wiimotion plus: without the wiimotion plus the nunchuck does work |
however, I've checked with a second wiimote which has integrated motion plus and it has the same problem: nunchuck is not usable in combination with motion plus. So it does not seem a hardware problem. |
Weird, in the videos you can see I'm using a wm+ and it works. Is everything Nintendo-branded? Maybe a xwiimote bug? Might be even possible that this is fixed in some fork, let's see if we can find a solution |
Seems like this is the issue @v1993 mentioned before. In the main repo you can also see he has an open issue regarding this. Then why does it work for me? I guess I hit the hardware lottery, and xwiimote needs some love. |
yes, and I used them with a real wii |
I also imagine that you don't have this issue using dolphin's internal wiimote drivers, right? |
I've tried, but no "real" wiimote is seen by dolphin :( |
I've opened a new issue in xwiimote |
FWIW - I'm looking into rewriting linuxmotehook in another language (either C++ or Vala) to bypass original problem in bindings. There's no conflict of interest with xwiimote-cemuhook either, since I prefer to avoid more invasive changes to system (changing access rights and creating new evdev devices), opting to only expose UDP interface. |
It would be great to add support for wiimote, since the only existing project - linuxmotehook - seems stuck with a bug that makes it totally unusable.
Presently the default kernel driver provides the following input devices for each connected wiimote:
Do you think it would be possible to add wiimote support in joycond-cemuhook?
The text was updated successfully, but these errors were encountered: