diff --git a/crates/pf-capture/src/linux/mod.rs b/crates/pf-capture/src/linux/mod.rs index 04d8a215..40ce1862 100644 --- a/crates/pf-capture/src/linux/mod.rs +++ b/crates/pf-capture/src/linux/mod.rs @@ -1362,8 +1362,19 @@ mod pipewire { // that SIGSEGVs inside the PipeWire `.process` callback (a segfault `catch_unwind` cannot // catch). Every offset below is validated against `region_size` with checked arithmetic, // mirroring the fd-length guard the main frame path already applies to xdg-desktop-portal-wlr. + // TEMP M2b on-glass probe (DROP BEFORE MERGE): the journal must show whether the + // compositor delivers SPA_META_Cursor at all, what it reports, and whether a bitmap is + // ever accepted — the cursor pipeline is otherwise blind end-to-end. Statics are fine for + // the single bring-up stream; every log is rate-limited or edge-triggered. + use std::sync::atomic::{AtomicU64, Ordering as ProbeOrd}; + static PROBE_NULL: AtomicU64 = AtomicU64::new(0); + static PROBE_META: AtomicU64 = AtomicU64::new(0); let meta = unsafe { spa::sys::spa_buffer_find_meta(spa_buf, spa::sys::SPA_META_Cursor) }; if meta.is_null() { + let n = PROBE_NULL.fetch_add(1, ProbeOrd::Relaxed) + 1; + if n.is_power_of_two() { + tracing::info!(n, "cursor meta probe: buffer carries NO SPA_META_Cursor"); + } return; } // SAFETY: `meta` is non-null and points into the held buffer's metadata array. @@ -1383,6 +1394,21 @@ mod pipewire { (*cur).bitmap_offset, ) }; + // TEMP M2b probe (see above): what the meta reports, every 64th + the first few. + let n = PROBE_META.fetch_add(1, ProbeOrd::Relaxed) + 1; + if n <= 4 || n % 64 == 1 { + tracing::info!( + n, + id, + pos_x, + pos_y, + hot_x, + hot_y, + bmp_off, + region_size, + "cursor meta probe: SPA_META_Cursor arrived" + ); + } if id == 0 { // Compositor reports no visible pointer (e.g. a game grabbed/hid it). cursor.visible = false; @@ -1461,6 +1487,14 @@ mod pipewire { cursor.bw = bw; cursor.bh = bh; cursor.serial = cursor.serial.wrapping_add(1); + // TEMP M2b probe (see above): bitmap accepted — once per shape change by construction. + tracing::info!( + bw, + bh, + vfmt, + serial = cursor.serial, + "cursor meta probe: bitmap cached" + ); } /// Destination channel byte offsets (R,G,B) and bytes-per-pixel for a packed-RGB `PixelFormat`,