flathub / org.freedesktop.Platform.VulkanLayer.MangoHud

https://flathub.org/apps/details/org.freedesktop.Platform.VulkanLayer.MangoHud
18 stars 8 forks source link

Gamemode integration broken - requires usage of gamemode portal #6

Open junglerobba opened 2 years ago

junglerobba commented 2 years ago

Since d6aa13bebec5db68533af5aae262f2c560910571784d324e8b25d56c2a4d82bb (2f45a317f2a6573b7f44635ac8c808f1f467f35b) Steam fails to launch games with Proton when Mangohud is enabled, they just get stuck on the 'Preparing to launch' window. Downgrading to 7325dcb0102b06e1706dd99a7e465be0b4d6846a04b5b6bb9003a480fa8e88ae (104142dac236e427d042f3726221842c10a81f02) makes them work again. The log doesn't seem to contain anything useful besides the glxinfo: not found mentioned in #2

GameAction [AppID 230410, ActionID 3] : LaunchApp changed task to ProcessingInstallScript with ""
esync: up and running.
wine: RLIMIT_NICE is <= 20, unable to use setpriority safely
WARNING: radv is not a conformant Vulkan implementation, testing use only.
[2021-12-20 14:36:39.380] [MANGOHUD] [info] [config.cpp:114] skipping config: '/home/j/.var/app/com.valvesoftware.Steam/config/MangoHud/wine-explorer.conf' [ not found ]
[2021-12-20 14:36:39.380] [MANGOHUD] [info] [config.cpp:114] skipping config: '/home/j/Games/Steam/steamapps/common/Proton - Experimental/files/bin/MangoHud.conf' [ not found ]
[2021-12-20 14:36:39.380] [MANGOHUD] [info] [config.cpp:114] skipping config: '/home/j/.var/app/com.valvesoftware.Steam/config/MangoHud/wine64-preloader.conf' [ not found ]
[2021-12-20 14:36:39.380] [MANGOHUD] [info] [config.cpp:119] parsing config: '/home/j/.var/app/com.valvesoftware.Steam/config/MangoHud/MangoHud.conf'
[2021-12-20 14:36:39.382] [MANGOHUD] [error] [dbus_helpers.h:344] [send_with_reply_and_block]: org.freedesktop.DBus.Error.ServiceUnknown
sh: 1: glxinfo: not found
gasinvein commented 2 years ago

Looks like MangoHud tries to talk to some DBus name which is filtered. Please run Steam flatpak with flatpak run --log-session-bus --log-system-bus com.valvesoftware.Steam and paste its console output here (when launching a game, right before the MangoHud error is logged). Also please provide your MangoHud config (MangoHud works for me, so you've probably enabled some feature that I didn't).

