flathub / com.valvesoftware.Steam

https://flathub.org/apps/details/com.valvesoftware.Steam
346 stars 69 forks source link

Can't load the Mumble overlay over a flatpak Steam game #997

Open carlocastoldi opened 2 years ago

carlocastoldi commented 2 years ago

Game information Team Fortress 2

Distribution name and version where applicable Arch Linux

Mumble version 1.4.0 + MR 5949, client

Flatpak info

~
❯ flatpak --version
Flatpak 1.14.0
~
❯ flatpak --gl-drivers 
default
host

Problem description Mumble is a VoIP application and allows to set an overlay by preloading a couple of libraries prior to launching the game. Flatpak, however, does not allow to punch a hole in the sandbox for some directories such as /lib, /lib32, /usr. I tried to copy the required libraries in Steam flatpak's directory in order to load the overlay:

cp /usr/lib32/libGL.so.1.7.0 /home/$USER/.var/app/com.valvesoftware.Steam/.local/share/Steam/linux32
cp /usr/lib/mumble/libmumbleoverlay.x86.so /home/$USER/.var/app/com.valvesoftware.Steam/.local/share/Steam/linux32
cd /home/$USER/.var/app/com.valvesoftware.Steam/.local/share/Steam/linux32
ln -s libGL.so.1.7.0 libGL.so.1
ln -s libGL.so.1 libGL.so

I then proceeded by setting the game launch options to: LD_PRELOAD=/home/carlo/.local/share/Steam/linux32/libmumbleoverlay.x86.so:/home/carlo/.local/share/Steam/linux32/libGL.so %command%

However, the game (TF2) still does not show the Mumble overlay if launched through flatpak Steam.

