flathub / org.freedesktop.Platform.VulkanLayer.gamescope

https://flathub.org/apps/details/org.freedesktop.Platform.VulkanLayer.gamescope
17 stars 6 forks source link

Cannot get flatpak version to work in flatpak steam - Questions #269

Closed Sennendog closed 1 week ago

Sennendog commented 4 weeks ago

Setup:

Trying to get Steam (from flatpak) launch games with gamescope (from freedekstop flatpak), but no success.

Behaviour:

A) In steam adding the launch options "ENABLE_GAMESCOPE_WSI=1 %command%": -> no effect, game is launched without any vulkan layer for gamescope, but game launches and runs fine.

B) In steam adding the launch options "gamescope -- %command%": -> game does NOT launch at all, unfortunately I cannot get any meaningful log from steam. :(

If testing the same with Mangohud (also the freedesktop flatpak), then: approach a) "MANGOHUD=1 %command%" also does NOT load any vulkan layer, game launches but no mangohud approach b) "mangohud %command%" DOES launch mangohud with the game, and everything works fine.

Debugging so far:

flatpak enter (pid of freedesktop process) bash
/usr/lib/extensions/vulkan/gamescope/bin/gamescope

>>> gamescope-brokey: error while loading shared libraries: libXRes.so.1: cannot open shared object file: No such file or directory

Tried many more combinations of launch options with gamescope, e.g. "-e", "--expose-wayland", ... ->no effect, game doesnt launch.

Questions: (1) Is the missing libXRes.so.1 an indication of a problem?

(2) Why is gamescope & mangohud only working when putting them explicitely into the steam launch options? Why is it not working just setting the ENABLE_GAMESCOPE_WSI / MANGOHUD variables for the vulkan layers? Is it because the game is actually runing on opengl (as per mangohud indication)?

(3) What else could I do to close in on the problem?

ColinKinloch commented 4 weeks ago

In order to get mangohud working with gamescope you need to use the argument --mangoapp. and make sure you have the version of org.freedesktop.Platform.VulkanLayer.MangoHud matching the version of gamescope installed. If you're running a game that requires proton then you should set your compatibility tool to the flatpaked version of proton ge: com.valvesoftware.Steam.CompatibilityTool.Proton-GE

ColinKinloch commented 4 weeks ago

So the steam command field should be gamescope --mangoapp -- %command%.

Sennendog commented 4 weeks ago

Thanks, but my problem is not to get gamescope work with mangohud - my whole gamescope (with or without mango) does not work in the first place...

ColinKinloch commented 3 weeks ago

Knowing which game you're trying to run may help. If it's running through proton it won't work unless you're using the flatpaked version of proton. If it's a native Linux build then it usually works.

Sennendog commented 3 weeks ago

I think it is a general issue, not game related. Gamescope doesnt work (in fact prevents launching the game as describe in Issue above) for:

EDIT: Finally also got at least some steam terminal outut: when launching with "gamescope -- %command% this happens:

[gamescope-brokey] [Info] vulkan: selecting physical device 'AMD Radeon 680M (RADV REMBRANDT)': queue family 1 (general queue family 0) [gamescope-brokey] [Info] vulkan: physical device supports DRM format modifiers [gamescope-brokey] [Info] wlserver: [backend/headless/backend.c:67] Creating headless backend [gamescope-brokey] [Error] xdg_backend: Couldn't create Wayland input objects. [gamescope-brokey] [Error] xdg_backend: Failed to initialize input thread

ColinKinloch commented 3 weeks ago

Ah, okay. That odd. So it's making a connection to the compositor and the compositor either isn't reporting a wl_seat or a zwp_relative_pointer_manager. Could you give me the output of wayland-info? Also which version of mutter/gnome-shell you're using?

Sennendog commented 3 weeks ago

GNOME Shell 43.9

wayland-info:

