diff --git a/.github/workflows/p1-windows.yml b/.github/workflows/p1-windows.yml index dee2a51c7..3d63b805e 100644 --- a/.github/workflows/p1-windows.yml +++ b/.github/workflows/p1-windows.yml @@ -430,6 +430,9 @@ jobs: - name: Prove two authentic historical Inno releases upgrade and roll back if: ${{ github.event_name == 'workflow_dispatch' && inputs.package_fat == true }} shell: pwsh + env: + # Per-job contents:read; do not forward to asset redirect URLs. + GITHUB_TOKEN: ${{ github.token }} run: | & ./scripts/test_two_genuine_inno_releases_windows.ps1 if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ba82034e..e01c7767e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -243,6 +243,13 @@ if(BUILD_TESTING) # all CTests. Make its native session regression a build dependency so the # new executable is actually present (without editing the CI target list). add_dependencies(ARMixMixerRoutingTests ARMixDynamicAcceptedSessionTests) + # O1/O2: integrated deterministic PCM on the existing Windows FAT CTest. + # No additional workflow job or duplicate native build. + add_executable(ARMixPhysicalExternalOutputTests tests/physical_external_output_pcm_test.cpp) + target_compile_features(ARMixPhysicalExternalOutputTests PRIVATE cxx_std_20) + add_test(NAME O1PhysicalExternalOutputNativePcmAndFailClosedRouting + COMMAND ARMixPhysicalExternalOutputTests) + add_dependencies(ARMixMixerRoutingTests ARMixPhysicalExternalOutputTests) # Integration-only producer/consumer: accepted ChannelId readback + real # offline PCM with CH07/CH02, GROUP, wet FX RETURN and MONITOR. No new host. add_executable(ARMixConsoleBridgeV6Tests tests/console_native_integration_test.cpp diff --git a/engine/core/DynamicNativeSessionPublisher.h b/engine/core/DynamicNativeSessionPublisher.h index 18ef3d10c..4970c1046 100644 --- a/engine/core/DynamicNativeSessionPublisher.h +++ b/engine/core/DynamicNativeSessionPublisher.h @@ -166,15 +166,24 @@ class DynamicNativeSessionPublisher final { float* monitorL=nullptr,float* monitorR=nullptr, std::span channelPeaksL={}, std::span channelPeaksR={}, - std::span playerPcm={}) noexcept { + std::span playerPcm={}, + float* const* hardwareOutputs=nullptr, + int hardwareOutputCount=0) noexcept { static_assert(std::is_nothrow_invocable_v, "Realtime VST dispatch must be noexcept"); const auto clearOutputs=[&]() noexcept { - if(frames>0 && mainL)std::fill_n(mainL,frames,0.f); - if(frames>0 && mainR && mainR!=mainL)std::fill_n(mainR,frames,0.f); - if(frames>0 && monitorL)std::fill_n(monitorL,frames,0.f); - if(frames>0 && monitorR && monitorR!=monitorL) - std::fill_n(monitorR,frames,0.f); + // A rejected/stale/muted native render must silence *every* + // ASIO destination, not only MAIN/MONITOR. Otherwise a previous + // external tap can remain in a driver-provided output buffer. + // Bounded callback-ordinal traversal; no allocations or locks. + if(frames<=0 || frames>8192)return; + if(hardwareOutputs && hardwareOutputCount>0 && hardwareOutputCount<=256) + for(int c=0;c8192 || !mainL || !mainR || mainL==mainR || physicalCount<0 || physicalCount>256 || @@ -196,6 +205,11 @@ class DynamicNativeSessionPublisher final { physicalCount!=snap->prepared->physicalInputs || (snap->prepared->monitor && !monitorL) || frames>snap->prepared->graph.capacity()) { + // A real, current-epoch callback with a changed input count or + // unsafe quantum must not retain last block's EXTERNAL LIVE + // readback after every hardware buffer was silenced. + if(snap && snap->prepared) + snap->prepared->graph.invalidateAppliedExternalOutputs(); clearOutputs();return false; } // A single callback producer owns the prepared scratch. In case a @@ -225,8 +239,16 @@ class DynamicNativeSessionPublisher final { }; const bool ok=snap->prepared->graph.process( physical,physicalCount,mainL,mainR,frames, - dispatch,monitorL,monitorR,channelPeaksL,channelPeaksR,playerPcm); - if(!ok)clearOutputs(); + dispatch,monitorL,monitorR,channelPeaksL,channelPeaksR,playerPcm, + hardwareOutputs,hardwareOutputCount); + if(!ok) { + // A rejected physical callback (including aliased independent + // amplifier buffers) emits silence, not a stale LIVE snapshot. + // The approved GUI will report PENDING until a later successful + // PCM callback re-publishes APPLIED on the same ChannelId graph. + snap->prepared->graph.invalidateAppliedExternalOutputs(); + clearOutputs(); + } return ok; } @@ -258,6 +280,27 @@ class DynamicNativeSessionPublisher final { return current?¤t->routing:nullptr; } + // O1 CONTROL only: one epoch/revision-guarded target in the same PCM graph. + // Caller validates actual driver pins and MAIN/MONITOR collision first. + bool setExternalOutput(std::uint64_t epoch,std::uint64_t revision, + ChannelId id,int left,int right,int outputCount) noexcept { + return publisher_.updateActiveControl(epoch,revision, + [&](Prepared& active) noexcept { + return active.graph.setExternalOutput(id,left,right,outputCount); + }); + } + std::pair externalOutput(std::uint64_t epoch, + std::uint64_t revision,ChannelId id) const noexcept { + const auto* p=publisher_.controlPrepared(epoch,revision); + return p?p->graph.externalOutput(id):std::pair{-1,-1}; + } + + std::pair appliedExternalOutput(std::uint64_t epoch, + std::uint64_t revision,ChannelId id) const noexcept { + const auto* p=publisher_.controlPrepared(epoch,revision); + return p?p->graph.appliedExternalOutput(id):std::pair{-1,-1}; + } + // M3C realtime parameters on the accepted ChannelId graph ONLY. // Caller must propagate the real device epoch and native ACK revision. // Rejected/stale edits leave the last accepted PCM unchanged. diff --git a/engine/core/DynamicPreparedMixerBlock.h b/engine/core/DynamicPreparedMixerBlock.h index e7a482544..e44575411 100644 --- a/engine/core/DynamicPreparedMixerBlock.h +++ b/engine/core/DynamicPreparedMixerBlock.h @@ -123,6 +123,24 @@ class DynamicPreparedMixerBlock final { std::atomic gain{1.f}; armix::dsp::RealtimeSlew64 applied{}; }; + // O1: immutable lane roster + one lock-free control target per lane. + // The callback owns the transition state; a physical tap is NOT a WIRE. + struct ExternalFade final { + std::uint32_t current=0xffffffffu,next=0xffffffffu; + int remaining=0; + }; + static constexpr std::uint32_t noExternal=0xffffffffu; + static constexpr std::uint32_t encodeExternal(int l,int r) noexcept { + return l<0 ? noExternal : + static_cast(l) | + (static_cast(r)<<16); + } + static constexpr int externalLeft(std::uint32_t pair) noexcept { + return pair==noExternal?-1:static_cast(pair&0xffffu); + } + static constexpr int externalRight(std::uint32_t pair) noexcept { + return pair==noExternal?-1:static_cast(pair>>16); + } static constexpr std::size_t notScheduled=std::numeric_limits::max(); public: DynamicPreparedMixerBlock()=default; @@ -237,6 +255,49 @@ class DynamicPreparedMixerBlock final { std::find(renderOrder_.begin(),renderOrder_.end(),found->second)!=renderOrder_.end(); } + // CONTROL only: the caller has already verified the ASIO device epoch, + // sparse physical pins, exclusive MAIN/MONITOR ownership and graph revision. + // Target is a callback ordinal, NEVER a physical port number. + bool setExternalOutput(ChannelId id,int left,int right,int outputCount) noexcept { + const auto it=controlIndex_.find(id.value); + if(it==controlIndex_.end() || outputCount<2 || outputCount>256 || + (left<0 ? right!=-1 : + (right<0 || left>=outputCount || right>=outputCount || + left==right)) || !channelScheduled(id))return false; + const auto role=lanes_[it->second].role; + if(role!=ChannelRole::input && role!=ChannelRole::group && + role!=ChannelRole::fxReturn)return false; + externalTargets_[it->second].store( + encodeExternal(left,right),std::memory_order_release); + return true; + } + // Independent installed CONTROL readback. No UI draft can claim LIVE. + std::pair externalOutput(ChannelId id) const noexcept { + const auto it=controlIndex_.find(id.value); + if(it==controlIndex_.end())return {-1,-1}; + const auto pair=externalTargets_[it->second].load(std::memory_order_acquire); + return {externalLeft(pair),externalRight(pair)}; + } + + // Independent audio-callback proof: APPLIED differs from merely + // requested until the existing hardware render finishes its transition. + std::pair appliedExternalOutput(ChannelId id) const noexcept { + const auto it=controlIndex_.find(id.value); + if(it==controlIndex_.end())return {-1,-1}; + const auto pair=externalAppliedTargets_[it->second].load( + std::memory_order_acquire); + return {externalLeft(pair),externalRight(pair)}; + } + // AUDIO only: an attempted native PCM render that fails must revoke + // callback-APPLIED evidence. Keep the requested CONTROL patch intact: + // the next valid block can recover it without operator re-ARM/re-WIRE. + // This is bounded to prepared atomic slots and never builds a graph, + // reallocates buffers, or touches the control-only ChannelId hash map. + void invalidateAppliedExternalOutputs() noexcept { + for(const auto i:renderOrder_) + externalAppliedTargets_[i].store(noExternal,std::memory_order_release); + } + // CONTROL-only DAG PDC. Every fan-in receives sample-aligned PCM, // including a destination's own hardware capture and PRE-fader sends. // A failure discards the unpublished candidate; the old graph stays live. @@ -245,7 +306,7 @@ class DynamicPreparedMixerBlock final { std::vector arrival(lanes_.size(),0),output(lanes_.size(),0); std::size_t bytes=scratch_.size()*sizeof(float); edgeDelays_.resize(edges_.size());physicalDelays_.resize(lanes_.size()); - sinkDelays_.resize(lanes_.size()); + sinkDelays_.resize(lanes_.size());externalDelays_.resize(lanes_.size()); const auto allocate=[&](armix::dsp::StereoLatencyDelay& delay,int samples) { if(samples<0||samples>armix::dsp::StereoLatencyDelay::maximumSamples)return false; const auto need=static_cast(samples)*2*sizeof(float); @@ -267,8 +328,17 @@ class DynamicPreparedMixerBlock final { for(std::size_t e=lanes_[i].first;e=0 || lane.playerDeckId!=0) && @@ -282,6 +352,14 @@ class DynamicPreparedMixerBlock final { if((i==main_||i==monitor_)&&!allocate(sinkDelays_[i],terminal-output[i])) { error={DynamicGraphFault::scratchBudget,lane.id};return false; } + // All potential direct taps are prepared on CONTROL so changing + // an output never allocates or rebuilds a VST rack on AUDIO. + if((lane.role==ChannelRole::input || + lane.role==ChannelRole::group || + lane.role==ChannelRole::fxReturn) && + !allocate(externalDelays_[i],externalTerminal-output[i])) { + error={DynamicGraphFault::scratchBudget,lane.id};return false; + } } latencySamples_=terminal;return true; } @@ -518,6 +596,14 @@ class DynamicPreparedMixerBlock final { target.appliedR.reset(next.lanes_[i].gainR); target.gate.reset(next.initialAudible_[i]?1.f:0.f); } + next.externalTargets_=std::make_unique[]>(rows.size()); + next.externalAppliedTargets_=std::make_unique[]>(rows.size()); + next.externalFades_=std::make_unique(rows.size()); + next.externalBlockTargets_.assign(rows.size(),noExternal); + for(std::size_t i=0;i(next.edges_.size()); for(std::size_t e=0;e channelPeaksL={}, std::span channelPeaksR={}, - std::span playerPcm={}) noexcept { + std::span playerPcm={}, + float* const* hardwareOutputs=nullptr, + int hardwareOutputCount=0) noexcept { if(frames<=0 || !outputL || !outputR)return false; // The physical 10CH/4AUX callback requests only the stable // legacy prefix of an expanded ChannelId roster. Dynamic extra @@ -551,7 +639,9 @@ class DynamicPreparedMixerBlock final { std::fill_n(channelPeaksL.data(),channelPeaksL.size(),0.f); std::fill_n(channelPeaksR.data(),channelPeaksR.size(),0.f); } - if(outputL==outputR || + if(outputL==outputR || hardwareOutputCount<0 || + hardwareOutputCount>256 || + (hardwareOutputCount!=0 && !hardwareOutputs) || (monitorL==nullptr)!=(monitorR==nullptr) || (monitor_!=notScheduled && !monitorL) || (monitorL && (monitorL==monitorR || monitorL==outputL || @@ -765,6 +855,92 @@ class DynamicPreparedMixerBlock final { } } if(monitorL)copySink(monitor_,monitorL,monitorR); + // External hardware taps consume the SAME post-FX/post-fader scratch. + // All input reads and native plugin calls are already complete. The + // host must not clear these dedicated output buffers a second time. + if(hardwareOutputs && hardwareOutputCount) { + // A JUCE/ASIO callback ordinal must own a unique physical PCM + // buffer. Two DIFFERENT EXTERNAL pairs can otherwise alias the + // same amplifier memory and silently mix unrelated ChannelIds. + // Previous validation only compared each pair against MAIN, + // MONITOR, or its own opposite side; it missed cross-pair alias. + // Compare borrowed pointers, not port labels: non-contiguous + // enabled ASIO masks are explicitly supported. Bounded O(N²) + // for the already-verified active callback pins, no allocation, + // sorting, lock, driver lookup or additional DSP pass on AUDIO. + for(int c=0;c=hardwareOutputCount || r>=hardwareOutputCount || + l==r || !hardwareOutputs[l] || !hardwareOutputs[r] || + hardwareOutputs[l]==hardwareOutputs[r] || + hardwareOutputs[l]==outputL || hardwareOutputs[l]==outputR || + hardwareOutputs[r]==outputL || hardwareOutputs[r]==outputR || + hardwareOutputs[l]==monitorL || hardwareOutputs[l]==monitorR || + hardwareOutputs[r]==monitorL || hardwareOutputs[r]==monitorR) + return false; + } + } + // External tap delay advances even while the tap is disconnected, + // so reconnect cannot spill a stale FX tail into a new amplifier. + for(const auto i:renderOrder_) { + const auto& lane=lanes_[i]; + if(lane.role!=ChannelRole::input && + lane.role!=ChannelRole::group && + lane.role!=ChannelRole::fxReturn)continue; + auto& fade=externalFades_[i]; + const auto wanted=externalBlockTargets_[i]; // same preflighted target + if(fade.remaining==0 && fade.current!=wanted) { + fade.next=wanted; + fade.remaining=armix::dsp::RealtimeSlew64::samples; + } + const auto slot=lane.slot; + const float* src=scratch_.data()+slot*2*block; + const float* srcR=src+block; + for(int f=0;f0) { + nextWeight=1.f-static_cast(fade.remaining-1)/ + static_cast(armix::dsp::RealtimeSlew64::samples); + oldWeight=1.f-nextWeight; + if(--fade.remaining==0)fade.current=fade.next; + } + if(fade.remaining>0 && fade.current!=noExternal) { + hardwareOutputs[externalLeft(fade.current)][f]+=l*oldWeight; + hardwareOutputs[externalRight(fade.current)][f]+=r*oldWeight; + } + const auto active=fade.remaining>0?fade.next:fade.current; + if(active!=noExternal) { + hardwareOutputs[externalLeft(active)][f]+=l*nextWeight; + hardwareOutputs[externalRight(active)][f]+=r*nextWeight; + } + } + externalAppliedTargets_[i].store( + fade.remaining==0?fade.current:noExternal, + std::memory_order_release); + } + } return true; } private: @@ -775,12 +951,16 @@ class DynamicPreparedMixerBlock final { std::vector initialAudible_,soloAncestors_,soloDescendants_; std::vector blockTargets_; // all allocated before RT std::vector scratch_; - std::vector edgeDelays_,physicalDelays_,sinkDelays_; + std::vector edgeDelays_,physicalDelays_,sinkDelays_,externalDelays_; + std::vector externalBlockTargets_; // preallocated, AUDIO-only writes int latencySamples_=0; std::unique_ptr channelTargets_; std::unique_ptr[]> sourceTargets_; std::unique_ptr sourceFades_; std::unique_ptr sendTargets_; + std::unique_ptr[]> externalTargets_; + std::unique_ptr[]> externalAppliedTargets_; + std::unique_ptr externalFades_; std::size_t main_=notScheduled,monitor_=notScheduled; bool mainMonoAfterFx_=false; int capacity_=0,physicalInputs_=0; diff --git a/engine/core/LiveOutputRouteGate.h b/engine/core/LiveOutputRouteGate.h index 1bb5f2bfa..b5c693bd4 100644 --- a/engine/core/LiveOutputRouteGate.h +++ b/engine/core/LiveOutputRouteGate.h @@ -1,5 +1,6 @@ // SPDX-License-Identifier: AGPL-3.0-only #pragma once +#include namespace armix::mixer { // One mixer graph, two independent routing destinations. The direct output // is preferred for minimal latency; any optional secondary playback device @@ -8,11 +9,24 @@ struct LiveOutputRouteGate final { struct State {bool renderMain=false, hardware=false, secondary=false;}; static constexpr State evaluate(bool routeAccepted,bool directAuthorized, bool normal,bool stable,bool masterUnmuted, - bool hardwareArmed,bool secondaryArmed) noexcept { + bool hardwareArmed,bool secondaryArmed, + bool nativeMainOnlyMute=false) noexcept { + // Native MAIN mute controls MAIN PCM, not physical BUS/EXT authorization. + // Actual global/device/epoch revocation still stops ALL outputs. const bool eligible=routeAccepted && directAuthorized && normal && - stable && masterUnmuted; + stable && (masterUnmuted || nativeMainOnlyMute); return {eligible&&(hardwareArmed||secondaryArmed), eligible&&hardwareArmed,eligible&&secondaryArmed}; } }; +// No extra graph, lock or FX pass: smooth just the MAIN output amplitude. +struct MainOnlyMuteSlew final { + float gain=1.f; + void reset(bool muted) noexcept {gain=muted?0.f:1.f;} + float next(bool muted) noexcept { + constexpr float step=1.f/64.f; + gain=muted?std::max(0.f,gain-step):std::min(1.f,gain+step); + return gain; + } +}; } diff --git a/engine/core/NativeOutputTransition.h b/engine/core/NativeOutputTransition.h new file mode 100644 index 000000000..68f04a6db --- /dev/null +++ b/engine/core/NativeOutputTransition.h @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: AGPL-3.0-only +#pragma once +#include "FxMoveRamp.h" +#include +#include +namespace armix::mixer { +// One output-only de-click sweep after the authoritative native PCM graph. +// Covers MAIN, MONITOR and each EXTERNAL ASIO output. Constant-space AUDIO. +struct NativeOutputTransition final { + static void apply(float* const* outputs,int count,int frames, + int moveStage,bool fadeOut,bool fadeIn, + const float* mainL,const float* mainR, + float& mainPeakL,float& mainPeakR) noexcept { + mainPeakL=mainPeakR=0.f; + if(!outputs || count<=0 || frames<=0)return; + const float step=frames>1?1.f/static_cast(frames-1):0.f; + for(int c=0;c(i)*step; + const float graphGain=fadeOut?1.f-phase:fadeIn?phase:1.f; + pcm[i]*=graphGain*armix::dsp::FxMoveRamp::gain(moveStage,i,frames); + peak=std::max(peak,std::abs(pcm[i])); + } + if(pcm==mainL)mainPeakL=peak; + if(pcm==mainR)mainPeakR=peak; + } + } +}; +} // namespace armix::mixer diff --git a/engine/device/JuceActivePortSnapshot.h b/engine/device/JuceActivePortSnapshot.h index feb8c1745..5d6e97f9a 100644 --- a/engine/device/JuceActivePortSnapshot.h +++ b/engine/device/JuceActivePortSnapshot.h @@ -25,6 +25,7 @@ struct JuceActivePortSnapshot final { int outputCount=0; std::uint64_t epoch=0; juce::String deviceName, typeName; + juce::StringArray outputNames; // physical pin indices, not packed callback ordinals // Accept a frozen copy of masks to exercise sparse numbering and real // output-only devices with zero capture pins. No fake input is created. @@ -83,6 +84,12 @@ struct JuceActivePortSnapshot final { } candidate.deviceName=device->getName(); candidate.typeName=device->getTypeName(); + candidate.outputNames=device->getOutputChannelNames(); + if(candidate.outputNames!=device->getOutputChannelNames() || + in!=device->getActiveInputChannels() || + out!=device->getActiveOutputChannels()) { + error=Fault::deviceChangedDuringRead;return false; + } destination=std::move(candidate); return true; } diff --git a/scripts/build_approved_native_gui.py b/scripts/build_approved_native_gui.py index 9fe40a1ba..b020f236a 100644 --- a/scripts/build_approved_native_gui.py +++ b/scripts/build_approved_native_gui.py @@ -23,7 +23,21 @@ NATIVE_ADAPTER = ROOT / "web" / "approved-native-bridge.js" ADAPTER_MARKER = ('\n' '\n' - '') + '\n' + '') SCHEMA = "arsonmix.approved-native-pages-bundle.v2" @@ -94,10 +108,21 @@ def accepted_pages_html() -> str: # Public /preview/ continues to show its labeled simulated reference. ("const channelOptions=(t,type)=>{\n", "const channelOptions=(t,type)=>{\n" + " if(type==='external'&&window.__JUCE__?.backend)\n" + " return window.__ARMIX_NATIVE_M2__?.externalChoices?.(t)||['None'];\n" " if(type==='input'&&window.__JUCE__?.backend)\n" " return window.__ARMIX_NATIVE_M2__?.inputChoices?.(t)||['None'];\n" " if(type==='output'&&window.__JUCE__?.backend)\n" " return window.__ARMIX_NATIVE_M2__?.outputChoices?.(t)||[t.output];\n"), + (" code+=sectionFx(t)+sectionSend(t);\n", + " if(t.kind!=='master'){\n" + " if(!code.endsWith(''))throw Error('Native O1 route anchor drift');\n" + " const extRow='
EXT'+\n" + " '
';\n" + " code=code.slice(0,-6)+extRow+'';\n" + " }\n" + " code+=sectionFx(t)+sectionSend(t);\n"), ("function wireGraphCommit(ops,{record=true}={}){\n", "function wireGraphCommit(ops,{record=true}={}){\n" " if(window.__JUCE__?.backend){window.__ARMIX_NATIVE_M2__?.consumeWire?.(ops);return false;}\n"), diff --git a/scripts/test_two_genuine_inno_releases_windows.ps1 b/scripts/test_two_genuine_inno_releases_windows.ps1 index 3a194e0e2..c9a17b122 100644 --- a/scripts/test_two_genuine_inno_releases_windows.ps1 +++ b/scripts/test_two_genuine_inno_releases_windows.ps1 @@ -11,6 +11,20 @@ if($env:GITHUB_ACTIONS -cne 'true' -or throw 'REAL_RELEASE_FAT_REQUIRES_DISPOSABLE_GITHUB_WINDOWS_RUNNER' } [Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12 +# Release metadata is an API request, not a public asset download. Anonymous +# GitHub Windows runner IPs can exhaust the unauthenticated 60/hour quota +# even when every CTest, EXE, ZIP and Inno installer gate has passed. +# Use ONLY the scoped, masked, read-only Actions token for metadata. +# Absence of credentials is a hard failure, not permission to skip FAT. +if([string]::IsNullOrWhiteSpace($env:GITHUB_TOKEN)) { + throw 'GENUINE_RELEASE_METADATA_AUTH_REQUIRED' +} +$releaseHeaders=@{ + 'User-Agent'='ArSonMix-GenuineFAT/1' + Accept='application/vnd.github+json' + 'X-GitHub-Api-Version'='2022-11-28' + Authorization="Bearer $env:GITHUB_TOKEN" +} $repo='masarray/arsonmix' $matrix=@( @{tag='v0.5.0-alpha.4';sha='7447d82e84a52e583c7e4c30b9a7bbcded1abd11'}, @@ -75,7 +89,7 @@ try { foreach($item in $matrix) { $tag=$item.tag $uri="https://api.github.com/repos/$repo/releases/tags/$tag" - $release=Invoke-RestMethod -Uri $uri -Headers @{'User-Agent'='ArSonMix-GenuineFAT/1';Accept='application/vnd.github+json'} -TimeoutSec 45 + $release=Invoke-RestMethod -Uri $uri -Headers $releaseHeaders -TimeoutSec 45 Assert-True (-not $release.draft -and $release.tag_name -ceq $tag -and $release.target_commitish -ceq $item.sha) "Unexpected historical published release identity" $name="ArSonMix-$tag-Windows-x64-Setup.exe" diff --git a/src/LiveAudioEngine.h b/src/LiveAudioEngine.h index 8411366b6..50670cdf7 100644 --- a/src/LiveAudioEngine.h +++ b/src/LiveAudioEngine.h @@ -19,6 +19,7 @@ #include "../engine/device/JuceIndependentClockDevice.h" #include "../engine/device/LiveSecondaryOutputDevice.h" #include "../engine/core/LiveOutputRouteGate.h" +#include "../engine/core/NativeOutputTransition.h" #include "../engine/core/NativeRenderAuthority.h" #include "../engine/device/AsioPriorityDeviceManager.h" #include "../engine/device/AsioRegistryIdentityProbe.h" @@ -1473,6 +1474,31 @@ class LiveAudioEngine final : private juce::AudioIODeviceCallback return "SOURCE: native prepare failed; prior audio kept"; } } + // O1 physical External OUT: solely CONTROL, on the already-approved + // single ASIO/ChannelId PCM callback. Hardware pin masks and labels + // are read atomically with the current device lifecycle generation. + juce::String setPhysicalExternalOutput(armix::mixer::ChannelId channel, + std::uint64_t expectedEpoch,std::uint64_t expectedRevision, + int physicalLeft,int physicalRight,bool confirmed) { + if(independent_.active() || !directFence_.permitted() || + routeReconfiguring_.load(std::memory_order_acquire) || + handoff_.busy() || savedDirectSetup_ || savedLiveSetup_ || + diagnosticRoute_.load(std::memory_order_acquire)!= + armix::diagnostics::Route::normal) + return "EXTERNAL OUT: DIRECT ASIO output is not available"; + if(deviceManager_.getCurrentAudioDeviceType()!="ASIO") + return "EXTERNAL OUT: active audio backend must be ASIO"; + auto* device=deviceManager_.getCurrentAudioDevice(); + armix::device::JuceActivePortSnapshot pins; + armix::device::JuceActivePortSnapshot::Fault fault{}; + if(!armix::device::JuceActivePortSnapshot::capture( + device,expectedEpoch,pins,fault) || + !device || !device->isOpen()) + return "EXTERNAL OUT: device pin inventory not verified"; + return dryRoutingLab_.setExternalOutput(channel,expectedEpoch, + expectedRevision,physicalLeft,physicalRight,confirmed,pins); + } + // Direct compact OUT / MONO-STEREO operator edits. One existing M4 // prepared graph is republished; original VST3 instances/Orbit remain // owned by the same native callback. Never touched on RT. @@ -2309,6 +2335,11 @@ class LiveAudioEngine final : private juce::AudioIODeviceCallback } bool dryRoutingLabActive() const noexcept {return dryRoutingLab_.active();} bool hasBoundMixerRoute() const noexcept {return dryRoutingLab_.hasExplicitRoute();} + // Existing verified ASIO external-pair intent is a valid output user + // selection even with SOURCE ONLY / PLAYER A and no microphone INPUT. + bool hasVerifiedExternalOutputIntent() const noexcept { + return dryRoutingLab_.hasVerifiedExternalOutputIntent(); + } void pollDryRoutingLab() noexcept {dryRoutingLab_.poll();} juce::var status() @@ -3119,6 +3150,9 @@ class LiveAudioEngine final : private juce::AudioIODeviceCallback if (renderOwner == armix::mixer::NativeRenderOwner::acceptedM4Session) { + const bool nativePcm=dryRoutingLab_.channelIdPhysicalPcmActive(); + const bool mainOnlyMuted=nativePcm && + masterMute_.load(std::memory_order_relaxed); const auto outputGate=armix::mixer::LiveOutputRouteGate::evaluate( dryRoutingLab_.active(), directFence_.permitted() && !independent_.active(), @@ -3127,7 +3161,7 @@ class LiveAudioEngine final : private juce::AudioIODeviceCallback !masterMute_.load(std::memory_order_relaxed), monitor_.load(std::memory_order_relaxed) && !topologyPublicationMute_.load(std::memory_order_acquire), - secondaryOutput_.armed()); + secondaryOutput_.armed(),nativePcm); const bool outputPermitted=outputGate.renderMain; // Native input PCM must remain observable even with safe output MUTE. // Scan bounded verified callback channels, no allocation or lock. @@ -3165,7 +3199,7 @@ class LiveAudioEngine final : private juce::AudioIODeviceCallback !routeReconfiguring_.load(std::memory_order_acquire) && !topologyPublicationMute_.load(std::memory_order_acquire), std::span( - deckBlocks.data(),deckCount)); + deckBlocks.data(),deckCount),mainOnlyMuted); // Constant-time, callback-local physical PCM tap. Nothing is // reconfigured or acquired from another graph generation. const auto nativeMain=armix::mixer::NativeOutputPairTap::select( @@ -3190,26 +3224,12 @@ class LiveAudioEngine final : private juce::AudioIODeviceCallback // Apply a single output de-click gain per sample, AFTER graph DSP, // without touching third-party plugin lifecycle on the callback. if(routedFxMove!=0 || cycle.fadeOut || cycle.fadeIn) { - const float step=samples>1?1.f/static_cast(samples-1):0.f; - // Fade both INDEPENDENT physical buses on FX MOVE or graph - // handoff, not only MAIN. Same callback, no second DSP pass. - for(int c=0;c<4;++c) { - auto* const out=c<2?nativeMain[static_cast(c)] - :nativeMonitor[static_cast(c-2)]; - if(!out)continue; - float peak=0.f; - for(int i=0;i(i)*step; - const float graphGain=cycle.fadeOut?1.f-phase: - cycle.fadeIn?phase:1.f; - const float moveGain=armix::dsp::FxMoveRamp::gain( - routedFxMove,i,samples); - out[i]*=graphGain*moveGain; - peak=juce::jmax(peak,std::abs(out[i])); - } - if(c==0)movedPeakL=peak; - else if(c==1)movedPeakR=peak; - } + // ONE post-FX envelope for MAIN, MONITOR and ALL physical + // ASIO taps. No second render, user ARM or blocking gate. + armix::mixer::NativeOutputTransition::apply( + outputs,outputChannels,samples,routedFxMove, + cycle.fadeOut,cycle.fadeIn, + nativeMain[0],nativeMain[1],movedPeakL,movedPeakR); if(routedFxMove==1 && cycle.graph) { cycle.graph->orderPacked.store( fxMovePendingOrder_.load(std::memory_order_acquire), diff --git a/src/LiveDryRoutingLab.h b/src/LiveDryRoutingLab.h index 0a380dc99..8390fa7b2 100644 --- a/src/LiveDryRoutingLab.h +++ b/src/LiveDryRoutingLab.h @@ -18,6 +18,7 @@ #include "../engine/core/RealtimeRoutePublisher.h" #include "../engine/core/RealtimeRenderPermit.h" #include "../engine/core/ProductionRenderAudit.h" +#include "../engine/core/LiveOutputRouteGate.h" #include "../engine/device/LiveInputPortRegistry.h" #include #include @@ -1341,6 +1342,7 @@ class LiveDryRoutingLab final { nativeAccepted_.graph.roster=std::move(next); nativeAccepted_.fxOwners=std::move(owner); nativeAccepted_.pcmRevision=published.revision; + reapplyExternalOutputsSameEpoch(); nativeStructureLive_=true; // M4 Show cannot represent new inserts. nativeMeterEpoch_.store(0,std::memory_order_release); out.accepted=true;out.error=""; @@ -1380,7 +1382,8 @@ class LiveDryRoutingLab final { revision,ep,epoch(),false,std::move(fx),false,true); if(!committed.ok()){reply.error="NATIVE_FX_RACK_PCM_COMMIT_REJECTED";return reply;} nativeAccepted_.graph.roster=std::move(roster);nativeAccepted_.fxOwners=std::move(owner); - nativeAccepted_.pcmRevision=committed.revision;nativeStructureLive_=true; + nativeAccepted_.pcmRevision=committed.revision; + reapplyExternalOutputsSameEpoch();nativeStructureLive_=true; nativeMeterEpoch_.store(0,std::memory_order_release); reply.accepted=true;reply.error="";reply.pcmRevision=committed.revision; reply.rosterRevision=nativeAccepted_.graph.roster.revision();return reply; @@ -1535,6 +1538,7 @@ class LiveDryRoutingLab final { nativeAccepted_.graph.roster=std::move(next); nativeAccepted_.fxOwners=std::move(owner); nativeAccepted_.pcmRevision=published.revision; + reapplyExternalOutputsSameEpoch(); // From now on original fixed M4 cannot express the extra BUS. // The native publisher remains the authoritative PCM, and a // failed scalar mirror MUST fault silent rather than reselect @@ -1629,6 +1633,7 @@ class LiveDryRoutingLab final { nativeAccepted_.graph.roster=std::move(roster); nativeAccepted_.fxOwners=std::move(owner); nativeAccepted_.pcmRevision=published.revision; + reapplyExternalOutputsSameEpoch(); nativeStructureLive_=true; // never restore stale M4 width nativeMeterEpoch_.store(0,std::memory_order_release); reply.accepted=true;reply.error=""; @@ -1792,6 +1797,7 @@ class LiveDryRoutingLab final { nativeAccepted_.graph.request=std::move(request); nativeAccepted_.fxOwners=std::move(owner); nativeAccepted_.pcmRevision=published.revision; + reapplyExternalOutputsSameEpoch(); nativeStructureLive_=true; // M4 can no longer represent CH11+ reply.accepted=true;reply.error=""; reply.created=created.createdIds.front(); @@ -1867,6 +1873,7 @@ class LiveDryRoutingLab final { nativeAccepted_.graph.request=std::move(request); nativeAccepted_.fxOwners=std::move(owner); nativeAccepted_.pcmRevision=published.revision; + reapplyExternalOutputsSameEpoch(); std::erase_if(waitingAsioInputs_,[id](const auto& pin){return pin.id==id;}); nativeStructureLive_=true; nativeMeterEpoch_.store(0,std::memory_order_release); @@ -1954,6 +1961,7 @@ class LiveDryRoutingLab final { nativeAccepted_.graph.request=std::move(request); nativeAccepted_.fxOwners=std::move(owner); nativeAccepted_.pcmRevision=published.revision; + reapplyExternalOutputsSameEpoch(); std::erase_if(waitingAsioInputs_,[channel](const auto& pin){return pin.id==channel;}); nativeStructureLive_=true; // M4 source roster no longer authoritative nativeMeterEpoch_.store(0,std::memory_order_release); @@ -2027,6 +2035,7 @@ class LiveDryRoutingLab final { nativeAccepted_.graph.roster=std::move(roster); nativeAccepted_.fxOwners=std::move(owner); nativeAccepted_.pcmRevision=published.revision; + reapplyExternalOutputsSameEpoch(); nativeMeterEpoch_.store(0,std::memory_order_release); r.accepted=true;r.error=""; r.pcmRevision=published.revision; @@ -2101,6 +2110,7 @@ class LiveDryRoutingLab final { nativeAccepted_.graph.roster=std::move(roster); nativeAccepted_.fxOwners=std::move(owner); nativeAccepted_.pcmRevision=published.revision; + reapplyExternalOutputsSameEpoch(); nativeStructureLive_=true; // never fall back to incompatible M4 nativeMeterEpoch_.store(0,std::memory_order_release); r.accepted=true;r.error=""; @@ -2254,6 +2264,7 @@ class LiveDryRoutingLab final { draft.outputs=nativeAccepted_.hardware; draft.request=nativeAccepted_.graph.request; draft.waitingAsioInputs=waitingAsioInputs_; + draft.externalOutputs=externalOutputAssignments_; std::vector staged; std::set hashes; juce::int64 total=0; @@ -2295,6 +2306,110 @@ class LiveDryRoutingLab final { } catch(...) {return "Native graph/VST3 state capture failed";} } + // O1 CONTROL: true ASIO physical pin identity -> packed callback ordinal. + // No OUT reconfiguration is allowed to steal MAIN or MONITOR. Every edit + // preserves the existing internal WIRE graph and FX lease. + juce::String setExternalOutput( + armix::mixer::ChannelId channel,std::uint64_t expectedEpoch, + std::uint64_t expectedRevision,int physicalLeft,int physicalRight, + bool confirmed,const armix::device::JuceActivePortSnapshot& pins) { + using namespace armix::mixer; + if(!channelIdPhysicalPcmActive() || !ready() || + !nativeAccepted_.matches(nativePublisher_,expectedEpoch,expectedRevision) || + !matchesSessionDevice(pins) || pins.epoch!=expectedEpoch || + pins.typeName!="ASIO") + return "EXTERNAL OUT: stale ASIO device, epoch or PCM revision"; + const auto* row=nativeAccepted_.graph.roster.find(channel); + if(!row || (row->role!=ChannelRole::input && + row->role!=ChannelRole::group && + row->role!=ChannelRole::fxReturn)) + return "EXTERNAL OUT: select a live INPUT, GROUP or FX RETURN"; + const bool none=physicalLeft==-1 && physicalRight==-1; + int left=-1,right=-1; + armix::session::StoredExternalOutput candidate; + candidate.channel=channel; + if(!none) { + if(physicalLeft<0 || physicalLeft%2!=0 || + physicalRight!=physicalLeft+1 || + physicalRight>=pins.outputNames.size() || + pins.outputNames[physicalLeft].isEmpty() || + pins.outputNames[physicalRight].isEmpty()) + return "EXTERNAL OUT: invalid or unnamed stereo physical pins"; + for(int i=0;i{}; + std::erase(verified,channel.value); + if(!none)verified.push_back(channel.value); + if(!nativePublisher_.setExternalOutput(expectedEpoch,expectedRevision, + channel,left,right,pins.outputCount)) + return "EXTERNAL OUT: native graph rejected; previous sound retained"; + externalOutputAssignments_=std::move(amended); + externalOutputVerified_=std::move(verified); + externalOutputEpoch_=expectedEpoch; + return {}; + } + + // The accepted graph can be rebuilt for a WIRE/FX edit in the SAME + // verified epoch. Reinstall only existing known pins: never auto-arm + // stale destinations after a device restart or a different ASIO device. + void reapplyExternalOutputsSameEpoch() noexcept { + // Remove deleted ChannelIds BEFORE saving an updated .smix. + std::erase_if(externalOutputAssignments_,[&](const auto& p){ + return nativeAccepted_.graph.roster.find(p.channel)==nullptr; + }); + std::erase_if(externalOutputVerified_,[&](const auto id){ + return nativeAccepted_.graph.roster.find(armix::mixer::ChannelId{id})==nullptr; + }); + if(externalOutputEpoch_!=nativeAccepted_.deviceEpoch)return; + for(const auto& p:externalOutputAssignments_) { + if(std::find(externalOutputVerified_.begin(), + externalOutputVerified_.end(),p.channel.value)== + externalOutputVerified_.end())continue; + int left=-1,right=-1; + const int count=callbackOutputCount_.load(std::memory_order_acquire); + for(int i=0;i callbackPins( + pins.outputByCallback.data(), + static_cast(pins.outputCount)); + externalOutputVerified_.reserve(externalOutputAssignments_.size()); + for(const auto& patch:externalOutputAssignments_) + if(armix::session::MixerDeviceBindingPolicy:: + canRestoreExternalOutput(patch,pins.deviceName, + callbackPins,pins.outputNames,nativeAccepted_.hardware)) + externalOutputVerified_.push_back(patch.channel.value); + if(!externalOutputVerified_.empty()) + externalOutputEpoch_=generation; + } nativeAccepted_.fxOwners=std::move(bank); nativeAccepted_.deviceEpoch=generation; nativeAccepted_.pcmRevision=published.revision; + reapplyExternalOutputsSameEpoch(); nativeStructureLive_=true; nativeControlDirty_=true; publishedEpoch_.store(0,std::memory_order_release); @@ -2396,6 +2534,7 @@ class LiveDryRoutingLab final { // disarmed until the user independently enables monitoring. installNativeHardware(generation,nativeAccepted_.hardware, nativeAccepted_.graph.request.maxFrames); + reapplyExternalOutputsSameEpoch(); return channelIdPhysicalPcmActive()?juce::String{}: juce::String("NEEDS_REMAP: device changed during native publication"); }catch(...) {return "Native session restore exception";} @@ -2707,6 +2846,7 @@ class LiveDryRoutingLab final { nativeAccepted_.graph.request=std::move(request); nativeAccepted_.deviceEpoch=newEpoch; nativeAccepted_.pcmRevision=applied.revision; + reapplyExternalOutputsSameEpoch(); nativeAccepted_.fxOwners=std::move(owner); nativeControlDirty_=true; installNativeHardware(newEpoch,hardware,nativeAccepted_.graph.request.maxFrames); @@ -2741,6 +2881,20 @@ class LiveDryRoutingLab final { bool hasExplicitRoute() const noexcept { return channelIdPhysicalPcmActive() || (ready() && acceptedRoute_.isObject()); } + // CONTROL thread: authorization intent for at least one external ASIO + // pair on THIS device epoch. Do not demand applied PCM here: the first + // callback/readback needs output enabled before it can prove LIVE. + bool hasVerifiedExternalOutputIntent() const noexcept { + if(!channelIdPhysicalPcmActive() || + externalOutputEpoch_!=epoch() || externalOutputVerified_.empty()) + return false; + return std::any_of(externalOutputAssignments_.begin(), + externalOutputAssignments_.end(),[this](const auto& patch) { + return std::find(externalOutputVerified_.begin(), + externalOutputVerified_.end(),patch.channel.value) + !=externalOutputVerified_.end(); + }); + } std::uint64_t epoch() const noexcept { return deviceEpoch_.load(std::memory_order_acquire); } @@ -2769,7 +2923,8 @@ class LiveDryRoutingLab final { std::array* actualOutputPair=nullptr, std::array* actualMonitorPair=nullptr, bool allowMutedMetering=false, - std::span playerPcm={}) noexcept { + std::span playerPcm={}, + bool mainOnlyMuted=false) noexcept { if(actualOutputPair)*actualOutputPair={{-1,-1}}; if(actualMonitorPair)*actualMonitorPair={{-1,-1}}; if(!active())return false; @@ -2889,6 +3044,8 @@ class LiveDryRoutingLab final { // Muted native metering uses scratch and keeps the output ramp at zero. const bool meterOnly=masterMuted && allowMutedMetering && channelIdRender; if(masterMuted) { + // True device disarm primes the next MAIN state without output blips. + mainOnlyMuteSlew_.reset(mainOnlyMuted); masterMonoPolicy_.primeWhileMuted(masterMono); fadeRemaining_=rampFrames; fadeFromL_=fadeFromR_=0.f; @@ -2901,6 +3058,7 @@ class LiveDryRoutingLab final { // Large/variable JUCE quantum is chunked using stack pointer views; // no heap allocation or new processing object inside callback. std::array shifted{}; + std::array outputSlices{}; int max=channelIdRender?static_cast(native>>36): std::min(snapshot->prepared->maxFramesPerPlugin(), reboundQuantum_.load(std::memory_order_acquire)); @@ -2926,6 +3084,9 @@ class LiveDryRoutingLab final { const int n=std::min(max,frames-offset); for(int c=0;c( - slice.data(),playerPcm.size())); + slice.data(),playerPcm.size()), + meterOnly?nullptr:outputSlices.data(), + meterOnly?0:outputCount); if(processed) { for(std::size_t ch=0;chsetProperty("mainOutputs",juce::var(liveMain)); out->setProperty("monitorOutputs",juce::var(liveMonitor)); out->setProperty("monitorSends",juce::var(liveMonitorSends)); + juce::Array external; + for(const auto& patch:externalOutputAssignments_) { + auto row=std::make_unique(); + row->setProperty("channelId",juce::String(std::to_string(patch.channel.value))); + row->setProperty("physicalLeft",patch.left); + row->setProperty("physicalRight",patch.right); + row->setProperty("leftName",patch.leftName); + row->setProperty("rightName",patch.rightName); + const auto live=nativePublisher_.externalOutput( + nativeAccepted_.deviceEpoch,nativeAccepted_.pcmRevision,patch.channel); + const auto applied=nativePublisher_.appliedExternalOutput( + nativeAccepted_.deviceEpoch,nativeAccepted_.pcmRevision,patch.channel); + const bool installed=nativePcm && externalOutputEpoch_==epoch() && + live.first>=0 && live.second>=0 && + applied==live && + live.firstsetProperty("status",installed?"LIVE": + (nativePcm && externalOutputEpoch_==epoch() && live.first>=0 && + live.second>=0)?"PENDING":"NEEDS_REMAP"); + external.add(juce::var(row.release())); + } + out->setProperty("externalOutputs",juce::var(external)); out->setProperty("note","Native 10CH+4AUX production mixer; unpatched startup is SILENT. Explicit input assignment/ACK required. Hardware FAT unqualified."); return juce::var(out.release()); } private: std::vector waitingAsioInputs_; + std::vector externalOutputAssignments_; + std::vector externalOutputVerified_; // per amplifier, CONTROL only + std::uint64_t externalOutputEpoch_=0; // CONTROL only, never callback state // Four 9-bit callback indices (0 means absent) and the prepared quantum. // One atomic read gives AUDIO a coherent destination/quantum contract. std::atomic nativeHardware_{0}; @@ -3287,4 +3485,5 @@ class LiveDryRoutingLab final { std::uint64_t audioRevision_=0,audioEpoch_=0; float fadeFromL_=0.f,fadeFromR_=0.f; float lastOutputL_=0.f,lastOutputR_=0.f; + armix::mixer::MainOnlyMuteSlew mainOnlyMuteSlew_{}; }; diff --git a/src/Main.cpp b/src/Main.cpp index 698621e20..8139835eb 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -1701,6 +1701,15 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr if(auto* obj=accepted.getDynamicObject()) { obj->setProperty("channelAppearance",channelAppearance_.snapshot(accepted.getProperty("graph",{}))); obj->setProperty("waitingAsioInputs",live.getProperty("waitingAsioInputs",0)); + obj->setProperty("externalOutputs", + live.getProperty("dryRoutingLab",{}).getProperty("externalOutputs",{})); + obj->setProperty("externalRevision", + live.getProperty("dryRoutingLab",{}).getProperty("nativeBus",{}) + .getProperty("graphRevision",{})); + obj->setProperty("physicalMainOutputs", + live.getProperty("dryRoutingLab",{}).getProperty("mainOutputs",{})); + obj->setProperty("physicalMonitorOutputs", + live.getProperty("dryRoutingLab",{}).getProperty("monitorOutputs",{})); } return accepted; } @@ -1995,9 +2004,13 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr // patch. A later device epoch or a user MUTE cancels the pending arm. std::uint64_t autoMainEpoch_=0; bool autoMainRequiresInput_=true; + // Operator's explicit OUTPUT MUTE must survive later input/FX/EXT edits. + // This control-thread intent is NOT a new callback gate or device lock. + bool operatorOutputMuted_=false; std::optional autoMainCheckedRevision_; void serviceAutomaticMain() { if(autoMainEpoch_==0)return; + if(operatorOutputMuted_){autoMainEpoch_=0;return;} if(autoMainEpoch_!=engine_.dryRoutingLabEpoch() || engine_.isMonitorEnabled()) { autoMainEpoch_=0; @@ -2011,7 +2024,12 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr // A transient native graph/FX ACK must not permanently consume // the only automatic MAIN attempt for this control revision. // Retry only the cheap CONTROL preflight until it is genuinely safe. - if(engine_.liveOutputArmFault(autoMainRequiresInput_).isNotEmpty())return; + // SOURCE ONLY/PLAYER -> confirmed EXTERNAL OUT is a complete hardware + // route. Requiring a microphone as well would strand it at MONITOR OFF. + // Only same-epoch, driver-verified pins qualify (not stale .smix text). + const bool requireInput=autoMainRequiresInput_ && + !engine_.hasVerifiedExternalOutputIntent(); + if(engine_.liveOutputArmFault(requireInput).isNotEmpty())return; autoMainCheckedRevision_=revision; engine_.setMonitorEnabled(true); autoMainEpoch_=0; @@ -2019,6 +2037,7 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr } void requestAutomaticMain(bool requireInput=true) { + if(operatorOutputMuted_){autoMainEpoch_=0;return;} autoMainRequiresInput_=requireInput; autoMainEpoch_=engine_.dryRoutingLabEpoch(); autoMainCheckedRevision_.reset(); @@ -4547,6 +4566,56 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr // ACK is not PCM proof; the bridge requires a LATER snapshot. return; } + // O1: native CONTROL intent, exact verified ASIO physical pair. + // Never reinterpret an external destination as internal WIRE/M4 OUT. + if(action=="routingExternalOutput") { + const auto requestId=args.getProperty("requestId",{}).toString(); + const auto channelText=args.getProperty("channelId",{}).toString(); + const auto ep=args.getProperty("deviceEpoch",{}); + const auto rv=args.getProperty("revision",{}); + const auto confirmed=args.getProperty("confirmed",{}); + const int left=static_cast(args.getProperty("left",-2)); + const int right=static_cast(args.getProperty("right",-2)); + const auto nativeStatus=engine_.status().getProperty("dryRoutingLab",{}); + const auto bus=nativeStatus.getProperty("nativeBus",{}); + const bool tokens= + armix::console::nativeSessionTokenMatches( + ep,nativeStatus.getProperty("epoch",{})) && + armix::console::nativeSessionTokenMatches( + rv,bus.getProperty("graphRevision",{})); + std::uint64_t rawId=0; + const bool idOk=armix::session::parseDecimal(juce::var(channelText),rawId); + juce::String error="EXTERNAL OUT: invalid or stale native request"; + if(requestId.startsWith("out-o-") && requestId.length()<=64 && + tokens && idOk && confirmed.isBool() && + ((left==-1 && right==-1) || (left>=0 && right>=0)) && + !nativeShowBusy_ && !studioBackupBusy_) + error=engine_.setPhysicalExternalOutput( + armix::mixer::ChannelId{rawId}, + armix::console::nativeSessionTokenValue(ep), + armix::console::nativeSessionTokenValue(rv), + left,right,static_cast(confirmed)); + auto ack=std::make_unique(); + ack->setProperty("requestId",requestId); + ack->setProperty("channelId",channelText); + ack->setProperty("ok",error.isEmpty()); + ack->setProperty("error",error); + ack->setProperty("deviceEpoch",ep); + ack->setProperty("graphRevision",rv); + if(browser_.loaded) + browser_.emitEventIfBrowserIsVisible( + "arMixExternalOutputAck",juce::var(ack.release())); + if(error.isNotEmpty())emitNotice(error,true); + else { + // The operator has already confirmed this exact ASIO pair. + // Complete first-sound automatically; never force MONITOR/ARM + // again, and never override a deliberate OUTPUT MUTE. + if(left>=0 && !operatorOutputMuted_ && !engine_.isMonitorEnabled()) + requestAutomaticMain(false); + emitApprovedNativeSnapshot(); // callback readback proves LIVE + } + return; + } // A visible /preview/ channel OUT changes this same installed M4 // topology. Only actual MAIN / NONE semantics are supported here. if(action=="routingChannelPatch"){ @@ -6218,6 +6287,7 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr engine_.diagnosticRoute()==armix::diagnostics::Route::normal) fault=engine_.liveOutputArmFault(); if (fault.isEmpty()) { + operatorOutputMuted_=!arm; // an explicit user control, not setup mute autoMainEpoch_=0; if(!arm)engine_.cancelAsioResetMonitorIntent(); engine_.setMonitorEnabled(arm); diff --git a/src/NativeMixerSessionDocument.h b/src/NativeMixerSessionDocument.h index b19517128..4dbdfbb8b 100644 --- a/src/NativeMixerSessionDocument.h +++ b/src/NativeMixerSessionDocument.h @@ -34,6 +34,17 @@ struct WaitingAsioInput final { int left=-1,right=-1; // physical pin indices, for legacy files without labels juce::String leftName,rightName; }; +// Physical pin identity is durable intent only. Never serialize callback +// ordinals, a LIVE flag, an armed amplifier or a native processor pointer. +struct StoredExternalOutput final { + ChannelId channel{}; + int left=-1,right=-1; // actual 0-based driver physical pins + juce::String leftName,rightName; + // The ASIO playback registration that the operator actually confirmed. + // Never overwrite this when a .smix is rebound to a different device: + // generic OUT 3/4 labels do not authorize a new physical amplifier. + juce::String playbackDevice; +}; struct StoredInsert final { ChannelId channel{}; std::size_t slot=0; @@ -55,6 +66,7 @@ struct MixerSessionDocument final { VerifiedNativeOutputs outputs{}; HardwareBinding binding{}; std::vector waitingAsioInputs; + std::vector externalOutputs; std::vector inserts; std::vector rackBypassed; // Logical-only per-slot bypass intentions; no fabricated FX processor @@ -90,6 +102,37 @@ struct MixerDeviceBindingPolicy final { (a.monitorL==b.monitorL && a.monitorR==b.monitorR)); } enum class Mode { exact, verifiedDeviceApply, verifiedMainPinApply, verifiedAsioRestart }; + // CONTROL-only independent ASIO EXTERNAL restore admission. Each saved + // ChannelId is judged against its original driver and currently enabled + // physical pins; a missing pair or MAIN/MONITOR collision cannot arm an + // unrelated amp. The supplied callback ordinals are NOT physical labels. + static bool canRestoreExternalOutput( + const StoredExternalOutput& patch, + const juce::String& currentDevice, + std::span physicalByCallback, + const juce::StringArray& physicalNames, + const VerifiedNativeOutputs& hw) { + if(patch.playbackDevice.isEmpty() || + patch.playbackDevice!=currentDevice || + !hw.valid() || + hw.activeOutputChannels!=static_cast(physicalByCallback.size()) || + patch.left<0 || patch.left%2!=0 || patch.right!=patch.left+1 || + patch.right>=physicalNames.size() || + patch.leftName.isEmpty() || patch.rightName.isEmpty() || + physicalNames[patch.left]!=patch.leftName || + physicalNames[patch.right]!=patch.rightName)return false; + int left=-1,right=-1; + for(std::size_t i=0;i(i); + if(physicalByCallback[i]==patch.right)right=static_cast(i); + } + if(left<0 || right<0 || left==right || + left==hw.mainL || left==hw.mainR || + right==hw.mainL || right==hw.mainR)return false; + return !hw.monitorEnabled || + (left!=hw.monitorL && left!=hw.monitorR && + right!=hw.monitorL && right!=hw.monitorR); + } static bool isAsio4All(const HardwareBinding& binding) { return binding.backend=="ASIO" && binding.playback.startsWithIgnoreCase("ASIO4ALL"); } @@ -259,6 +302,13 @@ struct MixerDeviceBindingPolicy final { sources=std::move(mapped); } } + // Legacy in-memory O1 patches may lack explicit provenance. Capture + // the OLD registered ASIO device before rebinding document.binding. + // Keeping this identifier through later Save/Open stops a changed + // driver with coincidentally matching "OUT 3/4" labels auto-arming. + for(auto& patch:document.externalOutputs) + if(patch.playbackDevice.isEmpty()) + patch.playbackDevice=document.binding.playback; document.request.physicalInputs=callbackInputs; document.binding=live; document.outputs=outputs; @@ -455,6 +505,20 @@ class Codec final { set(output,"monitorR",d.outputs.monitorR); set(output,"monitorEnabled",d.outputs.monitorEnabled); set(root,"outputs",output); + if(!d.externalOutputs.empty()) { + juce::Array assignments; + for(const auto& patch:d.externalOutputs) { + auto row=object(); + set(row,"channelId",decimal(patch.channel.value)); + set(row,"left",patch.left);set(row,"right",patch.right); + set(row,"leftName",patch.leftName); + set(row,"rightName",patch.rightName); + if(patch.playbackDevice.isNotEmpty()) + set(row,"playbackDevice",patch.playbackDevice); + assignments.add(row); + } + set(root,"externalOutputs",juce::var(assignments)); + } auto master=object(); set(master,"gain",d.masterGain);set(master,"mute",d.masterMute); set(master,"mono",d.masterMono);set(root,"master",master); @@ -644,6 +708,34 @@ class Codec final { entries.push_back(std::move(row)); } if(!doc.roster.restoreExact(doc.acceptedRevision,entries))return false; + // O1 additive intent, never implicit hardware admission on Open. + const auto external=get(root,"externalOutputs"); + if(!external.isVoid()) { + const auto* assignments=external.getArray(); + if(!assignments || assignments->size()>channels->size())return false; + std::set seen; + for(const auto& item:*assignments) { + StoredExternalOutput patch; + if(!parseDecimal(get(item,"channelId"),patch.channel.value) || + !seen.insert(patch.channel.value).second || + !integral(get(item,"left"),patch.left,0,255) || + !integral(get(item,"right"),patch.right,0,255) || + patch.left%2!=0 || patch.right!=patch.left+1 || + !textField(get(item,"leftName"),patch.leftName,256) || + !textField(get(item,"rightName"),patch.rightName,256)) + return false; + const auto origin=get(item,"playbackDevice"); + if(!origin.isVoid() && + !textField(origin,patch.playbackDevice,256))return false; + if(patch.playbackDevice.isEmpty()) + patch.playbackDevice=doc.binding.playback; // legacy .smix + const auto* owner=doc.roster.find(patch.channel); + if(!owner || (owner->role!=ChannelRole::input && + owner->role!=ChannelRole::group && + owner->role!=ChannelRole::fxReturn))return false; + doc.externalOutputs.push_back(std::move(patch)); + } + } // Optional additive H1 field. Old .smix sessions decode unchanged. // Exact ChannelId ownership prevents rename/reorder/strip replacement // from silently retargeting an operator's global shortcut. diff --git a/tests/approved_native_m2_contract.test.cjs b/tests/approved_native_m2_contract.test.cjs index c99521820..124f26b32 100644 --- a/tests/approved_native_m2_contract.test.cjs +++ b/tests/approved_native_m2_contract.test.cjs @@ -801,7 +801,8 @@ test("P0 same-VB-Cable feedback is blocked before native MAIN arm",()=>{ assert.match(engine,/MONITOR OFF: VB-Cable capture\/playback self-loop/); assert.match(bridge,/const virtualCableFeedbackPair=/); const native=read("src/Main.cpp"); - assert.match(native,/if\(engine_\.liveOutputArmFault\(autoMainRequiresInput_\)\.isNotEmpty\(\)\)return;/); + assert.match(native,/const bool requireInput=autoMainRequiresInput_ &&\s*!engine_\.hasVerifiedExternalOutputIntent\(\)/); + assert.match(native,/if\(engine_\.liveOutputArmFault\(requireInput\)\.isNotEmpty\(\)\)return;/); assert.match(native,/autoMainEpoch_!=engine_\.dryRoutingLabEpoch\(\)/); }); test("single /preview/ GUI: channel IN, actual OUT and correlated device safety ACK",()=>{ @@ -1835,3 +1836,123 @@ test("M5 native operator status renders useful actions without exposing internal assert.deepEqual(state,before); assert.ok(protocol.normalizeSnapshot(state).admitted); }); + + +test("O2 independent per-track external ASIO transactions and clear rejected ACK",()=>{ + const src=read("web/approved-native-bridge.js"); + const builder=read("scripts/build_approved_native_gui.py"); + assert.match(src,/const pendingExternal=new Map\(\)/); + assert.match(src,/pendingExternal\.has\(id\)/); + assert.match(src,/pendingExternal\.set\(id,/); + assert.match(src,/pendingExternal\.delete\(id\)/); + assert.match(src,/select\?\.removeAttribute\("aria-busy"\)/); + assert.match(src,/if\(!pendingExternal\.has\(id\)\)select\.removeAttribute/); + assert.match(src,/SHARED with /); + assert.match(src,/signals SUM/); + assert.match(builder,/external-out-state/); +}); + +test("O2 SOURCE ONLY confirmed ASIO EXTERNAL OUT auto-arms without a second Monitor click",()=>{ + const native=read("src/Main.cpp"),engine=read("src/LiveAudioEngine.h"); + const routing=read("src/LiveDryRoutingLab.h"); + const start=native.indexOf('if(action=="routingExternalOutput")'); + const end=native.indexOf('if(action=="routingChannelPatch")',start); + assert.ok(start>=0&&end>start,"real native external-output action is present"); + const control=native.slice(start,end); + assert.match(control,/error=engine_\.setPhysicalExternalOutput/); + assert.match(control,/if\(left>=0 && !operatorOutputMuted_ && !engine_\.isMonitorEnabled\(\)\)\s*requestAutomaticMain\(false\)/); + assert.match(control,/emitApprovedNativeSnapshot\(\); \/\/ callback readback proves LIVE/); + assert.match(native,/operatorOutputMuted_=!arm; \/\/ an explicit user control/); + assert.match(native,/if\(operatorOutputMuted_\)\{autoMainEpoch_=0;return;\}/); + assert.match(native,/autoMainRequiresInput_ &&\s*!engine_\.hasVerifiedExternalOutputIntent\(\)/); + assert.match(engine,/bool hasVerifiedExternalOutputIntent\(\) const noexcept/); + assert.match(routing,/externalOutputEpoch_!=epoch\(\)/); + assert.match(routing,/externalOutputVerified_\.empty\(\)/); + assert.doesNotMatch(control,/setMonitorEnabled\(true\)|setOutputMuted\(false\)/, + "Control delegates one-shot automatic output acceptance, not blind arm"); +}); + +test("O2 external OUT never reports LIVE while driver output is muted",()=>{ + const bridge=read("web/approved-native-bridge.js"); + const css=read("scripts/build_approved_native_gui.py"); + assert.match(bridge,/const pcmInstalled=row\?\.status==="LIVE"&&match/); + assert.match(bridge,/next\?\.device\?\.outputArmed===true\?"LIVE":"MUTED"/); + assert.match(bridge,/state==="MUTED"\?"ASIO pair connected/); + assert.match(bridge,/state==="LIVE"\|\|state==="MUTED"/); + assert.match(bridge,/EXTERNAL OUT patched · hardware output muted/); + assert.match(css,/external-out-state\[data-status="MUTED"\]/); +}); + +test("O2 SHARED output means two or more ChannelIds, not one",()=>{ + const bridge=read("web/approved-native-bridge.js"); + assert.match(bridge,/shared>1\?" · SHARED "\+shared\+" SOURCES"/); + assert.match(bridge,/const shared=Array\.isArray\(hardware\?\.raw\?\.externalOutputs\)/); + assert.doesNotMatch(bridge,/shared\?" · SHARED "\+shared/); +}); + +test("O3 OUTPUTS overview reflects real ASIO 8-pin ownership and callback status",()=>{ + const state=acceptedFixture(),voice=state.graph.channels[0].id; + state.device.backend="ASIO"; + state.device.outputArmed=true; + state.device.enabledOutputs=[0,1,2,3,4,5,6,7]; + state.device.outputEndpoints=state.device.enabledOutputs.map(n=>({ + id:"out:"+n,port:n,callback:n,label:"ASIO "+(n+1),active:true + })); + const group=(id,name)=>({id,name,role:"GROUP",processingFormat:"STEREO", + controls:{faderDb:0,pan:0,mute:false,solo:false},inserts:[],sends:[]}); + state.graph.channels.splice(1,0,group("9007199254740994","Music Bus"), + group("9007199254740995","Monitor Bus")); + state.physicalMainOutputs=[0,1]; + state.physicalMonitorOutputs=[2,3]; + state.externalOutputs=[ + {channelId:voice,physicalLeft:4,physicalRight:5,status:"LIVE"}, + {channelId:"9007199254740994",physicalLeft:6,physicalRight:7,status:"LIVE"}, + {channelId:"9007199254740995",physicalLeft:6,physicalRight:7,status:"LIVE"} + ]; + const read=()=>protocol.physicalOutputOverview(protocol.normalizeSnapshot(state)); + let out=read(); + assert.equal(out.length,4); + assert.deepEqual(out.map(row=>row.pair),["OUT 1/2","OUT 3/4","OUT 5/6","OUT 7/8"]); + assert.equal(out[0].role,"MAIN"); + assert.equal(out[1].role,"MONITOR"); + assert.equal(out[2].status,"LIVE"); + assert.equal(out[2].owners,"Vocal"); + assert.equal(out[2].shared,1,"single source must never be called SHARED"); + assert.equal(out[3].status,"LIVE"); + assert.equal(out[3].shared,2); + assert.match(out[3].owners,/Music Bus \+ Monitor Bus/); + state.device.outputArmed=false; + out=read(); + assert.equal(out[0].status,"MUTED"); + assert.equal(out[2].status,"MUTED"); + assert.equal(out[3].status,"MUTED"); + assert.equal(out[3].shared,2,"verified patch ownership persists through mute"); + state.device.outputArmed=true; + state.externalOutputs[2].status="PENDING"; + out=read(); + assert.equal(out[3].shared,1,"pending patch is not already installed PCM"); + state.externalOutputs[1].status="NEEDS_REMAP"; + out=read(); + assert.equal(out[3].status,"PENDING"); + assert.equal(out[3].shared,0); + state.device.outputEndpoints[7].active=false; + out=read(); + assert.equal(out.find(row=>row.role==="EXTERNAL"&&row.pair==="OUT 7/8").status, + "NEEDS_REMAP","disabled physical pin can never be LIVE"); + state.device.backend="WASAPI"; + assert.deepEqual(read(),[],"ASIO patch view must not invent WASAPI pairs"); +}); + +test("O3 OUTPUTS stays in one existing Audio I/O with safe, read-only DOM",()=>{ + const bridge=read("web/approved-native-bridge.js"); + assert.match(bridge,/protocol\.physicalOutputOverview\(next\)/); + assert.match(bridge,/paintPhysicalOutputs\(next\)/); + assert.match(bridge,/paintPhysicalOutputs\(hardware\)/); + assert.match(bridge,/class="armix-output-overview" data-audio-output-overview/); + assert.match(bridge,/class="armix-output-heading"/); + assert.doesNotMatch(bridge,/
native ACK -> callback readback. + + The backend is a controlled mock. This proves the UI transaction and + presentation, NOT actual physical sound on an eight-pin ASIO device. + """ + page.add_init_script("""window.__nativeListeners=new Map();window.__outActions=[]; + window.confirm=()=>true; + window.__JUCE__={backend:{ + emitEvent(name,payload){if(name==='arMixAction')window.__outActions.push(payload);}, + addEventListener(name,callback){window.__nativeListeners.set(name,callback);}}};""") + errors=[] + page.on("pageerror",lambda error:errors.append(str(error))) + page.goto((out / "index.html").as_uri()) + page.wait_for_function("()=>window.__ARMIX_NATIVE_M2__?.enabled") + state=snapshot() + state["productionCallbackLive"]=True + state["device"].update(backend="ASIO",outputArmed=True, + enabledOutputs=list(range(8)), + outputEndpoints=[{"id":"out:"+str(n),"port":n,"callback":n, + "label":"ASIO "+str(n+1),"active":True} for n in range(8)]) + state["physicalMainOutputs"]=[0,1] + state["physicalMonitorOutputs"]=[2,3] + state["externalRevision"]="2" + state["externalOutputs"]=[] + emit(page,"arMixConsoleSnapshot",state) + page.wait_for_selector('#tracks .strip[data-id="2"] select[data-field="external"]',state="attached") + page.locator("[data-native-io]").click() + matrix=page.locator("[data-audio-output-matrix] .armix-output-row") + assert matrix.count()==4,[x.inner_text() for x in matrix.all()] + assert "MAIN" in matrix.nth(0).inner_text() + assert "MONITOR" in matrix.nth(1).inner_text() + assert "FREE" in matrix.nth(2).inner_text() + page.locator("[data-audio-close]").click() + first=page.locator('#tracks .strip[data-id="1"] select[data-field="external"]') + second=page.locator('#tracks .strip[data-id="2"] select[data-field="external"]') + choices=first.locator("option").all_text_contents() + choice=next(x for x in choices if x.startswith("OUT 5/6")) + first.select_option(label=choice) + actions=page.evaluate("()=>window.__outActions.filter(x=>x.action==='routingExternalOutput')") + assert len(actions)==1,actions + requested=actions[0] + assert (requested["channelId"]==SOURCE and requested["deviceEpoch"]==state["device"]["epoch"] + and requested["revision"]=="2" and requested["left"]==4 and requested["right"]==5 + and requested["confirmed"] is True),requested + assert first.get_attribute("aria-busy")=="true" + # Failed ACK only clears the affected busy state; PCM remains unchanged. + emit(page,"arMixExternalOutputAck",{"requestId":requested["requestId"], + "ok":False,"error":"TEST_REJECTED"}) + assert first.get_attribute("aria-busy") is None + assert first.input_value()=="None" + first.select_option(label=choice) + actions=page.evaluate("()=>window.__outActions.filter(x=>x.action==='routingExternalOutput')") + assert len(actions)==2,actions + accepted=actions[-1] + emit(page,"arMixExternalOutputAck",{"requestId":accepted["requestId"],"ok":True}) + # ACK is NOT yet a callback-applied LIVE patch. + state["externalOutputs"]=[{"channelId":SOURCE,"physicalLeft":4,"physicalRight":5, + "status":"PENDING"}] + emit(page,"arMixConsoleSnapshot",state) + assert first.get_attribute("data-status")=="PENDING" + assert first.get_attribute("aria-busy")=="true" + state["externalOutputs"][0]["status"]="LIVE" + emit(page,"arMixConsoleSnapshot",state) + assert first.get_attribute("data-status")=="LIVE" + assert first.get_attribute("aria-busy") is None + # A second independent ChannelId may deliberately share a physical pair. + second.select_option(label=choice) + actions=page.evaluate("()=>window.__outActions.filter(x=>x.action==='routingExternalOutput')") + assert len(actions)==3,actions + assert actions[-1]["channelId"]==RECEIVER + emit(page,"arMixExternalOutputAck",{"requestId":actions[-1]["requestId"],"ok":True}) + state["externalOutputs"].append({"channelId":RECEIVER,"physicalLeft":4, + "physicalRight":5,"status":"LIVE"}) + emit(page,"arMixConsoleSnapshot",state) + assert second.get_attribute("data-status")=="LIVE" + assert "SHARED 2 SOURCES" in first.input_value(),first.input_value() + page.locator("[data-native-io]").click() + row=page.locator("[data-audio-output-matrix] .armix-output-row").filter(has_text="OUT 5/6") + assert "SHARED 2" in row.inner_text(),row.inner_text() + assert "CH03" in row.inner_text() and "CH04" in row.inner_text() + state["device"]["outputArmed"]=False + emit(page,"arMixConsoleSnapshot",state) + assert first.get_attribute("data-status")=="MUTED" + assert "MUTED" in row.inner_text(),row.inner_text() + # Driver no longer attests a pin: remembered intent is REMAP, never LIVE. + state["device"]["outputEndpoints"][5]["active"]=False + for patch in state["externalOutputs"]: + patch["status"]="NEEDS_REMAP" + emit(page,"arMixConsoleSnapshot",state) + assert first.get_attribute("data-status")=="NEEDS_REMAP" + assert "NEEDS REMAP" in row.inner_text(),row.inner_text() + assert not errors,errors + page.screenshot(path="native-external-output-matrix.png") + def main(): spec = importlib.util.spec_from_file_location("native_bundle", ROOT / "scripts/build_approved_native_gui.py") bundle = importlib.util.module_from_spec(spec) @@ -154,6 +250,9 @@ def main(): impact = browser.new_page(viewport={"width": 1366, "height": 768}) verify_socket_impact(impact, out) impact.close() + output_page = browser.new_page(viewport={"width":1366,"height":900}) + verify_external_output(output_page,out) + output_page.close() for width, height in [(1366, 768), (1680, 900), (1920, 1080)]: page = browser.new_page(viewport={"width": width, "height": height}) errors = [] diff --git a/tests/juce_active_port_snapshot_test.cpp b/tests/juce_active_port_snapshot_test.cpp index 06fd698b7..f6ee57979 100644 --- a/tests/juce_active_port_snapshot_test.cpp +++ b/tests/juce_active_port_snapshot_test.cpp @@ -1,8 +1,8 @@ // SPDX-License-Identifier: AGPL-3.0-only -#include "../engine/device/JuceActivePortSnapshot.h" #if defined(NDEBUG) #undef NDEBUG #endif +#include "../engine/device/JuceActivePortSnapshot.h" #include #include using namespace armix::device; @@ -49,6 +49,20 @@ int main(){ assert(!JuceActivePortSnapshot::fromMasks(13,in,out,snap,fault)); assert(fault==JuceActivePortSnapshot::Fault::emptyOutput); assert(snap.inputs.callbackIndex(9)==-1); // failed 0-OUT preserves accepted zero-input snapshot + // Sparse ASIO mask: physical OUT 5/6 are callback ordinals 2/3. + juce::BigInteger sparse; + for(const int pin: {0,1,4,5})sparse.setBit(pin); + assert(JuceActivePortSnapshot::fromMasks(14,in,sparse,snap,fault)); + assert(snap.outputCount==4); + assert(snap.outputPhysicalPort(0)==0); + assert(snap.outputPhysicalPort(1)==1); + assert(snap.outputPhysicalPort(2)==4); + assert(snap.outputPhysicalPort(3)==5); + assert(snap.matchesCallback(14,0,4)); + sparse.clearBit(5); // no fabricated partner for physical OUT 5 + assert(JuceActivePortSnapshot::fromMasks(15,in,sparse,snap,fault)); + assert(snap.outputCount==3 && snap.outputPhysicalPort(2)==4); + assert(snap.outputPhysicalPort(3)==-1); assert(!JuceActivePortSnapshot::capture(nullptr,12,snap,fault)); assert(fault==JuceActivePortSnapshot::Fault::nullDevice); } diff --git a/tests/live_graph_contract_test.mjs b/tests/live_graph_contract_test.mjs index dad4468c4..c2165769d 100644 --- a/tests/live_graph_contract_test.mjs +++ b/tests/live_graph_contract_test.mjs @@ -4,6 +4,7 @@ import test from 'node:test'; import assert from 'node:assert/strict'; import {readFileSync} from 'node:fs'; const e=readFileSync('src/LiveAudioEngine.h','utf8'); +const externalTransition=readFileSync('engine/core/NativeOutputTransition.h','utf8'); const h=readFileSync('src/LiveGraphHandoff.h','utf8'); const m=readFileSync('src/Main.cpp','utf8'); const b=readFileSync('web/bridge.js','utf8'); @@ -87,11 +88,16 @@ test('R0B CH1 MOVE inside routed 10CH graph uses the same callback-boundary de-c const begin=e.indexOf('if (renderOwner ==',e.indexOf('callbackCount_.fetch_add')); const end=e.indexOf('const bool enabled = monitor_',begin); const routed=e.slice(begin,end); - assert.match(routed,/FxMoveRamp::gain\(\s*routedFxMove,i,samples\)/); + // The same FX MOVE envelope now runs across ALL native physical ASIO pins, + // in a shared output-only helper after the single authoritative DSP pass. + assert.match(routed,/NativeOutputTransition::apply\(/); + assert.match(routed,/outputs,outputChannels,samples,routedFxMove/); + assert.match(externalTransition,/for\(int c=0;corderPacked\.store/); - assert.ok(routed.indexOf('FxMoveRamp::gain') full{{0,1,2,3,4,5,6,7}}; + const auto same=[&](const StoredExternalOutput& p) { + return MixerDeviceBindingPolicy::canRestoreExternalOutput( + p,"Verified ASIO",full,doc.binding.outputNames,doc.outputs); + }; + assert(same(loaded.externalOutputs[0])); + assert(same(loaded.externalOutputs[1])); + // A new ASIO device uses identical generic labels. A verified device + // APPLY must not silently transfer saved amp ownership to the new DAC. + auto newDevice=doc.binding; + newDevice.capture=newDevice.playback="Different ASIO"; + assert(MixerDeviceBindingPolicy::apply(loaded,newDevice,doc.outputs, + 2,BindingMode::verifiedDeviceApply).isEmpty()); + assert(loaded.binding.playback=="Different ASIO"); + assert(loaded.externalOutputs[0].playbackDevice=="Verified ASIO"); + assert(!MixerDeviceBindingPolicy::canRestoreExternalOutput( + loaded.externalOutputs[0],"Different ASIO",full, + newDevice.outputNames,doc.outputs)); + MixerSessionDocument reopened; + assert(Codec::decode(Codec::encode(loaded),reopened)); + assert(reopened.externalOutputs[0].playbackDevice=="Verified ASIO"); + assert(!MixerDeviceBindingPolicy::canRestoreExternalOutput( + reopened.externalOutputs[0],"Different ASIO",full, + newDevice.outputNames,doc.outputs)); + // Even when the driver itself returns, a 6-pin enabled mask must + // authorize 3/4 independently and keep missing 5/6 as NEEDS_REMAP. + const std::array sparse{{0,1,2,3,6,7}}; + VerifiedNativeOutputs sparseHw{6,0,1,-1,-1,false}; + assert(MixerDeviceBindingPolicy::canRestoreExternalOutput( + doc.externalOutputs[0],"Verified ASIO",sparse, + doc.binding.outputNames,sparseHw)); + assert(!MixerDeviceBindingPolicy::canRestoreExternalOutput( + doc.externalOutputs[1],"Verified ASIO",sparse, + doc.binding.outputNames,sparseHw)); + // Another active stereo pair may only be restored by exact original + // driver and without collisions against MAIN or MONITOR. + auto hw=doc.outputs;hw.mainL=2;hw.mainR=3; + assert(!MixerDeviceBindingPolicy::canRestoreExternalOutput( + doc.externalOutputs[0],"Verified ASIO",full, + doc.binding.outputNames,hw)); + hw=doc.outputs;hw.monitorEnabled=true;hw.monitorL=4;hw.monitorR=5; + assert(!MixerDeviceBindingPolicy::canRestoreExternalOutput( + doc.externalOutputs[1],"Verified ASIO",full, + doc.binding.outputNames,hw)); + auto renamed=doc.binding.outputNames; + renamed.set(2,"MOVED AMP"); + assert(!MixerDeviceBindingPolicy::canRestoreExternalOutput( + doc.externalOutputs[0],"Verified ASIO",full,renamed,doc.outputs)); + // Migration: an O1-v1 .smix with no playbackDevice property inherits + // only its ORIGINAL saved binding. It cannot be claimed by another ASIO. + auto legacyJson=juce::JSON::parse(saved); + auto* legacy=legacyJson.getProperty("externalOutputs",{}).getArray(); + assert(legacy&&legacy->size()==2); + for(auto& item:*legacy)item.getDynamicObject()->removeProperty("playbackDevice"); + assert(Codec::decode(juce::JSON::toString(legacyJson,false),reopened)); + assert(reopened.externalOutputs[0].playbackDevice=="Verified ASIO"); + assert(!MixerDeviceBindingPolicy::canRestoreExternalOutput( + reopened.externalOutputs[0],"Different ASIO",full, + doc.binding.outputNames,doc.outputs)); + // A bogus explicit provenance cannot bypass the decoder. + auto bad=juce::JSON::parse(saved); + bad.getProperty("externalOutputs",{}).getArray()->getReference(0) + .getDynamicObject()->setProperty("playbackDevice",juce::var(15)); + assert(!Codec::decode(juce::JSON::toString(bad,false),reopened)); +} +static void verifyExternalOutputPortableIntent() { + auto doc=makeSession(); + // Two additional amplifier pairs are physical intent, not armed state. + doc.binding.outputMask="ff"; + doc.binding.outputNames={"ASIO OUT 1","ASIO OUT 2", + "ASIO OUT 3","ASIO OUT 4","ASIO OUT 5","ASIO OUT 6", + "ASIO OUT 7","ASIO OUT 8"}; + doc.outputs.activeOutputChannels=8; + doc.externalOutputs.push_back({{16},2,3,"ASIO OUT 3","ASIO OUT 4"}); + doc.externalOutputs.push_back({{12},4,5,"ASIO OUT 5","ASIO OUT 6"}); + const auto encoded=Codec::encode(doc); + MixerSessionDocument loaded; + assert(Codec::decode(encoded,loaded)); + assert(loaded.externalOutputs.size()==2); + assert(loaded.externalOutputs[0].channel.value==16); + assert(loaded.externalOutputs[0].left==2); + assert(loaded.externalOutputs[0].right==3); + assert(loaded.externalOutputs[0].leftName=="ASIO OUT 3"); + assert(loaded.externalOutputs[1].channel.value==12); + // Legacy sessions without the optional field retain their native mixer. + doc.externalOutputs.clear(); + assert(Codec::decode(Codec::encode(doc),loaded)); + assert(loaded.externalOutputs.empty()); + // Corrupted pair, duplicate ChannelId or missing pin name fail closed. + doc.externalOutputs.push_back({{16},3,4,"ASIO OUT 4","ASIO OUT 5"}); + assert(!Codec::decode(Codec::encode(doc),loaded)); + doc.externalOutputs[0]={ {16},2,3,"ASIO OUT 3","ASIO OUT 4" }; + doc.externalOutputs.push_back(doc.externalOutputs[0]); + assert(!Codec::decode(Codec::encode(doc),loaded)); + doc.externalOutputs.pop_back(); + doc.externalOutputs[0].leftName.clear(); + assert(!Codec::decode(Codec::encode(doc),loaded)); +} + int main(){ verifyDurableNativeFxPowerIdentity(); verifyHotkeyDocumentIdentityAndMigration(); @@ -1189,6 +1304,8 @@ int main(){ warmVst3Discovery(); nativeDeviceRecovery(); auto d=makeSession(); + verifyExternalOutputPortableIntent(); + verifyIndependentAsioExternalRestoreProvenance(); const auto before=Codec::encode(d); MixerSessionDocument restored; assert(Codec::decode(before,restored)); diff --git a/tests/physical_external_output_pcm_test.cpp b/tests/physical_external_output_pcm_test.cpp new file mode 100644 index 000000000..b4c54b3fb --- /dev/null +++ b/tests/physical_external_output_pcm_test.cpp @@ -0,0 +1,340 @@ +// SPDX-License-Identifier: AGPL-3.0-only +#if defined(NDEBUG) +#undef NDEBUG +#endif +// O1: deterministic buffer-level proof. This does not certify physical FAT. +#include "../engine/core/DynamicNativeSessionPublisher.h" +#include "../engine/core/LiveOutputRouteGate.h" +#include "../engine/core/NativeOutputTransition.h" +#include +#include +#include +#include +#include +using namespace armix::mixer; + +static bool near(float a,float b,float eps=0.0001f) { + return std::abs(a-b),4> input{}; + std::array,8> output{}; + std::array inputPointers{}; + std::array outputPointers{}; + int callsA=0,callsB=0; + std::uint64_t epoch=9157,revision=1; + + Harness(bool sourceOnly=false) { + const std::array create{ + add(0,ChannelRole::input,"VOICE"), + add(1,ChannelRole::input,"MUSIC"), + add(2,ChannelRole::group,"BUS A"), + add(3,ChannelRole::group,"BUS B"), + add(4,ChannelRole::main,"MAIN") + }; + auto result=roster.edit(0,create); + assert(result.ok()&&result.createdIds.size()==5); + voice=result.createdIds[0];music=result.createdIds[1]; + busA=result.createdIds[2];busB=result.createdIds[3]; + main=result.createdIds[4]; + if(!sourceOnly) { + const std::array links{ + out(voice,busA),out(music,busB), + out(busA,main),out(busB,main) + }; + result=roster.edit(1,links);assert(result.ok()); + } + request.physicalInputs=4;request.maxFrames=frames; + request.sources={{voice,0,1,true},{music,2,3,true}}; + for(int s=0;s(f+1)/64.f)); + mute.reset(true); // global disarm primes 0, preventing restart bleed + assert(near(mute.next(true),0.f)); + assert(h.render(8)); + float mainPeakL=0.f,mainPeakR=0.f; + armix::mixer::NativeOutputTransition::apply(h.outputPointers.data(),8, + Harness::frames,1,false,false,h.output[0].data(), + h.output[1].data(),mainPeakL,mainPeakR); + assert(mainPeakL>0.f&&mainPeakR>0.f); + for(const auto& pair:h.output) + assert(near(pair[63],0.f)); // ALL physical pins fade out + assert(h.callsA==2&&h.callsB==2); // effects executed ONCE per render + assert(h.render(8)); + armix::mixer::NativeOutputTransition::apply(h.outputPointers.data(),8, + Harness::frames,2,false,false,h.output[0].data(), + h.output[1].data(),mainPeakL,mainPeakR); + assert(near(h.output[2][0],0.f)&&near(h.output[2][63],.50f)); + assert(near(h.output[4][63],.21f)&&near(h.output[6][63],.25f)); + assert(h.callsA==3&&h.callsB==3); + // Global graph handoff declick also reaches every independent physical pin. + assert(h.render(8)); + armix::mixer::NativeOutputTransition::apply(h.outputPointers.data(),8, + Harness::frames,0,true,false,h.output[0].data(), + h.output[1].data(),mainPeakL,mainPeakR); + for(const auto& pair:h.output)assert(near(pair[63],0.f)); + assert(h.callsA==4&&h.callsB==4); +} +static void verifyLiveFaderMuteAnd2PortBounds() { + Harness h; + // A 2-output device has no third/fourth callback ordinal. A driver-level + // MAIN ownership fence is checked by LiveDryRoutingLab, not this DSP. + assert(!h.publisher.setExternalOutput(h.epoch,1,h.busA,2,3,2)); + assert(h.publisher.setExternalOutput(h.epoch,1,h.busA,2,3,8)); + assert(h.publisher.setChannelMix(h.epoch,1,h.busA,.5f,0.f)); + assert(h.render()); + assert(near(h.output[2][63],.25f)); + assert(near(h.output[3][63],.10f)); + assert(h.publisher.setChannelMuteSolo(h.epoch,1,h.busA,true,false)); + assert(h.render()); + assert(near(h.output[2][63],0.f)); + assert(near(h.output[3][63],0.f)); + // Other bus remains unaffected by the mute or physical tap. + assert(near(h.output[0][63],.21f)); + assert(near(h.output[1][63],.12f)); +} +int main() { + verifyIndependentBusPcmAndOncePerFx(); + verifyEightPinIsolationAndAppliedReadback(); + verifyFourPinMainAndOneBus(); + verifyFailClosedAllPhysicalOutputBuffers(); + verifyAliasedCallbackPinFailsClosed(); + verifyCrossExternalAliasFailsClosedAndRecovers(); + verifyCurrentEpochRejectedQuantumRevokesPhysicalReadback(); + verifyMainOnlyMuteAndAllOutputFxTransitions(); + verifySourceOnlyAndSharedSums(); + verifyLiveFaderMuteAnd2PortBounds(); + std::puts("O1 physical external OUT: independent PCM, SRC ONLY, gain/mute, shared sum and stale target PASS"); + return 0; +} diff --git a/tests/windows_installer_contract_test.mjs b/tests/windows_installer_contract_test.mjs index 20128d27c..5de9d4a6a 100644 --- a/tests/windows_installer_contract_test.mjs +++ b/tests/windows_installer_contract_test.mjs @@ -285,6 +285,15 @@ test('two genuine release installers upgrade and roll back only in disposable Wi assert.match(real, /proof-user-session\.smix/); assert.match(ci, /Prove two authentic historical Inno releases upgrade and roll back/); assert.match(ci, /scripts\/test_two_genuine_inno_releases_windows\.ps1/); + // API requests from shared runner IPs must not silently fail at 60/hour. + // The workflow already has contents:read. Only the metadata lookup gets + // the scoped Actions token; downloadable release assets stay hash checked. + assert.match(real, /GENUINE_RELEASE_METADATA_AUTH_REQUIRED/); + assert.match(real, /Authorization="Bearer \$env:GITHUB_TOKEN"/); + assert.match(real, /Invoke-RestMethod -Uri \$uri -Headers \$releaseHeaders/); + assert.match(ci, /GITHUB_TOKEN:\s*\$\{\{ github\.token \}\}/); + assert.match(ci, /permissions:\s*\n\s*contents: read/); + assert.doesNotMatch(real, /Invoke-WebRequest -Uri \$url -Headers \$releaseHeaders/); assert.doesNotMatch(real, /(?:Stop-Process|taskkill|Remove-Item\s+-LiteralPath\s+\$install\s+-Recurse)/); }); diff --git a/web/approved-native-bridge.js b/web/approved-native-bridge.js index 5455b6178..c67904d3b 100644 --- a/web/approved-native-bridge.js +++ b/web/approved-native-bridge.js @@ -453,6 +453,13 @@ const target=out&&nativeOutputTargets(t,accepted.channels).find(x=>x.id===out.id); if(ch.role!=="MAIN")t.output=out?.role==="MAIN"?"Master": (target?.label||"SOURCE ONLY (No Main)"); + const direct=Array.isArray(native.raw?.externalOutputs)? + native.raw.externalOutputs.find(x=>x.channelId===ch.id):null; + const pair=direct && hardwareOutputPairs().find(p=> + p.left===direct.physicalLeft&&p.right===direct.physicalRight); + t.externalOutput=direct?(direct.status==="LIVE"&&pair?pair.label: + (direct.status==="PENDING"?"Pending · ":"Needs Remap · ")+ + "OUT "+(direct.physicalLeft+1)+"/"+(direct.physicalRight+1)):"None"; t.selected=previous.get(t.id)?.selected || false; if(typeof ch.fxRackBypassed==="boolean")t.fxOn=!ch.fxRackBypassed; if (Array.isArray(ch.inserts)) { @@ -570,6 +577,7 @@ next.graph.edges.map(e=>[e.edgeId,e.from,e.to,e.tap,e.enabled,e.primaryOutput])]); if(structure!==lastNativeTopologySignature){ if(!projection(next))return false; + paintExternalReadback(next); lastNativeTopologySignature=structure; return true; } @@ -664,6 +672,8 @@ // user selects REAL JUCE active pin -> explicitly patches CH1 -> arms output. // No auto-arm, demo PCM, guessed physical port or second GUI. let hardware=null, inputSelect=null, routeBtn=null, armBtn=null, muteBtn=null; + let externalSerial=0; + const pendingExternal=new Map(); // each ChannelId independent; no mixer-wide lock let hardwareNote=null, pendingSourceId=0, sourceSerial=100; const safeNativeCounter=x=>{ if(typeof x!=="string" || !/^[1-9]\d*$/.test(x))return null; @@ -690,6 +700,94 @@ const NEEDS_REMAP="Audio connection lost"; const monoLabel=p=>"Mono · "+p.label+" [IN "+(p.port+1)+"]"; const stereoLabel=(a,b)=>"Stereo · IN "+(a.port+1)+" + "+(b.port+1); + // Only driver-verified even/odd physical pin pairs (not packed ordinals). + // MAIN and MONITOR retain exclusive ownership of their actual pins. + const hardwareOutputPairs=()=>{ + const d=hardware?.device,choices=[{label:"None",left:-1,right:-1}]; + if(d?.backend!=="ASIO" || !Array.isArray(d.outputEndpoints) || + !Array.isArray(d.enabledOutputs))return choices; + const map=new Map(d.outputEndpoints.filter(p=> + p.active===true&&Number.isInteger(p.port)&& + d.enabledOutputs.includes(p.port)&& + typeof p.label==="string"&&p.label.length>0).map(p=>[p.port,p])); + const main=Array.isArray(hardware?.raw?.physicalMainOutputs)? + hardware.raw.physicalMainOutputs:[]; + const monitor=Array.isArray(hardware?.raw?.physicalMonitorOutputs)? + hardware.raw.physicalMonitorOutputs:[]; + for(const [left,a] of map) { + if(left%2!==0 || !map.has(left+1))continue; + const b=map.get(left+1); + if(main.includes(left)||main.includes(left+1)|| + monitor.includes(left)||monitor.includes(left+1))continue; + const shared=Array.isArray(hardware?.raw?.externalOutputs)? + hardware.raw.externalOutputs.filter(row=> + row.physicalLeft===left && row.physicalRight===left+1).length:0; + choices.push({label:"OUT "+(left+1)+"/"+(left+2)+" · "+ + a.label+" + "+b.label+(shared>1?" · SHARED "+shared+" SOURCES":""), + left,right:left+1}); + } + return choices; + }; + const paintExternalReadback=(next)=>{ + const assignments=Array.isArray(next?.raw?.externalOutputs)? + next.raw.externalOutputs:[]; + const choices=hardwareOutputPairs(); + for(const t of scope?.tracks||[]) { + const id=nativeIdFor(t); + const row=assignments.find(p=>p.channelId===id); + const match=row&&choices.find(p=>p.left===row.physicalLeft && + p.right===row.physicalRight); + // Control ACK/applied graph is not audible LIVE while the verified + // hardware output is MUTED. Keep patch identity without ghost meters. + const pcmInstalled=row?.status==="LIVE"&&match; + const state=pcmInstalled?(next?.device?.outputArmed===true?"LIVE":"MUTED"): + row?.status==="PENDING"&&match?"PENDING": + row?"NEEDS_REMAP":"NONE"; + const value=row?((state==="LIVE"||state==="MUTED")?match.label: + (state==="PENDING"?"Pending · ":"Needs Remap · ")+ + "OUT "+(row.physicalLeft+1)+"/"+(row.physicalRight+1)):"None"; + t.externalOutput=value; + const select=document.querySelector('.strip[data-id="'+t.id+ + '"] select[data-field="external"]'); + if(!select?.dataset)continue; // headless contract mocks may omit DOM dataset + const labels=choices.map(p=>p.label); + if(!labels.includes(value))labels.push(value); + const signature=labels.join("|"); + if(select.dataset.choices!==signature){ + select.replaceChildren(...labels.map(s=>{ + const op=document.createElement("option"); + op.value=op.textContent=s;return op; + })); + select.dataset.choices=signature; + } + if(select.value!==value)select.value=value; + select.dataset.status=state; + const marker=select.parentElement?.querySelector(".external-out-state"); + if(marker){ + marker.textContent=state==="NONE"?"":state==="NEEDS_REMAP"?"REMAP":state; + marker.dataset.status=state; + } + select.title=state==="PENDING"?"Native PCM pending · wait for audio callback": + state==="NEEDS_REMAP"? + "Saved physical output disarmed; choose a verified ASIO pair": + state==="MUTED"?"ASIO pair connected · output muted, settings retained": + state==="LIVE"?"LIVE · independent native post-fader PCM": + "None · internal WIRE remains unchanged"; + const pending=pendingExternal.get(id); + if(pending && next?.device?.epoch && next.device.epoch!==pending.epoch) + pendingExternal.delete(id); // stale device: release only this strip + else if(pending?.acked && + (((state==="LIVE"||state==="MUTED") && + row.physicalLeft===pending.left && + row.physicalRight===pending.right) || + (pending.left===-1 && !row))){ + pendingExternal.delete(id); + status(state==="MUTED"?"EXTERNAL OUT patched · hardware output muted": + "EXTERNAL OUT verified · "+t.name+" → "+value); + } + if(!pendingExternal.has(id))select.removeAttribute("aria-busy"); + } + }; const inputChoicesFor=()=>{ const pins=hardwarePins(),entries=[{label:"None",mode:"NONE",left:-1,right:-1}]; for(const p of pins)entries.push({ @@ -1627,6 +1725,39 @@ monitorButton.dataset.armed=String(!!d?.outputArmed); } } + // Output patching is rendered from physical native readback, never a + // second routing state. Repainting only on changes avoids 12 Hz DOM churn. + function paintPhysicalOutputs(next) { + const view=devicePanel?.querySelector?.("[data-audio-output-matrix]"); + if(!view || devicePanel.hidden)return; + const patches=protocol.physicalOutputOverview(next); + const signature=JSON.stringify(patches); + if(devicePanel.dataset.outputSignature===signature)return; + devicePanel.dataset.outputSignature=signature; + const summary=devicePanel.querySelector("[data-audio-output-overview] .armix-output-heading"); + if(summary)summary.textContent="OUTPUTS · "+patches.length+" physical patches"; + view.replaceChildren(); + if(!patches.length){ + view.textContent="No verified ASIO output pins · choose an ASIO device."; + return; + } + for(const patch of patches){ + const line=document.createElement("div"); + line.className="armix-output-row";line.setAttribute("role","listitem"); + const dest=document.createElement("span"); + dest.className="armix-output-pair";dest.textContent=patch.pair; + const owner=document.createElement("span"); + owner.className="armix-output-owner"; + owner.textContent=patch.role+" · "+patch.pins+" · "+patch.owners; + const state=document.createElement("span"); + state.className="armix-output-status"; + state.dataset.state=patch.status; + state.textContent=patch.status.replace("_"," ")+ + (patch.shared>1?" · SHARED "+patch.shared:""); + line.append(dest,owner,state); + view.appendChild(line); + } + } function updateHardwarePanel(next) { hardware=next || null; refreshRealM4Inputs(next); @@ -1637,6 +1768,7 @@ const playback=String(d?.playbackDevice||"unknown output"); const virtualOut=/VB-Audio Virtual Cable|CABLE Input/i.test(playback); syncMonitorButton(d); + paintPhysicalOutputs(next); const mainOutput=next?.retained?NEEDS_REMAP:deviceOpen?playback:null; if(scope?.master && mainOutput && scope.master.output!==mainOutput){ scope.master.output=mainOutput; @@ -1756,6 +1888,21 @@ .armix-device-progress span{display:block;margin-top:2px;color:#f2e0bf} .armix-audio-dialog details{border-top:1px solid #345666;padding-top:8px} .armix-audio-dialog summary{cursor:pointer;color:#c5e1ed} + .armix-audio-dialog{max-height:90vh;overflow:auto} + .armix-output-overview{border-top:1px solid #345666;padding-top:8px} + .armix-output-heading{color:#c5e1ed;font-weight:500} + .armix-output-matrix{max-height:175px;overflow:auto;display:grid;gap:3px;margin:7px 0} + .armix-output-row{display:grid;grid-template-columns:64px minmax(0,1fr) auto; + align-items:center;gap:8px;padding:5px 7px;border-radius:4px;background:#0c202b; + font-size:11px;min-height:28px} + .armix-output-pair{color:#b9dce8;font-variant-numeric:tabular-nums} + .armix-output-owner{overflow:hidden;text-overflow:ellipsis;white-space:nowrap; + color:#ccdce3} + .armix-output-status{font-size:10px;color:#b6c9d1;white-space:nowrap} + .armix-output-status[data-state="LIVE"], + .armix-output-status[data-state="ENABLED"]{color:#9bd3b8} + .armix-output-status[data-state="PENDING"]{color:#e5c17d} + .armix-output-status[data-state="NEEDS_REMAP"]{color:#e0a18b} .armix-audio-pins{display:grid;grid-template-columns:1fr 1fr;gap:8px; max-height:135px;overflow:auto;padding:5px 0} .armix-audio-pins label{display:flex;align-items:center;gap:5px;font-size:11px} @@ -1794,6 +1941,11 @@
Applying audio device… Waiting for driver and mixer verification.
+
+
OUTPUTS · physical routing
+
+
Native callback/readback only · speaker listening not verified
+
Advanced · rate, buffer and channel pins