Skip to content
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

[OGC] Only the first Wiimote opened works #19

Closed
Quadraxis-v2 opened this issue Oct 31, 2022 · 8 comments
Closed

[OGC] Only the first Wiimote opened works #19

Quadraxis-v2 opened this issue Oct 31, 2022 · 8 comments

Comments

@Quadraxis-v2
Copy link

Quadraxis-v2 commented Oct 31, 2022

It seems that the only Wiimote that register events is the one that is opened first, be it 1, 2, 3 or 4. GameCube controllers work fine. This needs some investigation.

Edit: WPAD_ScanPads() is commented out here, which is needed to register events from Wiimotes 2, 3, & 4. I don't know the reason for this. The first Wiimote does register events, since WPAD_ReadPending(WPAD_CHAN_0, NULL) is called here. However, this still does not fix the main problem, events are only coming from the Wiimote that is opened first. It must be noted that SDL_JoystickOpen() does NOT return NULL in any case, though.

@Quadraxis-v2 Quadraxis-v2 changed the title [OGC] Wiimotes #2, #3 and #4 don't work [OGC] Only the first Wiimote opened works Oct 31, 2022
WinterMute pushed a commit that referenced this issue Apr 7, 2023
…pened

This was the callstack:
    frame #3: 0x00000001004e1930 libSDL3.1.0.0.dylib`IOS_AddJoystickDevice(controller=0x0000600003b0c000, accelerometer=SDL_FALSE) at SDL_mfijoystick.m:528:14
    frame #4: 0x00000001004e1a54 libSDL3.1.0.0.dylib`__IOS_JoystickInit_block_invoke(.block_descriptor=0x0000000100547760, note=@"GCControllerDidConnectNotification") at SDL_mfijoystick.m:673:45
    frame #5: 0x000000018601e578 CoreFoundation`__CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 128
    frame #6: 0x00000001860bc074 CoreFoundation`___CFXRegistrationPost_block_invoke + 88
    frame #7: 0x00000001860bbfbc CoreFoundation`_CFXRegistrationPost + 440
    frame #8: 0x0000000185fefbac CoreFoundation`_CFXNotificationPost + 708
    frame #9: 0x0000000186edc72c Foundation`-[NSNotificationCenter postNotificationName:object:userInfo:] + 88
    frame #10: 0x000000019b054a18 GameController`__60-[_GCControllerManagerAppClient _onqueue_publishController:]_block_invoke + 156
    frame #11: 0x0000000185dc19dc libdispatch.dylib`_dispatch_call_block_and_release + 32
    frame #12: 0x0000000185dc3504 libdispatch.dylib`_dispatch_client_callout + 20
    frame #13: 0x0000000185dd1d1c libdispatch.dylib`_dispatch_main_queue_drain + 928
    frame #14: 0x0000000185dd196c libdispatch.dylib`_dispatch_main_queue_callback_4CF + 44
    frame #15: 0x000000018606ad6c CoreFoundation`__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
    frame #16: 0x00000001860287ec CoreFoundation`__CFRunLoopRun + 2036
    frame #17: 0x00000001860278a4 CoreFoundation`CFRunLoopRunSpecific + 612
    frame #18: 0x00000001003b1194 libSDL3.1.0.0.dylib`process_pending_events at hid.c:509:9
    frame #19: 0x00000001003aebe8 libSDL3.1.0.0.dylib`PLATFORM_hid_open_path(path="USB_054c_05c4_0x11a104290", bExclusive=0) at hid.c:823:2
    frame #20: 0x00000001003b051c libSDL3.1.0.0.dylib`SDL_hid_open_path_REAL(path="USB_054c_05c4_0x11a104290", bExclusive=0) at SDL_hidapi.c:1419:19
    frame #21: 0x00000001004dabdc libSDL3.1.0.0.dylib`HIDAPI_SetupDeviceDriver(device=0x0000600003518000, removed=0x000000016fdfee3c) at SDL_hidapijoystick.c:399:19
    frame #22: 0x00000001004da890 libSDL3.1.0.0.dylib`HIDAPI_AddDevice(info=0x000060000212c2d0, num_children=0, children=0x0000000000000000) at SDL_hidapijoystick.c:843:5
    frame #23: 0x00000001004d9148 libSDL3.1.0.0.dylib`HIDAPI_UpdateDeviceList at SDL_hidapijoystick.c:1000:21
    frame #24: 0x00000001004d9940 libSDL3.1.0.0.dylib`HIDAPI_JoystickDetect at SDL_hidapijoystick.c:1205:13
    frame #25: 0x00000001003bc6d8 libSDL3.1.0.0.dylib`SDL_UpdateJoysticks_REAL at SDL_joystick.c:1703:9
    frame #26: 0x00000001003a13a8 libSDL3.1.0.0.dylib`SDL_PumpEventsInternal(push_sentinel=SDL_FALSE) at SDL_events.c:855:9
    frame #27: 0x00000001003a1340 libSDL3.1.0.0.dylib`SDL_PumpEvents_REAL at SDL_events.c:879:5
    frame #28: 0x000000010038b380 libSDL3.1.0.0.dylib`SDL_PumpEvents at SDL_dynapi_procs.h:572:1
    frame #29: 0x0000000100004524 testgamepad`loop + 40
    frame #30: 0x00000001000063d8 testgamepad`main + 2140
