retroarch-snap icon indicating copy to clipboard operation
retroarch-snap copied to clipboard

Wired DualShock4 controller no longer being recognized after upgrade to retroarch 1.10 on Ubuntu 20.04

Open exerf opened this issue 3 years ago • 43 comments

After snapd automatically updated my version of retroarch to 1.10.0, my gamepad stopped working. I use a DualShock4 controller wired into USB. Historically, I have always used the "x" input driver and "udev" controller driver.

Here is how the problem manifests:

  • In previous versions of retroarch (1.9.x), upon launching retroarch I would get a notification at the bottom of the screen stating that my DualShock4 controller had been detected. That notification no longer appears.

  • Previously, I could use my controller to navigate the retroarch GUI, but now I can't.

  • In Settings -> Input -> Port 1 Controls, the Device Index is "Disabled" with no other available options.

  • When I try to re-map the buttons on the controller, the dialog box times out.

More observations:

  • I know that Ubuntu still recognizes my DS4 because I can use it outside of retroarch, which rules out something like a problem with my USB cable.

  • I did a diff of the current active retroarch.cfg file against a recent backup copy, and the only changes appear to be new lines corresponding to new settings introduced by 1.10.0.

  • I tried using other controller drivers. The only one I could get to work -- that is, the only one that allowed me to re-map buttons via the Settings -> Input -> Port 1 Controls screen -- was "linuxraw". But I couldn't get "linuxraw" to allow me to use my left analog stick to act as a D-pad, which is how the controller just naturally worked before (or perhaps because of the Analog to Digital Type setting). And using "linuxraw" didn't cause the controller notifications to reappear upon launching retroarch.

  • Previous versions of retroarch would print the following lines to the log:

    [INFO] [udev]: Pad #0 (/dev/input/event256) supports force feedback.
    [INFO] [udev]: Pad #0 (/dev/input/event256) supports 16 force feedback effects.
    [INFO] [Joypad]: Found joypad driver: "udev".
    

    But now, the log only contains:

    [INFO] [Joypad]: Found joypad driver: "udev".
    
  • After the update to 1.10.0, I tried running both the Update Assets and Update Controller Profiles commands. Neither had any noticeable effect.

Any idea what might have caused the problem, or how I might troubleshoot or fix?

Thanks in advance.

