From fa3d72d5f3d1360130e6781b3d8ab6194467deed Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 18:03:42 +0700 Subject: [PATCH 01/22] fix(win10): make VB-CABLE opt-in so first launch never silently installs audio drivers --- installer/ArSonMix.iss | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/installer/ArSonMix.iss b/installer/ArSonMix.iss index 6ced1b257..f4b662394 100644 --- a/installer/ArSonMix.iss +++ b/installer/ArSonMix.iss @@ -88,11 +88,17 @@ Name: "{autoprograms}\Repair ArSonMix"; Filename: "{sys}\WindowsPowerShell\v1.0\ ; preflight closes the prior verified app before [Files]; [Run] launches exactly ; one new executable only after a successful interactive install/update. ; Silent enterprise/FAT installs deliberately do not launch desktop audio. +[Tasks] +; P0 Win10 first-run: VB-CABLE is an OPTIONAL virtual-audio feature, not +; a dependency of the ASIO/WASAPI mixer. Never silently elevate/replace an +; audio driver or block a first launch for a driver reboot. Owner opt-in only. +Name: "installvbcable_driver"; Description: "Install optional VB-CABLE virtual audio driver (may require administrator approval and restart)"; GroupDescription: "Optional audio driver:"; Flags: unchecked + [Run] ; Check on interactive Setup before opening the mixer. Only a missing driver ; can reach the independently verified vendor EXE and its Windows approval. ; Silent updates and enterprise installs retain their noninteractive behavior. -Filename: "{sys}\WindowsPowerShell\v1.0\powershell.exe"; Parameters: "-NoLogo -NoProfile -ExecutionPolicy Bypass -File ""{app}\ThirdParty\VB-Audio\ArSonMixVBCableInstall.ps1"" -Archive ""{app}\ThirdParty\VB-Audio\VBCABLE_Driver_Pack45.zip"" -ExpectedSha256 ""{#VBCableSha256}"" -RestartMarker ""{tmp}\ArSonMixVBCableRestart"""; WorkingDir: "{app}"; StatusMsg: "Checking VB-Audio VB-CABLE for automatic audio setup..."; Flags: runasoriginaluser skipifsilent waituntilterminated runhidden +Filename: "{sys}\WindowsPowerShell\v1.0\powershell.exe"; Parameters: "-NoLogo -NoProfile -ExecutionPolicy Bypass -File ""{app}\ThirdParty\VB-Audio\ArSonMixVBCableInstall.ps1"" -Archive ""{app}\ThirdParty\VB-Audio\VBCABLE_Driver_Pack45.zip"" -ExpectedSha256 ""{#VBCableSha256}"" -RestartMarker ""{tmp}\ArSonMixVBCableRestart"""; WorkingDir: "{app}"; StatusMsg: "Installing OPTIONAL VB-CABLE audio driver..."; Tasks: installvbcable_driver; Flags: runasoriginaluser skipifsilent waituntilterminated runhidden Filename: "{app}\ArSonMix.exe"; WorkingDir: "{app}"; Flags: nowait runasoriginaluser skipifsilent; Check: CanLaunchMixer ; Never delete private Studio data on install/update/uninstall; never install From 932f3dfc9460324888ed464b79148046629e63ff Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 18:03:45 +0700 Subject: [PATCH 02/22] test(win10): explicit optional-driver install and safe direct launch contract --- tests/windows_installer_contract_test.mjs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/windows_installer_contract_test.mjs b/tests/windows_installer_contract_test.mjs index 2d8bcb195..fcb60140f 100644 --- a/tests/windows_installer_contract_test.mjs +++ b/tests/windows_installer_contract_test.mjs @@ -33,7 +33,7 @@ test('per-user Inno Setup upgrades the same app and retains private Studio data' assert.match(iss, /Source: "\.\.\\docs\\THIRD_PARTY_8D_SONKU_HRTF\.md"; Flags: dontcopy/); }); -test('official standard VB-CABLE ZIP is pinned and checked automatically without elevating ArSonMix', () => { +test('optional signed VB-CABLE driver does not block clean Windows 10 first launch', () => { const m = JSON.parse(read('config/vbcable-official-package.json')); const pack = read('scripts/prepare_vbcable_package.ps1'); const bootstrap = read('installer/ArSonMixVBCableInstall.ps1'); @@ -43,12 +43,15 @@ test('official standard VB-CABLE ZIP is pinned and checked automatically without assert.match(m.sha256, /^[a-f0-9]{64}$/); assert.match(m.proof, /actions\/runs\/43079930924/); assert.match(iss, /^PrivilegesRequired=lowest$/m); - assert.doesNotMatch(iss, /^\[Tasks\]$|Tasks: vbcable_driver/m); + assert.match(iss, /^\[Tasks\]$/m); + assert.match(iss, /Name: "installvbcable_driver";[^\n]*Flags: unchecked/); + assert.equal((iss.match(/Name: "installvbcable_driver"/g) || []).length, 1); assert.match(iss, /VBCABLE_Driver_Pack45\.zip/); assert.match(iss, /ArSonMixVBCableInstall\.ps1/); const run = iss.slice(iss.indexOf('[Run]'), iss.indexOf('[Code]')); - assert.match(run, /StatusMsg: "Checking VB-Audio VB-CABLE[^"]*"; Flags: runasoriginaluser skipifsilent waituntilterminated runhidden/); + assert.match(run, /StatusMsg: "Installing OPTIONAL VB-CABLE[^"]*"; Tasks: installvbcable_driver; Flags: runasoriginaluser skipifsilent waituntilterminated runhidden/); assert.ok(run.indexOf('ArSonMixVBCableInstall.ps1') < run.indexOf('Filename: "{app}\\ArSonMix.exe"')); + assert.doesNotMatch(run,/ArSonMixVBCableInstall\.ps1[^\n]*Flags:[^\n]*(?!Tasks: installvbcable_driver)/); assert.match(iss, /Check: CanLaunchMixer/); assert.match(iss, /function NeedRestart\(\): Boolean;[\s\S]*?FileExists/); assert.match(bootstrap, /if\(\$stateName -eq 'PENDING_REBOOT'\)\{[\s\S]*?New-Item -ItemType File -Path \$RestartMarker/); From a0b71b9ef260cccda2d7435bca6d84fb4c0b70f6 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 18:04:05 +0700 Subject: [PATCH 03/22] fix(win10): default all MSVC/JUCE libraries to matching static CRT for fresh installs --- CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d3fad01c..88485377c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -146,6 +146,15 @@ if(ARMIX_SONKU_EXPERIMENTAL_P99_VOCAL_DEPTH AND endif() set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) +# P0 Windows 10 fresh-install portability: the compiler's default /MD +# silently requires a machine-wide Microsoft VC++ Redistributable which is +# present on CI runners but NOT guaranteed on end-user Windows 10 PCs. +# Choose one matching static CRT across BOTH JUCE static libraries and the +# native mixer, before JUCE targets are created. Explicit downstream +# toolchain selection remains respected. Does NOT replace WebView2 Runtime. +if (MSVC AND WIN32 AND NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY) + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") +endif() if (NOT DEFINED JUCE_ROOT) message(FATAL_ERROR "Pass -DJUCE_ROOT=C:/path/to/JUCE (8.0.15+ required)") From ed42dcd3dfb1f9db89c8b86d0f9a950e7bc3b819 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 18:05:10 +0700 Subject: [PATCH 04/22] feat(audio-setup): expose native driver input/output and DSP latency readback honestly --- src/Main.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Main.cpp b/src/Main.cpp index 90e6965a2..e7187713c 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -2152,6 +2152,23 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr const auto live=engine_.status(); o->setProperty("deviceGeneration",live.getProperty("deviceGeneration",0)); o->setProperty("mainOutputs",live.getProperty("dryRoutingLab",{}).getProperty("mainOutputs",{})); + // DAW-style AUDIO SETUP telemetry: JUCE's driver-provided input/output + // latency hints in SAMPLES, plus the host's current admitted DSP delay. + // No test pulse, no loopback calibration, no re-open or RT work. + // The WebView must never present an untrusted draft as measured audio. + const bool latencyReady = device != nullptr && device->isOpen(); + o->setProperty("driverInputLatencyFrames",latencyReady + ? live.getProperty("driverReportedInputLatencyFrames",{}) : juce::var()); + o->setProperty("driverOutputLatencyFrames",latencyReady + ? live.getProperty("driverReportedOutputLatencyFrames",{}) : juce::var()); + o->setProperty("hostFxLatencyFrames",latencyReady + ? live.getProperty("latencySamples",{}) : juce::var()); + o->setProperty("latencyClockScope", + bool (live.getProperty("adaptiveClockActive",false)) + ? "INDEPENDENT_CLOCKS_NO_DIRECT_ROUNDTRIP_ESTIMATE" + : "SINGLE_CLOCK_DRIVER_HINTS"); + o->setProperty("latencyProvenance", + "JUCE_DRIVER_REPORTED_NOT_MEASURED_LOOPBACK_OR_ASIO_RTL"); juce::Array inputNames,outputNames,inputPins,outputPins,rates,buffers; if(device!=nullptr&&device->isOpen()) { const auto inputs=device->getInputChannelNames(); From 7f95c2dc4d7b79e93b701d19a719d415f95231d8 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 18:06:05 +0700 Subject: [PATCH 05/22] feat(audio-setup): compact native driver IN/OUT/FX latency and buffer readback in milliseconds --- web/mixer-io.js | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/web/mixer-io.js b/web/mixer-io.js index bf34032b4..ea0a67752 100644 --- a/web/mixer-io.js +++ b/web/mixer-io.js @@ -1302,6 +1302,29 @@ field.disabled=disabled||!options.length; return field; } + // Pure CONTROL/UI readback conversion. JUCE reports latency in frames; + // this is NOT an electrical loopback measurement or a driver XRUN test. + // Unknown/negative values stay UNKNOWN rather than being silently 0 ms. + function deviceLatencyDisplay(active){ + const rate=Number(active?.rate); + if(!active?.open||!Number.isFinite(rate)||rate<=0) + return {ready:false}; + const toMs=frames=>{ + if(frames===null||frames===undefined||frames===''|| + !Number.isInteger(Number(frames))||Number(frames)<0)return null; + return Math.round(Number(frames)*10000/rate)/10; + }; + const input=toMs(active.driverInputLatencyFrames); + const output=toMs(active.driverOutputLatencyFrames); + const fx=toMs(active.hostFxLatencyFrames); + const period=toMs(active.buffer); + const sameClock=active.latencyClockScope==='SINGLE_CLOCK_DRIVER_HINTS'; + return {ready:true,input,output,fx,period, + driverIoHintMs:sameClock&&input!==null&&output!==null? + Math.round((input+output)*10)/10:null, + provenance:active.latencyProvenance||'UNKNOWN'}; + } + function latencyText(value){return value===null?'N/A':value.toFixed(1)+' ms';} function renderCustomDevice(body){ const a=deviceInventory?.active||{},types=deviceInventory?.types||[]; if(!deviceDraft&&(types.length||a.open))deviceDraft=makeDeviceDraft(); @@ -1320,6 +1343,28 @@ activeLine.append(activeText,node('span','arIODeviceActiveFlag', a.open&&a.authorized!==false?'ACTIVE':'NOT READY')); panel.appendChild(activeLine); + // Thin DAW-style status inside the ONE approved Audio Setup view. + // Shows the ACTIVE device, never the unapplied staged driver or buffer. + const latency=deviceLatencyDisplay(a); + const line=node('div','arIODeviceActiveLine arIODeviceLatencyReadback'); + const text=node('div',''); + text.append( + node('span','arIODeviceMicro','AUDIO LATENCY · VERIFIED NATIVE DEVICE'), + node('span','',latency.ready? + 'IN '+latencyText(latency.input)+' · OUT '+latencyText(latency.output)+ + ' · HOST FX '+latencyText(latency.fx)+ + ' · BUFFER '+latencyText(latency.period): + 'Choose and APPLY an audio device to read driver latency.')); + if(latency.ready){ + text.appendChild(node('small','', + latency.driverIoHintMs===null? + 'Driver I/O estimate unavailable · separate clocks / missing latency report': + 'Driver I/O hint ≈ '+latencyText(latency.driverIoHintMs)+ + ' · excludes uncalibrated hardware/OS delay')); + } + line.title='Driver-reported JUCE latency, not a measured analog loopback or round-trip calibration. Buffer period is shown separately and is not added twice.'; + line.appendChild(text); + panel.appendChild(line); // Operator-first First Sound action: the existing monitor.js controller // stages the real native route then independently ARM-ACKs hardware. const quick=window.__arMixFastAudioState?.()||{}; From bed2a984c669ea4b3e48a3b4b978da7c6a807e95 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 18:07:20 +0700 Subject: [PATCH 06/22] fix(win10): actionable native WebView2 recovery dialog before any audio startup --- src/Main.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/Main.cpp b/src/Main.cpp index e7187713c..f78f0f6e4 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -144,7 +144,7 @@ void showWebViewStartupError (const juce::String& detail) juce::MessageBoxOptions{} .withIconType (juce::MessageBoxIconType::WarningIcon) #if defined(_WIN32) - .withTitle ("ArSonMix - WebView2 unavailable") + .withTitle ("ArSonMix - Windows GUI cannot start") .withMessage ("The offline ArSonMix mixer needs Microsoft Edge WebView2 Runtime.\\n\\n" + detail + "\\n\\nDownload / repair from Microsoft:\\n" "https://developer.microsoft.com/en-us/microsoft-edge/webview2/\\n\\n" @@ -154,9 +154,23 @@ void showWebViewStartupError (const juce::String& detail) .withMessage ("ArSonMix requires the system WebKit browser backend " "(WKWebView on macOS, WebKitGTK on Linux).\\n\\n" + detail + "\\n\\nNo Show, plugin or preset data were deleted.") +#endif +#if defined(_WIN32) + .withButton ("Download / Repair WebView2") #endif .withButton ("Close"), - [] (int) { juce::JUCEApplication::getInstance()->systemRequestedQuit(); }); + [] (int result) + { +#if defined(_WIN32) + // JUCE 8 pinned NativeMessageBox uses 0-based button indices. + // Only an explicit click opens the signed vendor download page. + // No driver installation, audio output or private data mutation. + if (result == 0) + juce::URL ("https://developer.microsoft.com/en-us/microsoft-edge/webview2/") + .launchInDefaultBrowser(); +#endif + juce::JUCEApplication::getInstance()->systemRequestedQuit(); + }); } class Browser final : public juce::WebBrowserComponent From 44a2269bda0e09913b7222a218c86de9e1276ce3 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 18:08:39 +0700 Subject: [PATCH 07/22] test(win10): static CRT, optional driver and actionable WebView2 recovery --- tests/windows_installer_contract_test.mjs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/tests/windows_installer_contract_test.mjs b/tests/windows_installer_contract_test.mjs index fcb60140f..00790ce4c 100644 --- a/tests/windows_installer_contract_test.mjs +++ b/tests/windows_installer_contract_test.mjs @@ -51,7 +51,10 @@ test('optional signed VB-CABLE driver does not block clean Windows 10 first laun const run = iss.slice(iss.indexOf('[Run]'), iss.indexOf('[Code]')); assert.match(run, /StatusMsg: "Installing OPTIONAL VB-CABLE[^"]*"; Tasks: installvbcable_driver; Flags: runasoriginaluser skipifsilent waituntilterminated runhidden/); assert.ok(run.indexOf('ArSonMixVBCableInstall.ps1') < run.indexOf('Filename: "{app}\\ArSonMix.exe"')); - assert.doesNotMatch(run,/ArSonMixVBCableInstall\.ps1[^\n]*Flags:[^\n]*(?!Tasks: installvbcable_driver)/); + const vendorRunLine=run.split('\n').find(s=>s.includes('ArSonMixVBCableInstall.ps1')); + assert.ok(vendorRunLine,'optional vendor installer remains available'); + assert.match(vendorRunLine,/Tasks: installvbcable_driver/); + assert.equal((run.match(/Tasks: installvbcable_driver/g)||[]).length,1); assert.match(iss, /Check: CanLaunchMixer/); assert.match(iss, /function NeedRestart\(\): Boolean;[\s\S]*?FileExists/); assert.match(bootstrap, /if\(\$stateName -eq 'PENDING_REBOOT'\)\{[\s\S]*?New-Item -ItemType File -Path \$RestartMarker/); @@ -482,3 +485,17 @@ test('updater rechecks both verified installer binaries before execution and rol assert.match(script, /if\(-not \(Test-StagedAsset \$oldPath \$oldAsset\)\)/); assert.match(script, /INSTALLER_BYTES_CHANGED_UPDATE_DEFERRED/); }); + + +test('P0 Windows 10 fresh install needs no VC redistributable and reports missing WebView2',()=>{ + const cmake=read('CMakeLists.txt'),native=read('src/Main.cpp'); + assert.match(cmake,/if \(MSVC AND WIN32 AND NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY\)/); + assert.match(cmake,/set\(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded\$<\$:Debug>"\)/); + assert.ok(cmake.indexOf('set(CMAKE_MSVC_RUNTIME_LIBRARY')< + cmake.indexOf('add_subdirectory("${JUCE_ROOT}"'), + 'static CRT must apply to JUCE and app as one ABI'); + assert.match(native,/Download \/ Repair WebView2/); + assert.match(native,/developer\.microsoft\.com\/en-us\/microsoft-edge\/webview2/); + assert.match(native,/if \(result == 0\)/); + assert.match(iss,/Flags: unchecked/); +}); From 21054d0829ee7b242cc1afd3ba0921797386a78e Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 18:08:43 +0700 Subject: [PATCH 08/22] test(audio-setup): exact native latency math and fail-closed unavailable readbacks --- tests/mixer_io_operator_contract_test.mjs | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/mixer_io_operator_contract_test.mjs b/tests/mixer_io_operator_contract_test.mjs index e6b87165f..d2be3be56 100644 --- a/tests/mixer_io_operator_contract_test.mjs +++ b/tests/mixer_io_operator_contract_test.mjs @@ -721,3 +721,30 @@ test('M2b native AUDIO SETUP holds one lease through visible selection and rebin assert.match(cpp,/Purpose::explicitApply/); assert.doesNotMatch(setup,/\.closeAudioDevice\(/); }); + + +test('P0 Audio Setup reports native driver latency ms, never fake measured loopback',()=>{ + assert.match(main,/setProperty\("driverInputLatencyFrames",latencyReady/); + assert.match(main,/setProperty\("driverOutputLatencyFrames",latencyReady/); + assert.match(main,/setProperty\("hostFxLatencyFrames",latencyReady/); + assert.match(main,/JUCE_DRIVER_REPORTED_NOT_MEASURED_LOOPBACK_OR_ASIO_RTL/); + assert.match(gui,/AUDIO LATENCY · VERIFIED NATIVE DEVICE/); + assert.match(gui,/Driver-reported JUCE latency, not a measured analog loopback/); + const m=/function deviceLatencyDisplay\(active\)\{([\s\S]*?)\n \}\n function latencyText/.exec(gui); + assert.ok(m,'pure latency model must remain under one approved Audio Setup'); + const compute=new Function('active',m[1]); + const actual={open:true,rate:48000,buffer:256,driverInputLatencyFrames:240, + driverOutputLatencyFrames:360,hostFxLatencyFrames:96, + latencyClockScope:'SINGLE_CLOCK_DRIVER_HINTS'}; + assert.deepEqual(compute(actual),{ + ready:true,input:5,output:7.5,fx:2,period:5.3,driverIoHintMs:12.5, + provenance:'UNKNOWN' + }); + const noReport=compute({...actual,driverInputLatencyFrames:null, + latencyClockScope:'INDEPENDENT_CLOCKS_NO_DIRECT_ROUNDTRIP_ESTIMATE'}); + assert.equal(noReport.input,null); + assert.equal(noReport.driverIoHintMs,null); + assert.equal(compute({...actual,open:false}).ready,false); + assert.equal(compute({...actual,driverOutputLatencyFrames:-1}).output,null); + assert.equal(compute({...actual,driverInputLatencyFrames:0}).input,0); +}); From 5fe84a3491453c472bcffed8511e85c8a320219e Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 18:10:22 +0700 Subject: [PATCH 09/22] test(win10): verify actual packaged PE has no VC++ runtime DLL imports --- scripts/verify_win10_pe_runtime.py | 127 +++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 scripts/verify_win10_pe_runtime.py diff --git a/scripts/verify_win10_pe_runtime.py b/scripts/verify_win10_pe_runtime.py new file mode 100644 index 000000000..159619a27 --- /dev/null +++ b/scripts/verify_win10_pe_runtime.py @@ -0,0 +1,127 @@ +#!/usr/bin/env python3 +"""Fail closed if a Windows x64 PE imports Visual C++ redistributable DLLs. + +Runs on the exact EXE that the per-user Inno installer will ship. /MT is +configured for the WHOLE JUCE target graph; this is an independent binary +check, not evidence that WebView2 or hardware ASIO is installed. +Standard-library only, no downloads or machine-wide changes. +""" +from __future__ import annotations + +import argparse +import pathlib +import re +import struct +import sys + + +def imports(path: pathlib.Path) -> set[str]: + data = path.read_bytes() + + def u16(at: int) -> int: + if at < 0 or at + 2 > len(data): + raise ValueError("Truncated PE word") + return struct.unpack_from(" int: + if at < 0 or at + 4 > len(data): + raise ValueError("Truncated PE dword") + return struct.unpack_from(" len(data): + raise ValueError("Truncated optional header") + directory = optional + 112 + if directory + 16 * 8 > optional + opt_bytes: + raise ValueError("Missing import data-directory") + sections = optional + opt_bytes + section_rows: list[tuple[int, int, int]] = [] + for i in range(count): + sec = sections + i * 40 + vsize = u32(sec + 8) + vaddr = u32(sec + 12) + rsize = u32(sec + 16) + raw = u32(sec + 20) + section_rows.append((vaddr, max(vsize, rsize), raw)) + + def rva_to_offset(rva: int) -> int: + for va, size, raw in section_rows: + if va <= rva < va + size and raw + rva - va < len(data): + return raw + rva - va + raise ValueError(f"Unmapped import RVA {rva:x}") + + def cstring(rva: int) -> str: + at = rva_to_offset(rva) + end = data.find(b"\x00", at, min(len(data), at + 512)) + if end < 0: + raise ValueError("Unterminated DLL import") + return data[at:end].decode("ascii").lower() + + names: set[str] = set() + # Standard import descriptors (20-byte structs; Name at +12). + base = u32(directory + 8) + if base: + at = rva_to_offset(base) + for _ in range(1024): + if at + 20 > len(data): + raise ValueError("Truncated import descriptors") + if data[at:at + 20] == b"\x00" * 20: + break + names.add(cstring(u32(at + 12))) + at += 20 + else: + raise ValueError("Unterminated PE imports") + # Delay-load descriptors (32-byte structs; DLL Name at +4). + delay_rva = u32(directory + 13 * 8) + if delay_rva: + at = rva_to_offset(delay_rva) + for _ in range(1024): + if at + 32 > len(data): + raise ValueError("Truncated delay-import descriptors") + if data[at:at + 32] == b"\x00" * 32: + break + attributes = u32(at) + if attributes & 1: # name is RVA, not virtual address + names.add(cstring(u32(at + 4))) + else: + raise ValueError("Unsupported absolute-VA delay import") + at += 32 + else: + raise ValueError("Unterminated delay imports") + return names + + +def check(path: pathlib.Path) -> None: + names = imports(path) + if not names: + raise ValueError("No imported libraries: unexpected native GUI PE") + forbidden = [n for n in sorted(names) if + re.match(r"^(vcruntime\d*(?:_\d+)?|msvcp\d+(?:_\d+)?|" + r"concrt\d+|mfc\d+|ucrtbased)\.dll$", n)] + if forbidden: + raise ValueError("Windows redistributable dependency: " + ", ".join(forbidden)) + print("WIN10_STATIC_CRT_PE_PASS: verified executable imports no VC++ runtime " + f"DLLs; {len(names)} direct/delay DLL imports inspected") + print("WEBVIEW2_RUNTIME_REQUIRED_SEPARATELY_NOT_PROVEN") + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--exe", type=pathlib.Path, required=True) + args = parser.parse_args() + try: + check(args.exe) + except (OSError, ValueError, struct.error) as err: + print("WIN10_STATIC_CRT_PE_FAIL: " + str(err), file=sys.stderr) + sys.exit(1) From 824e7599b75d12170f9959248a1b13f5fdaf5a12 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 18:10:54 +0700 Subject: [PATCH 10/22] ci(win10): reject actual installer PE if dynamic VC++ CRT imports remain --- scripts/build_verify_windows_installer.ps1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/build_verify_windows_installer.ps1 b/scripts/build_verify_windows_installer.ps1 index 2a39740c7..49aaa5a86 100644 --- a/scripts/build_verify_windows_installer.ps1 +++ b/scripts/build_verify_windows_installer.ps1 @@ -8,6 +8,11 @@ $sha=(& git rev-parse HEAD).Trim() $manifest=Get-Content -LiteralPath (Join-Path $dist "BUILD_PROVENANCE.json") -Raw -Encoding UTF8 | ConvertFrom-Json $exe=Join-Path $dist "ArSonMix-GUI10CH-P012-Windows-x64.exe" $appHash=(Get-FileHash -LiteralPath $exe -Algorithm SHA256).Hash.ToLowerInvariant() +# Binary-level fresh-Win10 prerequisite gate: GitHub runners have the VC++ +# redist preinstalled, so a successful CI launch alone cannot catch /MD. +# Inspect real PE import and delay-import tables BEFORE shipping/installation. +& python scripts/verify_win10_pe_runtime.py --exe $exe +if($LASTEXITCODE -ne 0){throw "Packaged PE still requires dynamic MSVC redistributable"} if($LASTEXITCODE -ne 0 -or $manifest.sourceCommit -ne $sha -or $manifest.exeSha256 -ne $appHash -or $manifest.fatStatus -ne "SOFTWARE_VERIFIED_PREVIEW_CANDIDATE" -or (Get-Item -LiteralPath $exe).Length -ne $manifest.guiExeBytes -or From d23384524c55b58e8158231bde623f109206749c Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 18:10:58 +0700 Subject: [PATCH 11/22] test(win10): require binary dependency proof, not just source flags --- tests/windows_installer_contract_test.mjs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/windows_installer_contract_test.mjs b/tests/windows_installer_contract_test.mjs index 00790ce4c..90157d5c9 100644 --- a/tests/windows_installer_contract_test.mjs +++ b/tests/windows_installer_contract_test.mjs @@ -498,4 +498,12 @@ test('P0 Windows 10 fresh install needs no VC redistributable and reports missin assert.match(native,/developer\.microsoft\.com\/en-us\/microsoft-edge\/webview2/); assert.match(native,/if \(result == 0\)/); assert.match(iss,/Flags: unchecked/); + const packaged=read('scripts/build_verify_windows_installer.ps1'); + const pe=read('scripts/verify_win10_pe_runtime.py'); + assert.match(packaged,/verify_win10_pe_runtime\.py --exe \$exe/); + assert.match(pe,/WIN10_STATIC_CRT_PE_PASS/); + assert.match(pe,/delay-import descriptors|delay-import|Delay-load descriptors/i); + assert.match(pe,/vcruntime/); + assert.match(pe,/msvcp/); + assert.match(pe,/WEBVIEW2_RUNTIME_REQUIRED_SEPARATELY_NOT_PROVEN/); }); From 44c39b91c958bfb4043dd430dce2501c6bce73d4 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 18:12:13 +0700 Subject: [PATCH 12/22] fix(win10): persist actionable early startup error without touching audio or user sessions --- src/Main.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/Main.cpp b/src/Main.cpp index f78f0f6e4..ca3584155 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -140,6 +140,25 @@ juce::WebBrowserComponent::Options webViewOptions() void showWebViewStartupError (const juce::String& detail) { +#if defined(_WIN32) + // Before ConsoleWindow/browser/diagnostics exist, there may be NO app + // window and NO regular diagnostics log on a fresh Windows 10 machine. + // Record only bounded OS/error information to the user's private profile. + // No .smix, plugin state, audio device, registry edit, or callback work. + const auto local = juce::SystemStats::getEnvironmentVariable ("LOCALAPPDATA", {}); + if (local.isNotEmpty()) + { + const auto failure = juce::File (local).getChildFile ("ArSonMix") + .getChildFile ("diagnostics").getChildFile ("startup-failure.txt"); + if (failure.getParentDirectory().createDirectory().wasOk() + || failure.getParentDirectory().isDirectory()) + (void) failure.replaceWithText ( + "ArSonMix GUI startup failure\\nTime: " + + juce::Time::getCurrentTime().toISO8601 (true) + + "\\nOS: " + juce::SystemStats::getOperatingSystemName() + + "\\nReason: " + detail.substring (0, 512) + "\\n"); + } +#endif juce::NativeMessageBox::showAsync ( juce::MessageBoxOptions{} .withIconType (juce::MessageBoxIconType::WarningIcon) @@ -148,7 +167,8 @@ void showWebViewStartupError (const juce::String& detail) .withMessage ("The offline ArSonMix mixer needs Microsoft Edge WebView2 Runtime.\\n\\n" + detail + "\\n\\nDownload / repair from Microsoft:\\n" "https://developer.microsoft.com/en-us/microsoft-edge/webview2/\\n\\n" - "No VST3, mixer presets or session data were deleted.") + "No VST3, mixer presets or session data were deleted.\\n" + "Local diagnostic: %LOCALAPPDATA%\\\\ArSonMix\\\\diagnostics\\\\startup-failure.txt") #else .withTitle ("ArSonMix - native WebKit unavailable") .withMessage ("ArSonMix requires the system WebKit browser backend " From c1aa28fd98231afa934a501d8b0e9fe35964e7ec Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 18:13:01 +0700 Subject: [PATCH 13/22] fix(win10): preserve actual newline and filesystem path escapes in early error dialog --- src/Main.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Main.cpp b/src/Main.cpp index ca3584155..421e24a96 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -153,10 +153,10 @@ void showWebViewStartupError (const juce::String& detail) if (failure.getParentDirectory().createDirectory().wasOk() || failure.getParentDirectory().isDirectory()) (void) failure.replaceWithText ( - "ArSonMix GUI startup failure\\nTime: " + "ArSonMix GUI startup failure\nTime: " + juce::Time::getCurrentTime().toISO8601 (true) - + "\\nOS: " + juce::SystemStats::getOperatingSystemName() - + "\\nReason: " + detail.substring (0, 512) + "\\n"); + + "\nOS: " + juce::SystemStats::getOperatingSystemName() + + "\nReason: " + detail.substring (0, 512) + "\n"); } #endif juce::NativeMessageBox::showAsync ( @@ -164,16 +164,16 @@ void showWebViewStartupError (const juce::String& detail) .withIconType (juce::MessageBoxIconType::WarningIcon) #if defined(_WIN32) .withTitle ("ArSonMix - Windows GUI cannot start") - .withMessage ("The offline ArSonMix mixer needs Microsoft Edge WebView2 Runtime.\\n\\n" - + detail + "\\n\\nDownload / repair from Microsoft:\\n" - "https://developer.microsoft.com/en-us/microsoft-edge/webview2/\\n\\n" - "No VST3, mixer presets or session data were deleted.\\n" - "Local diagnostic: %LOCALAPPDATA%\\\\ArSonMix\\\\diagnostics\\\\startup-failure.txt") + .withMessage ("The offline ArSonMix mixer needs Microsoft Edge WebView2 Runtime.\n\n" + + detail + "\n\nDownload / repair from Microsoft:\n" + "https://developer.microsoft.com/en-us/microsoft-edge/webview2/\n\n" + "No VST3, mixer presets or session data were deleted.\n" + "Local diagnostic: %LOCALAPPDATA%\\ArSonMix\\diagnostics\\startup-failure.txt") #else .withTitle ("ArSonMix - native WebKit unavailable") .withMessage ("ArSonMix requires the system WebKit browser backend " - "(WKWebView on macOS, WebKitGTK on Linux).\\n\\n" - + detail + "\\n\\nNo Show, plugin or preset data were deleted.") + "(WKWebView on macOS, WebKitGTK on Linux).\n\n" + + detail + "\n\nNo Show, plugin or preset data were deleted.") #endif #if defined(_WIN32) .withButton ("Download / Repair WebView2") From 46b922cf13ff7029b1ba3079cbebd11bd7c460fa Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 18:17:57 +0700 Subject: [PATCH 14/22] build(gui): synchronize generated standalone audio setup latency with one source-owned JS --- AR-MIX-Live-FX-Host-Standalone-v0.3.html | 45 ++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/AR-MIX-Live-FX-Host-Standalone-v0.3.html b/AR-MIX-Live-FX-Host-Standalone-v0.3.html index d280a1443..7dd043da0 100644 --- a/AR-MIX-Live-FX-Host-Standalone-v0.3.html +++ b/AR-MIX-Live-FX-Host-Standalone-v0.3.html @@ -4761,6 +4761,29 @@ field.disabled=disabled||!options.length; return field; } + // Pure CONTROL/UI readback conversion. JUCE reports latency in frames; + // this is NOT an electrical loopback measurement or a driver XRUN test. + // Unknown/negative values stay UNKNOWN rather than being silently 0 ms. + function deviceLatencyDisplay(active){ + const rate=Number(active?.rate); + if(!active?.open||!Number.isFinite(rate)||rate<=0) + return {ready:false}; + const toMs=frames=>{ + if(frames===null||frames===undefined||frames===''|| + !Number.isInteger(Number(frames))||Number(frames)<0)return null; + return Math.round(Number(frames)*10000/rate)/10; + }; + const input=toMs(active.driverInputLatencyFrames); + const output=toMs(active.driverOutputLatencyFrames); + const fx=toMs(active.hostFxLatencyFrames); + const period=toMs(active.buffer); + const sameClock=active.latencyClockScope==='SINGLE_CLOCK_DRIVER_HINTS'; + return {ready:true,input,output,fx,period, + driverIoHintMs:sameClock&&input!==null&&output!==null? + Math.round((input+output)*10)/10:null, + provenance:active.latencyProvenance||'UNKNOWN'}; + } + function latencyText(value){return value===null?'N/A':value.toFixed(1)+' ms';} function renderCustomDevice(body){ const a=deviceInventory?.active||{},types=deviceInventory?.types||[]; if(!deviceDraft&&(types.length||a.open))deviceDraft=makeDeviceDraft(); @@ -4779,6 +4802,28 @@ activeLine.append(activeText,node('span','arIODeviceActiveFlag', a.open&&a.authorized!==false?'ACTIVE':'NOT READY')); panel.appendChild(activeLine); + // Thin DAW-style status inside the ONE approved Audio Setup view. + // Shows the ACTIVE device, never the unapplied staged driver or buffer. + const latency=deviceLatencyDisplay(a); + const line=node('div','arIODeviceActiveLine arIODeviceLatencyReadback'); + const text=node('div',''); + text.append( + node('span','arIODeviceMicro','AUDIO LATENCY · VERIFIED NATIVE DEVICE'), + node('span','',latency.ready? + 'IN '+latencyText(latency.input)+' · OUT '+latencyText(latency.output)+ + ' · HOST FX '+latencyText(latency.fx)+ + ' · BUFFER '+latencyText(latency.period): + 'Choose and APPLY an audio device to read driver latency.')); + if(latency.ready){ + text.appendChild(node('small','', + latency.driverIoHintMs===null? + 'Driver I/O estimate unavailable · separate clocks / missing latency report': + 'Driver I/O hint ≈ '+latencyText(latency.driverIoHintMs)+ + ' · excludes uncalibrated hardware/OS delay')); + } + line.title='Driver-reported JUCE latency, not a measured analog loopback or round-trip calibration. Buffer period is shown separately and is not added twice.'; + line.appendChild(text); + panel.appendChild(line); // Operator-first First Sound action: the existing monitor.js controller // stages the real native route then independently ARM-ACKs hardware. const quick=window.__arMixFastAudioState?.()||{}; From e8e8e76c53d659861ea1c540925cb4cb90423953 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 18:21:48 +0700 Subject: [PATCH 15/22] feat(audio-setup): one approved MVVM driver-reported latency projection with honest provenance --- web/approved-device-view-model.js | 32 ++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/web/approved-device-view-model.js b/web/approved-device-view-model.js index d2068c015..895445b43 100644 --- a/web/approved-device-view-model.js +++ b/web/approved-device-view-model.js @@ -124,6 +124,36 @@ outputPins:Array.isArray(active.enabledOutputs)?active.enabledOutputs.slice():null, rate:0,buffer:0}; } + // DAW-style read-only latency from the ACTUAL active JUCE device. + // Driver input/output hints are not an electrical loopback measurement. + // Unavailable or independently clocked paths are NEVER converted to 0 ms. + function setupLatencyReadback(active) { + const rate=Number(active?.rate); + if(active?.open!==true || !Number.isFinite(rate)||rate<=0) + return Object.freeze({ready:false}); + const milliseconds=frames=>{ + if(frames===null||frames===undefined||frames===''|| + !Number.isSafeInteger(Number(frames))||Number(frames)<0)return null; + return Math.round(Number(frames)*10000/rate)/10; + }; + const input=milliseconds(active.driverInputLatencyFrames); + const output=milliseconds(active.driverOutputLatencyFrames); + const fx=milliseconds(active.hostFxLatencyFrames); + const buffer=milliseconds(active.buffer); + const sameClock=active.latencyClockScope==="SINGLE_CLOCK_DRIVER_HINTS"; + const hint=sameClock&&input!==null&&output!==null + ?Math.round((input+output)*10)/10:null; + const fmt=x=>x===null?"N/A":x.toFixed(1)+" ms"; + return Object.freeze({ + ready:true,inputMs:input,outputMs:output,fxMs:fx,bufferMs:buffer, + driverIoHintMs:hint, + line:"IN "+fmt(input)+" · OUT "+fmt(output)+ + " · FX "+fmt(fx)+" · BUFFER "+fmt(buffer), + note:hint===null?"Driver I/O estimate unavailable · verify driver and clock": + "Driver I/O hint ≈ "+fmt(hint)+" · not measured round-trip", + provenance:active.latencyProvenance||"UNKNOWN" + }); + } function setupPresentation(inventory,draft,state=setupInitial()) { const active=inventory?.active||{},types=inventory?.types||[]; const type=types.find(t=>t?.name===draft?.backend); @@ -423,7 +453,7 @@ return Object.freeze({kind:"SAME",expirePending:false}); } return Object.freeze({activeInputPins,inputChoices,inputLabel,outputChoices, - externalPresentation,setupDraft,setupPresentation,setupEditDraft, + externalPresentation,setupDraft,setupPresentation,setupLatencyReadback,setupEditDraft, setupInitial,setupBegin,setupAck,setupReadback, setupTimeout,setupClearResult,nativeLifecycleLease,nativeLifecycleDecision, nativeTransientReadbackPolicy}); From 8236cc0e43da054a81f15540fdd6074441d28e20 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 18:22:14 +0700 Subject: [PATCH 16/22] feat(audio-setup): display latency in the one approved native Audio I/O dialog --- web/approved-native-bridge.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/web/approved-native-bridge.js b/web/approved-native-bridge.js index 930bb8c00..f7e731beb 100644 --- a/web/approved-native-bridge.js +++ b/web/approved-native-bridge.js @@ -2137,6 +2137,9 @@
Reading current audio device…
+
+ Latency · waiting for native device readback +