diff --git a/crates/punktfunk-host/src/capture/linux/mod.rs b/crates/punktfunk-host/src/capture/linux/mod.rs index a8dd199..1ad1868 100644 --- a/crates/punktfunk-host/src/capture/linux/mod.rs +++ b/crates/punktfunk-host/src/capture/linux/mod.rs @@ -1278,9 +1278,13 @@ mod pipewire { } else { None }; - // PUNKTFUNK_FORCE_SHM=1 forces the race-free download path (SHM, no dmabuf) — required on - // Mutter+NVIDIA where dmabuf capture has no working sync and shows stale frames. KWin/ - // gamescope don't need it (they blit into the buffer, so no read-before-render race). + // PUNKTFUNK_FORCE_SHM=1 forces the race-free download path (SHM, no dmabuf) — a manual + // escape hatch, mainly for Mutter+NVIDIA: that combo has no implicit dmabuf fence, so + // zero-copy capture can in principle race the compositor's render and show stale frames. + // Zero-copy is the Mutter+NVIDIA default (no unconditional override) since live retesting + // found no visible staleness; set this if you do see flashing/stale content on such a + // host. KWin/gamescope don't need it (they blit into the buffer, so no read-before-render + // race). let force_shm = std::env::var("PUNKTFUNK_FORCE_SHM").as_deref() == Ok("1"); // VAAPI zero-copy passthrough: zero-copy on, no EGL→CUDA importer (any non-NVIDIA host), and // the encoder backend is VAAPI → hand the raw dmabuf to the encoder (it imports + GPU-CSCs). diff --git a/crates/punktfunk-host/src/vdisplay.rs b/crates/punktfunk-host/src/vdisplay.rs index 0881368..784975d 100644 --- a/crates/punktfunk-host/src/vdisplay.rs +++ b/crates/punktfunk-host/src/vdisplay.rs @@ -619,11 +619,6 @@ pub fn apply_session_env(active: &ActiveSession) { if let Some(d) = &e.xdg_current_desktop { std::env::set_var("XDG_CURRENT_DESKTOP", d); } - // Mutter on NVIDIA has no working dmabuf capture sync — force SHM there; the KWin/gamescope - // tiled/LINEAR paths keep zero-copy. - if active.kind == ActiveKind::DesktopGnome { - std::env::set_var("PUNKTFUNK_FORCE_SHM", "1"); - } // Topology (Stage 2): the per-compositor backends (KWin/Mutter) now read // [`effective_topology`] directly at create time — the console policy, else the legacy // `PUNKTFUNK_{KWIN,MUTTER}_VIRTUAL_PRIMARY` env, else the Auto default (exclusive on the