UPDATE: Oh, and one more thing. Ever since the upgrade to 1.10.0, when launching retroarch I now get the following error message on the command line (although it doesn't seem to prevent retroarch from running):

ERROR: ld.so: object '/snap/retroarch/1178/lib/libsnapcraft-preload.so' from
LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.

It may be unrelated to the controller detection issue, but I thought I'd mention it anyway.

UPDATE2: To the extent that the above ld.so error is something that needs to be fixed, it would appear that something is looking for libsnapcraft-preload.so in the wrong location. It appears to reside in usr/lib/libsnapcraft-preload.so, not lib/libsnapcraft-preload.so.

exerf avatar Jan 22 '22 16:01 exerf

Hi,

Is it still an issue with latest stable ?

gouchi avatar Mar 24 '22 20:03 gouchi

Unfortunately, it appears so.

I've been on on retroarch 1.10.2 for a few days now. I changed the controller driver from "linuxraw" back to "udev", then quit and restarted retroarch. Upon re-launch, the UI no longer responded to my controller buttons. :confused:

exerf avatar Mar 24 '22 20:03 exerf

For anyone else inconvenienced by this issue, here is my workaround in Ubuntu 20.04:

  1. Use "linuxraw" as the retroarch controller driver (and "x" as the input driver).
  2. Then install AntiMicroX and configure it to map either (or both) analog sticks to the arrow keys. I was able to use the .deb package without any issues.
  3. I think this is already the default, but make sure that the D-pad entries in Settings -> Input -> Port 1 Controls accept the arrow keys.

exerf avatar Mar 24 '22 20:03 exerf

Hello,

I've encountered this same issue with any game controllers since the version 1.10.0 update and the 1.10.2 update unfortunately did not fix this either.

I also have the preload library error on startup and I can confirm that the library is placed in incorrect place inside the snap filesystem:

ERROR: ld.so: object '/snap/retroarch/1318/lib/libsnapcraft-preload.so' from 
LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.

However as a not so great mitigation I can get controllers to work by unplugging and plugging them in while the retroarch is running. I think that might be related to something the preload is supposed to do but can't at the moment.

xard-dev avatar Mar 30 '22 20:03 xard-dev

I have the same issue. A Wii U Pro Controller works if I reconnect while the emulator is running, but I just can't get a Switch Pro Controller to be detected at all. Both controllers work with an old apt-get installable Retroarch version in Ubuntu.

joaorb64 avatar Apr 05 '22 11:04 joaorb64

I too have the extract same issues with a Bluetooth PS3 controller. Controller is not detected if retro arch is launched and the controller is already on. Turning it off and on connects it. Then when running a core the controller is disconnected again. Turning it off and on again reconnects. Same when exiting a core. Seems only related to snap. I have plugged usb-raw, joystick, bluez no luck.

haydnjonesdesign avatar Apr 09 '22 06:04 haydnjonesdesign

I'm quite sure the root cause of this issue is tied to the preload library put in incorrect location. Shame that snap filesystems are immutable by design and debugging this issue would require installing the whole snap development and packaging environment which considerably raises the effort needed for casual debugging.

xard-dev avatar Apr 09 '22 09:04 xard-dev

Hi,

Can you try to install it from edge channel (in about one hour) as we have just added one export ?

It might help to solve this issue.

sudo snap install retroarch --edge

Thank you.

gouchi avatar Apr 11 '22 20:04 gouchi

Well, I tried the installation, but it seems that snap does not like it when you have the retroarch already installed:

sudo snap install retroarch --edge
snap "retroarch" is already installed, see 'snap help refresh

Uh oh... if I go through the removal route it sounds very much like it's going to destroy my configuration (yet again).

Fortunately refreshing (probably) did the trick:

sudo snap refresh retroarch --edge
retroarch (edge) 1.10.2 from hunterk (libretro) refreshed

The core version is now 1.10.3 but the problem is still present:

retroarch 
ERROR: ld.so: object '/snap/retroarch/1350/lib/libsnapcraft-preload.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.

And the game controllers are not detected.

xard-dev avatar Apr 11 '22 20:04 xard-dev

You can backup your config files, mine are under USER/snap/retroarch/latest/.confg.

I haven't had a chance to test the edge version.

haydnjonesdesign avatar Apr 12 '22 02:04 haydnjonesdesign

I pushed some more updates to the edge channel. It seems to have gotten rid of the preload error, so if the ds4 is still not working, they were probably not related.

I'm going to hold off pushing these builds to the stable channel until I get confirmation that they help (or at least don't hurt)

EDIT: anybody had a chance to test the latest edge build? EDIT2: well, it seemed okay in my testing and we needed to get the stable build out, so I went ahead and promoted it to all of the channels. We'll see if anything blows up. Please still report back if your controller issue is/isn't fixed.

hizzlekizzle avatar Apr 12 '22 04:04 hizzlekizzle

I have just tested using a Wii U Pro Controller connected via Bluetooth. It still wasn't detected until reconnected.

joaorb64 avatar Apr 14 '22 10:04 joaorb64

Ok, thanks for testing/reporting. I think we can safely assume the preload stuff is/was unrelated.

As a bit of a sanity check, can anyone roll back to a previous version and verify that this is indeed a problem on our end and not something upstream (i.e., via snapcraft-core, etc.)?

To do so, you need to list the versions installed on your system and then select one to roll back to:

$ snap list retroarch  --all
$ sudo snap revert retroarch --revision [whatever]

hizzlekizzle avatar Apr 14 '22 13:04 hizzlekizzle

Can confirm the preload stuff was unrelated. Just tested 1.10.3 and the preload error is now gone but the issue with controllers remains.

I was unable to get a previous version list to rollback to using

snap list retroarch —all

The options available are 1.10.2 and 1.10.3. .2 is already to confirmed to have the issue. If anyone else has older versions previously installed to test that would be great.

haydnjonesdesign avatar Apr 17 '22 05:04 haydnjonesdesign

Can confirm the preload stuff was unrelated. Just tested 1.10.3 and the preload error is now gone but the issue with controllers remains.

Yes, I can also confirm this. The preload error is now fixed 1.10.3 - 1365 build but the controller issue remains.

As a bit of a sanity check, can anyone roll back to a previous version and verify that this is indeed a problem on our end and not something upstream (i.e., via snapcraft-core, etc.)?

If there is a way to rollback to a version 1.9.x snap then this could be tested but so far the rollback does not promising:

snap list retroarch  --all
Name       Version  Rev   Tracking     Publisher  Notes
retroarch  1.10.3   1365  latest/edge  libretro   disabled
retroarch  1.10.3   1373  latest/edge  libretro   -

