Play sound through two or more outputs/devices
With paprefs
you have access to a virtual output device that enables simultaneous output to all attached sound cards/devices:
sudo apt install paprefs
Then in terminal run paprefs
, select "Simultaneous Output" tab, and check "Add virtual output for simultaneous output on all local sounds cards".
The additionally created audio output device for simultaneous output may be selected in the "Output" tab from pulseaudio sound preferences menu:
In this example it is shown for a HDMI-device but as soon as your Bluetooth device is recognized it will also be available for simultaneous output.
The changes may need a restart of pulseaudio to take effect either by logging out and back in to your session or by running pulseaudio -k
in a terminal.
In case paprefs does not do the job or if you prefer to have paprefs not installed use this command from the command line:
pactl load-module module-combine-sink
Ubuntu
I've just confirmed this solution (from 4 years ago) still works on Ubuntu 14.04 LTS.
Install
Open terminal and type sudo apt-get install paprefs
go to the tab exactly as per the picture above and select the option.
Initial Run
Then; remaining in terminal, type pulseaudio -k
to kill and restart pulseaudio.
Then go to your sound settings and you will see the option to output to multiple sound devices.
Props to whoever wrote paprefs it's a brilliant little piece of software I would actually like to see included in Ubuntu without requiring additional installation.
Apple Macs OS X
A similar solution is available via an included piece of software and whats so great about pulseaudio
is that the sound seems to be perfectly in-sync from both outputs so it must be adjusting for the lag as well which is why its so impressive; otherwise we would be hearing a slightly delayed version from one output and another.
I could not get Takkat's proposal work out of the box in Debian 8.7, although I restarted the system.
I assume you have completed Takkat's proposal in installing paprefs
.
Extension on Takkat's answer which works based on Arch Linux wiki where keep analog input and Pulse calls that "duplex"
# /etc/pulse/default.pa
# http://unix.stackexchange.com/a/180374/16920
load-module module-alsa-sink device=hdmi:0
load-module module-combine-sink sink_name=combined
set-default-sink combined
Then restart pulseaudio:
pulseaudio -k