the native strip surface
how many input strips the console carries (hook ignores channels past it)
where a failed reconfigure is reported
Optionalmirror: StripPortMirror
the registry mirror to settle against (production: the loaded PwGraph).
Omitted (loopback / unit tests with no live graph) ⇒ no barrier.
the width-reconfigure hook for buildSoftwareAdapter
Build the import('./software-mixer-loader.js').SoftwareMixerDeps.reconfigureNativeStrip hook over a native mixer: map input channel N → strip N-1, reconfigure that strip's width IN PLACE, and hand back the (post-reconfigure) head-input ports to repoint the channel head onto — folded
r = lfor the mono case, so both source legs land on the oneinput_<n>port.Honest about failure (live-rig finding):
reconfigureStripreports a failed port swap asfalse, and a hook that ignored it would read the STALE port names back and silently repoint the head onto ports that no longer (or never) exist — the engine would then believe the width converged while the graph never changed. On failure this logs and returnsundefined, so the engine leaves the head where it was and the failure is visible in the rig log instead of a silent no-op.Symmetric about the WIDEN direction (#193): the mono-fold
r = lis correct ONLY when a mono strip is requested — a narrow strip has oneinput_<n>port and both source legs fold onto it. On a STEREO (widen) request the strip must expose two DISTINCTinput_<n>_L/input_<n>_Rports; ifreconfigureStripreports success butstripInputNamesstill returns a mono shape, the strip is HALF-WIDENED (the live-rig #193 divergence:channelsflipped stereo butin_i_Rwas never physically created). Foldingr = lthere would silently point the R source leg at the L port and leave a half-stereo strip diverging from the model. So a half-widen is treated exactly like a failed swap — log loud and returnundefined, leaving the head where it was — the same honesty the narrow / failed-swap path already has, never a silent half strip.Settles the registry MIRROR before handing the ports back (#202): the reconfigure mutates the daemon's ports synchronously, but the engine's registry mirror — what
NativeGraphBackend.connectresolvesnode.name:port.nameagainst — catches up asynchronously. The engine re-lays the source legs the instant this hook returns, so without a barrier it resolves the brand-new legs against a STALE mirror:in_i_Ris "not registered yet" and defers, or (after a stereo→mono→stereo cycle, where the name existed before) it resolves to the id of the ALREADY-DESTROYED port and the link factory rejects it withunknown input port <id>. Either way the R leg silently never lands and the strip is half-stereo — the model says stereo, the graph carries one leg. So the hook waits for the mirror to reflect the flip (settleStripPorts) before the engine may resolve against it. A timeout is reported and the ports are returned anyway: they are physically real, and leaving the head on the destroyed ones would be strictly worse.