Skip to content

itzTiru/klang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Klang

One-command bit-perfect audio for Linux, with kernel-level proof it worked.

Klang GUI

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.

Install

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.

Use it

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 above

After configure --write, restart the audio stack:

systemctl --user restart pipewire pipewire-pulse wireplumber

What it does

  • 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_params during playback, that ALSA actually received the source rate. No guessing.

What it doesn't do

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.

Docs

License

GPL-3.0-or-later. See LICENSE.

About

Bit perfect audio for Linux. detects your DAC, configures PipeWire and WirePlumber to match and and confirms the signal path against kernel reported ALSA parameters

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors