PulseAudio configuration


Default.pa

I used to use the default configuration in /etc/pulse/default.pa, but I had a few issues with it:

  • It did not remember the default configuration for built-in audio. It was constantly changing to HDMI output, while I needed built-in speakers and headphone jack.
  • USB Microphone did do duplex for a while, but at some point I only was able to configure it as output or input, not as both together.
  • Arctis Pro had too many useless settings and I did mess them up all the time.

Diagnose

pulseaudio is filled with useful features, you just need to find them. I’ve used these to fiddle around:

pulseaudio --dump-modules
To determine which modules are loaded

Restore

Automatically restore the volume of streams and devices.

load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore

TODO Dunno?

Should be after module-*-restore but before module-*-detect.

load-module module-switch-on-port-available

Manual device config

Instead of using udev to autodetect, configure them by hand.

I’ve used aplay -l to find the existing sinks and arecord -l to find the existing sources.

Built-in audio

Only the built-in speakers, no audio through HDMI.

load-module module-alsa-sink device=hw:CARD=PCH,DEV=0
load-module module-alsa-source device=hw:CARD=PCH,DEV=0

Arctis Pro headset

Input and output.

load-module module-alsa-sink device=hw:CARD=Wireless,DEV=0
load-module module-alsa-source device=hw:CARD=Wireless,DEV=0

Webcam

C920 webcam has input too.

load-module module-alsa-source device=hw:CARD=C920,DEV=0

USB microphone

Configure input and output for the mic.

load-module module-alsa-sink device=hw:CARD=MICROPHONE,DEV=0
load-module module-alsa-source device=hw:CARD=MICROPHONE,DEV=0
  • TODO Unplugging

    When the USB device is unplugged, and plugged in again, the devices don’t automatically show up again in pavucontrol.

Other

We don’t need these right now.

load-module module-null-sink
load-module module-pipe-sink

Automatic devices config

Automatically load driver modules depending on the hardware available.

.ifexists module-udev-detect.so
load-module module-udev-detect tsched=0
.else

Use the static hardware detection module (for systems that lack udev support).

load-module module-detect
.endif

Bluetooth

Automatically load driver modules for Bluetooth hardware.

.ifexists module-bluetooth-policy.so
load-module module-bluetooth-policy
.endif

TODO Device restore

Automatically restore the default sink/source when changed by the user during run time NOTE: This should be loaded as early as possible so that subsequent modules that look up the default sink/source get the right value.

(Doesn’t do anything AFAICT)

load-module module-default-device-restore

Always sink

Make sure we always have a sink around, even if it is a null sink.

load-module module-always-sink

Last

Should be the last line.

load-module module-native-protocol-unix