From LinuxReviews
Jump to navigationJump to search

PulseAudio is a standard audio stack used by as good as all Linux distributions. It places itself between end-user software and the kernels ALSA audio stack. It can be used for mixing, per-application volume control and network audio. It has a history of criticism for it's high CPU use and many, many bugs. Most of this was valid from it's creation in 2004 to about 2014. Modern versions are fine and quite useful.


PulseAudio was in 2012 described as:

"Pulse is the single worst Linux move I've ever seen. In the interest of removing audio from the kernel space (necessary for low-latency), it simply eliminated what used to be advanced capabilities. Lennart Poettering, author of Pulse simply disregarded these concerns, waved his hands and said "that's not the concerns Pulse was designed to address!"

Configuration example for (placebo) better audio

PulseAudio is system-wide configured by /etc/pulse/daemon.conf and this has some settings which may affect audio quality.

These settings may be of interest:

default-sample-rate = 48000
default-sample-format = float32le
resample-method = speex-float-10
avoid-resampling = false
enable-remixing = yes
remixing-use-all-sink-channels = no
enable-lfe-remixing = no 

You will also want this if you are using a 5.1 surround setup:

default-sample-channels = 6

The above settings provide the following benefits:

  • default-sample-rate sets the default sample-rate used by PulseAudio. Modern digital audio equipment can usually handle 48000 just fine. Using 96000 would also be fine.
  • default-sample-format = float32le sends higher quality samples to ALSA which in turn sends it to the actual audio card. You may not be able to use the better float32le option. Run the command pacmd list-sinks | grep sample to see what your card(s) actually support.
  • avoid-resampling means PulseAudio will use the default-sample-rate even if it means re-sampling 441000 audio. The alternative is to have PulseAudio switch between 48000 and 44100 depending on what is being played. This has historically been buggy and problematic when playing say 44100 music in the background and opening a video file that's 48000.
  • resample-method sets the type of technology used for resampling. speex-float-10 provides better quality than say speex-float-2 - higher values produce better quality and consume more CPU, lower values have lower quality and consume less CPU. The difference in CPU power required to re-sample audio mattered in 2005. Perhaps it meant something in 2010. It's irrelevant on modern machines.
  • enable-remixing refers to re-mixing audio channels. It is useful for remixing mono to stereo. It should be combined with remixing-use-all-sink-channels
  • remixing-use-all-sink-channels set to true or false decides if stereo should be up-mixed to all channels on a surround system. Setting this to no makes it possible to have enable-remixing set to yes and still have mono up-mixed to stereo.
  • enable-lfe-remixing refers to the sub-woofer channel.

PulseAudio can do Network Audi o

A dedicated machine next to a nice HI-FI surround receiver can run PulseAudio with the following in /etc/pulse/system.pa if PulseAudio is started as a system user - or /etc/pulse/default.pa if you start it as a user for some reason - and allow other machines to use it to output audio:

load-module module-native-protocol-tcp auth-ip-acl=; auth-anonymous=1
load-module module-zeroconf-publish

The client(s) on the network would just need this in /etc/pulse/default.pa

load-module module-zeroconf-discover

A working zeroconf setup like Avahi is also required for automatic discovery.

Add your comment
LinuxReviews welcomes all comments. If you do not want to be anonymous, register or log in. It is free.