One-command bit-perfect audio for Linux, with kernel-level proof it worked.
Plugging a hi-res DAC into Linux currently means editing PipeWire config
files, running pactl list sinks, and hoping you guessed the right rates.
Klang does it for you. It reads what your DAC actually supports from the
kernel, writes a matched PipeWire + WirePlumber config, and plays a test
tone to prove the chain is bit-perfect, verified by reading the kernel's
own hw_params while ALSA is running.
Klang is pre-publish. Install from source while it's still early:
git clone https://github.com/itzTiru/klang.git
cd klang
pip install -e '.[gui]'Runtime requirements: PipeWire and WirePlumber (default on most modern
distros), plus pw-cat and pactl from the pipewire package. The
[gui] extra pulls in PySide6; omit it for a headless install.
AUR and PyPI packages (yay -S klang-git, pip install klang) are
planned once the install path is battle-tested across a few more DACs.
klang detect # list cards and capabilities
klang configure KA11 # bit-perfect config (dry-run by default; --write to apply)
klang verify 0 # play a tone, confirm ALSA ran at the source rate
klang-gui # window version of the aboveAfter configure --write, restart the audio stack:
systemctl --user restart pipewire pipewire-pulse wireplumber- Widens PipeWire's graph so high-res rates (352.8 / 384 kHz) stop being silently resampled on DACs that support them.
- Generates a per-DAC WirePlumber rule that pins the best native format and disables suspend-induced pops.
- Proves, by reading
/proc/asound/cardN/pcm0p/sub0/hw_paramsduring playback, that ALSA actually received the source rate. No guessing.
It doesn't make music audibly better. 384 kHz is inaudible to humans in blind tests. What it gives you is a clean, verifiable signal path, the fixes for two real problems (silently-dropped hi-res rates, DAC pops), and proof the chain is doing what you think. See docs/audibility.md for the unvarnished version.
- How it works: stages, config files, match rules.
- Audibility, honestly: what bit-perfect buys you.
- Troubleshooting: common gotchas.
- CHANGELOG: release history.
GPL-3.0-or-later. See LICENSE.
