This should work conceptually on any Linux OS with PulseAudio but these particular instructions are for Ubuntu.
There are two major reasons for using simultaneous output. The first is self-evident - we can output to say a bluetooth
headset and wired headphones at the same time to enable two people to watch a movie with headphones on a single computer.
The second reason is a sort of a convenience for setup. We know the simultaneous sink name so the default.pa
config
would work without modification so long as simultaneous output is enabled. If we were to set this up without that,
we'd have to customize the config with our specific device sink name. That's totally doable but personally I always
setup simultaneous output. That's why I haven't described the alternative in this gist.
- Install LADSPA plugins containing the compressor and limiter we'll use:
sudo apt install swh-plugins
- Install PulseAudio Preferences
paprefs
:
sudo apt install paprefs
- Open PulseAudio Preferences:
paprefs
- Go to the Simultaneous Output tab.
- Check Add virtual output ... all sound cards and Close.
- Copy
default.pa
from this gist to~/.config/pulse/
. - Restart PulseAudio:
pulseaudio -k
The normalized output is selected by default. If you want to change this behaviour you can comment out or delete the set-default-sink ladspa_normalized
line in the ~/.config/pulse/default.pa
file. You can also select any other output from the PulseAudio settings when you need unmodified output. This approach can be modified to instead normalize the volume of a particular sound device instead of normalizing the simultaneous virtual device.
https://askubuntu.com/questions/95716/automatically-adjust-the-volume-based-on-content
You have to ensure that all of the chained sinks have their volumes maxed out. If for example the level of the final sound card is low, even if the combined, limiter and compressor are high, the final output would be low. The audio chain goes like
limiter > compressor > simultaneous output > sound card(s)
. It's setup so that the default output is set to thelimiter
. When you control your system's volume, you control thelimiter's
volume. If some sink downstream from it has its volume level lowered, the whole chain's level will be lower. Note that if you're utilizing simultaneous output and want different final volume on different sound cards, you can select each sound card individually, adjust its level, then select thelimiter
again as the output.