Files
punktfunk/scripts/punktfunk-host.service
T
enricobuehler 5bc257f1ae
ci / web (push) Successful in 27s
ci / rust (push) Successful in 2m7s
apple / swift (push) Successful in 1m14s
ci / docs-site (push) Successful in 31s
ci / bench (push) Successful in 1m36s
docker / build-push (--build-arg FEDORA_VERSION=44, ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora44-rpm) (push) Successful in 6s
docker / build-push (., web/Dockerfile, punktfunk-web) (push) Successful in 5s
docker / build-push (ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora-rpm) (push) Successful in 3s
docker / build-push (ci, ci/rust-ci.Dockerfile, punktfunk-rust-ci) (push) Successful in 4s
docker / build-push (docs-site, docs-site/Dockerfile, punktfunk-docs) (push) Successful in 4s
deb / build-publish (push) Successful in 2m19s
rpm / build-publish (bazzite, punktfunk-fedora-rpm) (push) Successful in 4m50s
rpm / build-publish (fedora-44, punktfunk-fedora44-rpm) (push) Successful in 4m25s
docker / deploy-docs (push) Successful in 18s
fix(headless/kde): virtual Punktfunk speaker + restart host with the session
Audio: a headless host has no speakers, and on a LAN with AirPlay devices PipeWire picks a random
HomePod as default — so desktop audio (which the host captures from the default sink's monitor)
went to a HomePod over AirPlay instead of to the client, and there was no "Punktfunk" output to
select. Ship a `punktfunk-sink.conf` (a `support.null-audio-sink` adapter — NOT the non-existent
module-null-sink, which makes pipewire refuse to start) with high priority.session so it's the
default; run-headless-kde.sh installs it and restarts pipewire once on first install. The host then
captures its monitor and streams it. (Disable AirPlay sinks out of band: `dnf remove
pipewire-config-raop`.)

Input: the host's libei portal D-Bus connection goes stale when the compositor session restarts the
portal under it, and the in-process reopen loop can't recover it (EIS setup keeps timing out) — only
a full restart does. Add PartOf=punktfunk-kde-session.service so the host restarts with the session.

Both verified live on the Fedora 44 KDE box.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 23:30:36 +00:00

38 lines
2.1 KiB
Desktop File

# punktfunk streaming host — systemd USER unit (`serve --native` = GameStream + punktfunk/1).
#
# Install (against an already-running compositor session):
# mkdir -p ~/.config/systemd/user && cp scripts/punktfunk-host.service ~/.config/systemd/user/
# cp scripts/host.env.example ~/.config/punktfunk/host.env # then edit for your backend
# systemctl --user daemon-reload && systemctl --user enable --now punktfunk-host
#
# Self-contained boot appliance (no login, no manual steps after boot):
# - kwin backend (stream the Plasma desktop): also install + enable
# punktfunk-kde-session.service (it brings up the headless KWin session this After=s), and set
# PUNKTFUNK_COMPOSITOR=kwin + WAYLAND_DISPLAY=wayland-kde in host.env.
# - gamescope backend (stream a nested app, no desktop): set PUNKTFUNK_COMPOSITOR=gamescope in
# host.env — the host spawns gamescope per session, so no kde-session unit is needed.
# Then `sudo loginctl enable-linger "$USER"` so user units start at boot, and reboot.
#
# The host LISTENS as soon as it starts and only touches the compositor per session (on a client
# connect), so the After= below is a soft ordering, not a hard readiness gate — the kde-session
# unit (when present) just needs to be up by the time a client streams (seconds later, user-driven).
# A missing After= unit (e.g. gamescope backend, no kde-session installed) is simply ignored.
[Unit]
Description=punktfunk GameStream + punktfunk/1 host
After=pipewire.service punktfunk-kde-session.service
# PartOf the kwin session (when present): the host's libei input uses the RemoteDesktop portal,
# whose D-Bus connection goes stale if the compositor session restarts the portal under it — the
# in-process reopen loop can't recover that, but a full restart re-establishes it. So restart the
# host whenever the kde-session restarts. Ignored when punktfunk-kde-session isn't installed
# (gamescope / other backends).
PartOf=punktfunk-kde-session.service
[Service]
EnvironmentFile=%h/.config/punktfunk/host.env
ExecStart=%h/punktfunk/target/release/punktfunk-host serve --native
Restart=on-failure
RestartSec=2
[Install]
WantedBy=default.target