Skip to content
swadhinbiswasPublic

About

Transform Linux audio from ordinary to exceptional.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Linux Audio Optimizer Banner

Linux Audio Optimizer

Automatic PipeWire, WirePlumber, and EasyEffects low-latency, high-fidelity audio tuning suite for Arch Linux and derivatives.


Linux Audio Optimizer is an open-source performance-tuning suite designed to configure Arch Linux (and its gaming/audio-focused derivatives like CachyOS, EndeavourOS, and Manjaro) for premium audio response. Instead of marketing "true Hi-Res Audio" (which is physically dependent on DAC and driver hardware), this optimizer configures the PipeWire and WirePlumber kernel/user layers to guarantee the lowest possible latency and bit-perfect, unresampled playback.


🌟 Key Features

  • ⚡ Ultra Low Latency: Drops your active buffering quantum limit down to 256 samples, yielding a ~5.33ms system-wide processing latency.
  • 🎵 Bit-Perfect Playback: Enables dynamic clock matching between [44100, 48000, 88200, 96000] Hz, ensuring your high-res audio bypasses the soundcard's default resampler.
  • 🛠️ ALSA Buffer Headroom Adjustments: Fine-tunes WirePlumber thread properties (period-size and headroom) to shield from kernel scheduler jitter and eliminate clicking/popping.
  • 🎛️ EasyEffects Preset Suite:
    • balanced — Flat frequency response for reference audio production.
    • music — Warm V-shaped curves enhancing bass punch and upper-mid detail.
    • gaming — Competitive preset boosting cues and footsteps (1kHz–8kHz) while attenuating low-end rumbling.
    • movie — Enhanced vocal dialogue spectrum and theater LFE sub-bass simulation.
    • voice — Bandpassed and gated voice settings tailored for noise-free Discord/VoIP capture.
    • headset/eksa-e900-pro — Custom hardware-equalization profile matching the 50mm drivers on the EKSA E900 Pro.
  • 🛡️ Safety First: Auto-creates timestamped configuration backups (backup.sh) before installation, allowing a complete system rollback (restore.sh) with one command.
  • 📊 Diagnostics: Live latency monitor and clock rate checker (benchmark.sh) which scans USB hubs for matching DAC architectures.

🚀 Quick Start

1. Installation

Clone this repository and run the installer:

git clone https://github.com/username/linux-audio-optimizer.git
cd linux-audio-optimizer
chmod +x install.sh scripts/*.sh
./install.sh

Important

Do not run install.sh with sudo directly. The installer runs in user space to correctly map configurations to your $HOME directory. Sudo privileges will be requested automatically when installing missing system dependencies.

2. Verify Latency & Playback Status

To ensure your services are running the optimized profile, run the diagnostic benchmark:

bash scripts/benchmark.sh

3. Activating Calibration Presets

  1. Open EasyEffects (available via application launchers or by typing easyeffects in a terminal).
  2. Go to Presets in the top right.
  3. Select your desired profile (e.g., music or headset/eksa-e900-pro).
  4. Click Apply.

🎧 Hardware Calibration: EKSA E900 Pro

The EKSA E900 Pro is a high-performance gaming headset featuring 50mm dynamic drivers and an integrated C-Media USB DAC. By default, the headset features a bass-heavy gaming tuning that can lead to "muddy" lower mids (125Hz–250Hz) and recessed, distant vocals.

Our hardware-calibration preset (headset/eksa-e900-pro.json) rectifies these flaws:

  • Mid-Bass Cleanup: Lowers the 125Hz to 250Hz range (-2.5dB and -1.5dB) to reduce acoustic masking and clear up instrument separation.
  • Sub-Bass Extension: Retains a slight boost at 32Hz and 64Hz for punchy cinematic effects.
  • Vocal Elevate: Elevates the core vocal range (+2.5dB at 1kHz and +3.0dB at 2kHz) to bring speech, footsteps, and spatial cues forward.
  • Treble Crispness: Moderately boosts 8kHz and 16kHz to introduce high-frequency detail and acoustic airiness.

🎼 Audiophile Guide: Achieving Bit-Perfect Hi-Res Output

Even with PipeWire configured, many music players by default resample audio streams to match the desktop environment mixer. To achieve true, unresampled Hi-Res Audio, you must configure your audio players to bypass the default mixer and output directly to the hardware.

🍓 Strawberry Music Player (Recommended)

  1. Open Strawberry and go to Tools -> Settings -> Backend.
  2. Set the Output engine to GStreamer.
  3. Under Device, change it from "Default" to your explicit hardware driver (e.g., alsa_output.usb-C-Media_Electronics_Inc._EKSA_E900_Pro-00.analog-stereo).
  4. Set the Output format to Unsigned 24-bit PCM or 32-bit float matching your files.

🎵 Audacious

  1. Go to File -> Settings -> Audio.
  2. Set the Output plugin to ALSA Output (or PipeWire Output).
  3. Click Settings next to the output plugin selection and select your EKSA E900 Pro output device directly.
  4. Check the box for Bit-perfect playback or Use linear volume to avoid software gain compression.

⚙️ Technical Blueprint

PipeWire Configuration (99-hifi.conf)

  • Dynamic Sample-Rate Matching: default.clock.allowed-rates = [ 44100 48000 88200 96000 ] When an audio source matches one of these rates, PipeWire switches the hardware clock rate of the DAC, bypassing the resampling algorithms.
  • Buffers & Latency Bounds: default.clock.quantum = 256 At 48kHz, this sets a processing buffer of 256/48000 = ~5.33ms. The boundaries default.clock.min-quantum = 128 and default.clock.max-quantum = 1024 prevent buffer underruns during gaming CPU spikes.

WirePlumber Configuration (99-audio-performance.conf)

  • Interrupt Scheduling: api.alsa.period-size = 1024 Specifies the block size of audio data sent to the kernel ALSA device driver, lowering interrupt frequency to improve CPU efficiency.
  • Buffer Margin (Headroom): api.alsa.headroom = 8192 Allocates buffer headroom to absorb scheduler jitter without causing audible latency degradation.

🔄 Reverting to Factory Settings

If you experience issues or wish to revert your system to its original state, run the restore script:

bash scripts/restore.sh

This utility detects your latest backed-up configurations, replaces the optimized properties files, cleans up newly created presets, and restarts systemd user audio daemons to clean up system state.


🛠️ Troubleshooting

Audio Crackling or Clicking (Buffer Underruns / xruns)

If your CPU is under intense loading or thermal throttling, a quantum of 256 may be too aggressive, resulting in audio pops.

  1. Open ~/.config/pipewire/pipewire.conf.d/99-hifi.conf.
  2. Edit default.clock.quantum to 512.
  3. Restart PipeWire: systemctl --user restart pipewire.

EasyEffects Presets Missing

If presets aren't loading, check if your plugins are installed:

  • Ensure package lsp-plugins-lv2 is installed. The installer tries to set this up automatically, but it can be manually installed:
    sudo pacman -S --needed lsp-plugins-lv2
  • If running the Flatpak version of EasyEffects, make sure Flatpak has permission to read files. You can grant access to the config folder via:
    flatpak override com.github.wwmm.easyeffects --filesystem=xdg-config/easyeffects:ro

About

Transform Linux audio from ordinary to exceptional.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages