Most stuff on this is dated and/or speculative, so here’s a quick and easy howto on combining sinks in PulseAudio for simultaneous output.
If you’d like to include a Bluetooth headset or similar transient output device in your combined sink, please ensure it is correctly connected and visible in your preferred PulseAudio volume manager before proceeding.
module-combine-sink module (previously simply “
module-combine“) provides the functionality we need.
pacmd is [usually] distributed with PulseAudio and allows the user to send commands to the running PA server. Start
pacmd and send
list-sinks to the server. You’ll get output like:
x sink(s) available.
flags: HARDWARE DECIBEL_VOLUME LATENCY FLAT_VOLUME DYNAMIC_LATENCY
flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY FLAT_VOLUME DYNAMIC_LATENCY
Read this list and copy the names of the sinks (without the enclosing brackets) that you would like to combine; they should be fairly self-explanatory.
Then, create a combined sink containing all sinks on which you’d like simultaneous output by sending this command to the
load-module module-combine-sink sink_name=combined slaves=alsa_output.pci-0000_09_04.0.analog-stereo,alsa_output.pci-0000_01_00.1.hdmi-stereo-extra3
sink_name is the name by which the sink will be identified and
slaves is a comma-delimited list of all sinks upon which simultaneous output of the desired stream should occur.
This new sink should be immediately visible in your volume manager, from which you can switch individual streams to the combined sink or set the new sink as the default output.
Note that on transient devices like Bluetooth headsets, it may be necessary to recreate this sink each time the device is reconnected. In my experience, it’s just simpler to restart PulseAudio before connecting your new transient device, or else the old sink may linger and create issues. This can be done simply by issuing
pulseaudio --kill; pulseaudio --start at your user’s shell.