Controller (joy2key?) mysteriously not working in Setup/Configuration Screens
-
Re: [joy2key_sdl.py errors - not working in RetroPie Setup](working in ES)
Re: [Controller wont work for choosing emulators anymore, joy2key problem/issue not working...]
Re: [Controller no longer works in RetroPie Setup, Launching Menu, Es Themes]System Info:
Hardware: Raspberry Pi 4 (4GB)
Power Supply: Intertek PG241-0503000U (5V / 3000 mA)
RetroPie version: 4.8.6
Built From: retropie-buster-4.8-rpi4-400 pre-made SD image
Guides used: https://retropie.org.uk/docs/First-Installation/ + the "Getting Started" guide series on the official RetroPie site
Controllers: 'Suily' NES-type generic controller, Kiwitata SNES-type generic controller, Retro-Bit Official Sega Genesis USB Controller 6-Button Arcade PadUSB Devices:
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 006: ID 0079:0011 DragonRise Inc. Gamepad Bus 001 Device 005: ID 062a:4101 MosArt Semiconductor Corp. Wireless Keyboard/Mouse Bus 001 Device 004: ID 0079:0011 DragonRise Inc. Gamepad Bus 001 Device 003: ID 0f0d:00c1 Hori Co., Ltd Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Description:
I seem to be experiencing an old issue (per the three older posts I found, listed at the top), seemingly mysteriously. My controllers no longer work in the retropie setup/configuration nor runcommand screens as of a week ago.
I've since then - in an effort to fix this - run an update on all the core packages, which had no effect. I then tried to update the joy2key package (no effect), and then remove and reinstall the joy2key package (still no effect). I also updated the sdl2 package (no effect) and repeated the joy2key remove/reinstall to no effect.
(Probably unrelated note: I did need to (re)update RetroArch as well after the core package updates since I did see some strange issues with the emulator itself when I launched a game (e.g. messages saying that my core does not support save states) but that reupdate of RetroArch fixed those issues.)
About the only thing I can think of that caused this is literally plugging in a different (wireless) keyboard (the "MosArt" device listed at the top) from the one I usually use (a wired USB Microsoft Ergonomics Natural 4000), but it's hard to believe this would be the cause. Unplugging the keyboard receiver dongle and rebooting the Pi had no effect; the problem persists.
Following @mitu's suggestions in the other posts, running the following test command:
/opt/retropie/admin/joy2key/joy2key_sdl.py kcub1 kcuf1 kcuu1 kcud1 0x0a 0x20 0x1b 0x00 kpp knp -d
produced the following log:
2024-01-17 17:54:51,670 DEBUG Using SDL Version 2.0.10, PySDL2 version 0.9.3. 2024-01-17 17:54:51,672 DEBUG Joystick #0 SWITCH CO.,LTD. Pro Controller added 2024-01-17 17:54:51,672 DEBUG Un-configured device "SWITCH CO.,LTD. Pro Controller", mapped using generic mapping 2024-01-17 17:54:51,672 DEBUG Joystick #1 USB Gamepad added 2024-01-17 17:54:51,673 DEBUG Un-configured device "USB Gamepad ", mapped using generic mapping 2024-01-17 17:54:51,673 DEBUG Joystick #2 USB Gamepad added 2024-01-17 17:54:51,673 DEBUG Un-configured device "USB Gamepad ", mapped using generic mapping Traceback (most recent call last): File "/opt/retropie/admin/joy2key/joy2key_sdl.py", line 560, in <module> sys.exit(main()) File "/opt/retropie/admin/joy2key/joy2key_sdl.py", line 552, in main event_loop(configs, joy_map, tty_fd) File "/opt/retropie/admin/joy2key/joy2key_sdl.py", line 405, in event_loop emitted_events = filter_active_events(event_queue) File "/opt/retropie/admin/joy2key/joy2key_sdl.py", line 271, in filter_active_events TypeError: unhashable type: 'list'
Based on my (relatively limited) programming knowledge, this seems to indicate some sort of interface contract breakage, but I can't see how given the issue started before I did any of these updates. I even inserted some debug logs into
joy2key_sdl.py
and did observe that the line throwing this exception:# remove any duplicate events from the list return list(set(filtered_events))
... is indeed attempting to convert a list wrapped inside another list into a set, but the reason the function receives the data in this shape was beyond the time I had to debug.
Any ideas?
(short of starting painfully from scratch, with a fresh RetroPie image)-Jandalf
P.S. You all are fantastic folks, and do a great service by enabling and igniting nostalgic joy amongst your fans in the community :)
-
@jandalf said in Controller (joy2key?) mysteriously not working in Setup/Configuration Screens:
Any ideas?
(short of starting painfully from scratch, with a fresh RetroPie image)I'll take a look, but before doing so, can you confirm that you have configured your controllers in EmulationStation ? From the debug log, it doesn't seem like any of the controllers connected have a configuration profile. Are the
.cfg
files for the controllers' profile generated in/opt/retropie/configs/all/retroarch-joypads
? -
@mitu THANK YOU! (and my regrets for any wasted time here)
TL;DR; <feeling very much boneheaded> The lack of default autoconfigs was absolutely the issue, and I don't know why I ignored it in the log errors from the
joy2key_sdl.py
test command I pasted above. I assumed because a button from one of my controllers was causing the error to trigger once I ran the script that they were indeed being detected and loaded, but I was wrong. Thank you! All controllers now work in all the config screens as well as runcommand.Background explanation: I'd incorrectly deleted the default (auto-generated) config file
/opt/retropie/configs/all/retroarch-joypads/USB Gamepad .cfg
once I'd created a couple of system-specific ones because two of my controllers have matching USB (vendor) ID's. These in turn were created based on another very helpful post you replied to some years ago (I have specific configs in/opt/retropie/configs/nes/joypad
and the other in/opt/retropie/configs/snes/joypad
, with their respectiveretroarch.cfg
s pointing to them; I just didn't realize that these are only relevant to the emulator and has no effect in EmulationStation itself).Case closed :)
-
@mitu THANK YOU! (and my regrets for any wasted time here)
No problem.
...
Case closed :)Well, not completely. It would be nice for the script to not keel over when there is more than one controller without an auto-config. I'll see what we can do about it - thanks for posting the issue.
-
@mitu sounds good, with a slight correction perhaps to say "more than one unique (from a vendor USB code perspective) controller without an auto-config."
-
I don't think it matters what controllers are connected, I'm guessing that the deciding factor is the lack of a configuration file.
-
@mitu Sure. Not to belabor the point, but I meant to say lack of a configuration file with a name matching the controller's ID (as recognized by the driver). In my case, both the SNES & NES type controllers produced the same config file name (hence the need for the system-specific workaround I mentioned above). I assume that what you meant is that the lack of valid configs for that "set" of controllers as well as the Sega Genesis one (which I'm beginning to doubt was actually valid at this point because I had to reconfigure it to make it work even in the emulator) is what tripped up the joy2key script. Anyway, however the unintentional experiment helped I'm glad it did.
-
OK, the crash should be fixed in https://github.com/RetroPie/RetroPie-Setup/pull/3861.
It doesn't matter how many un-configured devices are detected, one is enough to trigger the bug whenever its input is procesed by
joy2key
(a button needs to be pressed to trigger the bug).
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.