@Quadraxis-v2
Copy link
Author

I'm closing this since the fix was merged

@WinterMute
Copy link
Member

Thanks for the PR. I was waiting until I rebuilt wii SDL to close this though but I'll do it oin a sec.

giroletm pushed a commit to giroletm/dkp-SDL that referenced this issue Jul 6, 2023
…pened

This was the callstack:
    frame devkitPro#3: 0x00000001004e1930 libSDL3.1.0.0.dylib`IOS_AddJoystickDevice(controller=0x0000600003b0c000, accelerometer=SDL_FALSE) at SDL_mfijoystick.m:528:14
    frame devkitPro#4: 0x00000001004e1a54 libSDL3.1.0.0.dylib`__IOS_JoystickInit_block_invoke(.block_descriptor=0x0000000100547760, note=@"GCControllerDidConnectNotification") at SDL_mfijoystick.m:673:45
    frame devkitPro#5: 0x000000018601e578 CoreFoundation`__CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 128
    frame devkitPro#6: 0x00000001860bc074 CoreFoundation`___CFXRegistrationPost_block_invoke + 88
    frame devkitPro#7: 0x00000001860bbfbc CoreFoundation`_CFXRegistrationPost + 440
    frame devkitPro#8: 0x0000000185fefbac CoreFoundation`_CFXNotificationPost + 708
    frame devkitPro#9: 0x0000000186edc72c Foundation`-[NSNotificationCenter postNotificationName:object:userInfo:] + 88
    frame devkitPro#10: 0x000000019b054a18 GameController`__60-[_GCControllerManagerAppClient _onqueue_publishController:]_block_invoke + 156
    frame devkitPro#11: 0x0000000185dc19dc libdispatch.dylib`_dispatch_call_block_and_release + 32
    frame devkitPro#12: 0x0000000185dc3504 libdispatch.dylib`_dispatch_client_callout + 20
    frame devkitPro#13: 0x0000000185dd1d1c libdispatch.dylib`_dispatch_main_queue_drain + 928
    frame devkitPro#14: 0x0000000185dd196c libdispatch.dylib`_dispatch_main_queue_callback_4CF + 44
    frame devkitPro#15: 0x000000018606ad6c CoreFoundation`__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
    frame devkitPro#16: 0x00000001860287ec CoreFoundation`__CFRunLoopRun + 2036
    frame devkitPro#17: 0x00000001860278a4 CoreFoundation`CFRunLoopRunSpecific + 612
    frame devkitPro#18: 0x00000001003b1194 libSDL3.1.0.0.dylib`process_pending_events at hid.c:509:9
    frame devkitPro#19: 0x00000001003aebe8 libSDL3.1.0.0.dylib`PLATFORM_hid_open_path(path="USB_054c_05c4_0x11a104290", bExclusive=0) at hid.c:823:2
    frame devkitPro#20: 0x00000001003b051c libSDL3.1.0.0.dylib`SDL_hid_open_path_REAL(path="USB_054c_05c4_0x11a104290", bExclusive=0) at SDL_hidapi.c:1419:19
    frame devkitPro#21: 0x00000001004dabdc libSDL3.1.0.0.dylib`HIDAPI_SetupDeviceDriver(device=0x0000600003518000, removed=0x000000016fdfee3c) at SDL_hidapijoystick.c:399:19
    frame devkitPro#22: 0x00000001004da890 libSDL3.1.0.0.dylib`HIDAPI_AddDevice(info=0x000060000212c2d0, num_children=0, children=0x0000000000000000) at SDL_hidapijoystick.c:843:5
    frame devkitPro#23: 0x00000001004d9148 libSDL3.1.0.0.dylib`HIDAPI_UpdateDeviceList at SDL_hidapijoystick.c:1000:21
    frame devkitPro#24: 0x00000001004d9940 libSDL3.1.0.0.dylib`HIDAPI_JoystickDetect at SDL_hidapijoystick.c:1205:13
    frame devkitPro#25: 0x00000001003bc6d8 libSDL3.1.0.0.dylib`SDL_UpdateJoysticks_REAL at SDL_joystick.c:1703:9
    frame devkitPro#26: 0x00000001003a13a8 libSDL3.1.0.0.dylib`SDL_PumpEventsInternal(push_sentinel=SDL_FALSE) at SDL_events.c:855:9
    frame devkitPro#27: 0x00000001003a1340 libSDL3.1.0.0.dylib`SDL_PumpEvents_REAL at SDL_events.c:879:5
    frame devkitPro#28: 0x000000010038b380 libSDL3.1.0.0.dylib`SDL_PumpEvents at SDL_dynapi_procs.h:572:1
    frame devkitPro#29: 0x0000000100004524 testgamepad`loop + 40
    frame devkitPro#30: 0x00000001000063d8 testgamepad`main + 2140

