diff --git a/quest/m2/README.md b/quest/m2/README.md index 238937e5305..94a8e368be7 100644 --- a/quest/m2/README.md +++ b/quest/m2/README.md @@ -170,6 +170,7 @@ lite-07; bitrate enforcement is not part of this release. - [#2848](/quest/m2/2848-follow-the-bandwidth-grant-in-moq-audio-instead-of.md) - the Opus producer follows its bandwidth grant through the settled `moq_mux::rate::Control` - [NVENC buffer pool](/quest/m2/nvenc-pool.md) - NVENC reuses input and output buffers instead of allocating per frame, if a benchmark shows it wins - [Direct3D11 render import](/quest/m2/render-d3d11.md) - Windows presents without downloading every frame to system memory +- [Media Foundation encodes on the texture's adapter](/quest/m2/mf-encode-adapter.md) - Windows machines with two GPUs keep the studio's program on the GPU route into a hardware encoder - [Intra-refresh GOPs](/quest/m2/intra-refresh/README.md) - video with periodic intra refresh imports and plays back cleanly with one group per sweep and a catalog `warmup` - [#2819](/quest/m2/2819-moq-video-carry-pipewire-dma-bufs-safely-into-the-vulkan.md) - moq-video: validate PipeWire DMA-BUFs into the Vulkan renderer on hardware - [#3115](/quest/m2/3115-moqsink-the-publication-has-no-generation-so-a-flush.md) - moqsink: a flushing restart after EOS opens a new publication generation diff --git a/quest/m2/cli-packaging.md b/quest/m2/cli-packaging.md index 9037ab4a5a4..793dd3f2e75 100644 --- a/quest/m2/cli-packaging.md +++ b/quest/m2/cli-packaging.md @@ -2,9 +2,10 @@ ## Goal -A released `moq` binary can capture and play. Both features work and neither -is reachable: every distribution builds default features, and `capture` and -`play` are not among them. +A released `moq` binary can capture and play, and carries every video backend +its platform can load without system libraries. Both features work and +neither is reachable today: every distribution builds default features, and +`capture` and `play` are not among them. ## Plan @@ -14,15 +15,22 @@ Nix (`cargoExtraArgs = "-p moq-cli"`), Docker, winget, and is a packaging gap, not a documentation one: `doc/bin/cli.md` already documents the `--features capture` build. -Turn both on by default and keep the heavy parts individually droppable. The -sub-features already exist for this: `nvidia` is opt-out, `vaapi` and -`pipewire` are opt-in because they need libclang or libpipewire on the build -host, and `v4l2` is opt-in only by habit now that moq-v4l checks its bindings -in, so a self-compiler can shed CUDA or add the Linux extras, and -`--no-default-features` still reaches a minimal build. The cost is real and -lands on Linux source builds: the microphone pulls ALSA through cpal, and -`play` pulls winit plus a GPU stack. The camera path costs nothing. macOS and -Windows use OS frameworks and add nothing. +Decided 2026-10-26 (maintainer): defaults stay lean, and releases build +everything. A default skips any feature that is expensive to build or relies +on a system library, so `cargo build` and `cargo install moq-cli` stay fast +and portable. moq-cli gains a `release` feature that turns on `capture`, +`play`, `openh264`, `vaapi`, `nvidia`, and `v4l2` where the platform has it, +and every distribution (the release binaries, Nix, Docker, winget, Homebrew) +builds with it. `doc/bin/cli.md` tells source builders to pass +`--features release`. This replaces the earlier plan to turn `capture` and +`play` on by default. + +The individual sub-features stay, so a self-compiler can still pick a subset. +`vaapi` and `nvidia` load their driver libraries at runtime (dlopen), so they +belong in `release`. The microphone pulls ALSA through cpal, which is why +`release` waits on [ALSA without a load-time link](/quest/m2/capture-alsa-link.md); +`play` pulls winit plus a GPU stack. macOS and Windows use OS frameworks and +add nothing. Check each distribution actually builds: the Nix overlay needs those system dependencies present, and a Docker image without them fails at build rather @@ -44,16 +52,16 @@ without NVENC; Pi 4, CM4, Zero 2 W, and Orin NX and above encode. RK3588 encodes through rkmpp in a vendor kernel, not V4L2, so it stays on the `moq-gst` route. -`pipewire` stays off in shipped builds (decided 2026-10-06): it needs -libpipewire-0.3 to load, the same load-time requirement -[ALSA](/quest/m2/capture-alsa-link.md) removes. +`pipewire` stays out of `release` (decided 2026-10-06, reaffirmed +2026-10-26): it needs libpipewire-0.3 to load, the same load-time requirement +[ALSA](/quest/m2/capture-alsa-link.md) removes. It joins once it loads lazily. Decided in the 2026-09-30 audit: the v4l2 encode quest folded in here, since its remaining work was one release feature flag and a doc note. Decided in the 2026-10-06 audit: this does not wait on the library -`capture` defaults. moq-cli's `capture` feature enables `moq-video/capture` and `moq-audio/capture` explicitly, so -making it default-on does not depend on the library defaults. +`capture` defaults. moq-cli's `capture` feature enables `moq-video/capture` +and `moq-audio/capture` explicitly, and `release` enables `capture`. ## Required diff --git a/quest/m2/mf-encode-adapter.md b/quest/m2/mf-encode-adapter.md new file mode 100644 index 00000000000..4d85456ce7d --- /dev/null +++ b/quest/m2/mf-encode-adapter.md @@ -0,0 +1,32 @@ +# [M] Media Foundation encodes on the texture's adapter + +## Goal + +On a Windows machine with more than one GPU, `moq-studio`'s program reaches a +hardware Media Foundation encoder on the GPU route: the encoder is enumerated +on the adapter that owns the exported texture, rather than being passed over +for a readback encoder because Media Foundation picked another GPU. + +## Plan + +Builds on `moq_video::render::export` from +[moq-dev/moq#6805](https://github.com/moq-dev/moq/pull/6805); start after it +merges. That PR's exporter probes each candidate encoder with a frame +exported from the drawing device, and passes over a Media Foundation encoder +that sits on a different adapter. Enumerate with `MFTEnum2` instead of +`MFTEnumEx`, passing an `IMFAttributes` store whose `MFT_ENUM_ADAPTER_LUID` +is the texture's adapter, so the probe finds a hardware encoder that reads it. An explicitly named encoder that still cannot read the device +fails at setup, as it does today. + +Decided 2026-10-26 (maintainer): m2, beside Direct3D11 import. It changes no +public API, so it does not need to land before the cut, and it needs a +Windows machine with two GPUs to prove: an ignored hardware test plus an +entry in [Hardware validation](/quest/m3/video-hardware.md) if CI cannot run +it. + +Public API: none. Wire: none. + +## Related + +- [Direct3D11 render import](/quest/m2/render-d3d11.md) - the other Windows half of keeping the studio's pictures on the GPU +- [Studio](/quest/m3/studio/README.md) - the app whose program this encodes diff --git a/quest/m3/studio/packaging.md b/quest/m3/studio/packaging.md index a2ee938c65e..5c4167d99e6 100644 --- a/quest/m3/studio/packaging.md +++ b/quest/m3/studio/packaging.md @@ -6,6 +6,17 @@ Every release ships a signed and notarized macOS app, a signed Windows installer, and a Linux Flatpak of `moq-studio`, all built in CI. Each artifact is verified to launch and list devices on its platform. +## Plan + +Decided 2026-10-26 (maintainer): as for the `moq` binary in +[Ship capture and playback](/quest/m2/cli-packaging.md), moq-studio's defaults +skip any feature that is expensive to build or relies on a system library, +and a `release` feature turns on every backend its platform can load without +one (`capture`, `openh264`, `vaapi`, `nvidia`, and the platform frameworks). +Every artifact builds with `release`. `pipewire` stays out of `release` +because it links libpipewire at load time, but the Flatpak bundles +libpipewire, so it adds `pipewire` itself. + ## Required - [Signing identities are available](/quest/m3/studio/signing.md) - the credentials signing needs