4-agent feasibility read converged on three independent walls, any one fatal:
- host capture needs a kernel rebuild (CONFIG_USB_DUMMY_HCD off → no UDC for an
f_uac2 composite gadget; everything else for the gadget IS present);
- near-zero Linux supply (only ~5-10 Proton titles via custom Wine patches emit
it; hid-playstation/Steam-Input/RPCS3 don't);
- Apple client can't faithfully replay PCM haptics (CoreHaptics is discrete
pattern-based; no public CoreAudio channel-3/4 routing).
Advanced haptics ride the DualSense USB *audio* interface, not HID, so the UHID
backend structurally can't carry them. Defer; the reachable 80% ("real DualSense
feel") is adaptive triggers over the HID 0x02 path we already parse + two-motor
rumble. New docs/dualsense-haptics.md records the walls + conditions for a future
go; roadmap §5 updated (HID DualSense backend built & live-validated).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
8.0 KiB
punktfunk roadmap — next goals
Decided 2026-06-10 (research-grounded; see commit history). Sequence: KDE reliability → client compositor options → mic passthrough → Bazzite COPR RPM (then bootc) → touch → full UHID DualSense → iOS (+ Windows host, scoped & deferred).
Done (2026-06-10): #1 KDE reliability (Phase 1 + 2), #2 compositor options (full stack incl.
macOS client), #4 mic passthrough — all on main, live-validated. #3 Bazzite packaging written
(packaging/); the COPR/bootc build is operator-run. Remaining: #5 touch → UHID DualSense, #6 iOS,
and a Windows host (docs/windows-host.md).
1. Reliable headless KDE/compositor spawning ✅ (done — Phase 1 + 2)
Startup is a chain of timing-sensitive handoffs with no readiness checks — each is a blind
sleep, one-shot timeout, or silent fire-and-forget that fails into a black screen.
- Phase 1 (S): replace
run-headless-kde.sh's blindsleep 2with an active readiness wait (kwin socket +wl_displayroundtrip +zkde_screencastglobal advertised + KWIN_PID alive); add apunktfunk-host probe-compositorsubcommand (reuses kwin.rs's registry roundtrip); move the portal restart to after readiness and precede it withsystemctl --user import-environment+dbus-update-activation-environment(the missing env import — the Sway script does this, the KDE one doesn't). - Phase 2 (M): bounded retry-with-backoff around
vd.create()+ first-frame (permanent vs transient); a PipeWire negotiation watchdog with zero-copy→CPU auto-fallback ("no PipeWire frame within 10s" → recovery or precise diagnosis); fixset_custom_refreshto wait for the output, read back the active mode, reconcile encoder fps; harden gamescope node discovery + detect the known-bad-gamescope signature; graceful PipeWire-thread stop. - Phase 3 (L): supervised systemd user session (kwin + portal + host) with the readiness
probe as an
ExecStartPostgate,Restart=on-failure.
2. Offer available compositors in the client ✅ (done)
Host enumerates which backends are actually available (binary present + version OK: gamescope ≥3.16.22, KWin ≥6.5.6, gnome-shell, sway), advertises the list in the punktfunk/1 Welcome + a mgmt-API field; client sends its pick in the Hello; host honors it per session. Picker in the Apple client + web console.
3. Bazzite / install on other devices ✅ (packaging written — packaging/)
Bazzite already ships gamescope + PipeWire + the NVIDIA driver (incl. libnvidia-encode);
it's Fedora-atomic and the community installs Sunshine via COPR rpm-ostree — the analog.
Written: packaging/rpm/punktfunk.spec (builds the host from source), packaging/bootc/Containerfile
(FROM bazzite-nvidia), packaging/bazzite/host.env (gamescope default), packaging/copr/ +
packaging/README.md. The build itself is operator-run (COPR / a Fedora toolbox; not buildable on
the Ubuntu dev box). LICENSE-{MIT,APACHE} added to match the declared dual license.
- M-Bazzite-1: a COPR RPM (primary) — binary +
60-punktfunk.rules(→/usr/lib/udev/rules.d) + systemd--userunit +host.env.example;Requiresthe NVENC ffmpeg-libs Bazzite already pulls; links hostlibcuda/libnvidia-encodedirectly. Install =rpm-ostree install+ reboot + add toinput/render. Default backend = Bazzite's already-present gamescope (minimal session plumbing). - M-Bazzite-2: wrap the RPM in a bootc/OCI image layer (
FROM ghcr.io/ublue-os/bazzite-nvidia:stable) for the appliance/"just rebase" experience. - Flatpak only later as an explicitly-degraded convenience build (sandbox fights zero-copy NVENC/dmabuf/uinput).
4. Mic passthrough — client mic → host input device ✅ (done — host side)
The exact mirror of the host→client desktop-audio path. A PipeWire virtual source apps can
select = a pw_stream with Direction::Output + media.class=Audio/Source.
- New
0xCBMIC_AUDIO datagram (mirror of0xC9) +NativeClient::send_audio+ ABIpunktfunk_send_audio. audio/source_linux.rs— near-copy of the capture file, Direction::Output, fed from a jitter buffer (silence-fill underrun, Opus PLC).- Host
mic_thread(Opus decode → ring → source); teardown RAII, setnode.dont-reconnect. - Apple capture (AVAudioEngine → Opus). Opt-in + paired-only (a remote mic is a privacy surface). punktfunk/1-only.
5. Touch + rich DualSense (decision: commit to full UHID DualSense)
- Touch — implemented (host path), pending a backend that lands it.
TouchDown/Move/UpInputKinds (reuse the abs-pointerflags=(w<<16)|hmapping,code=touch id); hostinject/libei.rsrequests theTouchscreendevice type + binds theTouchcapability and injectsei_touchscreendown/motion/up;punktfunk-client-rs --touch-testdrags a finger. Validated: KWin's RemoteDesktop portal grants the Touchscreen device type, but its EIS server creates no touchscreen device (headless KWin) — so touch currently no-ops on KWin (now logged once). The code is correct; it needs a backend that exposesei_touchscreen(gamescope / newer KWin / the real iPad client path) to land. wlroots: no virtual-touch wired. - Rich DualSense — HID backend built & validated live.
inject/dualsense.rs: a hand-rolled/dev/uhidcodec (no bindgen) presenting a genuine USB DualSense (vendor 054C/0CE6, the 232-byte inputtino report descriptor) bound by the kernelhid-playstationdriver. The mandatory GET_REPORT feature handshake (calibration 0x05 / pairing 0x09 / firmware 0x20) is answered, so the kernel creates the full device (gamepad/motion/touchpad/lightbar). Input report0x01is built from gamepad frames; output report0x02is parsed for LED RGB, player LEDs, and adaptive trigger effects (L2/R2). Protocol carries new side-planes: rich-input0xCC(touchpad/motion) + HID-output0xCD(LED/triggers)./dev/uhidudev rule shipped. Remaining (paused, resume-able): route gamepad frames →DualSensePadbehindPUNKTFUNK_GAMEPAD=dualsense, wire the0xCC/0xCDback-channel end-to-end (+ C ABInext_hidout/send_rich_input), and render adaptive triggers + rumble on the Apple client. - Advanced (audio-driven voice-coil) haptics — scoped, NO-GO for now (
docs/dualsense-haptics.md). Driven by the DualSense's USB audio interface (4-ch, back 2 channels = haptic PCM), not HID — so the UHID backend structurally can't carry it. Three independent walls: host capture needs a kernel rebuild (CONFIG_USB_DUMMY_HCDis off → no UDC for anf_uac2gadget); near-zero Linux supply (only ~5–10 Proton titles via custom Wine patches emit it;hid-playstation/Steam Input/RPCS3 don't); and the Apple client can't faithfully replay PCM haptics (CoreHaptics is discrete/pattern- based, no public channel-3/4 routing). Deferred; revisit only if a real DS for capture + a UDC/host path + a PCM-capable client all land. Adaptive triggers (HID, above) deliver the reachable 80%.
6. iOS/iPadOS → tvOS (deferred)
PunktfunkKit is already platform-shared; iOS needs the UIViewRepresentable presenter twin
- touch capture (#5) + UI. tvOS later.
7. Windows as a host (scoped & deferred — docs/windows-host.md)
Architecturally an "add a backend" job, not a parallel port: punktfunk-core (protocol/FEC/
crypto/C-ABI) + QUIC + GameStream + mgmt + the m3/pipeline orchestration are all platform-agnostic
and already cfg-isolated (~95% reuse). New #[cfg(windows)] backends behind the existing traits:
capture (DXGI Desktop Duplication), encode (Media Foundation / NVENC-SDK with a D3D11 context),
input (SendInput + ViGEm), audio (WASAPI loopback + a virtual mic). The blocker is the
virtual-display feature — no user-mode Windows API; it needs a signed kernel-mode IDD driver
(XL). Recommended start: Phase 0 — a "basic Windows host" capturing an existing monitor (no
virtual display), proving the whole stack with the smallest surface. Deferred because it's large and
unbuildable on the Linux dev box; the trait boundaries are already in the right places.