';
document.body.appendChild(overlay);
const audioPath=node('div','arIOAudioPath');audioPath.id='arIOAudioPath';
- audioPath.innerHTML='CAPTURE · WAITROUTE · WAITOUTPUT · WAIT';
+ audioPath.innerHTML='RAW INPUT · WAITROUTE · WAITMIXER · WAITOUTPUT · WAIT';
overlay.querySelector('.arIOWindow').insertBefore(audioPath,el('arIOBody'));
function refreshAudioPath(){
const d=window.__arMixAudioPathView?.(lastStatus);
if(!d)return;
- for(const [key,value] of [['input',d.input],['route',d.route],['output',d.output],['reason',d.message]]){
+ for(const [key,value] of [['input',d.input],['route',d.route],['mixer',d.mixer],['output',d.output],['reason',d.message]]){
const n=audioPath.querySelector('[data-audio-path-'+key+']');
if(n&&n.textContent!==value)n.textContent=value;
}
+ // Same native START/ACK action as DEVICE/DRIVER. No duplicate host path,
+ // automatic unmute, optimistic status or periodic full DOM rebuild.
+ const start=audioPath.querySelector('[data-io-start-audio]');
+ if(start){
+ const pending=!!window.__arMixFastAudioState?.().pending;
+ const label=lastStatus.monitor?'MUTE OUTPUT':pending?'STARTING…':'START AUDIO';
+ if(start.textContent!==label)start.textContent=label;
+ start.disabled=startAudioBlocked();
+ start.setAttribute('aria-label',lastStatus.monitor?
+ 'Mute hardware output immediately':
+ 'Arm verified physical MAIN only after native route ACK');
+ }
}
// G3: ONE floating inspector follows the selected source/AUX, no new
// DSP graph, no heavyweight matrix, no layout shifts in the MIX strips.
@@ -4517,6 +4532,16 @@
(deviceSameEndpoint(d)&&
(!pinsEqual(d.enabledInputs,a.enabledInputs)||!pinsEqual(d.enabledOutputs,a.enabledOutputs))));
}
+ // Shared safety gate for BOTH visible START AUDIO buttons. The top
+ // transport cannot bypass a staged device change, invalid hardware,
+ // pending route/FX transaction or the existing native ACK handshake.
+ function startAudioBlocked(){
+ if(!isNative())return true;
+ if(lastStatus.monitor)return false; // emergency physical MUTE always allowed
+ const quick=window.__arMixFastAudioState?.()||{};
+ return deviceBusy||!!quick.pending||!deviceInventory?.active?.open||
+ !deviceSameEndpoint(deviceDraft)||deviceDirty()||!hardwareReady(route());
+ }
function deviceRefresh(rescan=false){
if(!isNative()||deviceBusy)return;
const now=Date.now();
@@ -4612,9 +4637,7 @@
const start=node('button','btn-180 arIODeviceStartAudio',
lastStatus.monitor?'MUTE OUTPUT':quick.pending?'STARTING…':'START AUDIO');
start.type='button';start.dataset.ioStartAudio='1';
- start.disabled=!isNative()||(!lastStatus.monitor&&(
- deviceBusy||!!quick.pending||!a.open||!deviceSameEndpoint(deviceDraft)||
- deviceDirty()||!hardwareReady(route())));
+ start.disabled=startAudioBlocked();
start.setAttribute('aria-label',lastStatus.monitor?'Mute physical output':
'Start verified live routing and arm hardware output');
activeLine.appendChild(start);
diff --git a/tests/mixer_io_operator_contract_test.mjs b/tests/mixer_io_operator_contract_test.mjs
index 894b4da27..5d7856272 100644
--- a/tests/mixer_io_operator_contract_test.mjs
+++ b/tests/mixer_io_operator_contract_test.mjs
@@ -419,7 +419,8 @@ test('FAST1 one gesture uses native routing ACK then fenced physical ARM, with p
assert.match(io,/dataset\.ioStartAudio/);
assert.match(io,/LIVE ON /);
assert.match(io,/ASSIGN CH/);
- assert.match(io,/start\.disabled=!isNative\(\)\|\|\(!lastStatus\.monitor/);
+ assert.match(io,/function startAudioBlocked\(\)/);
+ assert.match(io,/start\.disabled=startAudioBlocked\(\)/);
assert.match(control,/window\.__arMixStartLiveAudio=/);
assert.match(control,/fastAudioPending=\{phase:"patch"/);
assert.match(control,/if\(verified\)fastAudioArm\(result\)/);
@@ -453,3 +454,30 @@ test('P0 actual raw PCM before MUTE and native route/output state remain indepen
}
assert.doesNotMatch(io,/new AudioContext\(/);
});
+
+
+test('P0 First Sound separates RAW capture, post-fader PCM and physical output ARM',()=>{
+ const css=read('web/mixer-io.css');
+ const engine=read('src/LiveAudioEngine.h');
+ const core=read('engine/core/PreparedMixerBlock.h');
+ const main=read('src/Main.cpp');
+ assert.match(gui,/data-audio-path-mixer/);
+ assert.match(gui,/data-io-start-audio disabled/);
+ assert.match(gui,/function startAudioBlocked\(\)/);
+ assert.match(gui,/start\.disabled=startAudioBlocked\(\)/);
+ assert.match(gui,/start\.disabled=startAudioBlocked\(\)/);
+ assert.match(gui,/window\.__arMixStartLiveAudio\?\.\(\)/);
+ assert.match(monitor,/window\.__arMixStartLiveAudio=/);
+ assert.match(monitor,/action:"monitor",value:true/);
+ assert.match(monitor,/expectedEpoch:Number\(d\.epoch\),expectedRevision:Number\(d\.revision\)/);
+ assert.match(main,/engine_\.liveOutputArmFault\(\)/);
+ assert.match(monitor,/const mixed=patched\.some\(i=>Number\(meter\[i\]\)>0\.0002\)/);
+ assert.match(monitor,/const mainPcm=Number\(d\.peak\)>0\.0002/);
+ assert.match(monitor,/ArSonMix physical MAIN is SAFE-MUTED/);
+ assert.match(monitor,/if sound persists|sound must stop|If sound persists/i);
+ assert.match(engine,/const bool outputPermitted=outputGate\.renderMain/);
+ assert.match(engine,/if\(!outputGate\.hardware\)/);
+ assert.match(core,/observed\) observed->channelPeak\[strip\]=peak/);
+ assert.match(css,/\.arIOAudioPath>\.arIOPathStart/);
+ assert.doesNotMatch(gui,/new AudioContext|AudioWorklet|processBlock|createPluginInstance/);
+});
diff --git a/tests/mixer_io_smoke.py b/tests/mixer_io_smoke.py
index 073bb9fce..6a776047e 100644
--- a/tests/mixer_io_smoke.py
+++ b/tests/mixer_io_smoke.py
@@ -82,18 +82,36 @@ async def main():
callbackCount:10,callbackInputChannels:2,inputPeak:0,monitor:false,
dryRoutingLab:{ready:true,hasAcceptedRoute:true}
})""")
- assert silent['input']=='NO PCM IN CURRENT BLOCK',silent
+ assert silent['input']=='NO RAW CAPTURE PCM',silent
assert silent['route']=='NATIVE ROUTE ACK' and silent['output']=='OUTPUT SAFE-MUTED',silent
+ assert silent['mixer']=='MIXER · WAIT ARM',silent
assert 'CABLE Input' in silent['message'],silent
+ muted=await page.evaluate("""()=>window.__arMixAudioPathView({
+ connected:true,inputDevice:'CABLE Output (VB-Audio Virtual Cable)',
+ callbackCount:11,callbackInputChannels:2,inputPeak:.14,monitor:false,
+ dryRoutingLab:{ready:true,hasAcceptedRoute:true,
+ acceptedRoute:{channels:[{mode:'MONO'}]},channelPeaks:[0]}
+ })""")
+ assert muted['input']=='RAW CAPTURE PCM',muted
+ assert muted['mixer']=='MIXER · WAIT ARM' and muted['output']=='OUTPUT SAFE-MUTED',muted
+ assert 'direct monitor' in muted['message'].lower(),muted
audible=await page.evaluate("""()=>window.__arMixAudioPathView({
connected:true,inputDevice:'CABLE Output (VB-Audio Virtual Cable)',
- callbackCount:11,callbackInputChannels:2,inputPeak:.14,monitor:true,
- dryRoutingLab:{ready:true,hasAcceptedRoute:true}
+ callbackCount:11,callbackInputChannels:2,inputPeak:.14,peak:.035,monitor:true,
+ dryRoutingLab:{ready:true,hasAcceptedRoute:true,
+ acceptedRoute:{channels:[{mode:'MONO'}]},channelPeaks:[.09]}
})""")
- assert audible['input']=='PCM DETECTED' and audible['output']=='OUTPUT ARMED',audible
+ assert audible['input']=='RAW CAPTURE PCM' and audible['mixer']=='POST-FADER PCM',audible
+ assert audible['output']=='MAIN PCM · ARMED',audible
+ assert 'sound must stop' in audible['message'],audible
await page.evaluate("()=>window.__arMixOpenAudioIO('device')")
assert await page.locator('#arIOAudioPath').is_visible()
assert await page.locator('#arIOAudioPath [data-io-signal-check]').is_visible()
+ assert await page.locator('#arIOAudioPath [data-audio-path-mixer]').is_visible()
+ assert await page.locator('#arIOAudioPath [data-io-start-audio]').is_visible()
+ # The test has no authorized device inventory. Top-level START must
+ # remain disabled and cannot synthesize a hardware ARM.
+ assert await page.locator('#arIOAudioPath [data-io-start-audio]').is_disabled()
await page.locator('#arIOAudioPath [data-io-signal-check]').click()
assert await page.locator('#arSignalOverlay').evaluate("(e)=>e.classList.contains('open')")
await page.locator('#arSignalClose').click()
@@ -231,8 +249,8 @@ async def main():
assert await page.locator('.arIODevicePatchMatrix .arIOMatrixCell').count()>0
# FAST1: one gesture un-mutes a previously ACKed real input route;
# hardware action is still fenced to epoch/revision.
- assert await page.locator('[data-io-start-audio]').is_visible()
- await page.locator('[data-io-start-audio]').click()
+ assert await page.locator('#arIOAudioPath [data-io-start-audio]').is_visible()
+ await page.locator('#arIOAudioPath [data-io-start-audio]').click()
arm=await page.evaluate("""()=>window.__armixTestActions.filter(x=>
x.name==='arMixAction'&&x.data.action==='monitor'&&x.data.value===true)""")
assert len(arm)==1,arm
@@ -242,8 +260,8 @@ async def main():
ok:true,armed:true,deviceEpoch:4,error:''})""")
await page.evaluate("""status=>{status.monitor=true;
window.__armixTestEmit('arMixStatus',status)}""",status)
- assert await page.locator('[data-io-start-audio]').inner_text()=='MUTE OUTPUT'
- await page.locator('[data-io-start-audio]').click()
+ assert await page.locator('#arIOAudioPath [data-io-start-audio]').inner_text()=='MUTE OUTPUT'
+ await page.locator('#arIOAudioPath [data-io-start-audio]').click()
muted=await page.evaluate("""()=>window.__armixTestActions.filter(x=>
x.name==='arMixAction'&&x.data.action==='monitor'&&x.data.value===false)""")
assert len(muted)==1,muted
@@ -1001,7 +1019,7 @@ async def main():
types:[{name:'ASIO',active:true,separate:false,
inputs:['Mock Interface'],outputs:['Mock Interface']}]
})""")
- await qp.locator('[data-io-start-audio]').click()
+ await qp.locator('#arIOAudioPath [data-io-start-audio]').click()
requests=await qp.evaluate("""()=>window.__armixTestActions.filter(x=>
x.data?.action==='routingDryApply')""")
assert len(requests)==1,requests
diff --git a/web/mixer-io.css b/web/mixer-io.css
index 12c06895f..471714221 100644
--- a/web/mixer-io.css
+++ b/web/mixer-io.css
@@ -611,8 +611,11 @@
.arIOSoftwareName{flex-wrap:wrap}
/* P0 independent native PCM / routing / output proof: flat, static, compact. */
-.arIOAudioPath{display:grid;grid-template-columns:repeat(3,minmax(0,1fr)) auto;gap:5px;align-items:center;padding:7px 11px;background:#0e2630;border-block:1px solid #3c5b68;color:#c7e0e8;font:10px/1.4 "Segoe UI",sans-serif}
+.arIOAudioPath{display:grid;grid-template-columns:repeat(4,minmax(0,1fr)) auto auto;gap:5px;align-items:center;padding:7px 11px;background:#0e2630;border-block:1px solid #3c5b68;color:#c7e0e8;font:10px/1.4 "Segoe UI",sans-serif}
.arIOAudioPath>span{padding:5px 7px;border-left:2px solid #5b91a1;background:#142e39;min-width:0;overflow-wrap:anywhere}
.arIOAudioPath>small{grid-column:1/-1;color:#d9d0ad;font-size:10px;line-height:1.4;overflow-wrap:anywhere}
.arIOAudioPath>button{min-height:26px;white-space:nowrap}
-@media(max-width:850px){.arIOAudioPath{grid-template-columns:repeat(2,minmax(0,1fr))}.arIOAudioPath>small{grid-column:1/-1}}
+.arIOAudioPath>.arIOPathStart{--b180-color:#9de9c1;--b180-border:#39936f;--b180-ink:#133c2b}
+.arIOAudioPath>.arIOPathStart:disabled{opacity:.48;cursor:default}
+@media(max-width:950px){.arIOAudioPath{grid-template-columns:repeat(4,minmax(0,1fr))}.arIOAudioPath>button{grid-column:span 2}.arIOAudioPath>small{grid-column:1/-1}}
+@media(max-width:650px){.arIOAudioPath{grid-template-columns:repeat(2,minmax(0,1fr))}.arIOAudioPath>button{grid-column:span 1}}
diff --git a/web/mixer-io.js b/web/mixer-io.js
index f590f774f..54746d350 100644
--- a/web/mixer-io.js
+++ b/web/mixer-io.js
@@ -456,15 +456,27 @@
overlay.innerHTML='
ArSonMiX · AUDIO HARDWARE
Audio Setup · Windows Devices & Routing
';
document.body.appendChild(overlay);
const audioPath=node('div','arIOAudioPath');audioPath.id='arIOAudioPath';
- audioPath.innerHTML='CAPTURE · WAITROUTE · WAITOUTPUT · WAIT';
+ audioPath.innerHTML='RAW INPUT · WAITROUTE · WAITMIXER · WAITOUTPUT · WAIT';
overlay.querySelector('.arIOWindow').insertBefore(audioPath,el('arIOBody'));
function refreshAudioPath(){
const d=window.__arMixAudioPathView?.(lastStatus);
if(!d)return;
- for(const [key,value] of [['input',d.input],['route',d.route],['output',d.output],['reason',d.message]]){
+ for(const [key,value] of [['input',d.input],['route',d.route],['mixer',d.mixer],['output',d.output],['reason',d.message]]){
const n=audioPath.querySelector('[data-audio-path-'+key+']');
if(n&&n.textContent!==value)n.textContent=value;
}
+ // Same native START/ACK action as DEVICE/DRIVER. No duplicate host path,
+ // automatic unmute, optimistic status or periodic full DOM rebuild.
+ const start=audioPath.querySelector('[data-io-start-audio]');
+ if(start){
+ const pending=!!window.__arMixFastAudioState?.().pending;
+ const label=lastStatus.monitor?'MUTE OUTPUT':pending?'STARTING…':'START AUDIO';
+ if(start.textContent!==label)start.textContent=label;
+ start.disabled=startAudioBlocked();
+ start.setAttribute('aria-label',lastStatus.monitor?
+ 'Mute hardware output immediately':
+ 'Arm verified physical MAIN only after native route ACK');
+ }
}
// G3: ONE floating inspector follows the selected source/AUX, no new
// DSP graph, no heavyweight matrix, no layout shifts in the MIX strips.
@@ -1160,6 +1172,16 @@
(deviceSameEndpoint(d)&&
(!pinsEqual(d.enabledInputs,a.enabledInputs)||!pinsEqual(d.enabledOutputs,a.enabledOutputs))));
}
+ // Shared safety gate for BOTH visible START AUDIO buttons. The top
+ // transport cannot bypass a staged device change, invalid hardware,
+ // pending route/FX transaction or the existing native ACK handshake.
+ function startAudioBlocked(){
+ if(!isNative())return true;
+ if(lastStatus.monitor)return false; // emergency physical MUTE always allowed
+ const quick=window.__arMixFastAudioState?.()||{};
+ return deviceBusy||!!quick.pending||!deviceInventory?.active?.open||
+ !deviceSameEndpoint(deviceDraft)||deviceDirty()||!hardwareReady(route());
+ }
function deviceRefresh(rescan=false){
if(!isNative()||deviceBusy)return;
const now=Date.now();
@@ -1255,9 +1277,7 @@
const start=node('button','btn-180 arIODeviceStartAudio',
lastStatus.monitor?'MUTE OUTPUT':quick.pending?'STARTING…':'START AUDIO');
start.type='button';start.dataset.ioStartAudio='1';
- start.disabled=!isNative()||(!lastStatus.monitor&&(
- deviceBusy||!!quick.pending||!a.open||!deviceSameEndpoint(deviceDraft)||
- deviceDirty()||!hardwareReady(route())));
+ start.disabled=startAudioBlocked();
start.setAttribute('aria-label',lastStatus.monitor?'Mute physical output':
'Start verified live routing and arm hardware output');
activeLine.appendChild(start);
diff --git a/web/monitor.js b/web/monitor.js
index 110de8e06..c9eecda41 100644
--- a/web/monitor.js
+++ b/web/monitor.js
@@ -1830,9 +1830,20 @@
const peak=Math.max(0,Number(d.inputPeak)||0);
const captured=callback&&peak>0.0005;
const routed=normal&&!!r.ready&&!!r.hasAcceptedRoute&&!r.topologyFault;
- const input=!d.connected?"DEVICE CLOSED":!callback?"NO CAPTURE CALLBACK":captured?"PCM DETECTED":"NO PCM IN CURRENT BLOCK";
+ const input=!d.connected?"DEVICE CLOSED":!callback?"NO CAPTURE CALLBACK":captured?"RAW CAPTURE PCM":"NO RAW CAPTURE PCM";
const route=!normal?"DIAGNOSTIC MODE":!r.ready?"UNPATCHED / STALE":r.hasAcceptedRoute?"NATIVE ROUTE ACK":"INPUT PATCH REQUIRED";
- const output=!d.monitor?"OUTPUT SAFE-MUTED":d.masterMute?"MASTER MUTED":!routed?"OUTPUT BLOCKED":"OUTPUT ARMED";
+ // Capture peak is BEFORE the mixer. Native channel peaks are after
+ // source selection, inserts and the fader; never label raw PCM as mixed.
+ const acceptedChannels=Array.isArray(r.acceptedRoute?.channels)?r.acceptedRoute.channels:[];
+ const patched=acceptedChannels.map((row,i)=>
+ row?.mode==="MONO"||row?.mode==="STEREO"?i:-1).filter(i=>i>=0);
+ const meter=Array.isArray(r.channelPeaks)?r.channelPeaks:[];
+ const mixed=patched.some(i=>Number(meter[i])>0.0002);
+ const mainPcm=Number(d.peak)>0.0002;
+ const mixer=!routed?"MIXER · NOT READY":!d.monitor?"MIXER · WAIT ARM":
+ mixed?"POST-FADER PCM":"POST-FADER SILENT";
+ const output=!d.monitor?"OUTPUT SAFE-MUTED":d.masterMute?"MASTER MUTED":
+ !routed?"OUTPUT BLOCKED":mainPcm?"MAIN PCM · ARMED":"OUTPUT ARMED · SILENT";
let message;
if(d.error)message="Audio driver error: "+d.error;
else if(!d.connected)message="No device connected. Select real capture and render endpoints in AUDIO I/O.";
@@ -1846,12 +1857,12 @@
?"No input PCM in this block. VB-Cable CABLE Output is the recording endpoint: the player must send to Windows playback CABLE Input, not Realtek Speakers."
:"No capture PCM in this block. Send a steady source signal and inspect the selected input and enabled physical pins.";
if(!d.monitor)message+=" MAIN is also SAFE-MUTED. Press START AUDIO in AUDIO SETUP at low volume after verifying input.";
- }else if(!d.monitor)message="Capture PCM detected but physical MAIN is SAFE-MUTED. Press START AUDIO in AUDIO SETUP to arm at low headphone volume.";
- else if(d.masterMute)message="Capture PCM detected but MASTER MUTE is active.";
- else if((Number(d.postFxPeak)||0)<0.0002)message="Capture PCM present, but routed audio is silent. Check channel SOURCE, fader, mute and FX.";
- else if((Number(d.peak)||0)<0.0002)message="Post-FX PCM present but hardware MAIN is silent. Check MASTER fader and output pin patch.";
- else message="Input PCM and MAIN PCM detected. If silent at speakers, inspect Windows playback level, output endpoint and cables.";
- return {input,route,output,message,inputPeak:peak,captureSignalBlocks:Number(d.captureSignalBlocks)||0};
+ }else if(!d.monitor)message="Raw capture detected, but ArSonMix physical MAIN is SAFE-MUTED: this headphone sound is NOT proof of mixer playback. Check MAONO direct monitor/loopback or Windows Listen to this device, then press START AUDIO at low volume.";
+ else if(d.masterMute)message="Capture present but MASTER MUTE is active. If sound persists, check interface direct monitoring or another Windows playback route.";
+ else if(!mixed)message="Raw capture detected but no PCM after an accepted channel fader. Check patched channel SOURCE, MUTE, fader and native FX.";
+ else if(!mainPcm)message="Post-fader channel PCM exists but native MAIN is silent. Check bus/sends, MASTER fader, mute, and physical pin routing.";
+ else message="Native post-fader and MAIN PCM detected with output armed. To prove the sound is from ArSonMix, MUTE the active channel or MASTER: sound must stop. If not, disable direct monitoring/Windows parallel playback.";
+ return {input,route,mixer,output,message,inputPeak:peak,captureSignalBlocks:Number(d.captureSignalBlocks)||0};
};
function diagnosis(d) {
if(d.dryRoutingLab?.active)return window.__arMixAudioPathView(d).message;
@@ -1922,7 +1933,7 @@
" / overflow "+(d.secondaryOutputOverflow||0)+
". For external apps choose their corresponding capture device if applicable.");
if (!overlay.classList.contains("open")) return;
- el("arInputName").textContent=d.dryRoutingLab?.active?"NATIVE 10 CH INPUTS":d.diagnosticRoute==="OUTPUT_ONLY_TONE"?"INTERNAL TEST TONE":d.inputDevice||"Input device";
+ el("arInputName").textContent=d.dryRoutingLab?.active?"RAW CAPTURE · NOT FADER PCM":d.diagnosticRoute==="OUTPUT_ONLY_TONE"?"INTERNAL TEST TONE":d.inputDevice||"Input device";
el("arFxName").textContent=d.dryRoutingLab?.active?(String(d.dryRoutingLab.fxCount||0)+" NATIVE VST3"):d.diagnosticRoute==="OUTPUT_ONLY_TONE"?"NO INPUT / NO FX":d.diagnosticRoute!=="NORMAL"?"NO FX":d.dryTest?"DRY BYPASS":"VST3 Chain";
el("arOutputName").textContent=d.outputDevice||"Output device";
el("arInputBar").style.width=percent(d.inputPeak)+"%";