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.47k stars 287 forks source link

Game frame rate reduces with screen record/share and MangoHud active #1231

Open ChrisLane opened 8 months ago

ChrisLane commented 8 months ago

Describe the bug The frame rate in my games drops dramatically and shows as 0 in MangoHud when I open OBS or screenshare on Discord.

List relevant hardware/software information

To Reproduce Steps to reproduce the behavior:

  1. Launch Deep Rock Galactic with MANGOHUD=1 %command%
  2. Launch OBS or start screensharing in Discord

Expected behavior MangoHud correctly displays stats and does not affect game performance.

Screenshots mangohud-bug-report-demo.mp4

You can see from the video that MangoHud reports FPS as 0, frame time as "inf", CPU value jumps around a lot and the game FPS (reported via steam counter) drops. During the video, I switch to a different workspace to demonstrate that everything returns to normal.

Additional context

netborg-afps commented 8 months ago

Since I'm currently looking into the Vulkan code, I did experiment a bit with OBS, however on x11. My findings were that I get a bit of MangoHud flickering (mostly the first line) when recording via XSHM, but recordings were fine via obs-vkcapture (Game Capture).

Maybe you want to check different recording paths too, and maybe you can narrow down the issue by recording an OpenGL game.

ChrisLane commented 8 months ago

Ah yes, I forgot to mention that I cannot reproduce this recording an OpenGL game.

Additionally, I've found that with just a "Screen Capture (PipeWire)" source active in OBS I can reproduce the bug but with just a capture source from obs-vkcapture, I cannot. This behaviour happens even if the OBS scene containing the pipewire screen capture is not the selected scene.

netborg-afps commented 8 months ago

I'm not aware how these screen captures actually work under the hood, and pipewire screen capture doesn't seem stable to me, I get regular large stutters just recording the desktop with it and it's recording a black screen once the game is launched with fullscreen (also without MangoHud, and also in OpenGL).