I upgraded from 12.04 and lost the ability to connect multiple bluetooth headsets to watch movies with my wife and not disturb the neighbours! Any headsets that connects the first will remain the only headsets that can use the audio sink. Any Idea how to fix this?
1 Answer
You are perfectly right. There is no option in default Ubuntu sound settings to connect to more than one sink at a time.
Enable multiple devices in Bluetooth settings
To enable pairing and connecting to more than one audio device the settings file /etc/bluetooth/audio.conf needs to be edited (as root). Add/edit the following lines:
# Maximum number of connected HSP/HFP devices per adapter. Defaults to 1
MaxConnected=2
[A2DP]
SBCSources=2Create an output sink for more than one device
Using the pulseaudio command line we are able to create a combined sink of more than one sink where audio output then is sent to both.
These are the steps involved:
Find the internal names for the attached sinks by issueing the following command in a terminal:
pacmd list-sinksThis will give us a rather long list of all available output sinks. Look out for a line similar to this for your bluetooth headsets:
name: <bluez_sink.xx_xx_xx_xx_xx_xx>There are numbers instead of
xx_xx_xx_xx_xx_xxas given above which correspond to the MAC of your headset. These numbers will be different for the both. Note down or copy paste the names of the Bluetooth sinks for creating the combined sink.Load the pulseaudio module-combined-sink:
In a terminal issue the following commmand using the MAC numbers from above command (here exemplarily written as
xx_xx_xx_xx_xx_xx, andyy_yy_yy_yy_yy_yy)pacmd load-module module-combine-sink sink_name=combine sink_properties=device.description=myCombine slaves=bluez_sink.xx_xx_xx_xx_xx_xx,bluez_sink.yy_yy_yy_yy_yy_yy channels=2Open Sound Settings from the Sound Indicator in the panel to find the newly created output sink we had given the name "myCombine":
Select this output device before you start your movie player and sound should be played on both devices.
Unfortunately this sink will be lost on log out. The steps above will therefore have to be repeated after every log-in or reboot.
Disclaimer: we were unable to test here if this really works because we only have one Bluetooth device at hand. What we could test however is that audio outputs to both, the default audio, and the headset after we created a combined sink.
2