(cherry picked from commit a9650d4)
@mardy
Copy link
Collaborator

mardy commented Oct 5, 2023

Hi! This bug still occurs with the latest wii-sdl package. Has a release been made?

@Quadraxis-v2 Quadraxis-v2 reopened this Oct 7, 2023
@Quadraxis-v2
Copy link
Author

Quadraxis-v2 commented Oct 7, 2023

Hi! This bug still occurs with the latest wii-sdl package. Has a release been made?

Hi, apparently there have been some releases after the date of this issue but they still have the bug... Strange.

@WinterMute
Copy link
Member

@Anthypatos A test for the issue would be much appreciated. I do understand you're trying to be helpful by providing binaries but long experience has shown us that these things just cause endless problems for everyone. Looks like I possibly managed to generate a patchset in the pacman package with the wrong branch. That should hopefully be sorted now.

@mardy
Copy link
Collaborator

mardy commented Oct 8, 2023

I'm working on a tiny project where I met this issue, I can provide a repo soon, if desired (as well as a DOL file).

@Quadraxis-v2
Copy link
Author

Quadraxis-v2 commented Oct 8, 2023

@Anthypatos A test for the issue would be much appreciated. I do understand you're trying to be helpful by providing binaries but long experience has shown us that these things just cause endless problems for everyone. Looks like I possibly managed to generate a patchset in the pacman package with the wrong branch. That should hopefully be sorted now.

Hello, I tested the fix and it works. I have this repo that you can use to test: https://github.com/Anthypatos/ConnectXWii

However I found a new linking error in one of the packages (see devkitPro/pacman-packages#315). Nevertheless, if you encounter it you just need to comment out 2 calls (here and here) and it should compile fine. Once in the app, click on the rightmost option and the second controller should become usable (it's turn-based though).

I was just trying to provide a temporary solution for @mardy but I will delete it now :)

Edit: also forgot to mention that you must place the gfx folder inside the SD card in apps/ConnectXWii

@mardy
Copy link
Collaborator

mardy commented Oct 9, 2023

The very latest package (wii-sdl-1.2.15-11) works fine, I'm closing this then. Thanks @WinterMute :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants