From c1614e4f30fa715e3a7c818d152ac7e43afedbbd Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 4 Dec 2025 20:06:47 +0100 Subject: nvfbc: mitigate x11 display leak on monitor off When the monitor is turned off gsr will attempt to recreate the nvfbc session once a second. If that fails (because the monitor is still turned off) then nvfbc will leak an x11 display. This seems to be a bug in the nvidia driver. Mitigate this by only attempting to recreate the nvfbc session if the capture target monitor can be found (predicting if nvfbc recreate will fail). Thanks to Lim Ding Wen for finding the issue and suggesting the mitigation. --- TODO | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'TODO') diff --git a/TODO b/TODO index 9a664f5..498aa02 100644 --- a/TODO +++ b/TODO @@ -356,3 +356,8 @@ Support youtube sso. Remove -fm content (support it but remove it from documentation and output deprecation notice when its used) and use it when using -fm vbr (which is the default option). But first -fm content needs to be support on wayland as well, by checking if there is a difference between frames (checksum the frame content). -fm content also needs to have a minimum fps to prevent live stream from timing out when nothing changes on the screen. + +There is a leak in nvfbc. When a monitor is turned off and then on there will be an x11 display leak inside nvfbc. This seems to be a bug in nvfbc. + Right now a mitigation has been added to not try to recreate the nvfbc session if the capture target (monitor) isn't connected (predict if nvfbc session create will fail). + One possible reason this happens is because bExternallyManagedContext is set to true. + This also means that nvfbc leaks connection when destroying nvfbc, even if the monitor is connected (this is not an issue right now because exit is done, but if gsr was turned into a library it would be). -- cgit v1.2.3