Full flatpak log [does not work] ``` /bin/sh\0-c\0LD_PRELOAD=/home/carlo/.local/share/Steam/linux32/libmumbleoverlay.x86.so:/home/carlo/.local/share/Steam/linux32/libGL.so /home/carlo/.var/app/com.valvesoftware.Steam/.local/share/Steam/ubuntu12_32/reaper SteamLaunch AppId=440 -- /home/carlo/.var/app/com.valvesoftware.Steam/.local/share/Steam/ubuntu12_32/steam-launch-wrapper -- '/home/carlo/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/common/Team Fortress 2/hl2.sh' -game tf -steam -novid -nojoy -nosteamcontroller -nohltv -particles 1 -precachefontchars\0 Game process added : AppID 440 "LD_PRELOAD=/home/carlo/.local/share/Steam/linux32/libmumbleoverlay.x86.so:/home/carlo/.local/share/Steam/linux32/libGL.so /home/carlo/.var/app/com.valvesoftware.Steam/.local/share/Steam/ubuntu12_32/reaper SteamLaunch AppId=440 -- /home/carlo/.var/app/com.valvesoftware.Steam/.local/share/Steam/ubuntu12_32/steam-launch-wrapper -- '/home/carlo/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/common/Team Fortress 2/hl2.sh' -game tf -steam -novid -nojoy -nosteamcontroller -nohltv -particles 1 -precachefontchars", ProcID 419, IP 0.0.0.0:0 chdir /home/carlo/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/common/Team Fortress 2 GameAction [AppID 440, ActionID 1] : LaunchApp changed task to WaitingGameWindow with "" ERROR: ld.so: object '/home/carlo/.var/app/com.valvesoftware.Steam/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored. ERROR: ld.so: object '/home/carlo/.local/share/Steam/linux32/libmumbleoverlay.x86.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored. ERROR: ld.so: object '/home/carlo/.local/share/Steam/linux32/libGL.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored. ERROR: ld.so: object '/home/carlo/.local/share/Steam/linux32/libmumbleoverlay.x86.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored. ERROR: ld.so: object '/home/carlo/.local/share/Steam/linux32/libGL.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored. ERROR: ld.so: object '/home/carlo/.local/share/Steam/linux32/libmumbleoverlay.x86.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored. ERROR: ld.so: object '/home/carlo/.local/share/Steam/linux32/libGL.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored. GameAction [AppID 440, ActionID 1] : LaunchApp changed task to Completed with "" SDL video target is 'x11' SDL video target is 'x11' This system supports the OpenGL extension GL_EXT_framebuffer_object. This system supports the OpenGL extension GL_EXT_framebuffer_blit. This system supports the OpenGL extension GL_EXT_framebuffer_multisample. This system DOES NOT support the OpenGL extension GL_APPLE_fence. This system DOES NOT support the OpenGL extension GL_NV_fence. This system supports the OpenGL extension GL_ARB_sync. This system supports the OpenGL extension GL_EXT_draw_buffers2. This system DOES NOT support the OpenGL extension GL_EXT_bindable_uniform. This system DOES NOT support the OpenGL extension GL_APPLE_flush_buffer_range. This system supports the OpenGL extension GL_ARB_map_buffer_range. This system supports the OpenGL extension GL_ARB_vertex_buffer_object. This system supports the OpenGL extension GL_ARB_occlusion_query. This system DOES NOT support the OpenGL extension GL_APPLE_texture_range. This system DOES NOT support the OpenGL extension GL_APPLE_client_storage. This system DOES NOT support the OpenGL extension GL_ARB_uniform_buffer. This system supports the OpenGL extension GL_ARB_vertex_array_bgra. This system supports the OpenGL extension GL_EXT_vertex_array_bgra. This system supports the OpenGL extension GL_ARB_framebuffer_object. This system DOES NOT support the OpenGL extension GL_GREMEDY_string_marker. This system supports the OpenGL extension GL_ARB_debug_output. This system supports the OpenGL extension GL_EXT_direct_state_access. This system DOES NOT support the OpenGL extension GL_NV_bindless_texture. This system supports the OpenGL extension GL_AMD_pinned_memory. This system supports the OpenGL extension GL_EXT_framebuffer_multisample_blit_scaled. This system supports the OpenGL extension GL_EXT_texture_sRGB_decode. This system DOES NOT support the OpenGL extension GL_NVX_gpu_memory_info. This system DOES NOT support the OpenGL extension GL_ATI_meminfo. This system supports the OpenGL extension GL_EXT_texture_compression_s3tc. This system supports the OpenGL extension GL_EXT_texture_compression_dxt1. This system supports the OpenGL extension GL_ANGLE_texture_compression_dxt3. This system supports the OpenGL extension GL_ANGLE_texture_compression_dxt5. This system supports the OpenGL extension GL_ARB_buffer_storage. This system supports the OpenGL extension GLX_EXT_swap_control_tear. OpenGL: Mesa Intel(R) UHD Graphics 620 (KBL GT2) 4.6 (Compatibility Profile) Mesa 22.1.7 (git-7a3414c4bd) (4.6.0) GL_NV_bindless_texture: DISABLED GL_AMD_pinned_memory: DISABLED GL_ARB_buffer_storage: AVAILABLE GL_EXT_texture_sRGB_decode: AVAILABLE Installing breakpad exception handler for appid(steam)/version(1666144119) Using Breakpad minidump system. Version: 7638371 AppID: 440 Setting breakpad minidump AppID = 440 Using breakpad crash handler [S_API] SteamAPI_Init(): Loaded '/home/carlo/.var/app/com.valvesoftware.Steam/.local/share/Steam/linux32/steamclient.so' OK. Game process updated : AppID 440 "LD_PRELOAD=/home/carlo/.local/share/Steam/linux32/libmumbleoverlay.x86.so:/home/carlo/.local/share/Steam/linux32/libGL.so /home/carlo/.var/app/com.valvesoftware.Steam/.local/share/Steam/ubuntu12_32/reaper SteamLaunch AppId=440 -- /home/carlo/.var/app/com.valvesoftware.Steam/.local/share/Steam/ubuntu12_32/steam-launch-wrapper -- '/home/carlo/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/common/Team Fortress 2/hl2.sh' -game tf -steam -novid -nojoy -nosteamcontroller -nohltv -particles 1 -precachefontchars", ProcID 423, IP 0.0.0.0:0 Forcing breakpad minidump interfaces to load Looking up breakpad interfaces from steamclient Calling BreakpadMiniDumpSystemInit Looking up breakpad interfaces from steamclient Calling BreakpadMiniDumpSystemInit SteamInternal_SetMinidumpSteamID: Caching Steam ID: 76561198041836298 [API loaded yes] SteamInternal_SetMinidumpSteamID: Setting Steam ID: 76561198041836298 Installing breakpad exception handler for appid(steam)/version(1666144119) Installing breakpad exception handler for appid(steam)/version(1666144119) GL_NVX_gpu_memory_info: UNAVAILABLE GL_ATI_meminfo: UNAVAILABLE GL_MAX_SAMPLES_EXT: 16 CShaderDeviceMgrBase::GetRecommendedConfigurationInfo: CPU speed: 3600 MHz, Processor: GenuineIntel GlobalMemoryStatus: 4294967295 CShaderDeviceMgrBase::GetRecommendedConfigurationInfo: CPU speed: 3600 MHz, Processor: GenuineIntel GlobalMemoryStatus: 4294967295 IDirect3DDevice9::Create: BackBufWidth: 1280, BackBufHeight: 720, D3DFMT: 3, BackBufCount: 1, MultisampleType: 0, MultisampleQuality: 0 GL sampler object usage: DISABLED ##### swap interval = 0 swap limit = 1 ##### IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000004) differs from mask derived from shader name (0x0000000C) for shader ps-file shatteredglass_ps20b ps-index 40 ps-combo 0 Loaded program cache file "glbaseshaders.cfg", total keyvalues: 2227, total successfully linked: 2227 Loaded program cache file "glshaders.cfg", total keyvalues: 2464, total successfully linked: 2464 Precache: Took 3152 ms, Vertex 225, Pixel 1445 server.so loaded for "Team Fortress" ```