junglerobba commented 2 years ago
Steam output ``` GameAction [AppID 230410, ActionID 1] : LaunchApp changed task to ProcessingInstallScript with "" C1: -> org.freedesktop.DBus call org.freedesktop.DBus.Hello at /org/freedesktop/DBus C2: -> org.freedesktop.DBus fake AddMatch for org.freedesktop.Notifications C3: -> org.freedesktop.DBus fake GetNameOwner for org.freedesktop.Notifications C4: -> org.freedesktop.DBus fake wildcarded AddMatch for org.freedesktop.portal C5: -> org.freedesktop.DBus fake wildcarded AddMatch for org.mpris.MediaPlayer2.com.valvesoftware.Steam C6: -> org.freedesktop.DBus fake AddMatch for org.freedesktop.PowerManagement C7: -> org.freedesktop.DBus fake GetNameOwner for org.freedesktop.PowerManagement C8: -> org.freedesktop.DBus fake AddMatch for org.kde.StatusNotifierWatcher C9: -> org.freedesktop.DBus fake GetNameOwner for org.kde.StatusNotifierWatcher C10: -> org.freedesktop.DBus fake AddMatch for org.freedesktop.ScreenSaver C11: -> org.freedesktop.DBus fake GetNameOwner for org.freedesktop.ScreenSaver C12: -> org.freedesktop.DBus fake AddMatch for org.gnome.SettingsDaemon.MediaKeys C13: -> org.freedesktop.DBus fake GetNameOwner for org.gnome.SettingsDaemon.MediaKeys C14: -> org.freedesktop.DBus fake wildcarded AddMatch for com.valvesoftware.Steam C15: -> org.freedesktop.DBus fake ListNames B-1: <- org.freedesktop.DBus return from C1 B-1: <- org.freedesktop.DBus signal org.freedesktop.DBus.NameAcquired at /org/freedesktop/DBus B-1: <- org.freedesktop.DBus return from C2 *SKIPPED* B-1: <- org.freedesktop.DBus return from C3 *SKIPPED* B-1: <- org.freedesktop.DBus return from C4 *SKIPPED* B-1: <- org.freedesktop.DBus return from C5 *SKIPPED* B-1: <- org.freedesktop.DBus return from C6 *SKIPPED* B-1: <- org.freedesktop.DBus return error org.freedesktop.DBus.Error.NameHasNoOwner from C7 *SKIPPED* B-1: <- org.freedesktop.DBus return from C8 *SKIPPED* B-1: <- org.freedesktop.DBus return from C9 *SKIPPED* B-1: <- org.freedesktop.DBus return from C10 *SKIPPED* B-1: <- org.freedesktop.DBus return from C11 *SKIPPED* B-1: <- org.freedesktop.DBus return from C12 *SKIPPED* B-1: <- org.freedesktop.DBus return from C13 *SKIPPED* B-1: <- org.freedesktop.DBus return from C14 *SKIPPED* B-1: <- org.freedesktop.DBus return from C15 C16: -> org.freedesktop.DBus fake GetNameOwner for org.freedesktop.DBus C17: -> org.freedesktop.DBus fake GetNameOwner for org.freedesktop.Notifications C18: -> org.freedesktop.DBus fake GetNameOwner for org.freedesktop.ScreenSaver C19: -> org.freedesktop.DBus fake GetNameOwner for org.freedesktop.portal.Desktop C20: -> org.freedesktop.DBus fake GetNameOwner for org.freedesktop.portal.Documents C21: -> org.freedesktop.DBus fake GetNameOwner for org.freedesktop.portal.Flatpak C22: -> org.freedesktop.DBus fake GetNameOwner for org.freedesktop.portal.IBus C23: -> org.freedesktop.DBus fake GetNameOwner for org.gnome.SettingsDaemon.MediaKeys C24: -> org.freedesktop.DBus fake GetNameOwner for org.kde.StatusNotifierWatcher *SKIPPED* B-1: <- org.freedesktop.DBus return from C16 *SKIPPED* B-1: <- org.freedesktop.DBus return from C17 *SKIPPED* B-1: <- org.freedesktop.DBus return from C18 *SKIPPED* B-1: <- org.freedesktop.DBus return from C19 *SKIPPED* B-1: <- org.freedesktop.DBus return from C20 *SKIPPED* B-1: <- org.freedesktop.DBus return from C21 *SKIPPED* B-1: <- org.freedesktop.DBus return from C22 *SKIPPED* B-1: <- org.freedesktop.DBus return from C23 *SKIPPED* B-1: <- org.freedesktop.DBus return from C24 *SKIPPED* C25: -> org.freedesktop.DBus call org.freedesktop.DBus.AddMatch at /org/freedesktop/DBus B-1: <- org.freedesktop.DBus return from C25 C26: -> org.freedesktop.portal.Flatpak call org.freedesktop.DBus.Properties.Get at /org/freedesktop/portal/Flatpak B262: <- :1.110 return from C26 C27: -> org.freedesktop.portal.Flatpak call org.freedesktop.DBus.Properties.Get at /org/freedesktop/portal/Flatpak B263: <- :1.110 return from C27 C28: -> org.freedesktop.DBus call org.freedesktop.DBus.AddMatch at /org/freedesktop/DBus B-1: <- org.freedesktop.DBus return from C28 C29: -> org.freedesktop.portal.Flatpak call org.freedesktop.portal.Flatpak.Spawn at /org/freedesktop/portal/Flatpak B265: <- :1.110 return from C29 B-1: <- org.freedesktop.DBus signal org.freedesktop.DBus.NameOwnerChanged at /org/freedesktop/DBus B-1: <- org.freedesktop.DBus signal org.freedesktop.DBus.NameOwnerChanged at /org/freedesktop/DBus B-1: <- org.freedesktop.DBus signal org.freedesktop.DBus.NameOwnerChanged at /org/freedesktop/DBus B-1: <- org.freedesktop.DBus signal org.freedesktop.DBus.NameOwnerChanged at /org/freedesktop/DBus B-1: <- org.freedesktop.DBus signal org.freedesktop.DBus.NameOwnerChanged at /org/freedesktop/DBus B-1: <- org.freedesktop.DBus signal org.freedesktop.DBus.NameOwnerChanged at /org/freedesktop/DBus esync: up and running. wine: RLIMIT_NICE is <= 20, unable to use setpriority safely B-1: <- org.freedesktop.DBus signal org.freedesktop.DBus.NameOwnerChanged at /org/freedesktop/DBus WARNING: radv is not a conformant Vulkan implementation, testing use only. [2021-12-20 15:00:25.654] [MANGOHUD] [info] [config.cpp:114] skipping config: '/home/j/.var/app/com.valvesoftware.Steam/config/MangoHud/wine-explorer.conf' [ not found ] [2021-12-20 15:00:25.654] [MANGOHUD] [info] [config.cpp:114] skipping config: '/home/j/Games/Steam/steamapps/common/Proton - Experimental/files/bin/MangoHud.conf' [ not found ] [2021-12-20 15:00:25.654] [MANGOHUD] [info] [config.cpp:114] skipping config: '/home/j/.var/app/com.valvesoftware.Steam/config/MangoHud/wine64-preloader.conf' [ not found ] [2021-12-20 15:00:25.654] [MANGOHUD] [info] [config.cpp:119] parsing config: '/home/j/.var/app/com.valvesoftware.Steam/config/MangoHud/MangoHud.conf' B-1: <- org.freedesktop.DBus signal org.freedesktop.DBus.NameOwnerChanged at /org/freedesktop/DBus [2021-12-20 15:00:25.657] [MANGOHUD] [error] [dbus_helpers.h:344] [send_with_reply_and_block]: org.freedesktop.DBus.Error.ServiceUnknown sh: 1: glxinfo: not found ```
MangoHud config ``` ### Visual full media_player=0 version=0 time=0 fps_limit=0,144,120,60 no_display ### LOG output_folder=/tmp ```

