RetroArch: Joystick/gamepads stop communicating

I got a bug report on our snap repo about gamepads losing communication with the program following any context changes (e.g., closing a current game, opening a new one, toggling fullscreen, etc.): https://github.com/libretro/retroarch-snap/issues/52

The controller still shows up as connected (I can see its name in the device index), it just doesn’t register any communication unless/until I physically unplug/replug the device.

I thought it might be a plug connection issue at first, but none of that seems to have any effect, so I thought it might be something in RetroArch itself. However, using the current snapcraft.yaml with older, previously working snapshots of the RetroArch codebase still have the communication issue. I tried installing the current snap from the store on older versions of Ubuntu to see if it was related to any snapd changes, but the behavior is still there back to 19.04 LTS–and anything older doesn’t seem to allow installing the RetroArch snap due to requiring support for chained commands.

I also thought it could be related to confinement, but installing it with the --devmode flag didn’t seem to have any effect, either.

At this point, I’m kinda stumped and came here as a last resort to see if anyone had seen such issues in other snaps. Could it be a core20 issue? Would it make sense to try updating to core22?

This issue still persists, makes using the snap version of Retroarch too annoying or even obsolete.

It seems the same thing happens with the default udev gamepad driver on the flatpak version of RetroArch. They get around it by using SDL2 for gamepads, so I’ve switched the snap to use that, as well. It doesn’t fully solve the issue, as you still have to unplug/replug on first launch, but at least you don’t have to do it after closing each game.

It should be available in the next stable release but in the meantime, it should already be in effect in the “edge” branch. If you switch to that, let me know how it goes.