ValveSoftware / SteamOS

SteamOS community tracker
1.59k stars 70 forks source link

Some flatpak apps won't run from Steam #830

Closed missionfloyd closed 2 years ago

missionfloyd commented 2 years ago

Your system information

Please describe your issue in as much detail as possible:

Take Mednaffe, for instance. This works fine when run from the terminal.

"/usr/bin/flatpak" run --command=mednafen com.github.AmatCoder.mednaffe "/home/deck/Roms/Saturn/Sonic R/Sonic R (USA, Brazil).cue"

But it won't run when added as a non-steam game, whether in game mode or desktop. No errors, just nothing. The non-flatpak Mednafen binary does work, however.

Here's the log from trying to run it.

[2022-08-16 16:35:43] Game 12367352156997550080 adding PID 1967 as a tracked process "/home/deck/.local/share/Steam/ubuntu12_32/reaper SteamLaunch AppId=2879498563 -- "/usr/bin/flatpak" run --command=mednafen com.github.AmatCoder.mednaffe "/home/deck/Roms/Saturn/Sonic R/Sonic R (USA, Brazil).cue""
[2022-08-16 16:35:43] Game 12367352156997550080 adding PID 1968 as a tracked process
[2022-08-16 16:35:43] Game 12367352156997550080 no longer tracking PID 1968, exit code -1
[2022-08-16 16:35:43] Game 12367352156997550080 no longer tracking PID 1967, exit code 0

Similarly, Flycast doesn't work when launched from Steam, either,

"/usr/bin/flatpak" run org.flycast.Flycast -config window:fullscreen=yes "/home/deck/Roms/Dreamcast/Sonic Adventure (USA).cue"

but it does if you do it this way.

org.flycast.Flycast -config window:fullscreen=yes "/home/deck/Roms/Dreamcast/Sonic Adventure (USA).cue"

and for some reason. once the latter is run, the former suddenly works. I noticed the same thing with MAME.

This workaround doesn't work with the Mednaffe command above because it needs to pass the --command=mednafen argument to flatpak.

I've tried re-imaging my Steam Deck, didn't help.

Edit: More apps that refuse to run from Steam. Nestopia DOSBox Staging DOSBox-X

This problem severely impacts the Steam Deck's usability.

Others have reported this problem as well.

missionfloyd commented 2 years ago

I got it so spit out an error. I don't know which process this is coming from.

ERROR: ld.so: object '/home/deck/.local/share/Steam/ubuntu12_64/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
ERROR: ld.so: object '/home/deck/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/deck/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
error: Invalid byte sequence in conversion input

And here's the console output.

Loaded Config for Last Resort Path for App ID -595421553, Controller 0: /home/deck/.local/share/Steam//controller_base/templates/controller_neptune_gamepad_fps.vdf
Loaded Config for Last Resort Path for App ID -595421553, Controller 0: /home/deck/.local/share/Steam//controller_base/templates/controller_neptune_gamepad_fps.vdf
Loaded Config for Last Resort Path for App ID -595421553, Controller 0: /home/deck/.local/share/Steam//controller_base/templates/controller_neptune_gamepad_fps.vdf
Loaded Config for Last Resort Path for App ID -595421553, Controller 0: /home/deck/.local/share/Steam//controller_base/templates/controller_neptune_gamepad_fps.vdf
CAPIJobRequestUserStats - Server response failed 2
GameAction [AppID 3699545743, ActionID 1] : LaunchApp changed task to SynchronizingControllerConfig with ""
Loaded Config for Last Resort Path for App ID -595421553, Controller 0: /home/deck/.local/share/Steam//controller_base/templates/controller_neptune_gamepad_fps.vdf
GameAction [AppID 3699545743, ActionID 1] : LaunchApp changed task to SiteLicenseSeatCheckout with ""
GameAction [AppID 3699545743, ActionID 1] : LaunchApp changed task to CreatingProcess with ""
GameAction [AppID 3699545743, ActionID 1] : LaunchApp waiting for user response to CreatingProcess ""
GameAction [AppID 3699545743, ActionID 1] : LaunchApp continues with user response "CreatingProcess"
Game process added : AppID 0 "/home/deck/.local/share/Steam/ubuntu12_32/reaper SteamLaunch AppId=3699545743 -- "/usr/bin/flatpak" run --command=mednafen com.github.AmatCoder.mednaffe "/home/deck/Roms/Saturn/Sonic R/Sonic R (USA, Brazil).cue"", ProcID 6076, IP 0.0.0.0:0
GameAction [AppID 3699545743, ActionID 1] : LaunchApp changed task to Completed with ""
Game process removed: AppID 0 "/home/deck/.local/share/Steam/ubuntu12_32/reaper SteamLaunch AppId=3699545743 -- "/usr/bin/flatpak" run --command=mednafen com.github.AmatCoder.mednaffe "/home/deck/Roms/Saturn/Sonic R/Sonic R (USA, Brazil).cue"", ProcID 6076
ThreadGetProcessExitCode: no such process 6077
bertogg commented 2 years ago

Hello, I can run Mednaffe, but I did find a problem.

I went to the desktop and added a launcher like this (foobar.desktop):

[Desktop Entry]
Name=Foo Bar on the SNES
Exec=/usr/bin/flatpak run --command=mednafen com.github.AmatCoder.mednaffe /home/deck/Roms/foobar.smc
Type=Application
Encoding=UTF-8

Then opened Steam, added that as a non-Steam game, went back to Gaming Mode and ran the game. This works fine.

However I see that if the Exec line has quotes then this doesn't work, e.g from your example:

Exec="/usr/bin/flatpak" run --command=mednafen com.github.AmatCoder.mednaffe "/home/deck/Roms/Saturn/Sonic R/Sonic R (USA, Brazil).cue"

What happens if you select the game on Steam, click the settings button, then select Properties -> Shortcut -> Launch options? Do you see the full Flatpak command-line options?

If that's the problem you're having, this is https://github.com/ValveSoftware/steam-for-linux/issues/8164

missionfloyd commented 2 years ago

I'm using Steam ROM Manager for this, not Add to Steam.

The shortcut does contain the full command, with quotes. I have other flatpak apps (Dolphin, DuckStation, xemu) added exactly the same way, and they do work.

bertogg commented 2 years ago

Ok but what do you see when you go to the game and select Settings -> Properties? Can you paste the exact contents of "Target", "Start In" and "Launch Options"?

missionfloyd commented 2 years ago

Target: "/usr/bin/flatpak" Start in: /usr/bin Launch Options: run --command=mednafen com.github.AmatCoder.mednaffe "/home/deck/Roms/Saturn/Sonic R/Sonic R (USA, Brazil).cue"

I've also tried putting the entire command in "Target".

Another one that doesn't work. Target: "/usr/bin/flatpak" Start in: /usr/bin Launch Options: run org.flycast.Flycast -config window:fullscreen=yes "/home/deck/Roms/Dreamcast/Sonic Adventure (USA).chd"

A few that do. Target: "/usr/bin/flatpak" Start in: /usr/bin Launch Options: run org.DolphinEmu.dolphin-emu -b -e "/home/deck/Roms/Dolphin/GZLE01.iso"

Target: "/usr/bin/flatpak" Start in: /usr/bin Launch Options: run org.duckstation.DuckStation -batch -fullscreen "/home/deck/Roms/PS1/Metal Gear Solid (USA).m3u"

Target: "/usr/bin/flatpak" Start in: /usr/bin Launch Options: run app.xemu.xemu -full-screen -dvd_path "/home/deck/Roms/XBOX/Jet Set Radio Future (USA).iso"

bertogg commented 2 years ago

Does it work if you use file names without spaces or other strange characters?

$ cat sonic.desktop 
[Desktop Entry]
Type=Application
Name=Sonic
Exec=/usr/bin/flatpak run --command=mednafen com.github.AmatCoder.mednaffe /home/deck/Roms/Sonic/sonic.cue

This works just fine for me after I add it to Steam, I don't need to tweak anything.

tlneondo commented 2 years ago

I have also noticed that, specifically, a Flatpak application will not run if the Steam entry's name has been changed. Whereas if it is added and left alone, things will tend to work.

missionfloyd commented 2 years ago

Target: /usr/bin/flatpak Start in: /usr/bin Launch Options: run --command=mednafen com.github.AmatCoder.mednaffe /home/deck/Roms/Saturn/Sonic/Sonic.cue

Doesn't make a difference. That wouldn't be it anyway, I have others (see above) with spaces, quotes, and parentheses that work fine.

Somehow, adding the apps themselves with "Add to Steam", then editing it to be exactly the same as above, does work. Maybe this is really a problem with Steam ROM Manager.

Edit: I think I figured it out, something to do with pasting vs typing in SRM. Launch Options from shortcuts.vdf

Typed: run --command=mednafen com.github.AmatCoder.mednaffe "/home/deck/Roms/Saturn/Sonic R (USA, Brazil)/Sonic R (USA, Brazil).cue"

Pasted: run --command=mednafen com.github.AmatCoder.mednaffe "/home/deck/Roms/Saturn/Sonic R (USA, Brazil)/Sonic R (USA, Brazil).cue"