perf(portal): achieve 58-60fps PipeWire screen capture

- Force PipeWire quantum=512 via NODE_FORCE_QUANTUM (48000/512=93Hz scheduling)
- Switch to libx264 ultrafast/zerolatency with 6 threads
- Use two-phase poll_and_encode: blocking recv_timeout for first frame,
  non-blocking try_recv drain for subsequent frames
- Remove fps_limit from portal path (PW already rate-limits via quantum/KWin;
  fps_limit's min_interval was silently dropping ~10% of valid frames)
- Remove diagnostic instrumentation (TIMING/PIPEWIRE logs, timing fields,
  pw_stats counters)
- Add lightweight production stats: per-10s fps log + shutdown summary
- Prefer libx264 over libopenh264 (better quality at same speed)
This commit is contained in:
dailz
2026-05-30 08:44:15 +08:00
parent a83d146ed3
commit 74f4dc826d
6 changed files with 88 additions and 187 deletions

View File

@@ -22,6 +22,6 @@ libc = "0.2"
ashpd = { version = "0.13", features = ["tokio", "screencast"] }
zbus = { version = "5", default-features = false, features = ["tokio"] }
tokio = { version = "1", features = ["rt"] }
pipewire = "0.9"
pipewire = { version = "0.9", features = ["v0_3_45"] }
libspa = "0.9"
crossbeam-channel = "0.5"