interface: 'wl_compositor', version: 5, name: 1 interface: 'wl_drm', version: 2, name: 2 interface: 'wl_shm', version: 1, name: 3 formats (fourcc): 0x48344258 = 'XB4H' 0x48344241 = 'AB4H' 0x48345258 = 'XR4H' 0x48345241 = 'AR4H' 0x30334258 = 'XB30' 0x30334241 = 'AB30' 0x30335258 = 'XR30' 0x30335241 = 'AR30' 0x36314752 = 'RG16' 0x34324258 = 'XB24' 0x34324241 = 'AB24' 1 = 'XR24' 0 = 'AR24' interface: 'wl_output', version: 3, name: 4 x: 0, y: 0, scale: 1, physical_width: 600 mm, physical_height: 340 mm, make: 'AUS', model: 'VG27AQA1A', subpixel_orientation: unknown, output_transform: normal, mode: width: 2560 px, height: 1440 px, refresh: 165.002 Hz, flags: current interface: 'zxdg_output_manager_v1', version: 3, name: 5 xdg_output_v1 output: 4 name: 'DP-4' description: 'ASUSTek COMPUTER INC 27"' logical_x: 0, logical_y: 0 logical_width: 2560, logical_height: 1440 interface: 'wl_data_device_manager', version: 3, name: 6 interface: 'zwp_primary_selection_device_manager_v1', version: 1, name: 7 interface: 'wl_subcompositor', version: 1, name: 8 interface: 'xdg_wm_base', version: 4, name: 9 interface: 'gtk_shell1', version: 5, name: 10 interface: 'wp_viewporter', version: 1, name: 11 interface: 'zwp_pointer_gestures_v1', version: 3, name: 12 interface: 'zwp_tablet_manager_v2', version: 1, name: 13 interface: 'wl_seat', version: 8, name: 14 name: seat0 capabilities: pointer keyboard keyboard repeat rate: 33 keyboard repeat delay: 500 interface: 'zwp_relative_pointer_manager_v1', version: 1, name: 15 interface: 'zwp_pointer_constraints_v1', version: 1, name: 16 interface: 'zxdg_exporter_v1', version: 1, name: 17 interface: 'zxdg_importer_v1', version: 1, name: 18 interface: 'zwp_linux_dmabuf_v1', version: 4, name: 19 main device: 0xE281 tranche target device: 0xE281 flags: none formats (fourcc) and modifiers (names): 0x34325241 = 'AR24'; 0x00ffffffffffffff = INVALID 0x34324241 = 'AB24'; 0x00ffffffffffffff = INVALID 0x34325258 = 'XR24'; 0x00ffffffffffffff = INVALID 0x34324258 = 'XB24'; 0x00ffffffffffffff = INVALID 0x30335241 = 'AR30'; 0x00ffffffffffffff = INVALID 0x30334241 = 'AB30'; 0x00ffffffffffffff = INVALID 0x30335258 = 'XR30'; 0x00ffffffffffffff = INVALID 0x30334258 = 'XB30'; 0x00ffffffffffffff = INVALID 0x36314752 = 'RG16'; 0x00ffffffffffffff = INVALID 0x48344241 = 'AB4H'; 0x00ffffffffffffff = INVALID 0x48344258 = 'XB4H'; 0x00ffffffffffffff = INVALID interface: 'wp_single_pixel_buffer_manager_v1', version: 1, name: 20 interface: 'zwp_keyboard_shortcuts_inhibit_manager_v1', version: 1, name: 21 interface: 'zwp_text_input_manager_v3', version: 1, name: 22 interface: 'wp_presentation', version: 1, name: 23 presentation clock id: 1 (CLOCK_MONOTONIC) interface: 'xdg_activation_v1', version: 1, name: 24

Sennendog commented 3 weeks ago

I think it is an issue in (upstream) gamescope :(, and has nothing to do with this flatpak version.

Reason:

Faugus commented 1 week ago

I don't know if the problem is the same, but I'm trying to get it to work with umu-launcher, but to no avail. If I run gamescope -W 1920 -H 1080 -- vkcube inside the Flatpak, it works. But GAMEID=0 gamescope -W 1920 -H 1080 -- /app/bin/umu-run "some/windows/exe" does not. Only a blank window appears on the entire screen and I can hear the sound of the game in the background. umu-flatpak.log

ColinKinloch commented 1 week ago

No, that looks unrelated: Failed to bind socket @/tmp/.X11-unix/X0: Address already in use

ColinKinloch commented 1 week ago

I'll close this since you think it's not a flatpak issue. Hopefully I'll be able to update this repo to a newer gamescope version at some point.