Removing the full entry from the MangoHud config makes it work, which of course doesn't narrow it down at all. I'll try testing all the individual settings to see which one breaks it.

edit: Turns out it's the gamemode entry that breaks it.

gasinvein commented 2 years ago

I don't see the relevant dbus call, probably due to Proton running in pressure-vessel sub-sandbox. Can you try with Proton community build from flathub? Also, as a random guess, maybe gamemode=0 in MangoHud config would help? Yep, guessed it.

junglerobba commented 2 years ago

I'm guessing it's this one?

C28: -> com.feralinteractive.GameMode call com.feralinteractive.GameMode.QueryStatus at /com/feralinteractive/GameMode
*HIDDEN* (ping)
B-1: <- org.freedesktop.DBus return from C28
*REWRITTEN*
[2021-12-20 15:18:32.749] [MANGOHUD] [error] [dbus_helpers.h:344] [send_with_reply_and_block]: org.freedesktop.DBus.Error.ServiceUnknown

Also, despite that error the game launches with the Community build.

gasinvein commented 2 years ago

Yes, it's this. Looks like MagoHud calls GameMode directly. This is not going to work in flatpak sandbox due to PID namespaces: games' PID as seen by the game is different from the one as seen by gamemoded. If MangoHud wants gamemode integration to work in flatpak sandbox, they'll need to use the gamemode portal. Sadly this issue isn't fixable without changes to MangoHud itself.

junglerobba commented 2 years ago

I don't even use gamemode, so this fixes my issue already. Judging by the amount of time since the update it doesn't seem many others use either the full or gamemode configs for mangohud, so I'm not sure how important of a change this really is. Should I edit the issue name and leave it open or just close this?

gasinvein commented 2 years ago

Yeah, let's keep it open, it's still an issue, even if its impact isn't too big. And thanks for reporting it.

junglerobba commented 2 years ago

Thank you for your help!

junglerobba commented 2 years ago

For clarification, the gamemode portal would always work, not just when running the steam flatpak? So would it be a viable change for mangohud to just always use the portal?

gasinvein commented 2 years ago

Honestly I'm not sure, better ask xdg-desktop-portal devs to be certain. I'm guessing it should work outside flatpak as long as xdg-desktop-portal is installed in the host OS. Update: no, it won't work for processes outside the sandbox. Anyway, since the gamemode portal dbus API is a 1-to-1 mapping to gamemodes' native dbus API, it shouldn't be too difficult to add a flatpak-specific case.