Jump to content

Electric guitar interface setup: Difference between revisions

From Official NixOS Wiki
update: fixed PipeWire/Pulse config, switched to sessionVariables for GUI plugin paths, added memlock limits, expanded software guide with categorized explanations
Add practical example section: high-output pickups + low-headroom interfaces (Schecter Omen-6 + Scarlett Solo), pickup height and Gain tuning, passive DI-box
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
= Electric guitar interface setup =
This guide covers setting up an '''electric guitar''' with NixOS to achieve professional, low-latency audio processing. It targets live playing with round-trip latency (RTL) under 6 ms using the modern PipeWire and WirePlumber stack.


This guide covers setting up an electric guitar with NixOS to achieve professional, low-latency audio processing. It targets live playing with round-trip latency (RTL) under 6 ms using the modern PipeWire/JACK stack.
{{Warning
 
  |icon=⚠
'''⚠️ Safety Warning''': Always start with monitoring volume at minimum when testing new signal chains. A sudden, loud feedback loop can be generated during loopback testing. Increase volume gradually only after the plugin is open and stable.
  |color=var(--border-color-warning)
 
  |background=var(--background-color-warning-subtle)
== Introduction ==
  |Always start testing new signal chains with the monitoring volume at minimum. A sudden, loud feedback loop can be generated during loopback testing. Increase the volume gradually only after the plugin is open and stable.
}}


The digital signal chain for a guitar consists of:
The digital signal chain for a guitar consists of:
# '''Instrument-level signal''' from Hi-Z pickups.
# '''Instrument-level signal''' from Hi-Z pickups.
# '''Analog-to-Digital conversion''' via an external audio interface.
# '''Analog-to-digital conversion''' via an external audio interface.
# '''Real-time processing''' on NixOS using a low-latency kernel and specialized software.
# '''Real-time processing''' on NixOS using a low-latency kernel and specialized software.


'''Note''': Software-reported latency values are often inaccurate. Physical measurement via loopback test is mandatory for verification.
{{Note
 
  |icon=ℹ
== Installation ==
  |color=var(--border-color-info)
  |background=var(--background-color-info-subtle)
  |Software-reported latency values are often inaccurate. Physical measurement via a loopback test is mandatory for verification.
}}


=== System Configuration ===
== Quick Start ==


