Best PulseAudio Settings Fact Check?

I actually just learned about PulseAudio configuration settings, and am curious as to which settings would optimize audio quality.

I have a decent gaming rig and wouldn’t mind spending a bit more CPU on higher quality audio.

These settings were recommended by a certain website (https://medium.com/@gamunu/enable-high-quality-audio-on-linux-6f16f3fe7e1f):

default-sample-format = float32le
default-sample-rate = 48000
alternate-sample-rate = 44100
;default-sample-channels = 2
;default-channel-map = front-left,front-right
;default-fragments = 2
;default-fragment-size-msec = 125
resample-method = soxr-vhq
enable-lfe-remixing = no
high-priority = yes
nice-level = -11
realtime-scheduling = yes
realtime-priority = 9
rlimit-rtprio = 9
daemonize = no

Here is my system right now:

System:
  Host: MidnightStarSign Kernel: 5.10.7-3-MANJARO x86_64 bits: 64 compiler: gcc 
  v: 10.2.1 Desktop: KDE Plasma 5.20.5 Distro: Manjaro Linux 
Machine:
  Type: Desktop Mobo: ASUSTeK model: PRIME X570-PRO v: Rev X.0x 
  serial: <superuser required> UEFI: American Megatrends v: 1407 
  date: 04/02/2020 
CPU:
  Info: 6-Core model: AMD Ryzen 5 3600 bits: 64 type: MT MCP arch: Zen 2 rev: 0 
  L2 cache: 3 MiB 
  flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm 
  bogomips: 103839 
  Speed: 4325 MHz min/max: 2200/4325 MHz boost: enabled Core speeds (MHz): 
  1: 4325 2: 4324 3: 4325 4: 4325 5: 4324 6: 4325 7: 4325 8: 4325 9: 4325 
  10: 4324 11: 4325 12: 4325 
Graphics:
  Device-1: AMD Navi 10 [Radeon RX 5600 OEM/5600 XT / 5700/5700 XT] 
  vendor: ASRock driver: amdgpu v: kernel bus ID: 0c:00.0 
  Display: x11 server: X.Org 1.20.10 driver: loaded: amdgpu,ati 
  unloaded: modesetting,radeon resolution: 1: 1920x1080~60Hz 2: 1920x1080~60Hz 
  3: 1920x1080~60Hz 
  OpenGL: renderer: AMD Radeon RX 5600 XT (NAVI10 DRM 3.40.0 5.10.7-3-MANJARO 
  LLVM 11.0.1) 
  v: 4.6 Mesa 20.3.3 direct render: Yes 
Audio:
  Device-1: AMD Navi 10 HDMI Audio driver: snd_hda_intel v: kernel 
  bus ID: 0c:00.1 
  Device-2: AMD Starship/Matisse HD Audio vendor: ASUSTeK driver: snd_hda_intel 
  v: kernel bus ID: 0e:00.4 
  Device-3: ASUSTek ASUS AI Noise-Cancelling Mic Adapter type: USB 
  driver: hid-generic,snd-usb-audio,usbhid bus ID: 5-5.2:6 
  Device-4: Microdia USB 2.0 Camera type: USB driver: snd-usb-audio,uvcvideo 
  bus ID: 7-1:3 
  Sound Server: ALSA v: k5.10.7-3-MANJARO 
Network:
  Device-1: Intel I211 Gigabit Network vendor: ASUSTeK driver: igb v: kernel 
  port: f000 bus ID: 06:00.0 
  IF: enp6s0 state: up speed: 1000 Mbps duplex: full mac: 24:4b:fe:5b:08:2a 
Drives:
  Local Storage: total: 5.58 TiB used: 1.9 TiB (34.1%) 
  ID-1: /dev/nvme0n1 vendor: Western Digital model: WDS100T3X0C-00SJG0 
  size: 931.51 GiB temp: 40.9 C 
  ID-2: /dev/nvme1n1 vendor: Western Digital model: WDS100T2B0C-00PXH0 
  size: 931.51 GiB temp: 38.9 C 
  ID-3: /dev/sda vendor: Seagate model: ST2000LM015-2E8174 size: 1.82 TiB 
  ID-4: /dev/sdb vendor: Seagate model: ST380815AS size: 74.51 GiB 
  ID-5: /dev/sdc vendor: Toshiba model: MQ01ABD100 size: 931.51 GiB 
  ID-6: /dev/sdd vendor: Seagate model: ST1000LM035-1RK172 size: 931.51 GiB 
  ID-7: /dev/sde type: USB model: N/A size: 29.3 GiB 
  ID-8: /dev/sdk type: USB vendor: Toshiba model: TransMemory size: 14.92 GiB 
  ID-9: /dev/sdl type: USB vendor: SanDisk model: Gaming Xbox 360 size: 7.48 GiB 
Partition:
  ID-1: / size: 767 GiB used: 478.65 GiB (62.4%) fs: btrfs dev: /dev/dm-0 
  mapped: luks-466d5812-64c7-4a28-bcc4-a1a5adfa9450 
  ID-2: /boot/efi size: 511 MiB used: 26.1 MiB (5.1%) fs: vfat 
  dev: /dev/nvme0n1p1 
  ID-3: /home size: 767 GiB used: 478.65 GiB (62.4%) fs: btrfs dev: /dev/dm-0 
  mapped: luks-466d5812-64c7-4a28-bcc4-a1a5adfa9450 
Swap:
  ID-1: swap-1 type: partition size: 64 GiB used: 0 KiB (0.0%) dev: /dev/dm-1 
  mapped: luks-81b2dc57-06f5-4471-b484-77c3a516f307 
Sensors:
  System Temperatures: cpu: 43.0 C mobo: N/A gpu: amdgpu temp: 40.0 C 
  Fan Speeds (RPM): N/A gpu: amdgpu fan: 0 
Info:
  Processes: 555 Uptime: 1h 28m Memory: 31.33 GiB used: 11.24 GiB (35.9%) 
  Init: systemd Compilers: gcc: 10.2.0 clang: 11.0.1 Packages: 1871 Shell: Bash 
  v: 5.1.0 inxi: 3.2.02 

Are there any additions or exclusions that I should make to improve audio quality?

IMO the 3 important settings for HD audio users should start with are these

default-sample-format = float32le
default-sample-rate = 48000
resample-method = speex-float-3

This comment by author is incorrect and missing a downside of soxr resampler

I have selected soxr-vhq. It is the point sampler, which offers better sound quality than speex-* methods however it is CPU intensive.

man pulse-daemon.conf has this:

The Soxr resamplers generally offer better quality at less CPU compared to other resamplers, such as speex. The downside is that they can add a significant delay to the output (usu‐ ally up to around 20 ms, in rare cases more).

Pulseaudio documentation usually recommends speex-float-3
(or speex-float-5 for 96000Hz samplerate)
The default speex-float-1 is awful on PCs and should be changed by users
PulseAudio uses this as default for supporting ARM and MIPS systems
Change the default resample-method to speex-float-10 in daemon.conf (#310) · Issues · PulseAudio / pulseaudio · GitLab

enable-lfe-remixing = no should be removed as the setting has been deprecated and might cause an error. Low Frequency Effects for sub-woofer channel is turned off by default anyway so this was not needed

These settings are also not needed as they are the same as the commented out defaults
in system file /etc/pulse/daemon.conf (but they won’t cause a problem if not removed)
nice-level = -11
rlimit-rtprio = 9
daemonize = no

6 Likes

Thanks for the feedback!

Hmm I got this error:
E: [pulseaudio] daemon-conf.c: [/etc/pulse/daemon.conf:95] Invalid sample format 'speex-float-3'.

Here is the full doc:

; default-sample-format = s16le
default-sample-format = float32le

either one - this is from my config file -
the first one is commented so I can easier revert

speex-float-3
or something else is for:
resample-method
not for:
default-sample-format

like this:
resample-method = speex-float-3
or, what you have:
resample-method = soxr-vhq

probably a mixup …

ps:
The original file (default options) can be viewed/extracted from the package
pulseaudio
which is probably still in the pacman cache
/var/cache/pacman/pkg

2 Likes

default-sample-format is to set the audio bitrate
SupportedAudioFormats

The default setting s16le is only CD quality audio
for HD (DVD) Audio it would only need to be increased to s24le
but it is usually suggested to set it to highest setting float32le
This does not seem to cause extra CPU load to set it high

resample-method=speex-float-3 should be used to replace resample-method=soxr-vhq
the resampler setting can take a lot of CPU power if the setting is too high

1 Like