Repository navigation
feat(io2c): primary-clock ASRC-to-ChannelId reader and stable device-map leases #825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
masarray
wants to merge
67
commits into
main
Choose a base branch
from
feat/io2c-primary-clock-capture-consumer-20261119
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
67 commits
Select commit
Hold shift + click to select a range
116bd6d
feat(io2): compile qualified multi-device pins into one immutable gra…
masarray a1e84b5
test(io2): verify source identity, packed input map and isolated stal…
masarray 6e6738f
fix(io2): reject swapped devices with equal generations using native …
masarray 762cee4
test(io2): prove native lease prevents device swap and fail-closed id…
masarray 6499a21
test(io2): standalone cross-platform CTest target without shared root…
masarray 5dce5b3
chore(io2): explicit C++20 standard includes and warning-clean size b…
masarray ad35612
test(io2): equal generation across two independent devices still requ…
masarray 526297c
docs(io2): define source-map native lease, one-graph integration and …
masarray 7ac9557
test(io2): share full device-lease identity regression with registere…
masarray 0b8fe0a
test(io2): use shared regression cases from standalone native CTest
masarray e4b2733
test(io2): execute full qualified input-map cases in existing Windows…
masarray c4c8b09
fix(io2): preserve native independence of physical source and FX chan…
masarray cf463e7
test(io2): verify mono-to-stereo FX and stereo-to-mono channel parity
masarray bee42dc
docs(io2 safety): require detached control preparation and existing R…
masarray 7fe10aa
docs(io2): prohibit mutation of installed plan; publish via existing …
masarray f42776d
merge(io2): reconcile qualified input plan onto N-MOD-19 and G-MV main
masarray eab9ad3
feat(io2b): stage qualified A/B ChannelId graph and verify BUS FX MAI…
masarray 0b2806f
feat(io2b): publish qualified input map in same ChannelId graph and F…
masarray 55388da
test(io2b): assert atomic qualified map and ChannelId FX publication,…
masarray a683e14
fix(io2b): assert existing acceptedRevision native API
masarray 362e6f3
fix(io2b): reject unqualified legacy source switches under native dev…
masarray 28b089a
fix(native IO2B): avoid duplicate restore copy and GCC15 Werror in lo…
masarray b0577d3
merge(io2): reconcile qualified PCM source map onto merged IO1 and na…
masarray 29daeea
feat(io2c): bounded primary-clock reader for separately clocked verif…
masarray 82bc90c
test(io2c): prove real ASRC B plus primary A through one ChannelId FX…
masarray fd103ef
feat(io2c): carry verified device map through native WIRE revisions a…
masarray 802fd9d
test(io2c): use a genuinely wrong B ordinal in negative WIRE recompile
masarray e39288c
test(io2c): run real ASRC-to-native-main proof in fast Linux C++ gate
masarray 4859831
fix(io2c): distinguish rejected native commit from a detached device-…
masarray fe6e4b1
test(io2c): prove sample-rate conversion 44.1k B to 48k A through nat…
masarray 5c671bb
merge(io2): reconcile qualified input graph PR #816 with G-MV31 main
masarray bdfd526
merge(io2c): preserve G-MV31 main and qualified IO-2B parent
masarray 74640cf
feat(io2d): add fail-closed A+B clock input to sole native callback
masarray 78db684
feat(io2d): stage qualified B source and FX lease in single native tr…
masarray d543116
merge(io2c): reconcile clocked B reader and native control staging on…
masarray 8bff7b8
feat(io2d): opt-in real B ASIO capture host to one accepted native graph
masarray 371a80e
fix(io2d): sample qualified secondary callback attachment once per pr…
masarray 30d8c25
fix(io2d): retain A+B qualified capture across no-op Audio Setup; fai…
masarray 1d5a10b
merge(io2d): reconcile qualified dual-input native host with latest G…
masarray 633d597
fix(io2d): expose exact accepted qualified-map presence for safe .smi…
masarray 5efe446
fix(io2d): reject unsafe .smix saves before replacing last recoverabl…
masarray 603e623
test(io2d): qualified graph and WIRE revisions keep v1 .smix save fence
masarray 877477a
fix(io2d): retire A+B capture admission before CLEAR PATCH or primary…
masarray ca25c4a
fix(io2d): also fence qualified B reader across primary-device diagno…
masarray c6e39b9
merge(io2d): reconcile qualified ASIO B host with latest approved G-M…
masarray 97ab1b5
fix(io2d): explicit muted session replacement may retire A+B map; WIR…
masarray f93c0fe
fix(io2d): distinguish explicit persisted A-only restore from WIRE/FX…
masarray dece601
fix(io2d): transactionally restore primary-only .smix without leaking…
masarray c8b42aa
test(io2d): explicit muted A-only .smix restore drops B map; failures…
masarray 7bbcc24
merge(io2d): preserve G-MV35 exact FX editor authority after qualifie…
masarray 7c87d3d
merge(io2d): reconcile native N-MOD device coordinator and rollback i…
masarray e28ed10
fix(io2d): atomic qualified-source removal for SOURCE NONE and Delete…
masarray c90a10a
fix(io2d): non-destructive ASIO A restart retaining A+B mixer, WIRE a…
masarray e2d1df4
fix(io2d): sustain second primary restart and admit hardware callback…
masarray ec0a71d
fix(io2): expose revision-guarded retained device epoch only to nativ…
masarray 93af723
fix(io2): retire retained B input lease explicitly when restoring A-o…
masarray 5cb7bc7
test(io2): accepted A+B across primary ASIO epoch is replaced only by…
masarray 3407c21
fix(io2f): carry explicit qualified B map retirement through verified…
masarray 5f67c37
fix(io2f): propagate staged lost-B restart recovery intent to native …
masarray 5e9f25a
test(io2f): reproduce P1 retained A+B restart and verify explicit ret…
masarray 1b80519
merge(io2f): reconcile INT-1 main GUI/session updates without overwri…
masarray 16a0c20
fix(io2f): preserve existing single-ASIO rebind callers with safe def…
masarray bea8842
test(io2f): real JUCE fixture A+B install, retained restart handoff, …
masarray 4a58da8
fix(io2g P1): atomically gate reader entry and scratch reclamation un…
masarray 74e4c80
test(io2g): P1 concurrent callback-vs-stop deterministic fence and re…
masarray d3d5ec3
fix(io2h P1): atomically gate B producer and A ASRC reader before sto…
masarray e071e16
test(io2h): ASRC STOP/reprepare concurrent with primary A rendering p…
masarray File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| // SPDX-License-Identifier: AGPL-3.0-only | ||
| #pragma once | ||
| #include "MultiDeviceInputPlan.h" | ||
| #include "SecondaryCaptureClockStream.h" | ||
| #include <cstdint> | ||
|
|
||
| // CONTROL-side exact A/B admission; no driver query or realtime work. | ||
| // Caller MUST derive both device identities and masks from independently | ||
| // attested native hardware readback, never from display labels or .smix. | ||
| namespace armix::device { | ||
| class QualifiedCaptureAdmission final { | ||
| public: | ||
| enum class Fault { | ||
| none, stalePrimary, wrongTopology, wrongPrimaryPins, | ||
| secondaryNotReady, wrongCaptureLease, unsafeFrames | ||
| }; | ||
| static Fault verify(const MultiDeviceInputPlan& plan, | ||
| const SecondaryCaptureClockStream& clock, | ||
| std::uint64_t primaryEpoch, | ||
| int verifiedPrimaryInputCount, | ||
| int maximumRenderFrames) noexcept { | ||
| if(!primaryEpoch||plan.primaryEpoch()!=primaryEpoch|| | ||
| plan.deviceCount()!=2|| | ||
| plan.device(0).generation!=primaryEpoch) | ||
| return Fault::stalePrimary; | ||
| if(!plan.device(0).primary||plan.device(1).primary|| | ||
| !plan.device(0).deviceLease||!plan.device(1).deviceLease|| | ||
| plan.device(0).deviceLease==plan.device(1).deviceLease|| | ||
| plan.device(1).activePins<1|| | ||
| plan.device(1).activePins>16) | ||
| return Fault::wrongTopology; | ||
| if(verifiedPrimaryInputCount<1|| | ||
| plan.device(0).activePins!=verifiedPrimaryInputCount) | ||
| return Fault::wrongPrimaryPins; | ||
| if(maximumRenderFrames<1|| | ||
| maximumRenderFrames>MultiDeviceInputPlan::maxCallbackFrames) | ||
| return Fault::unsafeFrames; | ||
| if(!clock.ready())return Fault::secondaryNotReady; | ||
| const auto& format=clock.format(); // CONTROL only; not in RT | ||
| // The ASIO callback period is a HARDWARE value. The native graph | ||
| // legitimately renders in smaller bounded chunks when the period | ||
| // exceeds the retained VST scratch quantum. Reader::prepare() and | ||
| // withBlocks() are constrained by maximumRenderFrames, not by the | ||
| // whole hardware callback size. Never reject a valid 512->256 split. | ||
| if(format.captureGeneration!=plan.device(1).generation|| | ||
| format.deviceLease!=plan.device(1).deviceLease|| | ||
| format.primaryEpoch!=primaryEpoch|| | ||
| format.channels!=plan.device(1).activePins|| | ||
| format.primaryPeriod<1|| | ||
| format.primaryPeriod>MultiDeviceInputPlan::maxCallbackFrames) | ||
| return Fault::wrongCaptureLease; | ||
| return Fault::none; | ||
| } | ||
| }; | ||
| } // namespace armix::device |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| // SPDX-License-Identifier: AGPL-3.0-only | ||
| #pragma once | ||
| // IO-2D: native callback selection is a pure rule, not another renderer. | ||
| // The existing qualified reader and publisher still check exact leases. | ||
| namespace armix::device { | ||
| enum class QualifiedCaptureHostMode { | ||
| directPrimary, qualifiedDual, rejectPartial | ||
| }; | ||
| constexpr QualifiedCaptureHostMode qualifiedCaptureHostMode( | ||
| bool hasReader,bool hasClock) noexcept { | ||
| if(!hasReader&&!hasClock)return QualifiedCaptureHostMode::directPrimary; | ||
| if(hasReader&&hasClock)return QualifiedCaptureHostMode::qualifiedDual; | ||
| return QualifiedCaptureHostMode::rejectPartial; | ||
| } | ||
| } // namespace armix::device |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| // SPDX-License-Identifier: AGPL-3.0-only | ||
| #pragma once | ||
|
|
||
| #include "MultiDeviceInputPlan.h" | ||
| #include "../core/DynamicPreparedMixerBlock.h" | ||
| #include <algorithm> | ||
| #include <utility> | ||
|
|
||
| // IO-2D CONTROL-only, non-destructive restart fallback. Keep the entire | ||
| // ChannelId/WIRE/VST3 graph, but remove B's old physical source assignments | ||
| // from a DETACHED request after the primary ASIO clock changes. Never render | ||
| // or authorize an ordinal from the previous secondary device lease. | ||
| namespace armix::device { | ||
| class QualifiedPrimaryRestartRecoveryPlan final { | ||
| public: | ||
| static bool stage(const MultiDeviceInputPlan& prior, | ||
| const armix::mixer::DynamicGraphRequest& accepted, | ||
| int verifiedPrimaryInputs, | ||
| armix::mixer::DynamicGraphRequest& destination) { | ||
| using namespace armix::mixer; | ||
| if(prior.primaryEpoch()==0 || prior.deviceCount()!=2 || | ||
| !prior.device(0).primary || prior.device(0).firstVirtual!=0 || | ||
| prior.device(0).activePins<=0 || | ||
| verifiedPrimaryInputs!=prior.device(0).activePins || | ||
| prior.virtualInputCount()!=accepted.physicalInputs || | ||
| prior.virtualInputCount()<=verifiedPrimaryInputs) | ||
| return false; | ||
| int sourceCount=0; | ||
| for(const auto& source:accepted.sources) { | ||
| if(source.kind!=DynamicSourceKind::physical)continue; | ||
| ++sourceCount; | ||
| bool matched=false; | ||
| for(int i=0;i<prior.sourceCount();++i) { | ||
| const auto& bound=prior.source(i); | ||
| if(source.id==bound.channel && | ||
| source.inputL==bound.inputL && | ||
| source.inputR==bound.inputR && | ||
| source.stereo==bound.stereo) { | ||
| matched=true;break; | ||
| } | ||
| } | ||
| if(!matched || source.inputL<0 || | ||
| source.inputL>=prior.virtualInputCount() || | ||
| (source.stereo && | ||
| (source.inputR<0 || | ||
| source.inputR>=prior.virtualInputCount()))) | ||
| return false; | ||
| const auto device=prior.slot(source.inputL).device; | ||
| if((device==0 && source.inputL>=verifiedPrimaryInputs) || | ||
| (device!=0 && source.inputL<verifiedPrimaryInputs) || | ||
| (source.stereo && | ||
| prior.slot(source.inputR).device!=device)) | ||
| return false; | ||
| } | ||
| if(sourceCount!=prior.sourceCount())return false; | ||
| auto candidate=accepted; // only CONTROL, never the live graph | ||
| std::erase_if(candidate.sources,[&](const auto& source){ | ||
| return source.kind==DynamicSourceKind::physical && | ||
| prior.slot(source.inputL).device!=0; | ||
| }); | ||
| candidate.physicalInputs=verifiedPrimaryInputs; | ||
| destination=std::move(candidate); // atomic detached result | ||
| return true; | ||
| } | ||
| }; | ||
| } // namespace armix::device |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.