forked from unom/punktfunk
PUNKTFUNK_MAX_FPS caps how fast the compositor lets the game render. It deliberately does NOT touch the session: the client still negotiates and receives its full rate, because the encode loop re-encodes the held frame whenever the compositor produced no new one, and a repeat of an unchanged picture is an almost-empty P-frame. So a 60-capped game on a 120 Hz session still puts 120 frames a second on the wire — and the GPU time the game gives up goes to capture and encode instead, which is the point (on a laptop or a handheld, it goes to heat and battery too). Capping the stream would be a different and mostly unwanted feature: it hands the client fewer frames than it asked for and saves the game's GPU nothing. gamescope is the compositor that has the lever, so it is the one that gets it: the rate becomes --nested-refresh, which is what gamescope clamps the game to. All three sessions we own take it — the bare spawn's -r, the managed gamescope-session-plus wrapper's PF_HZ, and the SteamOS PATH shim's. In the managed path the limit lands on PF_HZ alone and NOT on CUSTOM_REFRESH_RATES, so the mode the session advertises stays the client's — that is what makes games see the real refresh rather than the box's EDID. Two scoping notes. Under gamescope the cap is the nested output's rate, so everything it composites moves at it, not the game alone; there is only the one output. And the attach path (PUNKTFUNK_GAMESCOPE_NODE) mirrors a gamescope we do not own, so it has no lever to pull and is untouched. Closes #13 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
64 lines
3.4 KiB
Bash
64 lines
3.4 KiB
Bash
# punktfunk host configuration (Windows) — read by the `PunktfunkHost` service.
|
|
#
|
|
# `punktfunk-host service install` writes a default copy of this to
|
|
# %ProgramData%\punktfunk\host.env
|
|
# Edit that file (not this one) and restart the service to apply:
|
|
# punktfunk-host service stop
|
|
# punktfunk-host service start
|
|
#
|
|
# Format: KEY=VALUE per line; '#' starts a comment. The service loads these into its environment
|
|
# and passes PUNKTFUNK_* and RUST_LOG through to the host it launches into the active session.
|
|
|
|
# Hardware encode backend. `auto` (default) detects the GPU vendor: NVIDIA->nvenc (direct SDK),
|
|
# AMD->amf, Intel->qsv (both libavcodec). Force one with: nvenc | amf | qsv | sw (software H.264).
|
|
# nvenc needs the `--features nvenc` build; amf/qsv need the `--features amf-qsv` build (FFmpeg DLLs
|
|
# ship in the installer). The published installer is built with all three.
|
|
PUNKTFUNK_ENCODER=auto
|
|
|
|
# Video source: `virtual` creates a per-client virtual display at the client's exact resolution +
|
|
# refresh — the flagship mode. Requires the bundled pf-vdisplay indirect display driver installed.
|
|
PUNKTFUNK_VIDEO_SOURCE=virtual
|
|
|
|
# Virtual-display backend: the all-Rust pf-vdisplay IddCx driver the installer bundles is the only
|
|
# backend now (the legacy SudoVDA backend was removed). This is informational; leave it as `pf`.
|
|
PUNKTFUNK_VDISPLAY=pf
|
|
|
|
# Capture is IDD-push: straight from the pf-vdisplay driver's shared ring — zero-copy, includes the
|
|
# secure desktop. It is the SOLE capture path (DDA/WGC were removed; the former PUNKTFUNK_IDD_PUSH
|
|
# knob is gone — a stale setting is ignored).
|
|
|
|
# Capture the secure desktop (UAC / lock / login) so the stream survives those transitions.
|
|
PUNKTFUNK_SECURE_DDA=1
|
|
|
|
# The name this host shows up under in Moonlight and the Punktfunk clients. Defaults to the
|
|
# machine's computer name; set it to give the box a friendly name without renaming Windows.
|
|
#PUNKTFUNK_HOST_NAME=Living Room
|
|
|
|
# Log level (info | debug | trace). Logs land in %ProgramData%\punktfunk\logs\.
|
|
RUST_LOG=info
|
|
|
|
# The host subcommand the service launches. The native punktfunk/1 host is ALWAYS on; `--gamestream`
|
|
# adds the GameStream/Moonlight-compat planes, which pair over plain HTTP and reuse legacy GCM
|
|
# nonces (security-review #5/#9) — so `serve` alone is the SECURE native-only host.
|
|
#
|
|
# A Windows install writes this line explicitly from the installer's "Enable GameStream (Moonlight)
|
|
# compatibility" task, which is OPT-IN (unchecked) — so a default install lands `serve`. Only if
|
|
# this line is absent altogether does the service fall back to its built-in `serve --gamestream`.
|
|
# Change it later with `punktfunk-host service install --gamestream=on|off` + a service restart; a
|
|
# custom value you write here by hand is never overwritten by a reinstall/upgrade.
|
|
#PUNKTFUNK_HOST_CMD=serve --gamestream
|
|
|
|
# Multi-GPU boxes only: force the NVENC/Desktop-Duplication GPU by Description substring. Leave
|
|
# unset on single-GPU machines (the default auto-picks the discrete adapter).
|
|
#PUNKTFUNK_RENDER_ADAPTER=4090
|
|
|
|
# Keep a per-client virtual display alive briefly after disconnect so a quick reconnect reuses it
|
|
# (no display connect/disconnect chime). Default 10000 ms.
|
|
#PUNKTFUNK_MONITOR_LINGER_MS=10000
|
|
|
|
|
|
# Run the virtual display at a MULTIPLE of the session's frame rate, without sending a single extra
|
|
# frame — halves the worst-case wait for a freshly composited frame at 2. Costs the extra
|
|
# composites, so it's opt-in; 1 (default) is off, 4 is the ceiling.
|
|
#PUNKTFUNK_VDISPLAY_HZ_MULT=2
|