Add the following to your <code>/etc/nixos/configuration.nix</code>. This configuration is optimized for high-performance CPUs like the AMD Ryzen 7 9700X (Zen 5 architecture).
If you want to get sound from your guitar within 15 minutes, follow these minimal steps. Ensure you have a compatible USB audio interface (see [[#Hardware|Hardware]] section).


# Connect your interface directly to the motherboard (rear USB port).
# Add the following minimal configuration to your <code>/etc/nixos/configuration.nix</code>:
<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
{ pkgs, config, ... }:
{
  # 1. Sound Server: PipeWire with JACK/PulseAudio support
   services.pipewire = {
   services.pipewire = {
     enable = true;
     enable = true;
     alsa.enable = true;
     alsa.enable = true;
     alsa.support32Bit = true; # Required for yabridge/wine VST bridging
     alsa.support32Bit = true;
     pulse.enable = true;
     pulse.enable = true;
     jack.enable = true;
     jack.enable = true;
     wireplumber.enable = true;
     wireplumber.enable = true;
   
    # Global low-latency defaults for native JACK clients
     extraConfig.pipewire."92-low-latency" = {
     extraConfig.pipewire."92-low-latency" = {
       "context.properties" = {
       "context.properties" = {
         "default.clock.rate" = 48000; # Fixed rate avoids resampling latency
         "default.clock.rate" = 48000;
         "default.clock.quantum" = 128;     # ~5ms latency at 48kHz
         "default.clock.quantum" = 128;
         "default.clock.min-quantum" = 64;   # ~2.5ms latency at 48kHz
         "default.clock.min-quantum" = 32;
         "default.clock.max-quantum" = 512;
         "default.clock.max-quantum" = 512;
       };
       };
     };
     };
  };
  security.rtkit.enable = true;
  environment.systemPackages = with pkgs; [ carla neural-amp-modeler-lv2 lsp-plugins pavucontrol ];
</syntaxhighlight>
# Rebuild and switch:
<syntaxhighlight lang="bash">
sudo nixos-rebuild switch
systemctl --user restart pipewire wireplumber
</syntaxhighlight>
# Open <code>pavucontrol</code>, go to the '''Configuration''' tab, and set your interface profile to '''Pro Audio'''.
# Launch <code>carla</code>, add the <code>Neural Amp Modeler</code> plugin, and connect your interface's input to the plugin and the plugin's output to the interface.
== Hardware ==
Standard PC line-ins are unsuitable for guitar due to impedance mismatch. You need a dedicated interface with a Hi-Z (Instrument) input.
=== Why special cards are needed ===
Linux supports USB Audio Class 2.0 (UAC2) compliant devices natively. However, '''Thunderbolt audio interfaces generally do not work on Linux''' due to proprietary, closed protocols. Even high-end interfaces from Focusrite (Clarett Thunderbolt), RME, and Universal Audio will not function properly. Always choose USB interfaces, unless you are willing to use an experimental, reverse-engineered driver that currently only supports basic control routing without PCM audio streaming.
=== The clipping problem ===
{{Warning
  |icon=⚠
  |color=var(--border-color-warning)
  |background=var(--background-color-warning-subtle)
  |'''Input headroom and clipping:''' Many budget and mid-range interfaces have limited headroom on their Hi-Z inputs. Modern high-output passive or active pickups can cause digital clipping at the ADC stage ''before'' the signal reaches 0 dB in your DAW, even with the gain knob at minimum.
}}
The input headroom capacity is measured in '''dBu'''. A higher value means the interface can handle louder input transients without clipping.


    # Crucial: Match low-latency for PulseAudio clients (browsers, Steam/Rocksmith)
{| class="wikitable" style="text-align: center; width: 500px;"
    extraConfig.pipewire-pulse."92-low-latency" = {
|-
      "pulse.properties" = {
! Device !! Headroom (dBu) !! Status
        "pulse.min.req" = "64/48000";    # Start with 64, not 32, for stability
|-
        "pulse.default.req" = "64/48000";
| '''PreSonus Studio HD2 / 24c''' || 21 dBu || ✅ Excellent
        "pulse.max.req" = "128/48000";
|-
      };
| '''MOTU M2 / M4''' || 16 dBu || ✅ Good
    };
|-
  };
| '''Focusrite Scarlett 2i2 3rd Gen''' || 12.5 dBu || ⚠️ Average
|-
| '''Audient iD14 MkII''' || 9 dBu || ❌ Clips easily
|-
| '''Steinberg UR44''' || 8.5 dBu || ❌ Clips easily
|}
 
=== Practical example: high-output pickups and low-headroom interfaces ===
 
This section demonstrates how to set up a guitar with high-output pickups when using an interface with limited input headroom. The principles apply to any similar setup.
 
'''Example setup:'''
* '''Guitar:''' Schecter Omen-6 with Schecter Diamond Plus ceramic humbuckers and 9–42 strings.
* '''Interface:''' Focusrite Scarlett Solo (3rd Gen) — 12.5 dBu headroom on the Hi-Z input.
 
==== Step 1: Physical guitar setup ====
 
High-output ceramic humbuckers combined with light strings produce a very sharp attack that can easily clip low-headroom inputs. To reduce the signal at the source:


  # 2. Real-time Scheduling
# '''Lower the bridge pickup''' using a screwdriver. Turn the height screws clockwise to move the pickup further from the strings. This reduces the magnetic field strength and the output voltage.
  # RTKit handles real-time privileges via D-Bus/Polkit.
# '''Set the guitar volume knob to 7–8''' instead of 10. This preserves tone while reducing peak transients.
  security.rtkit.enable = true;
 
  # Critical: Allow unlimited memlock for real-time audio buffers
  security.pam.loginLimits = [
    {
      domain = "@audio";
      item = "memlock";
      type = "-";
      value = "unlimited";
    }
    {
      domain = "@audio";
      item = "rtprio";
      type = "-";
      value = "95";
    }
  ];
 
  users.users.yourname.extraGroups = [ "audio" ]; # Replace 'yourname' with your username


  # 3. Kernel and Performance Tweaks
{{Tip|Test the difference: play a hard downstroke on the 6th string with the volume at 10, then at 7. Notice how the waveform peaks are reduced without losing sustain.}}
  boot.kernelPackages = pkgs.linuxPackages_zen;
  boot.kernelParams = [
    "threadirqs"
    "preempt=full"              # Optional: add if experiencing Xruns
    "amd_pstate=passive"        # Zen 4/5: passive + performance governor = stable freq
    # For Intel or older AMD: remove amd_pstate or use "intel_pstate=active"
    "usbcore.autosuspend=-1"    # Prevent USB audio interface sleep
  ];


  powerManagement.cpuFreqGovernor = "performance";
==== Step 2: Interface configuration ====
 
  # GameMode can elevate priorities for real-time audio applications
  programs.gamemode.enable = true;


  # 4. NVIDIA Workaround (If applicable)
# '''Enable INST mode:''' Press the INST button on the Scarlett Solo. The indicator should light up. Without this, the input operates in mic mode (low impedance), causing muffled tone and instant clipping.
  # For RTX 40/50 series: disable GSP firmware to prevent DPC latency spikes
# '''Set Gain to minimum (0):''' Turn the gain knob fully counter-clockwise.
  # hardware.nvidia.powerManagement.enable = false;
  # hardware.nvidia.modesetting.enable = true;
  # boot.extraModprobeConfig = "options nvidia NVreg_EnableGpuFirmware=0";


  # 5. Plugin Search Paths (Crucial for NixOS DAWs)
==== Step 3: Testing for clipping ====
  # Use sessionVariables for GUI apps launched from DE menu
  environment.sessionVariables = let
    makePluginPath = format = (pkgs.lib.makeSearchPath format [
      "/run/current-system/sw/lib"
      "${config.users.users.yourname.home}/.nix-profile/lib"  # Adjust if using home-manager
    ]) + ":$HOME/.${format}";
  in {
    LV2_PATH = makePluginPath "lv2";
    VST3_PATH = makePluginPath "vst3";
    CLAP_PATH = makePluginPath "clap";  # Modern plugin format, supported by LSP/Chow
  };


  # 6. Essential Packages
Open your DAW or a visualizer plugin (e.g., LSP Analyzer) and play the hardest downstroke you can on the open 6th string.
  nixpkgs.config.allowUnfree = true; # Required for REAPER, Tonelib, etc.
  environment.systemPackages = with pkgs; [
    # --- Utilities & Routing ---
    qpwgraph            # Visual patchbay for PipeWire
    pavucontrol        # Profile selection (Pro Audio mode)
    pw-top              # Real-time CPU usage per audio node
    pw-cli              # Modern alternative to pw-metadata
    cpupower            # CPU frequency scaling controls
    alsa-scarlett-gui  # Hardware mixer for Focusrite Scarlett (may require firmware)


    # --- DAWs ---
* '''If the waveform shows flat tops''' (hard clipping) even at 0% gain, your interface cannot handle the signal level.
    ardour
* '''If the peaks stay around −12 dBFS or lower,''' you have sufficient headroom.
    reaper


    # --- Plugin Hosts ---
{{Warning|If clipping persists at minimum gain, do '''not''' try to "fix" it by turning down the guitar volume further — this changes your tone. Instead, use a passive DI-box.}}
    carla              # Modular plugin host / pedalboard, supports Windows VST via yabridge


    # --- Standalone Guitar Processors ---
==== Step 4: Using a passive DI-box ====
    guitarix
    # tonelib-gfx      # NOTE: Currently marked as broken in nixpkgs; install from vendor if needed


    # --- Plugins (LV2/CLAP) ---
If your interface clips even at 0% gain, insert a '''passive DI-box''' (e.g., Palmer PAN 01, ART DTI, AMT Reincarnator RD2) between the guitar and the interface:
    neural-amp-modeler-lv2  # NAM: loads .nam files from https://tonehunt.org
    lsp-plugins            # Includes latency meter, compressors, IR loader
    calf
    dragonfly-reverb
    gxplugins-lv2
    kapitonov-plugins-pack  # Profile-based amp models (KPP)
    chow-centaur            # Klon Centaur emulation
    chow-phaser
    # airwindows-lv2        # NOTE: Large package (~400 plugins); consider selective install


    # --- Practice & Learning ---
# Connect guitar → DI-box input (TS cable).
    tuxguitar
# Connect DI-box XLR output → interface mic input (XLR cable).
    hydrogen
# Make sure Phantom Power (+48V) is '''off''' — a passive DI-box does not require it.
# Disable the INST button on the interface, since the signal now arrives at the mic input.


    # --- Windows VST Compatibility ---
This converts the instrument-level signal to mic-level, matching the interface's input stage and preserving the full dynamic range of your playing.
    yabridge
    yabridgectl
    wineWowPackages.stable  # Use stable, not staging, for VST compatibility
  ];
}
</syntaxhighlight>


'''Note on <code>musnix</code>''': For advanced users, the [https://github.com/musnix/musnix musnix] flake automates many low-level audio optimizations (such as <code>PREEMPT_RT</code> kernel patching, <code>rtirq</code> tuning, and <code>das_watchdog</code>). If you experience persistent Xruns with the standard Zen kernel, replacing manual tweaks with <code>musnix.enable = true;</code> is highly recommended. '''Warning''': musnix may require replacing your kernel and can affect compatibility with Steam/Wine applications.
{{Note|Passive DI-boxes are preferred over active ones for this use case because they provide natural attenuation without adding noise or requiring external power.}}


=== Applying Changes ===
==== Choosing an interface by headroom ====


<syntaxhighlight lang="bash">
When selecting an interface, check the '''Maximum Input Level (dBu)''' of its instrument input:
sudo nixos-rebuild switch


# Apply PipeWire configuration changes (required after rebuild):
* '''≥ 15 dBu''' — sufficient headroom for most humbuckers; a DI-box is not needed.
systemctl --user restart pipewire pipewire-pulse wireplumber
* '''10–14 dBu''' — works with most guitars, but a DI-box may be required with hot pickups.
</syntaxhighlight>
* '''< 10 dBu''' — high risk of clipping with humbuckers; a DI-box is almost mandatory.


== Hardware & Connection ==
The Focusrite Scarlett 2i2 and Solo (3rd Gen) have a value of '''12.5 dBu''', which is average. With high-output pickups, clipping is easy to hit. This is why the Schecter Omen-6 + Scarlett Solo combination is a classic example where either careful Gain and pickup-height adjustment or a passive DI-box is required.


Standard PC line-ins are unsuitable for guitar. Use a dedicated interface with a '''Hi-Z (Instrument)''' input.
=== Recommendations ===


=== Verified compatible devices (2026) ===
For NixOS, plug-and-play compatibility is critical. Choose interfaces with high dBu ratings to preserve the natural attack of your guitar.


{| class="wikitable"
{| class="wikitable" style="text-align: left;"
|-
! Device !! Notes
! Device !! Notes
|-
|-
| '''Focusrite Scarlett Solo (4th Gen)''' || Plug-and-play. Use <code>alsa-scarlett-gui</code> for hardware monitoring. May require firmware update.
| '''Focusrite Scarlett 4th Gen (Solo/2i2/4i4)''' || Plug-and-play. Requires disabling MSD Mode (hold 48V button while powering on). <code>alsa-scarlett-gui</code> v1.0 beta 9 works natively.
|-
|-
| '''MOTU M2 / M4''' || Native ALSA kernel support for direct hardware mixer control via <code>alsamixer</code>. Exceptionally stable USB-C latency.
| '''Focusrite Scarlett 4th Gen (16i16/18i16/18i20)''' || Requires kernel ≥ 6.12, <code>fcp-support</code>, and a firmware update via <code>alsa-scarlett-gui</code>.
|-
|-
| '''Universal Audio Volt 276''' || Reliable USB-C class-compliant interface.
| '''MOTU M2 / M4''' || Native ALSA kernel support (requires kernel ≥ 6.1). Direct hardware mixer control via <code>alsamixer</code>. Exceptionally stable USB-C latency.
|-
|-
| '''Arturia MiniFuse 1''' || Stable performance under PipeWire.
| '''Audient iD4 / iD14 (All Generations)''' || Fully functional on NixOS. Note: iD14 MkII has limited Hi-Z headroom (9 dBu).
|}
|}


=== Hardware Rules ===
=== DI-box ===
 
If you already own a budget interface with low dBu and experience clipping, '''use a passive DI-box''' (e.g., Palmer PAN 01, ART DTI). A passive DI-box naturally attenuates the signal by ~20–23 dB, converting it to a balanced microphone level. Connect the DI-box between your guitar and the interface's XLR input.
 
== System configuration ==


# Connect the interface '''directly to the motherboard''' (rear panel USB 3.0/3.2). Avoid USB hubs — they add latency and can cause Xruns.
Add the following snippets to your <code>/etc/nixos/configuration.nix</code>. This configuration is optimized for high-performance CPUs.
# Use a high-quality, shielded USB cable. Audio dropouts are frequently caused by cheap cables acting as antennas for electrical interference.
# '''Disable Bluetooth''' during live playing: <code>rfkill block bluetooth</code>. BT audio stack can generate interrupt storms causing Xruns.


=== Verification ===
=== PipeWire ===


<syntaxhighlight lang="bash">
Configure PipeWire with global low-latency defaults and disable node suspension to prevent audio pops on USB interfaces. Note that WirePlumber 0.5+ (standard in NixOS 26.05) supports SPA-JSON syntax, which is preferred over deprecated Lua scripts.
lsusb                    # Confirm hardware connection
 
arecord -l              # Verify ALSA sees the capture input
<syntaxhighlight lang="nix">
aplay -l                # Verify ALSA sees the playback output
  services.pipewire = {
# For detailed interface capabilities:
    enable = true;
arecord --dump-hw-params -D hw:<card>,<device>
    alsa.enable = true;
    alsa.support32Bit = true; # Required for yabridge/wine VST bridging
    pulse.enable = true;
    jack.enable = true;
    wireplumber.enable = true;
   
    # Global low-latency defaults
    extraConfig.pipewire."92-low-latency" = {
      "context.properties" = {
        "default.clock.rate" = 48000;      # Fixed rate avoids resampling latency
        "default.clock.quantum" = 128;      # ~5 ms latency at 48 kHz
        "default.clock.min-quantum" = 32;  # Allows top-tier interfaces to achieve ~1.5 ms
        "default.clock.max-quantum" = 512;
      };
    };
 
    # Disable node suspension and fix crackling on problematic USB interfaces
    wireplumber.extraConfig."99-disable-suspend" = {
      "monitor.alsa.rules" = [{
        matches = [
          { "node.name" = "~alsa_input.*"; }
          { "node.name" = "~alsa_output.*"; }
        ];
        actions = {
          update-props = {
            "session.suspend-timeout-seconds" = 0;
          };
        };
      }];
    };
  };
</syntaxhighlight>
</syntaxhighlight>


== Audio Server Setup ==
=== Kernel and performance ===


=== Pro Audio Profile ===
Modern mainline kernels include merged PREEMPT_RT patches. Dynamic preemption (<code>preempt=full</code>) provides best-effort low latency without the overhead of a dedicated RT kernel. CPU frequency scaling must be locked to prevent sleep-state latency spikes.


To achieve minimal latency, you must bypass standard software mixing:
<syntaxhighlight lang="nix">
  boot.kernelPackages = pkgs.linuxPackages_latest;
  boot.kernelParams = [
    "preempt=full"             
    "usbcore.autosuspend=-1"    # Prevent USB audio interface sleep
  ];
 
  services.power-profiles-daemon.enable = false;
  powerManagement.cpuFreqGovernor = "performance";
  programs.gamemode.enable = true; # Can elevate priorities for real-time audio applications
</syntaxhighlight>


# Open <code>pavucontrol</code>.
{{Note|Always verify your bootloader configuration after changing kernel parameters to ensure they are applied correctly.}}
# Go to '''Configuration''' tab.
# Set your interface profile to '''Pro Audio'''.


'''Note''': If "Pro Audio" profile is missing, ensure <code>pipewire-alsa</code> is installed and restart PipeWire. This profile disables software mixing and enables hardware-exclusive mode, critical for achieving lowest latency.
=== Real-time scheduling ===


=== Dynamic Buffer Control ===
RTKit handles real-time privileges via D-Bus/Polkit. Critical PAM limits must be set to allow unlimited memlock and high real-time priority for audio buffers.


You can change latency without rebuilding the system. Note: these settings affect PipeWire clients only; ALSA-direct applications (like Ardour with ALSA backend) use their own buffer settings.
<syntaxhighlight lang="nix">
  security.rtkit.enable = true;
 
  security.pam.loginLimits = [
    { domain = "@audio"; item = "memlock"; type = "-"; value = "unlimited"; }
    { domain = "@audio"; item = "rtprio"; type = "-"; value = "99"; }
    { domain = "@audio"; item = "nice"; type = "-"; value = "-19"; }
  ];
 
  users.users.yourname.extraGroups = [ "audio" ]; # Replace 'yourname' with your username
</syntaxhighlight>


<syntaxhighlight lang="bash">
=== Plugin search paths ===
# Modern syntax (PipeWire 0.3.65+):
pw-cli set-param 0 clock.force-quantum 64/48000


# Verify current settings:
Crucial for NixOS DAWs to find plugins reliably in Wayland/X11 sessions.
pw-cli dump settings | grep -E "quantum|rate"


# Alternative: use wpctl (WirePlumber CLI)
<syntaxhighlight lang="nix">
wpctl set-default-rate 48000
  environment.variables = let
    makePluginPath = format:
      (pkgs.lib.makeSearchPath format [
        "$HOME/.nix-profile/lib"
        "/run/current-system/sw/lib"
        "/etc/profiles/per-user/$USER/lib"
      ]) + ":$HOME/.${format}";
  in {
    LV2_PATH = makePluginPath "lv2";
    VST3_PATH = makePluginPath "vst3";
    CLAP_PATH = makePluginPath "clap";
  };
</syntaxhighlight>
</syntaxhighlight>


Use <code>pw-top</code> in a separate terminal to monitor which applications are consuming the most DSP processing time. Look for the <code>ERR</code> column — values >0 indicate Xruns.
== Software installation ==
 
<syntaxhighlight lang="nix">
  nixpkgs.config.allowUnfree = true; # Required for REAPER, Bitwig Studio
  environment.systemPackages = with pkgs; [
    # --- Utilities & routing ---
    qpwgraph            # Visual patchbay for PipeWire (v1.0.4+)
    pwvucontrol        # Modern native PipeWire volume control (v0.5.3+)
    pavucontrol        # Fallback for Pro Audio profile selection
    pw-top             # Real-time CPU usage per audio node
    easyeffects        # System-wide real-time EQ and effects
   
    # --- DAWs ---
    ardour
    reaper
    bitwig-studio      # Native Linux commercial DAW, excellent CLAP support


== Software Guide: Choosing Your Rig ==
    # --- Plugin hosts ---
    carla              # Modular plugin host, supports Windows VST via yabridge


This section explains the available software for guitar processing on NixOS, organized by purpose.
    # --- Standalone guitar processors ---
    guitarix            # Includes native NAM and RTNeural module support


=== Digital Audio Workstations (DAWs) ===
    # --- Plugins (LV2/CLAP) ---
    neural-amp-modeler-lv2  # NAM: AI captures of real tube amps (v0.2.3, supports A2)
    proteus              # Neural network modeling (LSTM) by GuitarML
    lsp-plugins          # Professional EQ, compression, IR loader (now available in CLAP)
    calf                  # Vintage-style effects
    dragonfly-reverb      # High-quality algorithmic reverb
    gxplugins-lv2        # Guitarix project pedals as standalone LV2
    kapitonov-plugins-pack # Profile-based traditional amp modeling (VST3/LV2)
    chow-centaur          # Klon Centaur emulation
    chow-phaser          # Phaser emulation
    ratatouille-lv2      # Dual neural modeler (loads .nam, .json, .aidax)


{| class="wikitable"
    # --- Practice & learning ---
! Software !! Purpose !! Notes
    tuxguitar
|-
    hydrogen
| '''Ardour''' || Professional recording, mixing, editing || For absolute minimum RTL, use '''ALSA backend''' (bypasses PipeWire). Warning: ALSA locks device exclusively — no other app can produce sound.
 
|-
    # --- Windows VST compatibility ---
| '''REAPER''' || Commercial DAW, lightweight, scriptable || Uses PipeWire-JACK natively. Excellent Linux support. Unlimited trial.
    yabridge
|}
    (yabridgectl.override { wine = wineWow64Packages.stable; }) # Explicit 64-bit Wine path
    wineWow64Packages.stable  # Note: wineWowPackages is deprecated
  ];
</syntaxhighlight>


=== Amp Simulators & Neural Modelers ===
=== Digital audio workstations ===


{| class="wikitable"
{| class="wikitable" style="text-align: left;"
|-
! Software !! Purpose !! Notes
! Software !! Purpose !! Notes
|-
|-
| '''Neural Amp Modeler (NAM)''' (<code>neural-amp-modeler-lv2</code>) || Loads <code>.nam</code> files — AI captures of real tube amps || '''No built-in GUI in LV2 version'''. In Carla/Ardour: look for <code>atom:Path</code> parameter and point to your <code>.nam</code> file. Models: [https://tonehunt.org tonehunt.org]
| '''Ardour''' || Professional recording, mixing, editing || For absolute minimum RTL (< 5 ms), use the '''ALSA backend''' (bypasses PipeWire). Warning: ALSA locks the device exclusively — no other app can produce sound.
|-
|-
| '''Kapitonov Plugins Pack (KPP)''' || Profile-based traditional amp modeling || Excellent for classic rock/metal. Lower CPU than neural nets.
| '''REAPER''' || Commercial DAW, lightweight, scriptable || Uses PipeWire-JACK natively. Excellent Linux support. Can be declaratively configured via [https://github.com/9Prestidigitator/reaper-flake Reaper HM Flake].
|-
|-
| '''Guitarix''' || All-in-one virtual amp + pedals || Standalone or LV2. Good for quick practice.
| '''Bitwig Studio''' || Modern commercial DAW || Native Linux support. Superior CLAP format integration. PipeWire-JACK is often more stable out-of-the-box than Direct ALSA.
|}
|}


'''⚠️ Critical''': Neural amps (NAM, KPP) only model preamp/poweramp. '''You must load a Cabinet IR''' (via LSP IR Loader or similar) to get a usable guitar tone. Without IR, it sounds like a swarm of bees.
=== Amp simulators and neural modelers ===


=== Effects Plugins ===
{| class="wikitable" style="text-align: left;"
 
{| class="wikitable"
! Plugin Pack !! Key Features
|-
|-
| '''LSP Plugins''' || Professional EQ, compression, gating. '''Includes LSP Latency Meter''' and '''LSP Impulse Response Loader''' (required for cabinet sims).
! Software !! Purpose !! Notes
|-
|-
| '''Dragonfly Reverb''' || High-quality algorithmic reverb (Hall, Room, Plate).
| '''Neural Amp Modeler (NAM)''' || LV2 plugin. Loads <code>.nam</code> files || AI captures of real tube amps. Architecture 2 (A2) released in June 2026 offers higher accuracy with 30–40% less CPU. Models: [https://tone3000.com TONE3000].
|-
|-
| '''Chow Plugins''' (<code>chow-centaur</code>, <code>chow-phaser</code>) || High-fidelity emulations of classic pedals using RNN/WDF.
| '''Proteus''' || LV2 plugin. Neural network modeling (LSTM) || By GuitarML. Faster preset switching than NAM.
|-
|-
| '''Calf Studio Gear''' || Vintage-style effects with "warm" analog character.
| '''Kapitonov Plugins Pack (KPP)''' || Profile-based traditional amp modeling || Excellent for classic rock/metal. Available in LV2 and VST3.
|-
|-
| '''GxPlugins.lv2''' || Guitarix project pedals (distortion, overdrive, fuzz) as standalone LV2.
| '''Guitarix''' || All-in-one virtual amp + pedals || Standalone or LV2. Includes native modules for loading <code>.nam</code> and RTNeural models.
|}
|}


=== Modular Hosts ===
{{Note
  |icon=ℹ
  |color=var(--border-color-info)
  |background=var(--background-color-info-subtle)
  |'''CRITICAL for KPP:''' The input level at the beginning of the Kapitonov Plugins Pack chain must be strictly around '''-20 dB''', otherwise the plugins will distort incorrectly. Use a meter plugin (e.g., LSP Meter) to verify.
}}
 
{{Warning
  |icon=⚠
  |color=var(--border-color-warning)
  |background=var(--background-color-warning-subtle)
  |Neural amps (NAM, Proteus, KPP) only model preamp/poweramp. You must load a Cabinet IR (via LSP IR Loader or similar) to get a usable guitar tone. Without an IR, the sound will be thin and unpleasant.
}}
 
=== Modular hosts ===


{| class="wikitable"
{| class="wikitable" style="text-align: left;"
|-
! Software !! Purpose
! Software !! Purpose
|-
|-
Line 282: Line 359:
|}
|}


=== Windows VST Compatibility ===
== Configuration and first launch ==


{| class="wikitable"
=== Pro audio profile ===
! Tool !! Purpose
 
|-
To achieve minimal latency, you must bypass standard software mixing:
| '''yabridge + yabridgectl''' || Bridge for running Windows VST2/VST3 plugins on Linux via Wine. Essential for commercial plugins (Neural DSP, STL Tones, Amplitube).
# Open <code>pavucontrol</code>.
|}
# Go to the '''Configuration''' tab.
# Set your interface profile to '''Pro Audio'''.
 
If the "Pro Audio" profile is missing, ensure <code>pipewire-alsa</code> is installed and restart PipeWire. This profile disables software mixing and enables hardware-exclusive mode, critical for the lowest latency.
 
=== Latency verification ===
 
Always perform a physical loopback test to measure the real Round-trip Latency (RTL).


# Connect a cable from your interface '''Output''' back into the '''Input'''.
# Launch LSP Latency Meter:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
# After installing Windows plugins via Wine:
# Option A: Via Carla (recommended for beginners)
yabridgectl sync # Required to register plugins with Linux hosts
carla # Add plugin "LSP Latency Meter Stereo", connect wires
 
# Option B: Via jalv (terminal)
jalv http://lsp-plug.in/plugins/lv2/latency_meter_stereo
</syntaxhighlight>
</syntaxhighlight>
# Play a sharp transient (string scratch) and read the '''Round-trip Latency (RTL)''' value.


'''Note''': Ensure glibc versions match between Wine and system. Check with <code>ldd /path/to/plugin.dll</code>.
'''Target values''':
* < 5 ms: Excellent
* 5–10 ms: Acceptable for practice
* > 12 ms: Noticeable "lag", difficult to play in time


== Rocksmith 2014 Remastered (Optional) ==
=== Typical processing chain ===


Rocksmith 2014 runs on NixOS via Proton and PipeWire.
For a standard metal/rock tone, route your signal in <code>carla</code> or your DAW as follows:
'''Hardware Input''' → '''Noise Gate''' (e.g., LSP Gate) → '''NAM''' (Load A2-Full model) → '''LSP IR Loader''' (Load Cabinet Impulse Response) → '''Dragonfly Reverb''' → '''Hardware Output'''.


=== Connection Options ===
== Windows VST via Wine ==


{| class="wikitable"
=== Yabridge ===
! Method !! Pros !! Cons
|-
| '''Real Tone Cable''' || Official, plug-and-play || Proprietary, limited to 48kHz
|-
| '''Your Audio Interface + RS_ASIO''' || Use professional interface, any sample rate || Requires modding game files
|}


=== Setup Steps ===
Yabridge (v5.1.1+) bridges Windows VST2/VST3/'''CLAP''' plugins to Linux via Wine. It is essential for commercial plugins (Neural DSP, STL Tones, Amplitube).


# '''Install dependencies''':
<syntaxhighlight lang="bash">
<syntaxhighlight lang="nix">
# After installing Windows plugins via Wine:
# In configuration.nix:
yabridgectl sync # Required to register plugins with Linux hosts
programs.steam.enable = true;
programs.gamemode.enable = true; # For launch option below
</syntaxhighlight>
</syntaxhighlight>


# '''Steam Launch Options''' (force low latency + real-time priority):
=== JUCE 8 black screen fix ===
<pre>
PIPEWIRE_LATENCY=128/48000 gamemoderun %command%
</pre>
Start with <code>128/48000</code> (~5ms). If stable, try <code>64/48000</code> (~2.5ms). Values <64 may cause crashes.


# '''Sample Rate''': Rocksmith strictly requires '''48000 Hz'''. Do not force 96000 Hz while playing.
{{Note
  |icon=ℹ
  |color=var(--border-color-info)
  |background=var(--background-color-info-subtle)
  |A widespread issue in 2026 affects JUCE 8-based plugins (e.g., Serum 2, Nexus 5) running via Wine/yabridge: the plugin GUI is a black window. This is because stock Wine lacks the Direct2D/DirectComposition render path required by JUCE 8.
}}


# '''If using Real Tone Cable and experiencing issues''', try ALSA backend as fallback (warning: exclusive device access):
To fix this, you must use patched Wine builds. The [https://github.com/giang17/wine/tree/d2d1-dcomp-11.0 giang17/wine-d2d1-dcomp] project provides prebuilt binaries and a guide for Arch/CachyOS.
<syntaxhighlight lang="bash">
# Only use if Pulse backend fails. May silence other apps.
protontricks 221680 sound=alsa
</syntaxhighlight>


# '''For interface users (no Real Tone Cable)''': Install [https://github.com/mdias/rs_asio RS_ASIO] mod to enable direct interface support. This bypasses the 48kHz limitation and allows using your professional interface.
=== PipeASIO for Proton/Steam ===


== Measuring Latency ==
For Windows DAWs (FL Studio, Ableton) or games (Rocksmith) running via Proton, [https://github.com/M0n7y5/pipeasio PipeASIO] (v1.7.0, Sept 2026) connects ASIO directly to PipeWire, bypassing the missing <code>libjack.so.0</code> in the Steam Runtime container.


Never trust software reports. Always perform a physical loopback test.
{{Note
  |icon=ℹ
  |color=var(--border-color-info)
  |background=var(--background-color-info-subtle)
  |If using FL Studio via Wine/Proton, you must turn '''off''' "Mix in buffer switch" in Audio settings to prevent constant xruns.
}}


=== Procedure ===
== Rocksmith 2014 ==


'''⚠️ Warning''': Before starting, turn output volume on your audio interface '''all the way down'''. A sudden, loud feedback loop can be generated if the connection is unstable. Increase volume gradually only after the plugin is open.
Rocksmith 2014 runs on NixOS via Proton. The recommended method uses the [https://codeberg.org/nizo/linux-rocksmith nixos-rocksmith] flake, which patches Steam to preload <code>libjack.so</code> and use <code>RS_ASIO</code> with WineASIO. For visual patching, <code>crosspipe</code> is recommended as a modern alternative to <code>helvum</code>.


# Connect a cable from your interface '''Output''' back into the '''Input''' (use a TS/TRS patch cable).
<syntaxhighlight lang="nix">
# Launch LSP Latency Meter:
programs.steam = {
<syntaxhighlight lang="bash">
  enable = true;
# Option A: Via Carla (recommended for beginners)
  rocksmithPatch.enable = true;
carla  # Add plugin "LSP Latency Meter Stereo", connect wires
};
 
# Option B: Via jalv (terminal)
jalv http://lsp-plug.in/plugins/lv2/latency_meter_stereo
</syntaxhighlight>
</syntaxhighlight>
# Play a sharp transient (string scratch) and read the '''Round-trip Latency (RTL)''' value.
=== Target Values ===


{| class="wikitable"
'''Steam Launch Options''':
! Latency !! Perception
<pre>LD_PRELOAD=/run/current-system/sw/lib/libjack.so PIPEWIRE_LATENCY=128/48000 %command%</pre>
|-
| '''< 5 ms''' || Professional / Imperceptible
|-
| '''5–10 ms''' || Acceptable for practice
|-
| '''> 12 ms''' || Noticeable "lag", difficult to play in time
|}


'''Note''': If measured latency exceeds calculated buffer latency <code>(buffer / sample_rate) * 2 * 1000</code>, check: USB interface hardware buffers, PipeWire extra quantum settings, kernel interrupt latency.
{{Note
  |icon=ℹ
  |color=var(--border-color-info)
  |background=var(--background-color-info-subtle)
  |Rocksmith strictly requires a sample rate of 48000 Hz.
}}


== Troubleshooting ==
== Troubleshooting ==


{| class="wikitable"
{| class="wikitable" style="text-align: left;"
|-
! Symptom !! Cause & Solution
! Symptom !! Cause & Solution
|-
|-
| '''Xruns (audio glitches)''' || • Ensure <code>powerManagement.cpuFreqGovernor = "performance"</code> is active (<code>cpupower frequency-info</code>).<br>• Check <code>pw-top</code> for high-CPU nodes.<br>• Close browsers/heavy apps during playing.<br>• Disable Wi-Fi: <code>sudo modprobe -r iwlwifi</code>.<br>• As last resort: add <code>processor.max_cstate=1</code> to <code>boot.kernelParams</code> (disables CPU sleep — high power draw).
| '''Xruns (audio glitches)''' || Ensure <code>powerManagement.cpuFreqGovernor = "performance"</code> is active. Check <code>pw-top</code> for high-CPU nodes. Disable Wi-Fi: find driver name via <code>lspci -k</code> or <code>lshw -class network</code>, then run <code>rfkill block wifi</code> to prevent interrupt storms.  
|-
|-
| '''No sound''' || • Check <code>qpwgraph</code> — PipeWire does not auto-connect hardware.<br>• Verify Pro Audio profile in <code>pavucontrol</code>.<br>• Run <code>sudo lsof /dev/snd/*</code> to find conflicting processes.
| '''Extreme latency stutters''' || As a last resort, add <code>processor.max_cstate=1</code> to <code>boot.kernelParams</code>. '''Warning:''' This disables CPU sleep states, resulting in extreme power draw and heat. Use with caution.
|-
|-
| '''DAW cannot find plugins''' || • Ensure <code>environment.sessionVariables</code> block is applied. Log out/in after rebuild.<br>• Verify paths: <code>echo $LV2_PATH</code>.<br>• Check plugin installation: <code>ls ~/.lv2</code>, <code>ls /run/current-system/sw/lib/lv2</code>.
| '''Input clipping / digital distortion''' || High-output pickups are overloading the interface's Hi-Z preamp (low dBu). Use a passive DI-box, an inline pad, or lower your guitar's pickup height.
|-
|-
| '''NVIDIA audio glitches''' || • Disable GPU power management: <code>hardware.nvidia.powerManagement.enable = false;</code><br>• For RTX 40/50 series: add <code>boot.extraModprobeConfig = "options nvidia NVreg_EnableGpuFirmware=0";</code><br>• Prefer X11 over Wayland for lowest latency.
| '''No sound''' || Check <code>qpwgraph</code> — PipeWire does not auto-connect hardware. Verify Pro Audio profile in <code>pavucontrol</code>. Run <code>sudo lsof /dev/snd/*</code> to find conflicting processes.
|-
|-
| '''Bluetooth causing Xruns''' || • Disable Bluetooth stack: <code>rfkill block bluetooth</code> during live sessions.
| '''DAW cannot find plugins''' || Ensure <code>environment.variables</code> block is applied. Log out/in after rebuild. Verify paths: <code>echo $LV2_PATH</code>.
|-
|-
| '''PipeWire config not applying''' || • Restart user services after rebuild: <code>systemctl --user restart pipewire wireplumber</code>.<br>• Check for WirePlumber overrides: <code>wpctl status</code>.
| '''Audio pops a few seconds after playback stops''' || WirePlumber suspends the ALSA node after 5 seconds of inactivity. Ensure <code>session.suspend-timeout-seconds = 0</code> is set in <code>wireplumber.extraConfig</code>.
|-
| '''JUCE 8 VST shows black screen''' || Stock Wine lacks Direct2D support. Install <code>wine-d2d1-dcomp</code> patches by giang17 and route the specific plugin to this patched Wine version using yabridge's dispatcher trick.
|-
| '''PipeWire config not applying''' || Restart user services after rebuild: <code>systemctl --user restart pipewire wireplumber</code>. Check for WirePlumber overrides: <code>wpctl status</code>.
|}
|}


== Quick Start Checklist ==
== See also ==
 
Before playing, verify:
 
<syntaxhighlight lang="bash">
# 1. CPU governor is performance
cpupower frequency-info | grep "current policy"  # Should show "performance"
 
# 2. PipeWire buffer is set
pw-cli dump settings | grep quantum  # Should show 64 or 128
 
# 3. No Xruns reported
pw-top | grep -E "ERR|XRUN"  # Should show 0 or empty
 
# 4. Pro Audio profile active
pavucontrol  # Configuration tab → your interface → Pro Audio
 
# 5. Plugin paths are set (for GUI apps)
echo $LV2_PATH  # Should include /run/current-system/sw/lib/lv2
</syntaxhighlight>
 
== See Also ==


* [[PipeWire]] — Official NixOS PipeWire documentation
* [[PipeWire]] — Official NixOS PipeWire documentation
* [[Audio production]] — General audio configuration and plugin paths
* [https://github.com/musnix/musnix musnix] — Deep NixOS audio optimizations module
* [https://github.com/musnix/musnix musnix] — Deep NixOS audio optimizations module
* [https://linuxmusicians.com/ LinuxMusicians Forum] — Community support
* [https://tone3000.com TONE3000] — Largest library of NAM A2 models and IRs
* [https://tonehunt.org ToneHunt] — Free NAM model library
* [https://github.com/M0n7y5/pipeasio PipeASIO] — ASIO to PipeWire bridge for Wine/Proton
* [https://github.com/mdias/rs_asio RS_ASIO] — Rocksmith interface mod
* [https://github.com/OpenSauce/rustortion Rustortion] — Modern Rust-based amp sim (experimental, build from source)
* [https://github.com/AidaDSP/AIDA-X AIDA-X] — RTNeural-based amp model player (experimental)
* [https://github.com/brummer10/neural-amp-modeler-ui neural-amp-modeler-ui] — GUI wrapper for NAM (experimental)


[[Category:Guides]]
[[Category:Guides]]
[[Category:Hardware]]
[[Category:Hardware]]
[[Category:Sound]]
[[Category:Sound]]

Latest revision as of 07:24, 20 September 2026

This guide covers setting up an electric guitar with NixOS to achieve professional, low-latency audio processing. It targets live playing with round-trip latency (RTL) under 6 ms using the modern PipeWire and WirePlumber stack.

⚠︎
Warning: Always start testing new signal chains with the monitoring volume at minimum. A sudden, loud feedback loop can be generated during loopback testing. Increase the volume gradually only after the plugin is open and stable.

The digital signal chain for a guitar consists of:

  1. Instrument-level signal from Hi-Z pickups.
  2. Analog-to-digital conversion via an external audio interface.
  3. Real-time processing on NixOS using a low-latency kernel and specialized software.
Note: Software-reported latency values are often inaccurate. Physical measurement via a loopback test is mandatory for verification.

Quick Start

If you want to get sound from your guitar within 15 minutes, follow these minimal steps. Ensure you have a compatible USB audio interface (see Hardware section).

  1. Connect your interface directly to the motherboard (rear USB port).
  2. Add the following minimal configuration to your /etc/nixos/configuration.nix:
  services.pipewire = {
    enable = true;
    alsa.enable = true;
    alsa.support32Bit = true;
    pulse.enable = true;
    jack.enable = true;
    wireplumber.enable = true;
    extraConfig.pipewire."92-low-latency" = {
      "context.properties" = {
        "default.clock.rate" = 48000;
        "default.clock.quantum" = 128;
        "default.clock.min-quantum" = 32;
        "default.clock.max-quantum" = 512;
      };
    };
  };
  security.rtkit.enable = true;
  environment.systemPackages = with pkgs; [ carla neural-amp-modeler-lv2 lsp-plugins pavucontrol ];
  1. Rebuild and switch:
sudo nixos-rebuild switch
systemctl --user restart pipewire wireplumber
  1. Open pavucontrol, go to the Configuration tab, and set your interface profile to Pro Audio.
  2. Launch carla, add the Neural Amp Modeler plugin, and connect your interface's input to the plugin and the plugin's output to the interface.

Hardware

Standard PC line-ins are unsuitable for guitar due to impedance mismatch. You need a dedicated interface with a Hi-Z (Instrument) input.

Why special cards are needed

Linux supports USB Audio Class 2.0 (UAC2) compliant devices natively. However, Thunderbolt audio interfaces generally do not work on Linux due to proprietary, closed protocols. Even high-end interfaces from Focusrite (Clarett Thunderbolt), RME, and Universal Audio will not function properly. Always choose USB interfaces, unless you are willing to use an experimental, reverse-engineered driver that currently only supports basic control routing without PCM audio streaming.

The clipping problem

⚠︎
Warning: Input headroom and clipping: Many budget and mid-range interfaces have limited headroom on their Hi-Z inputs. Modern high-output passive or active pickups can cause digital clipping at the ADC stage before the signal reaches 0 dB in your DAW, even with the gain knob at minimum.

The input headroom capacity is measured in dBu. A higher value means the interface can handle louder input transients without clipping.

Device Headroom (dBu) Status
PreSonus Studio HD2 / 24c 21 dBu ✅ Excellent
MOTU M2 / M4 16 dBu ✅ Good
Focusrite Scarlett 2i2 3rd Gen 12.5 dBu ⚠️ Average
Audient iD14 MkII 9 dBu ❌ Clips easily
Steinberg UR44 8.5 dBu ❌ Clips easily

Practical example: high-output pickups and low-headroom interfaces

This section demonstrates how to set up a guitar with high-output pickups when using an interface with limited input headroom. The principles apply to any similar setup.

Example setup:

  • Guitar: Schecter Omen-6 with Schecter Diamond Plus ceramic humbuckers and 9–42 strings.
  • Interface: Focusrite Scarlett Solo (3rd Gen) — 12.5 dBu headroom on the Hi-Z input.

Step 1: Physical guitar setup

High-output ceramic humbuckers combined with light strings produce a very sharp attack that can easily clip low-headroom inputs. To reduce the signal at the source:

  1. Lower the bridge pickup using a screwdriver. Turn the height screws clockwise to move the pickup further from the strings. This reduces the magnetic field strength and the output voltage.
  2. Set the guitar volume knob to 7–8 instead of 10. This preserves tone while reducing peak transients.
🟆︎
Tip: Test the difference: play a hard downstroke on the 6th string with the volume at 10, then at 7. Notice how the waveform peaks are reduced without losing sustain.

Step 2: Interface configuration

  1. Enable INST mode: Press the INST button on the Scarlett Solo. The indicator should light up. Without this, the input operates in mic mode (low impedance), causing muffled tone and instant clipping.
  2. Set Gain to minimum (0): Turn the gain knob fully counter-clockwise.

Step 3: Testing for clipping

Open your DAW or a visualizer plugin (e.g., LSP Analyzer) and play the hardest downstroke you can on the open 6th string.

  • If the waveform shows flat tops (hard clipping) even at 0% gain, your interface cannot handle the signal level.
  • If the peaks stay around −12 dBFS or lower, you have sufficient headroom.
⚠︎
Warning: If clipping persists at minimum gain, do not try to "fix" it by turning down the guitar volume further — this changes your tone. Instead, use a passive DI-box.

Step 4: Using a passive DI-box

If your interface clips even at 0% gain, insert a passive DI-box (e.g., Palmer PAN 01, ART DTI, AMT Reincarnator RD2) between the guitar and the interface:

  1. Connect guitar → DI-box input (TS cable).
  2. Connect DI-box XLR output → interface mic input (XLR cable).
  3. Make sure Phantom Power (+48V) is off — a passive DI-box does not require it.
  4. Disable the INST button on the interface, since the signal now arrives at the mic input.

This converts the instrument-level signal to mic-level, matching the interface's input stage and preserving the full dynamic range of your playing.

Note: Passive DI-boxes are preferred over active ones for this use case because they provide natural attenuation without adding noise or requiring external power.

Choosing an interface by headroom

When selecting an interface, check the Maximum Input Level (dBu) of its instrument input:

  • ≥ 15 dBu — sufficient headroom for most humbuckers; a DI-box is not needed.
  • 10–14 dBu — works with most guitars, but a DI-box may be required with hot pickups.
  • < 10 dBu — high risk of clipping with humbuckers; a DI-box is almost mandatory.

The Focusrite Scarlett 2i2 and Solo (3rd Gen) have a value of 12.5 dBu, which is average. With high-output pickups, clipping is easy to hit. This is why the Schecter Omen-6 + Scarlett Solo combination is a classic example where either careful Gain and pickup-height adjustment or a passive DI-box is required.

Recommendations

For NixOS, plug-and-play compatibility is critical. Choose interfaces with high dBu ratings to preserve the natural attack of your guitar.

Device Notes
Focusrite Scarlett 4th Gen (Solo/2i2/4i4) Plug-and-play. Requires disabling MSD Mode (hold 48V button while powering on). alsa-scarlett-gui v1.0 beta 9 works natively.
Focusrite Scarlett 4th Gen (16i16/18i16/18i20) Requires kernel ≥ 6.12, fcp-support, and a firmware update via alsa-scarlett-gui.
MOTU M2 / M4 Native ALSA kernel support (requires kernel ≥ 6.1). Direct hardware mixer control via alsamixer. Exceptionally stable USB-C latency.
Audient iD4 / iD14 (All Generations) Fully functional on NixOS. Note: iD14 MkII has limited Hi-Z headroom (9 dBu).

DI-box

If you already own a budget interface with low dBu and experience clipping, use a passive DI-box (e.g., Palmer PAN 01, ART DTI). A passive DI-box naturally attenuates the signal by ~20–23 dB, converting it to a balanced microphone level. Connect the DI-box between your guitar and the interface's XLR input.

System configuration

Add the following snippets to your /etc/nixos/configuration.nix. This configuration is optimized for high-performance CPUs.

PipeWire

Configure PipeWire with global low-latency defaults and disable node suspension to prevent audio pops on USB interfaces. Note that WirePlumber 0.5+ (standard in NixOS 26.05) supports SPA-JSON syntax, which is preferred over deprecated Lua scripts.

  services.pipewire = {
    enable = true;
    alsa.enable = true;
    alsa.support32Bit = true; # Required for yabridge/wine VST bridging
    pulse.enable = true;
    jack.enable = true;
    wireplumber.enable = true;
    
    # Global low-latency defaults
    extraConfig.pipewire."92-low-latency" = {
      "context.properties" = {
        "default.clock.rate" = 48000;       # Fixed rate avoids resampling latency
        "default.clock.quantum" = 128;      # ~5 ms latency at 48 kHz
        "default.clock.min-quantum" = 32;   # Allows top-tier interfaces to achieve ~1.5 ms
        "default.clock.max-quantum" = 512;
      };
    };

    # Disable node suspension and fix crackling on problematic USB interfaces
    wireplumber.extraConfig."99-disable-suspend" = {
      "monitor.alsa.rules" = [{
        matches = [
          { "node.name" = "~alsa_input.*"; }
          { "node.name" = "~alsa_output.*"; }
        ];
        actions = {
          update-props = {
            "session.suspend-timeout-seconds" = 0;
          };
        };
      }];
    };
  };

Kernel and performance

Modern mainline kernels include merged PREEMPT_RT patches. Dynamic preemption (preempt=full) provides best-effort low latency without the overhead of a dedicated RT kernel. CPU frequency scaling must be locked to prevent sleep-state latency spikes.

  boot.kernelPackages = pkgs.linuxPackages_latest;
  boot.kernelParams = [ 
    "preempt=full"              
    "usbcore.autosuspend=-1"    # Prevent USB audio interface sleep
  ];

  services.power-profiles-daemon.enable = false;
  powerManagement.cpuFreqGovernor = "performance";
  programs.gamemode.enable = true; # Can elevate priorities for real-time audio applications
Note: Always verify your bootloader configuration after changing kernel parameters to ensure they are applied correctly.

Real-time scheduling

RTKit handles real-time privileges via D-Bus/Polkit. Critical PAM limits must be set to allow unlimited memlock and high real-time priority for audio buffers.

  security.rtkit.enable = true;
  
  security.pam.loginLimits = [
    { domain = "@audio"; item = "memlock"; type = "-"; value = "unlimited"; }
    { domain = "@audio"; item = "rtprio"; type = "-"; value = "99"; }
    { domain = "@audio"; item = "nice"; type = "-"; value = "-19"; }
  ];
  
  users.users.yourname.extraGroups = [ "audio" ]; # Replace 'yourname' with your username

Plugin search paths

Crucial for NixOS DAWs to find plugins reliably in Wayland/X11 sessions.

  environment.variables = let
    makePluginPath = format:
      (pkgs.lib.makeSearchPath format [
        "$HOME/.nix-profile/lib"
        "/run/current-system/sw/lib"
        "/etc/profiles/per-user/$USER/lib"
      ]) + ":$HOME/.${format}";
  in {
    LV2_PATH = makePluginPath "lv2";
    VST3_PATH = makePluginPath "vst3";
    CLAP_PATH = makePluginPath "clap";
  };

Software installation

  nixpkgs.config.allowUnfree = true; # Required for REAPER, Bitwig Studio
  environment.systemPackages = with pkgs; [
    # --- Utilities & routing ---
    qpwgraph            # Visual patchbay for PipeWire (v1.0.4+)
    pwvucontrol         # Modern native PipeWire volume control (v0.5.3+)
    pavucontrol         # Fallback for Pro Audio profile selection
    pw-top              # Real-time CPU usage per audio node
    easyeffects         # System-wide real-time EQ and effects
    
    # --- DAWs ---
    ardour
    reaper
    bitwig-studio       # Native Linux commercial DAW, excellent CLAP support

    # --- Plugin hosts ---
    carla               # Modular plugin host, supports Windows VST via yabridge

    # --- Standalone guitar processors ---
    guitarix            # Includes native NAM and RTNeural module support

    # --- Plugins (LV2/CLAP) ---
    neural-amp-modeler-lv2  # NAM: AI captures of real tube amps (v0.2.3, supports A2)
    proteus               # Neural network modeling (LSTM) by GuitarML
    lsp-plugins           # Professional EQ, compression, IR loader (now available in CLAP)
    calf                  # Vintage-style effects
    dragonfly-reverb      # High-quality algorithmic reverb
    gxplugins-lv2         # Guitarix project pedals as standalone LV2
    kapitonov-plugins-pack # Profile-based traditional amp modeling (VST3/LV2)
    chow-centaur          # Klon Centaur emulation
    chow-phaser           # Phaser emulation
    ratatouille-lv2       # Dual neural modeler (loads .nam, .json, .aidax)

    # --- Practice & learning ---
    tuxguitar
    hydrogen

    # --- Windows VST compatibility ---
    yabridge
    (yabridgectl.override { wine = wineWow64Packages.stable; }) # Explicit 64-bit Wine path
    wineWow64Packages.stable  # Note: wineWowPackages is deprecated
  ];

Digital audio workstations

Software Purpose Notes
Ardour Professional recording, mixing, editing For absolute minimum RTL (< 5 ms), use the ALSA backend (bypasses PipeWire). Warning: ALSA locks the device exclusively — no other app can produce sound.
REAPER Commercial DAW, lightweight, scriptable Uses PipeWire-JACK natively. Excellent Linux support. Can be declaratively configured via Reaper HM Flake.
Bitwig Studio Modern commercial DAW Native Linux support. Superior CLAP format integration. PipeWire-JACK is often more stable out-of-the-box than Direct ALSA.

Amp simulators and neural modelers

Software Purpose Notes
Neural Amp Modeler (NAM) LV2 plugin. Loads .nam files AI captures of real tube amps. Architecture 2 (A2) released in June 2026 offers higher accuracy with 30–40% less CPU. Models: TONE3000.
Proteus LV2 plugin. Neural network modeling (LSTM) By GuitarML. Faster preset switching than NAM.
Kapitonov Plugins Pack (KPP) Profile-based traditional amp modeling Excellent for classic rock/metal. Available in LV2 and VST3.
Guitarix All-in-one virtual amp + pedals Standalone or LV2. Includes native modules for loading .nam and RTNeural models.
Note: CRITICAL for KPP: The input level at the beginning of the Kapitonov Plugins Pack chain must be strictly around -20 dB, otherwise the plugins will distort incorrectly. Use a meter plugin (e.g., LSP Meter) to verify.
⚠︎
Warning: Neural amps (NAM, Proteus, KPP) only model preamp/poweramp. You must load a Cabinet IR (via LSP IR Loader or similar) to get a usable guitar tone. Without an IR, the sound will be thin and unpleasant.

Modular hosts

Software Purpose
Carla Modular plugin host. Chain plugins visually: Input → Tuner → NAM → IR Loader → Reverb → Output. Hosts Windows VSTs via yabridge.
qpwgraph Visual patchbay for PipeWire/JACK. Manually connect hardware inputs to software hosts (PipeWire does not auto-connect).

Configuration and first launch

Pro audio profile

To achieve minimal latency, you must bypass standard software mixing:

  1. Open pavucontrol.
  2. Go to the Configuration tab.
  3. Set your interface profile to Pro Audio.

If the "Pro Audio" profile is missing, ensure pipewire-alsa is installed and restart PipeWire. This profile disables software mixing and enables hardware-exclusive mode, critical for the lowest latency.

Latency verification

Always perform a physical loopback test to measure the real Round-trip Latency (RTL).

  1. Connect a cable from your interface Output back into the Input.
  2. Launch LSP Latency Meter:
# Option A: Via Carla (recommended for beginners)
carla  # Add plugin "LSP Latency Meter Stereo", connect wires

# Option B: Via jalv (terminal)
jalv http://lsp-plug.in/plugins/lv2/latency_meter_stereo
  1. Play a sharp transient (string scratch) and read the Round-trip Latency (RTL) value.

Target values:

  • < 5 ms: Excellent
  • 5–10 ms: Acceptable for practice
  • > 12 ms: Noticeable "lag", difficult to play in time

Typical processing chain

For a standard metal/rock tone, route your signal in carla or your DAW as follows: Hardware Input → Noise Gate (e.g., LSP Gate) → NAM (Load A2-Full model) → LSP IR Loader (Load Cabinet Impulse Response) → Dragonfly Reverb → Hardware Output.

Windows VST via Wine

Yabridge

Yabridge (v5.1.1+) bridges Windows VST2/VST3/CLAP plugins to Linux via Wine. It is essential for commercial plugins (Neural DSP, STL Tones, Amplitube).

# After installing Windows plugins via Wine:
yabridgectl sync  # Required to register plugins with Linux hosts

JUCE 8 black screen fix

Note: A widespread issue in 2026 affects JUCE 8-based plugins (e.g., Serum 2, Nexus 5) running via Wine/yabridge: the plugin GUI is a black window. This is because stock Wine lacks the Direct2D/DirectComposition render path required by JUCE 8.

To fix this, you must use patched Wine builds. The giang17/wine-d2d1-dcomp project provides prebuilt binaries and a guide for Arch/CachyOS.

PipeASIO for Proton/Steam

For Windows DAWs (FL Studio, Ableton) or games (Rocksmith) running via Proton, PipeASIO (v1.7.0, Sept 2026) connects ASIO directly to PipeWire, bypassing the missing libjack.so.0 in the Steam Runtime container.

Note: If using FL Studio via Wine/Proton, you must turn off "Mix in buffer switch" in Audio settings to prevent constant xruns.

Rocksmith 2014

Rocksmith 2014 runs on NixOS via Proton. The recommended method uses the nixos-rocksmith flake, which patches Steam to preload libjack.so and use RS_ASIO with WineASIO. For visual patching, crosspipe is recommended as a modern alternative to helvum.

programs.steam = {
  enable = true;
  rocksmithPatch.enable = true;
};

Steam Launch Options:

LD_PRELOAD=/run/current-system/sw/lib/libjack.so PIPEWIRE_LATENCY=128/48000 %command%
Note: Rocksmith strictly requires a sample rate of 48000 Hz.

Troubleshooting

Symptom Cause & Solution
Xruns (audio glitches) Ensure powerManagement.cpuFreqGovernor = "performance" is active. Check pw-top for high-CPU nodes. Disable Wi-Fi: find driver name via lspci -k or lshw -class network, then run rfkill block wifi to prevent interrupt storms.
Extreme latency stutters As a last resort, add processor.max_cstate=1 to boot.kernelParams. Warning: This disables CPU sleep states, resulting in extreme power draw and heat. Use with caution.
Input clipping / digital distortion High-output pickups are overloading the interface's Hi-Z preamp (low dBu). Use a passive DI-box, an inline pad, or lower your guitar's pickup height.
No sound Check qpwgraph — PipeWire does not auto-connect hardware. Verify Pro Audio profile in pavucontrol. Run sudo lsof /dev/snd/* to find conflicting processes.
DAW cannot find plugins Ensure environment.variables block is applied. Log out/in after rebuild. Verify paths: echo $LV2_PATH.
Audio pops a few seconds after playback stops WirePlumber suspends the ALSA node after 5 seconds of inactivity. Ensure session.suspend-timeout-seconds = 0 is set in wireplumber.extraConfig.
JUCE 8 VST shows black screen Stock Wine lacks Direct2D support. Install wine-d2d1-dcomp patches by giang17 and route the specific plugin to this patched Wine version using yabridge's dispatcher trick.
PipeWire config not applying Restart user services after rebuild: systemctl --user restart pipewire wireplumber. Check for WirePlumber overrides: wpctl status.

See also

  • PipeWire — Official NixOS PipeWire documentation
  • Audio production — General audio configuration and plugin paths
  • musnix — Deep NixOS audio optimizations module
  • TONE3000 — Largest library of NAM A2 models and IRs
  • PipeASIO — ASIO to PipeWire bridge for Wine/Proton
  • Rustortion — Modern Rust-based amp sim (experimental, build from source)
  • AIDA-X — RTNeural-based amp model player (experimental)
  • neural-amp-modeler-ui — GUI wrapper for NAM (experimental)