feat(host/vdisplay): per-connect active-session backend selection
ci / web (push) Successful in 26s
ci / docs-site (push) Successful in 29s
apple / swift (push) Successful in 1m16s
ci / bench (push) Successful in 1m34s
deb / build-publish (push) Successful in 4m32s
ci / rust (push) Successful in 7m2s
docker / build-push (., web/Dockerfile, punktfunk-web) (push) Successful in 5s
docker / build-push (--build-arg FEDORA_VERSION=44, ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora44-rpm) (push) Successful in 7s
docker / build-push (ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora-rpm) (push) Successful in 5s
docker / build-push (ci, ci/rust-ci.Dockerfile, punktfunk-rust-ci) (push) Successful in 5s
docker / build-push (docs-site, docs-site/Dockerfile, punktfunk-docs) (push) Successful in 3s
rpm / build-publish (bazzite, punktfunk-fedora-rpm) (push) Successful in 5m23s
rpm / build-publish (fedora-44, punktfunk-fedora44-rpm) (push) Successful in 5m26s
docker / deploy-docs (push) Successful in 18s
ci / web (push) Successful in 26s
ci / docs-site (push) Successful in 29s
apple / swift (push) Successful in 1m16s
ci / bench (push) Successful in 1m34s
deb / build-publish (push) Successful in 4m32s
ci / rust (push) Successful in 7m2s
docker / build-push (., web/Dockerfile, punktfunk-web) (push) Successful in 5s
docker / build-push (--build-arg FEDORA_VERSION=44, ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora44-rpm) (push) Successful in 7s
docker / build-push (ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora-rpm) (push) Successful in 5s
docker / build-push (ci, ci/rust-ci.Dockerfile, punktfunk-rust-ci) (push) Successful in 5s
docker / build-push (docs-site, docs-site/Dockerfile, punktfunk-docs) (push) Successful in 3s
rpm / build-publish (bazzite, punktfunk-fedora-rpm) (push) Successful in 5m23s
rpm / build-publish (fedora-44, punktfunk-fedora44-rpm) (push) Successful in 5m26s
docker / deploy-docs (push) Successful in 18s
Bazzite/SteamOS boxes flip between Steam Gaming Mode (gamescope) and a KDE/GNOME desktop. The host statically read PUNKTFUNK_COMPOSITOR / XDG_CURRENT_DESKTOP once, so switching to Desktop Mode failed the stream, and the gamescope managed-session path stopped+relaunched the autologin per connect — leaking GPU context on F44 (reconnect → black screen). Replace the static read with a runtime probe of the live session and route each connect to the right backend, churn-free: - vdisplay::detect_active_session() probes /proc for the running compositor of our uid (gamescope|kwin_wayland|gnome-shell|sway, desktop outranks a leftover gamescope) + scans the runtime dir for the live wayland-* socket. Returns an ActiveKind + the SessionEnv (WAYLAND_DISPLAY/XDG_RUNTIME_DIR/DBUS/ XDG_CURRENT_DESKTOP) that targets it. - apply_session_env() writes that into the process env per connect (host serves one session at a time), so every backend (capture + input) opens against the live session; apply_input_env() points input at the matching backend and selects gamescope ATTACH (no managed restart) unless PUNKTFUNK_GAMESCOPE_MANAGED. - resolve_compositor() (native path) auto-detects + applies; explicit PUNKTFUNK_COMPOSITOR still wins (legacy/CI/forcing). detect() is now active-aware for the GameStream/mgmt callers too. - Bazzite host.env drops the static gamescope force; documents auto-detection + the optional overrides. Result: Desktop Mode → KWin/Mutter virtual output at the client's mode (churn-free, the reliable path); Gaming Mode → attach to the running gamescope (no SIGSEGV/GPU leak on reconnect). Compiles + clippy-clean; 78 host tests pass. Live validation on the Bazzite box pending (box offline). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+12
-13
@@ -1,26 +1,25 @@
|
||||
# punktfunk host config for Bazzite (~/.config/punktfunk/host.env).
|
||||
#
|
||||
# Bazzite ships gamescope, PipeWire and the NVIDIA driver, so the default backend here is
|
||||
# gamescope: the host spawns a headless gamescope per session at the client's exact mode and
|
||||
# captures its PipeWire node — no separate desktop session to bring up. Set PUNKTFUNK_GAMESCOPE_APP
|
||||
# to what you want to run inside it (e.g. `steam -gamepadui` for a SteamOS-like couch session).
|
||||
# The compositor + input backend are AUTO-DETECTED per connect from the ACTIVE session: the host
|
||||
# follows the box as you flip between Steam Gaming Mode (gamescope — attached to the running
|
||||
# session, no churn) and a KDE/GNOME Desktop (KWin/Mutter virtual output at the client's mode).
|
||||
# So nothing here forces a backend — only the trustworthy anchors stay.
|
||||
|
||||
XDG_RUNTIME_DIR=/run/user/1000
|
||||
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
|
||||
|
||||
# gamescope backend: spawned per session, no compositor login required.
|
||||
PUNKTFUNK_COMPOSITOR=gamescope
|
||||
PUNKTFUNK_VIDEO_SOURCE=virtual
|
||||
PUNKTFUNK_GAMESCOPE_APP=steam -gamepadui
|
||||
|
||||
# gamescope hosts its own EIS input socket — input lands in the nested session.
|
||||
PUNKTFUNK_INPUT_BACKEND=gamescope
|
||||
|
||||
# GPU zero-copy capture (dmabuf -> CUDA -> NVENC). Auto-falls back to CPU if unavailable.
|
||||
PUNKTFUNK_ZEROCOPY=1
|
||||
|
||||
#RUST_LOG=info
|
||||
|
||||
# To drive the full Plasma/GNOME desktop instead of a nested gamescope, switch to:
|
||||
# PUNKTFUNK_COMPOSITOR=kwin (and run inside a KDE session — WAYLAND_DISPLAY/XDG_CURRENT_DESKTOP set)
|
||||
# PUNKTFUNK_INPUT_BACKEND=libei
|
||||
# --- Optional overrides (default is active-session auto-detection) ---
|
||||
# Force a specific backend for testing (skips auto-detect + env retargeting):
|
||||
# PUNKTFUNK_COMPOSITOR=kwin|mutter|wlroots|gamescope
|
||||
# PUNKTFUNK_INPUT_BACKEND=libei|wlr|gamescope|uinput
|
||||
# Opt into the host-MANAGED gamescope session (spawns gamescope-session-plus at the client mode,
|
||||
# stops the autologin gaming session for the duration) instead of attaching to the running one:
|
||||
# PUNKTFUNK_GAMESCOPE_MANAGED=1
|
||||
# PUNKTFUNK_GAMESCOPE_APP=steam -gamepadui
|
||||
|
||||
Reference in New Issue
Block a user