Pulseaudio

From Blue-IT.org Wiki

Connect bluetooth headset

Ubuntu 14.04

Add the following ppa:

sudo add-apt-repository ppa:blueman/ppa
sudo apt-get update
sudo apt-get upgrade blueman

Further reading:

Script for auto-connecting a bluetooth headset

The following script switches the default audio sink to the one of the headset, when the headset is switched on (checks every 10 seconds):

#!/bin/bash
# switches automatically between bluetooth headset and loutspeaker
# be sure you have checked that the device is enabled 
# in the "configurations" section of puvcontrol AND
# in /etc/bluetooth/audio.conf auncomment the line
# like this: "# AutoConnect=true"

###################################################
# EDIT
# use this command to find out:
# pacmd list-sinks | grep "name:"

myBTHeadSetSinkName="bluez_sink.xx_xx_xx_xx_xx"
myDefaultSinkName="alsa_output.usb-name_of_device.analog-stereo"
###################################################

while (true)
do

if pacmd list-sinks | grep "${myBTHeadSetSinkName}"
then
	pacmd set-default-sink "${myBTHeadSetSinkName}"

else
	pacmd set-default-sink "${myDefaultSinkName}"

fi

sleep 10

done