Skip to content

Instantly share code, notes, and snippets.

@eagleusb
Last active June 17, 2023 09:10
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save eagleusb/ecfc045ac59c9a2126fea035e06e61ee to your computer and use it in GitHub Desktop.
Save eagleusb/ecfc045ac59c9a2126fea035e06e61ee to your computer and use it in GitHub Desktop.
High Quality Linux Sound :)

HQLS

High Quality Linux Sound is just my memo about Linux sound stack configuration, as:

  1. I never remember all the tools to configure (ALSA, PulseAudio...)
  2. I never remember the correct parameter(s)
  3. It must be automated

ALSA

PulseAudio

pulseaudio

Loaded configuration(s):

  • ~/.config/pulse/daemon.conf
  • ~/.config/pulse/daemon.conf.d/*.conf
  • /etc/pulse/daemon.conf
  • /etc/pulse/daemon.conf.d/*.conf
$ pulseaudio --kill

Resampling Methods

SoX resamplers are considered the best choice for audio of up to 16 bits per sample. The vhq variant has more precision than hq and is more suitable for larger samples.

  • src-sinc-best-quality
  • src-sinc-medium-quality
  • src-sinc-fastest
  • src-zero-order-hold
  • src-linear
  • trivial
  • speex-float-N
  • speex-fixed-N
  • ffmpeg
  • soxr-mq
  • soxr-hq
  • soxr-vhq

Remixing

  • remixing-produce-lfe=[yes|no]
  • remixing-consume-lfe=[yes|no]

Sample Rate

  • default-sample-format=float32le
  • default-sample-rate=192000
  • alternate-sample-rate=48000

pactl

pactl - Control a running PulseAudio sound server

$ pactl info

Set your Bluetooth headset in A2DP mode (vs HSP, low quality)

$ pactl set-card-profile bluez_card.00_12_34_5C_C6_98 a2dp_sink

Set your volume

 $ pactl set-sink-volume bluez_sink.00_12_34_5C_C6_98.a2dp_sink 60%

pacmd

pacmd - Reconfigure a PulseAudio sound server during runtime

$ pacmd info

PipeWire

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment