steam-for-linux icon indicating copy to clipboard operation
steam-for-linux copied to clipboard

Flatpak non-steam games fail to run overlay even after exposing steam's directories

Open RushingAlien opened this issue 3 years ago • 7 comments

Your system information

  • Steam client version (build number or date): 1668654564
  • Distribution (e.g. Ubuntu): Arch Linux
  • Opted into Steam client beta?: No
  • Have you checked for system updates?: Yes

Please describe your issue in as much detail as possible:

Steam has an overlay for quick access to frequently used menus in steam, however this overlay does not work when steam is running a flatpak app, even with ~/.local/share/Steam exposed to the flatpak sandbox filesystem. LD_PRELOAD-ing also has failed Related issue : https://github.com/flatpak/flatpak/issues/1756

Steps for reproducing this issue:

  1. Install a flatpak game
  2. Add said game as non-steam game
  3. Make sure ~/.local/share/Steam is exposed to the flatpak sandbox
  4. Run said game from steam
  5. See as overlay does not load

RushingAlien avatar Nov 24 '22 19:11 RushingAlien

And i'm not sure, but i think it's also only on opengl games?

RushingAlien avatar Nov 24 '22 19:11 RushingAlien

Related to #8599.

kisak-valve avatar Nov 24 '22 21:11 kisak-valve

I've been researching, and i've come to guess that this is due to the overlay being 32 bit. All the while, for flatpak apps 32-bit support, it needs to be added per app in their manifest, otherwise, no 32 bit libraries for said app,. Most flatpak games don't have this. To me, best course of actions are :

  • a 64-bit overlay client or;
  • communicate with the flatpak team to have the --allow=multiarch option mounts org.freedesktop.Platform.Compat.i386 to the appropriate directory within the namespace and also giving information to the dynamic library loader where it is.

RushingAlien avatar Jan 29 '23 17:01 RushingAlien

the overlay in Steam Deck's gamemode is integrated to gamescope, bypassing any need to inject to games.

RushingAlien avatar Apr 15 '23 03:04 RushingAlien

I've been researching, and i've come to guess that this is due to the overlay being 32 bit

I don't think that's it. For the LD_PRELOAD code-injection used on desktop, both 32- and 64-bit versions of the overlay module exist: 32-bit games must load the 32-bit gameoverlayrenderer.so, 64-bit games must load the 64-bit gameoverlayrenderer.so, and the opposite is not possible. Because Steam doesn't know whether your game is 32-bit, 64-bit or even a mixture of the two, the way it sets up the LD_PRELOAD is to try to load both. Whichever overlay is successfully loaded, you will get an error message for the other one (but that error message is harmless and does not actually mean that the overlay module was not loaded).

A more likely reason for this to be broken for Flatpak non-Steam games is that the Steam overlay assumes that various aspects of process state are shared between Steam and the game, including /tmp and the process ID namespace - but Flatpak's sandboxing means that non-Steam games installed via Flatpak do not share those aspects of their process state with the un-sandboxed Steam.

(This is the same reason why the various versions of Steam Linux Runtime share the process ID namespace with Steam - we originally tried using a new process ID namespace for the game-specific container, but that broke the overlay.)

smcv avatar Nov 13 '23 19:11 smcv

I tried that with libretro flatpak, that I think is 64-bit. I get many occurances of this:

ERROR: ld.so: object '/home/dkl/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.

and only a single message of this

ERROR: ld.so: object '/home/dkl/.local/share/Steam/ubuntu12_64/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.

So it fails to load both 32 and 64 bit library, and of course the overlay doesn't work. The overlay works for me for non-Flatpak non-Steam games with no problem.

dklementowski avatar Apr 05 '24 17:04 dklementowski

  1. flatpak game

Sorry for the silly question, but did you try using the Steam Overlay on games from Flathub, or am I mistaken?

ilievi187 avatar Aug 14 '24 13:08 ilievi187

Has anyone had success with workarounds for this? For example, I'm trying to run the Flatpak of retrodeck as a non-steam game (imported into steam via Boilr). At this point just launching retrodeck outside of steam, but I'd really like to use steam-big-picture as the primary launcher UI

Running steam via flatpak on ubuntu 24.04

matthewgrossman avatar Dec 23 '24 18:12 matthewgrossman

Any workarounds for this? It happens with cemu and yuzu too

rex118da avatar Apr 15 '25 22:04 rex118da

You can workaround this by using gamescope. That is running steam inside gamescope, since this will make the steam overlay integrated into gamescope instead of injected into the game. Idk if running steam normally and then running the flatpak game(flatpak) inside gamescope(host) fixes this tho

gamescope --steam --extra-args -- steam -gamepadui

RushingAlien avatar Apr 15 '25 22:04 RushingAlien