diff --git a/docs/windows-host.md b/docs/windows-host.md index b4deae3..11e3202 100644 --- a/docs/windows-host.md +++ b/docs/windows-host.md @@ -12,6 +12,48 @@ control interface — **no driver to write or WHQL-sign.** History: scoped 2026-06-10 (4-agent read of the host crate); SudoVDA path 2026-06-11; this concrete plan + dev box + SudoVDA protocol + no-GPU strategy added 2026-06-14 (12-agent research pass). +## Status (2026-06-15) — all host backends landed; runnable on Windows + +Every OS-touching backend is implemented behind the existing traits and **builds clean on +`x86_64-pc-windows-msvc`** (and Linux unaffected). `serve --native` / `m3-host` **run on Windows** +(identity in `%APPDATA%`/`HOME`, QUIC bound, mDNS advertising, accepting sessions — validated live). + +| Backend | State | GPU-less validation on the VM | +|---|---|---| +| Virtual display (SudoVDA) | ✅ done | live: open/version/watchdog/ADD/REMOVE via the trait | +| Input (SendInput) | ✅ done | compiles; live injection needs an interactive session (not SSH) | +| Software encode (openh264) | ✅ done | **live: m0 synthetic→openh264→core FEC loopback, 120/120, 0 mismatches** | +| Audio (WASAPI loopback) | ✅ done | live: init chain opens (silent VM → no samples) | +| Capture (DXGI Desktop Duplication) | ✅ done | helpers unit-tested; DuplicateOutput needs a GPU-activated monitor | +| NVENC (D3D11, `--features nvenc`) | ✅ compiles+links | needs a GPU at runtime | +| Run host (serve/m3-host) | ✅ live | m3-host starts + listens; `c_abi_connection_roundtrip` passes | +| Gamepad (ViGEm) | ⬜ next | needs ViGEmBus driver | +| Host→client audio wiring | ⬜ next | needs `opus` to build on MSVC | + +**Remaining for full parity:** ViGEm gamepad + wiring host→client Opus audio (the WASAPI backend +exists; `m3` `audio_thread` is still Linux-gated pending an MSVC `opus` build). + +### Building & testing on a real-GPU Windows box (NVENC) + +1. Install **SudoVDA** (virtual display) and **ViGEmBus** (gamepad) drivers; install the NVIDIA driver. +2. NVENC link lib: either install the NVIDIA Video Codec SDK, or generate an import lib from the + driver DLL — `lib /def:nvenc.def /machine:x64 /out:nvencodeapi.lib` where `nvenc.def` lists + `NvEncodeAPICreateInstance` and `NvEncodeAPIGetMaxSupportedVersion` — and set + `PUNKTFUNK_NVENC_LIB_DIR` to its directory. +3. `cargo build -p punktfunk-host --features nvenc` (needs NASM + CMake for aws-lc-rs; libclang for + any ffmpeg-using client). Default build (no feature) uses the openh264 software encoder. +4. Run in the **interactive session** (not a Session-0 service / not over SSH — SendInput + DXGI + Desktop Duplication need a desktop): `serve --native` or `m3-host --source virtual`. Set + `PUNKTFUNK_ENCODER=nvenc` to select NVENC (the DXGI capturer switches to zero-copy D3D11 output to + match). The SudoVDA monitor activates once a real GPU drives WDDM, so capture + NVENC then work. + +### Dev loop (this repo → the Windows VM) + +`ssh "Enrico Bühler"@192.168.1.57` (PowerShell shell). Repo cloned at `C:\Users\Public\punktfunk` +(Gitea). Sync uncommitted files with **sftp** (`sftp -b - host`, `/C:/...` paths — scp and +base64-over-ssh are unreliable here). Commit on Linux → `git reset --hard origin/main` on the VM. +Build env: `PATH` += cargo bin + NASM + CMake + LLVM (vcvars not needed — rustc/cc self-locate MSVC). + ## Decisions (locked 2026-06-14) | Decision | Choice | Rationale |