NAM-Audio-Pipe is an ultra-low latency, real-time standalone PipeWire host application for Neural Amp Modeler (NAM) simulation on Linux.
Turn your Linux machine into a world-class, instantaneous guitar amplifier or studio rig. Powered directly by the cutting-edge NeuralAmpModeler-rs engine (v4.1.0), NAM-Audio-Pipe connects directly to your native PipeWire audio graph without requiring heavyweight digital audio workstations (DAWs), complex JACK bridging, or Wine emulation layers.
Whether practicing at home, tracking live in the studio, or performing on stage, NAM-Audio-Pipe delivers studio-grade tone with analog-like responsiveness, sub-millisecond buffer sizes, zero dropouts, and one-touch lock-free WAV recording.
NAM-Audio-Pipe inherits the relentless engineering, mathematical precision, and raw performance of the NeuralAmpModeler-rs core engine, wrapping it in a standalone Linux application designed specifically for musicians and audio professionals:
You get the exact, authentic tone of your favorite amp models. The underlying engine is verified under a continuous dual-oracle regression suite against both the reference C++ NAMCore (NeuralAmpModeler-rs:
-
WaveNet A1/A2 Models: Maintains Error-to-Signal Ratio (ESR)
$< 2.31 \times 10^{-14}$ against NAMCore and$9.05 \times 10^{-15}$ against the$f64$ oracle ($136.4\text{ dB}$ SNR). -
ConvNet Models: Achieves ESR
$< 9.33 \times 10^{-16}$ ($150.3\text{ dB}$ SNR). -
Perceptual Metric Validation: All models verify multi-resolution STFT distance (MR-STFT
$< 6.5 \times 10^{-6}$ ), spectral convergence, and LUFS loudness constancy. -
Full Model Coverage: Loads standard
.nam(JSON) and lightning-fast pre-transposed.nambv2 (binary, Gate-Major LSTM / Interleaved-4 WaveNet with CRC32,$< 1\text{ ms}$ load time) models across all major architectures: WaveNet A1/A2, LSTM (1 & 2 layers, multi-I/O), ConvNet, Linear FIR/FFT, and Sequential compositions.
Hand-written vector SIMD compute kernels (x86-64-v3 AVX2/FMA baseline) monomorphized at compile-time with zero virtual dispatch:
-
Massive Real-Time Headroom: On modern hardware (e.g., AMD Ryzen 7 5700U), a WaveNet Standard model processes a 64-sample buffer in just
$41.26\text{ Β΅s}$ βconsuming only$3.1%$ of the available$1.33\text{ ms}$ real-time budget. Modern WaveNet A2 models execute in$13.76\text{β}18.68\text{ Β΅s}$ ($1.0\text{β}1.4%$ ), and lighter LSTM profiles execute in as little as$6.44\text{ Β΅s}$ ($0.5%$ CPU). -
Const-Generic Optimization & Dynamic Topologies: Features 24 distinct model variants (16 static const-generic profiles + zero-allocation dynamic fallbacks). Canonical channel counts (
$CH=16, 12, 8, 4, 3$ ), kernel sizes, and receptive fields are monomorphized at compile time, enabling aggressive LLVM loop unrolling and register allocation. -
Zero-Vtable Dispatch: The static
dispatch_simd!engine eliminates all indirect function pointers and vtable lookups on the audio path. Compute kernels utilize tap-major memory layouts and instruction-level parallelism (sum0..sum3) unrolling. -
Adaptive Compute FSM: Dynamic CPU load-monitoring state machine with hysteresis (
--slim auto) that automatically throttles model complexity under system spikes (Full β Reduced β Minimal) using 32 ms click-free linear crossfades to prevent buffer dropouts. -
Microarchitecture Layout Optimization: Compiled with Profile-Guided Optimization (PGO) and LLVM BOLT instruction reordering, validated and promoted through the automated A/B optimization ceremony (
utils/ab-opt-ceremony.sh) to maximize CPU Instruction Cache (I-Cache) and TLB hit rates.
Engineered from the ground up for zero-dropout live playing:
-
Zero Heap Allocations: Scratch memory, model weights, and resamplers are pre-allocated. No
mallocorfreeever occurs on the audio thread (audited viaCountingAllocator). - Zero Mutex Locks & 3-Tier GC Cascade: State changes, model swaps, and telemetries communicate across bounded lock-free Single-Producer Single-Consumer (SPSC) rings backed by a 3-tier garbage collection cascade (SPSC queue β 16-slot parking lot β overwrite ring), ensuring safe off-RT resource deallocation without audio thread stalls.
- Zero Blocking I/O: Filesystem access, socket IPC, and logging macros are strictly excluded from the audio callback.
-
Denormal & Subnormal Armor: Injects symmetric
$-220\text{ dBFS}$ deterministic dither ($1.0 \times 10^{-11}$ ) combined with hardware MXCSR FTZ/DAZ reassertion on every processing block, preventing 10β100Γ CPU microcode penalties during digital silence with zero net DC drift.
No external audio libraries or third-party wrappers needed:
-
Zero-Latency Cabinet Simulation & SPA Delay Accounting: Single exclusive cabinet slot (
--cab) supporting Uniformly Partitioned Overlap-Save (UPOLS) FFT convolution for.wavimpulse responses ($1.24\text{ Β΅s}$ for 2048-sample IRs, configurable--cabsim-partition32β256samples) or 1-in/1-out.nam/.nambneural cabinet models at strict unity gain (isolated from amp calibration and--ir-level-policy), plus independent--cab-bypasswith 64-sample cosine crossfade. Algorithmic priming latency is strictly declared to the PipeWire graph scheduler via SPA latency properties (SPA_PARAM_Latency), preserving constant delay compensation even while cabinet bypass is engaged (seedocs/latency-spa-adr.md). -
Minimum-Phase Polyphase Sinc Resampling: Native 256 phases Γ 64 taps Kaiser sinc resampler (Kaiser
$\beta=12$ ,$>105\text{ dB}$ stopband attenuation,$< 0.05\text{ dB}$ passband ripple, zero pre-ringing,$0.65\text{β}1.30\text{ Β΅s}$ execution) seamlessly adapts 48 kHz models to any host sample rate (44.1 kHz, 96 kHz, 192 kHz). -
Half-Band Anti-Aliasing Oversampling: Multi-stage half-band polyphase FIR filters (
Off,2x,4x,$>100\text{ dB}$ stopband attenuation) attenuate non-linear high-frequency foldover distortion on screaming high-gain leads. Experimental until SRI: fixed-rate models shift timbre when oversampled. -
Selectable Activation Precision: Choose between
standard(exact Taylor minimax, +89.5 dB SNR) andfast(PadΓ© polynomial minimax approximation) to tailor math precision against CPU cycles. -
Selectable Noise Gate Topologies (
--gate-mode): Choose betweenmusical(default log-domain continuous expander triggering pre-calibration and attenuating post-model / pre-CabSim IR to preserve natural cabinet tails) andsilence(dual-threshold Schmitt gate with CPU-skipping shutoff), plus the C++-paritylegacyexpander. -
Deliberate DSP Architectural Boundaries:
-
Omission of Integrated Tone Stack (EQ): Omitted by deliberate design to keep the standalone pipeline lean, deterministic, and modular. Equalization and tone shaping are best placed within the PipeWire graph via dedicated audio filter nodes or external visual patchbays (e.g.
qpwgraph+ Calf/LSP/Carla plugins). - Omission of Post-Cabinet DC Filter: Omitted by deliberate design. While symmetrical dither and floating-point denormal armoring prevent hardware microcode slowdowns, there is no claim of absolute immunity to DC offset (which may arise from asymmetric non-linear models). Users requiring steep sub-bass DC filtering can route the stream through a high-pass filter in the audio graph. This decision remains open and may be reevaluated in future revisions based on user requirements.
-
Omission of Integrated Tone Stack (EQ): Omitted by deliberate design to keep the standalone pipeline lean, deterministic, and modular. Equalization and tone shaping are best placed within the PipeWire graph via dedicated audio filter nodes or external visual patchbays (e.g.
Capture your tone directly to pristine 32-bit float stereo WAV files without touching DAW software:
- Zero-Impact
io_uringEngine: Audio samples travel through a pre-allocated 64 KiB slot pool transport with safe, non-nullable memory references (~57% lower memory traffic than traditional rings) and write to disk via Linuxtokio-uring. - Crash-Resilient Header Checkpointing: Automatically updates WAV header chunk lengths and invokes
fsyncevery 3 seconds. An unexpected power outage or signal kill loses at most 3 seconds instead of destroying the entire recording. - Automatic 4 GiB RIFF File Splitting: Seamlessly splits extended jam sessions into continuous, gapless
_partN.wavsegments. - Continuous Capture Across Gate Pauses: In
--gate-mode silence, a gate-closed quantum is committed as a zero-copy intentional-silence marker β the RT thread only sends the frame count and the disk worker writes the matching zero frames. The take keeps its real duration (including rehearsal pauses) without copying zeros on the audio thread. Genuine transport loss (pool starvation, full ring) is never padded: it is counted as overrun and reported as a lossy capture.--gate-mode musicalrecords continuously with expanded tails.
Optimizes the operating system kernel for audio automatically on launch:
- Locks application memory into physical RAM (
mlockall) to prevent disk paging. - Pins Power Management DMA latency to 0 Β΅s (
/dev/cpu_dma_latency), eliminating CPU C-state wake-up lag. - Profiles
/proc/interruptsin real-time to bind the audio thread to the least-contended CPU core away from hardware device IRQs. - Disables Transparent Huge Pages (THP) to prevent background kernel memory compaction jitter.
Getting started with guitar on Linux has never been easier. You do not need to configure JACK, compile kernel patches, or launch complex software suites.
Guitar / Bass
β (1/4" Instrument Cable)
βΌ
βββββββββββββββββββββββββββ
β USB Audio Interface β
β (Focusrite, Behringer, β
β PreSonus, MOTU, etc.) β
ββββββββββββββ¬βββββββββββββ
β (USB)
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Linux Machine (PipeWire Audio Graph) β
β β
β [Capture: Guitar DI] βββΊ [NAM-Audio-Pipe] βββΊ [Speakers] β
β β β
β ββββΊ (WAV Recording) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
On Ubuntu, Debian, Pop!_OS, or Linux Mint:
sudo apt update && sudo apt install -y build-essential pkg-config clang libclang-dev libpipewire-0.3-dev libspa-0.2-devDownload free community-created amp models and impulse responses from:
Plug in your guitar, select your instrument input in your system sound settings, and launch:
# Basic amp playback:
nam-audio-pipe --model ~/models/MyFavoriteAmp.nam
# Complete rig with amp model and speaker cabinet:
nam-audio-pipe --model ~/models/Plexi50W.nam --cab ~/irs/Greenback4x12.wavYou will hear your guitar processed with full neural simulation in real time!
π‘ Pro-Tip: Visual Patching & Innovative Routing with
qpwgraphOn startup,
NAM-Audio-Pipe Processed Output(NAM-Audio-Pipe-playback) auto-connects to your default speakers/headphones, whileNAM-Audio-Pipe Input(NAM-Audio-Pipe-input, virtualAudio/Sink) starts unconnected so you choose which hardware interface or desktop application feeds the rig. PipeWire's dynamic multimedia graph lets you route any audio source through the neural amp rig with zero extra quantum latency.Using a visual patchbay tool such as
qpwgraph(orHelvum), follow these routing rules:
- Guitar DI / Live Playing: Connect your audio interface capture port (e.g.,
capture_FL/capture_FR) toNAM-Audio-Pipe Input(playback_FL/playback_FR). Note that the capture sink is created withStreamFlags::EXCLUSIVE, so only one input source should be patched into it at a time (use an external mixer node if you want to blend multiple sources).- Creative Re-Amping & Tone Coloration (VLC / Browsers / Synths): Patch your application (Firefox, Chromium, VLC, MPV, software synthesizers, or drum samplers) straight into
NAM-Audio-Pipe Inputβ and disconnect the application's direct link to your speakers/headphones (otherwise you will hear the dry unprocessed signal mixed over the processed output).- Never Patch
NAM-Audio-Pipe Input:monitor_FL/FRto Speakers: PipeWire'sAudio/Sinkmonitor ports tap the incoming audio before DSP processing. Processed audio always exits exclusively fromNAM-Audio-Pipe Processed Output.- Jam Along with Backing Tracks: Route your browser or music player directly to your speakers/headphones while keeping only your guitar routed through
NAM-Audio-Pipe Input.- Live Dynamic Re-Routing: Connections can be made, broken, or rerouted on the fly while playingβno audio dropouts, no driver reloading, and no engine restarts needed.
Install
qpwgrapheasily via your package manager:sudo apt install qpwgraph # Debian / Ubuntu / Pop!_OS # or via Flatpak: flatpak install flathub org.rncbc.qpwgraph
| Capability | Technical Implementation | Practical Musician / Engineering Impact |
|---|---|---|
| Neural Amp Simulation | Full NeuralAmpModeler-rs engine (WaveNet A1/A2, LSTM, ConvNet, Linear, Sequential) |
Authentic tube amp tone with exact dynamic feel and pick-attack nuance |
| Native PipeWire Routing | Direct Client API (libpipewire-0.3-dev pipewire crate |
Seamless integration with qpwgraph, Helvum, and system audio patchbays |
| Latency Benchmark | Native quantums down to 64 samples ( |
Imperceptible latency matching real analog hardware amplifiers |
| SPA Latency Publication | Real-time SPA_PARAM_Latency synchronization based on active DSP stages and graph rate |
Exact host delay compensation preventing phase alignment errors in complex graphs |
| Real-Time Safety | Strict zero heap allocations, zero mutex locks, zero blocking I/O | Absolute reliability on stage and in the studioβno audio glitches or xruns |
| Numerical Accuracy | Dual-oracle verified against C++ NAMCore |
Laboratory-grade fidelity ( |
| Const-Generic Profiles | 24 model variants (16 static compile-time profiles |
Compile-time loop unrolling and optimal register allocation for canonical architectures |
| Low-Latency Cabinet Slot | Exclusive slot for .wav IR (UPOLS FFT) or 1x1 .nam/.namb cabs + --cab-bypass
|
Natural cabinet tone ( |
| Multi-Rate Resampling | 256-phase Γ 64-tap Kaiser sinc resampler (>105 dB stopband, <0.05 dB ripple) | Pristine 44.1/48/96/192 kHz rate conversion in 0.65β1.30 Β΅s with zero pre-ringing |
| Anti-Aliasing Oversampling | Multi-stage half-band polyphase FIR filtering (2x exp., 4x exp., |
Attenuates high-frequency aliasing; timbre shifts until SRI oversampling |
| Activation Math Modes |
standard (exact Taylor minimax) vs fast (PadΓ© polynomial approximation) |
Balance maximum floating-point precision (+89.5 dB SNR) against minimal CPU cycles |
| Calibration & Output Safety | Per-sample ParamSmoother trims/calibration, resilient metadata (strict opt-in), 5 Hz DC blocker, and soft-clip/true-peak/clamp playback limiter |
Click-free gain staging, transparent DC removal, and protected monitoring with raw recording |
| Dual Noise Gate Topologies |
silence (10 dB Schmitt hysteresis, CPU-skip) or musical (pre-IR quadratic expander) |
Eliminates pickup noise cleanly or lets natural cabinet tails ring out smoothly |
Binary .namb v2 Format |
Pre-transposed memory layout (Gate-Major LSTM, Interleaved-4 WaveNet) with CRC32 | Lightning-fast model loading and live hot-swapping in |
| Denormal Armor | Symmetric β220 dBFS dither injection + hardware MXCSR FTZ/DAZ | Prevents 10β100Γ CPU microcode stalls on digital silence with zero net DC drift |
| Asynchronous WAV Recording | Non-blocking slot pool transport with safe references + Linux tokio-uring engine |
Lossless 32-bit float stereo recording straight to disk with zero audio thread burden |
| Crash Protection | Periodic 3-second header checkpointing & 5-second graceful signal shutdown | Saves your take even if the host machine experiences a sudden power loss |
| Kernel Latency Tuning | Real-time PM QoS (mlockall, THP disable, CPU IRQ isolation |
Prevents CPU sleep states and operating system scheduler interruptions |
| Adaptive Compute | Dynamic CPU pressure monitoring (--slim auto) with 32 ms crossfading |
Automatically throttles model complexity under system overload to prevent dropouts |
| Desktop & Flatpak Deployment | Standalone Flatpak bundle with AppStream metadata & .desktop launcher |
1-click install and sandboxed execution across all modern Linux distributions |
NAM-Audio-Pipe delivers world-class audio fidelity backed by the strict quality contract and empirical baselines established in NeuralAmpModeler-rs.
Accuracy is validated against two co-equal reference oracles across 52 model baselines:
-
Canonical C++ NAMCore Reference (
$f32$ ): Verifies bit-exact behavioral parity across WaveNet A1/A2, LSTM, ConvNet, and Linear architectures. -
Double-Precision Reference (
$f64$ ): Quantifies numerical ideality and eliminates floating-point rounding divergence.
| Architecture / Model | Error-to-Signal Ratio (ESR) | Signal-to-Noise Ratio (SNR) | Multi-Resolution STFT |
|---|---|---|---|
| WaveNet Standard | |||
| WaveNet A2 | |||
| ConvNet ReLU | |||
| LSTM 1-Layer |
All models satisfy spectral convergence and LUFS loudness constancy invariants.
Execution times for isolated DSP kernels measured per 64-sample block at 48 kHz (x86-64-v3 AVX2 baseline, verified against NeuralAmpModeler-rs v4.1.0 baselines on rustc 1.100.0; crate MSRV remains 1.99.0):
| Component / Profile | Execution Time | RT Deadline Budget Used | Max Theoretical Instances |
|---|---|---|---|
| WaveNet Standard (CH=16) | 41.26 Β΅s | 3.1% | ~32 instances |
| WaveNet Lite (CH=12) | 51.86 Β΅s | 3.9% | ~25 instances |
| WaveNet Feather (CH=8) | 14.63 Β΅s | 1.1% | ~91 instances |
| WaveNet Nano (CH=4) | 11.97 Β΅s | 0.9% | ~111 instances |
| WaveNet A2 Full (CH=8) | 18.68 Β΅s | 1.4% | ~71 instances |
| WaveNet A2 Lite (CH=3) | 13.76 Β΅s | 1.0% | ~96 instances |
| LSTM 1-Layer (Hidden=16) | 6.44 Β΅s | 0.5% | ~207 instances |
| LSTM 2-Layer (Hidden=8) | 6.91 Β΅s | 0.5% | ~192 instances |
| ConvNet | 9.30 Β΅s | 0.7% | ~143 instances |
| Linear FIR (RF=4 Direct) | 0.17 Β΅s | 0.01% | >1,000 instances |
| DSP Resampler (44.1 kHz β 48 kHz) | 1.30 Β΅s | 0.10% | >1,000 instances |
| Cabinet IR Simulation (UPOLS 2048 taps) | 1.24 Β΅s | 0.09% | >1,000 instances |
| Full Pipeline Base (Model + CabSim, No OS) | 41.81 Β΅s | 3.1% | ~31 instances |
| Full Pipeline HQ (Model + CabSim + 4Γ OS) | 170.23 Β΅s | 12.8% | ~7 instances |
In live operation, nam-audio-pipe runs as a native PipeWire SPA client executing the complete end-to-end audio processing chain (Capture callback
| Host Metric / Invariant | Measured Specification | Architectural Guarantee |
|---|---|---|
| Native Quantum Support | Down to 64 samples ( |
Sub-millisecond buffer scheduling with zero driver jitter |
| Full Rig CPU Budget Used (64 samp) |
|
Over |
| Real-Time Memory Allocations | 0 heap allocations | Enforced via CountingAllocator in RT processing loop |
| Lock-Free Concurrency | SPSC lock-free atomic queues | Zero mutexes, zero blocking system calls in audio callback |
| Full-Chain Parity vs |
WaveNet ESR |
Bit-exact perceptual accuracy validated in pipe_offline_parity.rs
|
| Thread Priority & Stability |
SCHED_FIFO (priority 80β95) with PM QoS |
Deterministic audio deadlines with zero xruns under system load |
Why This Matters for Live Guitarists: A complete standalone rig (WaveNet + CabSim + Noise Gate) executing within PipeWire uses only a fraction of a 64-sample quantum (
$1.33\text{ ms}$ at 48 kHz). Musician players experience imperceptible latency indistinguishable from analog tube amplifiers, backed by ironclad real-time safety and zero audio dropouts.
Ideal for clean jazz, funk, or acoustic simulation:
nam-audio-pipe \
--model models/TwinReverb-Clean.nam \
--cab irs/OpenBack2x12.wav \
--gate -75Tip: --gate -75 sets a gentle threshold, preserving delicate fingerpicking tails.
Eliminates aliasing foldover on heavy distortion leads:
nam-audio-pipe \
--model models/HighGainDrive.nam \
--cab irs/Vintage4x12.wav \
--oversample 4x \
--gate -50Tip: --gate -50 silences single-coil hum and high-gain hiss between riffs.
For maximum responsiveness during stage monitoring:
nam-audio-pipe \
--model models/PlexiLead.nam \
--cab irs/4x12-Greenback.wav \
--buffer-size 64 \
--activation fastTip: --activation fast selects PadΓ© polynomial activations for maximum CPU speed.
Records your complete processed guitar take directly to a timestamped WAV file:
nam-audio-pipe \
--model models/OverdriveAmp.nam \
--cab irs/Cab1x12.wav \
--record \
--record-dir ~/Music/GuitarJamsFiles save as capture_YYYYMMDD_HHMMSS.wav. When --gate on is active, long silent pauses are trimmed automatically.
Stream dry audio through PipeWire without loading a model:
nam-audio-pipe --gate off| Architecture | Platform Tier | Continuous Integration | Real-Time Hardware Certification | Notes |
|---|---|---|---|---|
Linux x86_64 |
Tier 1 (Reference) | Blocking (lints, quick, msrv, long) |
Fully verified & certified | Requires x86-64-v3 baseline (AVX2, FMA, BMI2). Supports full PGO + LLVM BOLT optimization pipeline. |
Linux on ARM (aarch64) |
Tier 2 (Compatible) | Blocking compile/lint (linux-arm64-lints) and quick test suite (linux-arm64-quick) |
Not formally tested on bare-metal hardware | Compiles cleanly on native ARM64 runners (ubuntu-26.04-arm). Architecture flags are scoped in .cargo/config.toml, and pure-Rust SPA logging supports AAPCS64. |
Note
Linux on ARM Status: While NAM-Audio-Pipe continuously compiles, passes static analysis, and is architecturally compatible on Linux on ARM (aarch64), formal validation on physical ARM audio workstations (such as real-time audio deadline certification, bare-metal ALSA/PipeWire driver testing, and hardware latency profiling) has not yet been formally conducted.
NAM-Audio-Pipe can be run directly via Cargo, compiled into a standalone hyper-optimized binary, or installed as a sandboxed Flatpak application.
NAM-Audio-Pipe is packaged as an autonomous desktop Flatpak (io.github.fabiohl.NAMAudioPipe), targeting the org.freedesktop.Platform//26.08 runtime. It provides an isolated, reliable environment with direct low-latency PipeWire IPC access.
flatpak install --user --reinstall target/dist/nam-audio-pipe-v1.3.0-linux-x86_64-v3.flatpak# 1. Inspect environment diagnostics:
flatpak run io.github.fabiohl.NAMAudioPipe --diagnose
# 2. Run amp simulation reading models from your home directory:
flatpak run io.github.fabiohl.NAMAudioPipe \
--model ~/models/Amp.nam \
--cab ~/irs/Cabinet.wav \
--buffer-size 64The Flatpak bundle exports native desktop launchers and high-resolution icons to your application menu, including desktop actions for Run in bypass and Diagnostics.
For developers working on source code or rapid testing on x86_64 or Linux on ARM:
# Direct development execution:
cargo run --release --bin nam-audio-pipe -- --model /path/to/amp_model.nam
# Build standard release binary:
cargo build --release --bin nam-audio-pipeThe compiled binary will be located at target/release/nam-audio-pipe.
Building on Linux on ARM (ARM64): Standard Cargo compilation works out-of-the-box (
cargo build --release --bin nam-audio-pipe). Microarchitecture flags (x86-64-v3) in.cargo/config.tomlare automatically scoped tox86_64targets, generating clean, native AArch64 code on ARM systems.
For maximum performance in mission-critical live setups and stage environments, compile using the automated multi-stage optimization pipeline combining Profile-Guided Optimization (PGO) and LLVM BOLT:
# 1. Build hyper-optimized PGO + LLVM BOLT binary into target/dist/:
./utils/build-release.sh --strict
# 2. Run the long audit against the canonical artifact:
./utils/tests-long.sh --strict --artifact
# 3. Certify and install locally to ~/.local/bin/nam-audio-pipe:
./utils/build-release.sh --strict --certify --install| Canonical Option | Purpose |
|---|---|
--strict |
Enforces fail-closed mode: PGO is mandatory, BOLT requires ceremony proof (target/logs/ab-opt-ceremony-receipt.json), and unproven gaps abort |
--package |
Generates distribution tarball (.tar.zst) and Flatpak bundle (.flatpak) in target/dist/ |
--certify |
Does not recompile: validates artifact SHA-256 and reconciles build receipt with long audit evidence |
--install |
Valid with --certify: installs the certified binary to ~/.local/bin/nam-audio-pipe (and Flatpak if packaged) |
-h, --help |
Displays command-line help screen and exits |
This automated builder executes:
- Profile-Guided Optimization (PGO): Instruments DSP kernels across quantum matrices (32 to 1024 frames) and model families, generating profile traces to guide branch prediction and loop vectorization.
- LLVM BOLT: Rearranges basic blocks in machine code using Linux
perfsample traces to minimize CPU Instruction Cache (I-Cache) and TLB misses. - Automated A/B Optimization Ceremony: Evaluates median P99 cycles across all canonical topologies (
wavenet_a1,wavenet_a2,lstm) with an explicit 1.0% promotion margin (utils/ab-opt-ceremony.sh, usingllvm-bolt -instrument+merge-fdatawhen hardware LBR is absent), cleanly falling back to proven PGO-only or proven plain release when higher-tier margins are not met. - Static Hotspot Gates: Enforces zero
zmmregisters (AVX-512 opt-in policy), zerolibmcalls in RT paths, and zero heap allocations. - Verified Local Installation (
--certify --install): Reconciles the build and audit receipts, then installs the verified artifact directly to~/.local/bin/nam-audio-pipe.
For distributors and release publishing, the official release pipeline enforces strict separation between compilation, stress testing, and cryptographic verification:
# 1. Build canonical optimized release artifact and packages into target/dist/
./utils/build-release.sh --strict --package
# 2. Audit the canonical artifact under heavy soak, RT deadline, and zero-alloc stress
./utils/tests-long.sh --strict --artifact
# 3. Certify release compliance using the generated receipts and install without recompilation
./utils/build-release.sh --strict --certify --installnam-audio-pipe [OPTIONS]
| Flag / Option | Parameter Domain / Values | Default | Operational Description |
|---|---|---|---|
-m, --model <FILE> |
Filepath (.nam, .namb) |
None (Bypass) | Path to neural amplifier model file. Invalid path fails fast before PipeWire initialization. |
-c, --cab <FILE> |
Filepath (.wav, .nam, .namb) |
None (Bypass) | Path to cabinet asset (.wav IR or 1-in/1-out neural cabinet). Invalid asset fails with code 4 unless --cab-optional. |
--cab-optional |
Flag | false |
Missing or unreadable --cab warns and continues without cabinet simulation. |
--cab-bypass |
Flag | false |
Starts with cabinet slot bypassed at constant SPA latency (crossfade & dry-delay aligned). |
-i, --input-gain <DB> |
Float (-96.0 to +30.0 dB) |
0.0 |
Input gain adjustment prior to neural inference. |
-o, --output-gain <DB> |
Float (-96.0 to +30.0 dB) |
0.0 |
Output gain adjustment after cabinet simulation. |
-b, --buffer-size <SAMPLES> |
{0} βͺ {2^k | 16 β€ 2^k β€ 8192} |
256 |
PipeWire quantum block size in samples (0 for auto-negotiation). |
--cabsim-partition <N> |
32, 64, 128, 256 samples |
128 |
Cab-sim UPOLS partition size. Lower values reduce algorithmic latency at slight CPU cost. |
--ir-level-policy <MODE> |
loudness-normalized, rms, peak-normalized, preserved, legacy-nam-plugin
|
loudness-normalized |
Cabinet IR gain policy applied per channel (stereo WAV supported): continuous K-weighted LUFS normalization (default), flat RMS, peak normalization, 1:1 amplitude, or C++ scaling ( |
--calibrate-input <on|off> |
on, off, true, false, 1, 0
|
off |
Enables pre-nonlinearity input calibration using model input_level_dbu. Missing metadata warns and falls back to unity unless --strict-calibration. |
--input-calibration-level <DBU> |
Float (-60.0 to +60.0 dBu) |
12.0 |
Reference 0 dBFS input level in dBu for input calibration and calibrated output mode. |
--output-mode <MODE> |
raw, normalized, calibrated
|
normalized |
Output gain mode: unity (raw), -18 LUFS via loudness (normalized), or output_level (calibrated). Missing metadata warns and falls back to unity unless --strict-calibration. |
--strict-calibration |
Flag | false |
Fails startup with exit code 3 when requested calibration/output metadata is missing (default is warn + unity fallback). |
--dc-blocker <on|off> |
on, off, true, false, 1, 0
|
on |
Post-IR 5 Hz DC blocker (f64 TDF-II). Removes offset before output trim and the playback limiter. |
--output-limit <MODE> |
soft-clip, true-peak, clamp, off
|
soft-clip |
Playback-only output protection: zero-latency residual-ADAA soft-clip, 4Γ look-ahead true-peak (adds latency to SPA PDC), hard clamp, or off. --record float WAV output is never limited. |
--oversample <off|2x|4x> |
off, 2x, 4x
|
off |
Half-band polyphase anti-aliasing oversampling factor. |
--activation <MODE> |
standard, fast
|
standard |
Math precision: standard (exact Taylor minimax) vs fast (PadΓ© polynomial approximation). |
--slim <auto|full|lite> |
auto, full, lite
|
auto |
Adaptive compute: automatically swaps submodels under CPU pressure to prevent dropouts. |
--gate <MODE> |
on, off, or [-96.0, -20.0] dBFS |
on (-70 dB) |
Gate enable/threshold configuration. Numeric thresholds derive Silence close value via 10 dB Schmitt relation. |
--gate-mode <MODE> |
silence, musical, legacy
|
musical |
Noise gate topology: musical (continuous pre-IR log-domain expander, default), silence (block-RMS CPU-skipping gate), or legacy (C++ parity). |
--cpu <INDEX> |
Integer core ID | Dynamic IRQ selection | Manually binds the real-time audio thread to a specific CPU core. |
--record |
Flag | false |
Enables asynchronous 32-bit float stereo WAV recording via io_uring. |
--record-dir <DIR> |
Directory path |
$XDG_MUSIC_DIR/NAM-Audio-Pipe (or ~/Music/NAM-Audio-Pipe, else .) |
Output directory for saved audio takes (auto-created if missing). |
--fail-fast |
Flag | false |
Disables bounded reconnect cycle: exits immediately on PipeWire daemon disconnect. |
--reconnect-timeout <SECS> |
Seconds (integer >= 0) |
11.75 (6 attempts) |
Caps the total reconnect retry backoff budget (0 behaves like --fail-fast). |
--color <WHEN> |
auto, always, never
|
auto (respects NO_COLOR) |
Controls ANSI color output for diagnostic banners and terminal messages. |
--diagnose |
Flag | false |
Emits technical diagnostic bundle and exits. |
--diagnose-full |
Flag | false |
Emits diagnostic bundle with unredacted raw paths and exits. |
--pause |
Flag | false |
Waits for Enter before exiting on interactive terminals (used by .desktop Diagnostics). |
-h, --help |
Flag | β | Displays command-line help screen and exits. |
NAM-Audio-Pipe returns typed exit codes to distinguish invocation mistakes from hardware or runtime failures:
| Exit Code | Classification | Meaning / Trigger Condition | Remediation Guidance |
|---|---|---|---|
| 0 | Success | Normal termination or successful --help / --diagnose. |
None. |
| 1 | Generic / Forced | Uncategorized failure or hard escalation after termination grace window timeout. | Inspect application error logs. |
| 2 | Usage Error | Invalid CLI arguments or non-power-of-two buffer size. | Review command syntax with --help. |
| 3 | Model Load Error | Model file missing/corrupt, unsupported architecture, or strict calibration metadata failure. | Verify .nam/.namb integrity or metadata. |
| 4 | Cab Asset Error | Cabinet asset (.wav IR or .nam/.namb cab) missing, invalid, or rejected. |
Check file path/format (must be 1x1) or use --cab-optional. |
| 5 | Backend Error | PipeWire daemon unreachable or stream initialization failed. | Check PipeWire daemon status (systemctl --user status). |
| 6 | Recording Error | Recording directory unwritable, io_uring failed, or buffer overruns occurred. |
Check disk permissions and available space. |
On startup, NAM-Audio-Pipe registers dedicated capture and playback nodes in the PipeWire graph:
| Internal Node Name | Patchbay Label (qpwgraph) |
Media Class | Function in Audio Graph |
|---|---|---|---|
NAM-Audio-Pipe-input |
NAM-Audio-Pipe Input |
Audio/Sink (Input) |
Exclusive virtual capture sink (starts unconnected) receiving guitar DI or app audio |
NAM-Audio-Pipe-playback |
NAM-Audio-Pipe Processed Output |
Stream/Output/Audio |
Auto-connected playback stream emitting processed audio to speakers or headphones |
- Causal Intra-Quantum Ordering: Both nodes share scheduling groups (
node.group = "nam-audio-pipe-dsp"/node.link-group = "nam-audio-pipe-link-group"), and the playback stream usesPW_STREAM_FLAG_TRIGGERdriven by the capture RT callback so capture and playback run in sequence within the same quantum (zero extra quantum latency). - SPA Latency Compensation: Stream latency properties (
SPA_PARAM_Latency) publish the exact algorithmic delay (cab-sim partition latency + resampler + oversampling) in sample units to the graph scheduler, eliminating phase smearing and timing misalignment. - Default-Sink Auto-Connect & Dual-Stream Isolation:
NAM-Audio-Pipe-playbackdelegates default hardware output selection to PipeWire/WirePlumber (AUTOCONNECT), while the isolatedDspBridgeseparation betweenAudio/Sinkcapture andStream/Output/Audioplayback preventsmonitor_*dry leakage and acoustic feedback loops. - Visual Patchbay Support: Nodes are clearly labelled and easily connected using visual patchbays such as
qpwgraph,Helvum, orCarla. Seamlessly patch physical guitar inputs, desktop browsers, media players, software synthesizers, or DAW tracks intoNAM-Audio-Pipe Input(NAM-Audio-Pipe-input) for instant live processing and re-amping (remembering to disconnect the source's direct speaker link and leavemonitor_FL/FRunconnected).
NAM-Audio-Pipe maintains enterprise-grade reliability through an automated testing and verification suite located in utils/:
# 1. Static quality gate (formatting applied, check, clippy -D warnings, SPDX, AppStream):
./utils/lints.sh
# 2. Quick discipline (all non-ignored targets, development profile):
./utils/tests-quick.sh
# 3. Release chain (human operator only): build -> long audit -> certify.
# The long suite covers accelerated soak, zero-alloc heap audit, RT deadline/jitter,
# endurance, live PipeWire, io_uring and offline f64 parity.
./utils/build-release.sh --strict --package
./utils/tests-long.sh --strict --artifact
./utils/build-release.sh --strict --certify --installFor complete architectural details on testing, verification phases, and real-time compliance criteria, consult docs/testing.md.
-
Gain staging contract: chain order, per-sample smoothing, calibration resolution and host range contracts.
-
Output protection: DC blocker, limiter policies, latency/PDC and the raw-recording invariant.
-
docs/architecture.mdβ Comprehensive architecture bible: dual-stream PipeWire topology,DspBridgeshared memory layout, SPSC GC cascade, Linux RT hardening, and asynchronousio_uringWAV recording. -
docs/testing.mdβ Testing architecture, unit/integration inventory, 11-phase long audit suite, script contract, and compiler optimization pipeline. -
docs/latency-spa-adr.mdβ Architecture decision record: PipeWire SPA latency publication, sample-rate vs nanosecond evaluation invariants, UPOLS partition alignment, and graph delay compensation. -
CHANGELOG.mdβ Project release history, version milestones, and feature additions.
- Steven Atkinson β Creator of Neural Amp Modeler (NAM) for revolutionizing open-source deep learning guitar modeling.
- The PipeWire Project (Wim Taymans and contributors) β For creating the high-performance Linux multimedia routing subsystem that makes ultra-low latency audio accessible to everyone.
- Tone3000 / ToneHunt Community β For hosting and curating thousands of exceptional, free neural amp models for guitarists worldwide.
The software architecture, real-time safety guarantees, DSP pipeline design, and microarchitectural optimizations are intellectual work (and passion) of the maintainer (FΓ‘bio Lima). Implementation and continuous refinement were accelerated through pair programming (Vibe Coding) using cutting-edge artificial intelligence models (Gemini, Claude, Grok, DeepSeek and others) within Google Antigravity IDE. AI is an amplifier of human intent, transforming ambitious vision into robust software.
This project is licensed under the GNU General Public License v3.0 or later (GPL-3.0-or-later). See LICENSE.txt for complete license terms. Third-party attribution for the Apache-2.0 NeuralAmpModeler-rs engine is in NOTICE, which is included in the distributed tarball and Flatpak bundle.