xard-dev avatar Apr 17 '22 18:04 xard-dev

I was wondering if this could have any connection to the connected interfaces, does it?

For testing, I ran this command to get all interfaces that Yuzu uses but Retroarch doesn't:

snap interfaces | grep "yuzu" | grep -v "retroarch"

gtk-common-themes:icon-themes                                             citra-emu,discord,dolphin-emulator,firefox,gimp,inkscape,kdenlive,krita,obs-studio,snap-store,yuzu
gtk-common-themes:sound-themes                                            citra-emu,discord,dolphin-emulator,firefox,gimp,kdenlive,krita,obs-studio,snap-store,yuzu
nightmayr-kf5-qt-5-15-2-core20:nightmayr-kf5-qt-5-15-2-core20             citra-emu,dolphin-emulator,yuzu
:browser-support                                                          discord,firefox:browser-sandbox,gimp,obs-studio,yuzu
:desktop-legacy                                                           citra-emu,discord,dolphin-emulator,firefox,gimp,inkscape,kdenlive,krita,moonlight,obs-studio,snap-store,yuzu
:gsettings                                                                citra-emu,discord,dolphin-emulator,firefox,gimp,inkscape,obs-studio,snap-store,yuzu
:hardware-observe                                                         firefox,yuzu
:mount-observe                                                            yuzu

The only interesting entries here would be hardware-observe and mount-observe, even though I do not know their exact purposes.

joaorb64 avatar May 10 '22 14:05 joaorb64

desktop-legacy could be another possibility, I guess /shrug

You could try connecting them and see if it improves anything.

hizzlekizzle avatar May 10 '22 23:05 hizzlekizzle

When I try to manually connect any interface, I get errors:

sudo snap connect retroarch:desktop-legacy  :desktop-legacy 
snap "retroarch" has no plug named "desktop-legacy"

joaorb64 avatar May 11 '22 01:05 joaorb64

I just added desktop-legacy to the plugs. It should be available in the next edge build: https://github.com/libretro/retroarch-snap/blob/master/snapcraft.yaml#L58

hizzlekizzle avatar May 11 '22 13:05 hizzlekizzle

Also I noticed that the "reconnecting controller after starting retroarch" mitigation is not that great as the controller is lost every time you launch content using a core.

xard-dev avatar May 11 '22 15:05 xard-dev

Is there an estimate of when a new build will be uploaded?

joaorb64 avatar May 11 '22 16:05 joaorb64

It looks like it does them automatically every 3 days and they just did a new build yesterday, but I went ahead and triggered a new one. It'll probably publish in the next 30 min to an hour.

hizzlekizzle avatar May 11 '22 16:05 hizzlekizzle

So a build was released and I was able to connect desktop-legacy. Not sure if it made any difference. I also noticed that while my Wii U Pro Controller works the same as before (connects via Bluetooth, I need to connect after opening retroarch to have it detected), my Switch Pro Contoller (I'm connecting via USB) works randomly: if I disconnect and connect many times, sometimes it is detected.

If it helps in any way, here's the Yuzu yaml file for reference/comparison: https://github.com/Nightmayr-snaps/yuzu-snap/blob/master/snap/snapcraft.yaml

joaorb64 avatar May 11 '22 17:05 joaorb64

Now that a new permission was mentioned I wonder if something broke in the retroarch or the snap itself?

xard-dev avatar May 11 '22 17:05 xard-dev

Hmm... retroarch does not have hardware-observe. Could it be related?

xard-dev avatar May 11 '22 18:05 xard-dev

alright, i tried adding hardware-observe, mount-observe and browser-support. None of those sound at all related based on their documentation, but whatever. We'll give it a shot :) New builds should publish in an hour or so.

hizzlekizzle avatar May 11 '22 18:05 hizzlekizzle

Yeah, no changes coming from the connections... :(

joaorb64 avatar May 11 '22 20:05 joaorb64

Thanks for checking.

hizzlekizzle avatar May 11 '22 21:05 hizzlekizzle

I migrated to Ubuntu 22.04 and I can say that this issue is at least consistent: same controller problem with the snap.

I finally gave up and installed the PPA version and everything just worked nicely out of the box and the settings were easy to migrate.

xard-dev avatar Jul 02 '22 16:07 xard-dev

Yeah this is still occurring. I've just given up on retroarch and am not using it. Not sure even where to start looking to resolve this.

haydnjonesdesign avatar Jul 04 '22 02:07 haydnjonesdesign