flightlessmango / MangoHud

A Vulkan and OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load and more. Discord: https://discordapp.com/invite/Gj5YmBb
MIT License
6.33k stars 278 forks source link

MangoHud with `vsync=1` isn't working in gamescope #1215

Closed hashworks closed 7 months ago

hashworks commented 7 months ago

Describe the bug Starting mangohud or mangoapp with vsync=1 in gamescope kills the application, while it works fine without gamescope.

List relevant hardware/software information

To Reproduce Steps to reproduce the behavior:

  1. Set vsync=1 in MangoHud.conf
  2. Run vkcube in gamescope and wrap with mangohud or use mangoapp
  3. See failure

Expected behavior mangohud with vsync=1 works with gamescope just as it works without it.

Screenshots Running mangohud vkcube works just fine: image

Running gamescope -W 2560 -H 1440 -w 2560 -h 1440 -r 165 -f -- vkcube works as well (log output).

However, injecting mangohud instantly kills vkcube in gamescope (log output:

$ mangohud gamescope -W 2560 -H 1440 -w 2560 -h 1440 -r 165 -f -- vkcube
...
gamescope: children shut down!
xwm: error 3: BadWindow (invalid Window parameter) request 15 minor 0 serial 393
(EE) failed to read Wayland events: Broken pipe

Using mangoapp starts vkcube for a second, but then the screen just turns black and nothing happens anymore (log output:

$ gamescope -W 2560 -H 1440 -w 2560 -h 1440 -r 165 -f -- sh -c 'vkcube & mangoapp'
...
wlserver: [types/wlr_compositor.c:692] New wlr_surface 0x55ddc6c438b0 (res 0x55ddc6bd7cc0)
xwm: Rejecting WM_CHANGE_STATE to ICONIC for window 0x600007

When I remove vsync=1 from my MangoHud.conf it works fine in gamescope.

Additional context I've also tested the latest mangohud master commit (2fa6ff7cb341f318661fc382440115a4476eed96), same result.

flightlessmango commented 7 months ago

It's not supported to use mangohud with gamescope You instead want to use mangoapp However mangoapp is not able to change present mode (vsync) for gamescope

hashworks commented 7 months ago

It's not supported to use mangohud with gamescope I see!

I just noticed that mangoapp in 0.7.0 crashes even without vsync=1, so I'll close this issue since the mangohud usage is unsupported anyway and the mangoapp crash seems to have a different cause. Thanks!

leucome commented 7 months ago

It's not supported to use mangohud with gamescope You instead want to use mangoapp However mangoapp is not able to change present mode (vsync) for gamescope

Might be a good idea to include a description of the proper usage of mangoapp in the readme ... Seriously I never managed to get anything to work with mangoapp. whatever the kind of launch argument I could try. First thing I do not even know if I am supposed to use it on the game or steam or on the Gamescope. Like I there is not even a --help option on mangoapp.

I tried this
gamescope -e -H 2160 -f -F fsr -- mangoapp steam

Then this mangoapp gamescope -e -H 2160 -f -F fsr -- steam

Then this gamescope -e -H 2160 -f -F fsr -- steam then launch a game with mangoapp %command%

I also tried without -e / -F fsr or with vkcube with Lutris and many games. This app literally never worked, blank seen or crash every time. I got that same result on multiple computers with different AMD GPU (5700xt 6700XT 7900XT). Also with so little information provided about its usage or requirement, it was a waste of time to try to diagnose what is going on. I just concluded that it is an experimental software meant to run on some specific uncommon hardware. Not only that trying to find more information just end up with freaking result about "Modern Intranet, Communications & Engagement Platform" or even mango the manga hosting.

On the other side using mangohud %command% to launch a game when Steam is already running inside Gamescope was working perfectly until it stopped working lately.

Anyway now I know it was vsync=1 that was causing this. So I can finally go back to running steam big picture in Gamescope then launch game with magohud %command% like I was doing before.

hashworks commented 7 months ago

Might be a good idea to include a description of the proper usage of mangoapp in the readme

It's in the manual (man mangoapp). In there it's recommended to create a script file that runs the game in the background and mangohud in the foreground:

#!/bin/sh

vkcube&
mangoapp

Then you simply run gamescope script.sh.

However, you can also just call gamescope -- sh -c 'vkcube & mangoapp'.