It works as intended if I launch it from shell with the following commands:

cd /home/$USER/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common/Team\ Fortress\ 2
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/bin:/usr/lib:/usr/lib32
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/$USER/.var/app/com.valvesoftware.Steam/.local/share/Steam/ubuntu12_32/steam-runtime/lib/i386-linux-gnu
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/$USER/.var/app/com.valvesoftware.Steam/.local/share/Steam/ubuntu12_32/steam-runtime/usr/lib/i386-linux-gnu
LD_PRELOAD=/usr/lib/mumble/libmumbleoverlay.x86.so:/usr/lib32/libGL.so ./hl2.sh -game tf
Full shell log [works as intended] ``` ERROR: ld.so: object '/usr/lib/mumble/libmumbleoverlay.x86.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored. ERROR: ld.so: object '/usr/lib32/libGL.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored. ERROR: ld.so: object '/usr/lib/mumble/libmumbleoverlay.x86.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored. ERROR: ld.so: object '/usr/lib32/libGL.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored. SDL video target is 'x11' SDL video target is 'x11' This system supports the OpenGL extension GL_EXT_framebuffer_object. This system supports the OpenGL extension GL_EXT_framebuffer_blit. This system supports the OpenGL extension GL_EXT_framebuffer_multisample. This system DOES NOT support the OpenGL extension GL_APPLE_fence. This system DOES NOT support the OpenGL extension GL_NV_fence. This system supports the OpenGL extension GL_ARB_sync. This system supports the OpenGL extension GL_EXT_draw_buffers2. This system DOES NOT support the OpenGL extension GL_EXT_bindable_uniform. This system DOES NOT support the OpenGL extension GL_APPLE_flush_buffer_range. This system supports the OpenGL extension GL_ARB_map_buffer_range. This system supports the OpenGL extension GL_ARB_vertex_buffer_object. This system supports the OpenGL extension GL_ARB_occlusion_query. This system DOES NOT support the OpenGL extension GL_APPLE_texture_range. This system DOES NOT support the OpenGL extension GL_APPLE_client_storage. This system DOES NOT support the OpenGL extension GL_ARB_uniform_buffer. This system supports the OpenGL extension GL_ARB_vertex_array_bgra. This system supports the OpenGL extension GL_EXT_vertex_array_bgra. This system supports the OpenGL extension GL_ARB_framebuffer_object. This system DOES NOT support the OpenGL extension GL_GREMEDY_string_marker. This system supports the OpenGL extension GL_ARB_debug_output. This system supports the OpenGL extension GL_EXT_direct_state_access. This system DOES NOT support the OpenGL extension GL_NV_bindless_texture. This system supports the OpenGL extension GL_AMD_pinned_memory. This system supports the OpenGL extension GL_EXT_framebuffer_multisample_blit_scaled. This system supports the OpenGL extension GL_EXT_texture_sRGB_decode. This system DOES NOT support the OpenGL extension GL_NVX_gpu_memory_info. This system DOES NOT support the OpenGL extension GL_ATI_meminfo. This system supports the OpenGL extension GL_EXT_texture_compression_s3tc. This system supports the OpenGL extension GL_EXT_texture_compression_dxt1. This system supports the OpenGL extension GL_ANGLE_texture_compression_dxt3. This system supports the OpenGL extension GL_ANGLE_texture_compression_dxt5. This system supports the OpenGL extension GL_ARB_buffer_storage. This system supports the OpenGL extension GLX_EXT_swap_control_tear. OpenGL: Mesa Intel(R) UHD Graphics 620 (KBL GT2) 4.6 (Compatibility Profile) Mesa 22.2.1 (4.6.0) GL_NV_bindless_texture: DISABLED GL_AMD_pinned_memory: DISABLED GL_ARB_buffer_storage: AVAILABLE GL_EXT_texture_sRGB_decode: AVAILABLE Using Breakpad minidump system. Version: 7638371 AppID: 440 Setting breakpad minidump AppID = 440 Using breakpad crash handler [S_API] SteamAPI_Init(): SteamAPI_IsSteamRunning() did not locate a running instance of Steam. dlopen failed trying to load: /home/carlo/.steam/sdk32/steamclient.so with error: /home/carlo/.steam/sdk32/steamclient.so: cannot open shared object file: No such file or directory [S_API] SteamAPI_Init(): Sys_LoadModule failed to load: /home/carlo/.steam/sdk32/steamclient.so No Steam interfaces - attempting to initialize SteamNetworkingSockets without steam support [SteamNetworkingSockets] WARNING: No ISteamUtils: Using local time! [S_API] SteamAPI_Init(): SteamAPI_IsSteamRunning() did not locate a running instance of Steam. dlopen failed trying to load: /home/carlo/.steam/sdk32/steamclient.so with error: /home/carlo/.steam/sdk32/steamclient.so: cannot open shared object file: No such file or directory [S_API] SteamAPI_Init(): Sys_LoadModule failed to load: /home/carlo/.steam/sdk32/steamclient.so Did not detect any valid joysticks. GL_NVX_gpu_memory_info: UNAVAILABLE GL_ATI_meminfo: UNAVAILABLE GL_MAX_SAMPLES_EXT: 16 CShaderDeviceMgrBase::GetRecommendedConfigurationInfo: CPU speed: 3600 MHz, Processor: GenuineIntel GlobalMemoryStatus: 4294967295 CShaderDeviceMgrBase::GetRecommendedConfigurationInfo: CPU speed: 3600 MHz, Processor: GenuineIntel GlobalMemoryStatus: 4294967295 IDirect3DDevice9::Create: BackBufWidth: 1280, BackBufHeight: 720, D3DFMT: 3, BackBufCount: 1, MultisampleType: 0, MultisampleQuality: 0 GL sampler object usage: DISABLED ##### swap interval = 0 swap limit = 1 ##### IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000004) differs from mask derived from shader name (0x0000000C) for shader ps-file shatteredglass_ps20b ps-index 40 ps-combo 0 Loaded program cache file "glbaseshaders.cfg", total keyvalues: 2227, total successfully linked: 2227 Loaded program cache file "glshaders.cfg", total keyvalues: 2464, total successfully linked: 2464 Precache: Took 3123 ms, Vertex 224, Pixel 1444 server.so loaded for "Team Fortress" ```

Any idea of how I can set the flatpak correctly in order to be able to access the right (system) libraries so that I can have the Mumble overlay?

Does this issue reproduce with native Steam No

Twin Mumble issue 5951

carlocastoldi commented 2 years ago

I discovered that --device=all most probably does not include --device=shm. I couldn't find anything confirming my suspect in the documentation. Setting --device=shm to Steam's flatpak solved it completely

also: flatpak Steam must be run after Mumble

carlocastoldi commented 2 years ago

regarding Mumble having to be launched before flatpak Steam: it seems like Steam can't see the connect to the local socket if Mumble is run after Steam (error: connection refused).

If I go into flatpak's bash (flatpak run --command=bash com.valvesoftware.Steam) I notice that permissions on the Mumble's local socket change:

Mumble after flatpak Steam. Only read permissions. Date/time is wrong.

Mumble after flatpak Steam. Works as intended. Full permissions. Date/time is correct.


#### Mumble _restarted_ with flapak Steam running. Doesn't work. Full permissions.
The number of hard links of the socket changes to `0`. I think this means that the socket was deleted. Date/time is wrong: indeed confirming that it points to the "old" socket and does not update the old one.

* flatpak bash:
```bash
[📦 com.valvesoftware.Steam ~]$ ls -l /run/user/1000/MumbleOverlayPipe 
srwxrwxrwx 0 carlo carlo 0 13 nov 12.00 /run/user/1000/MumbleOverlayPipe

Discord

on a similar note Discord, which also communicates with Steam through a local socket, doesn't have this problem. They create links to sockets that do not (yet) exist if Discord isn't running:

[📦 com.valvesoftware.Steam ~]$ ls -l /run/user/1000/
totale 0
-r--r--r-- 1 carlo carlo  0 13 nov 10.24 MumbleOverlayPipe
lrwxrwxrwx 1 carlo carlo 40 13 nov 10.24 discord-ipc-0 -> app/com.discordapp.Discord/discord-ipc-0
lrwxrwxrwx 1 carlo carlo 40 13 nov 10.24 discord-ipc-1 -> app/com.discordapp.Discord/discord-ipc-1
lrwxrwxrwx 1 carlo carlo 40 13 nov 10.24 discord-ipc-2 -> app/com.discordapp.Discord/discord-ipc-2
lrwxrwxrwx 1 carlo carlo 40 13 nov 10.24 discord-ipc-3 -> app/com.discordapp.Discord/discord-ipc-3
lrwxrwxrwx 1 carlo carlo 40 13 nov 10.24 discord-ipc-4 -> app/com.discordapp.Discord/discord-ipc-4
lrwxrwxrwx 1 carlo carlo 40 13 nov 10.24 discord-ipc-5 -> app/com.discordapp.Discord/discord-ipc-5
lrwxrwxrwx 1 carlo carlo 40 13 nov 10.24 discord-ipc-6 -> app/com.discordapp.Discord/discord-ipc-6
lrwxrwxrwx 1 carlo carlo 40 13 nov 10.24 discord-ipc-7 -> app/com.discordapp.Discord/discord-ipc-7
lrwxrwxrwx 1 carlo carlo 40 13 nov 10.24 discord-ipc-8 -> app/com.discordapp.Discord/discord-ipc-8
lrwxrwxrwx 1 carlo carlo 40 13 nov 10.24 discord-ipc-9 -> app/com.discordapp.Discord/discord-ipc-9
...
[📦 com.valvesoftware.Steam ~]$ ls -l /run/user/1000/app/com.discordapp.Discord/
totale 0

P.S. the following settings are set:

carlocastoldi commented 2 years ago

273 could be relevant. A similar work may be needed for Mumble