个人工具

“UbuntuHelp:BluetoothHeadset”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
 
(未显示同一用户的2个中间版本)
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/BluetoothHeadset}}
 
{{From|https://help.ubuntu.com/community/BluetoothHeadset}}
 
{{Languages|UbuntuHelp:BluetoothHeadset}}
 
{{Languages|UbuntuHelp:BluetoothHeadset}}
<<Include(Tag/ContentCleanup)>>
 
''Stolen from HyRax1 on the [http://forums.overclockers.com.au/showthread.php?t=694010 Overclockers forum]. Don't forget to send him a nice thank you note for this.''
 
 
== Purpose ==
 
== Purpose ==
 
This guide should help you redirect music, audio and media players to your Bluetooth headset.
 
This guide should help you redirect music, audio and media players to your Bluetooth headset.
To make this work properly, all audio will have to be redirected through the PulseAudio Server
+
To make this work properly all audio will have to be redirected through the PulseAudio Server
 +
Thanks to HyRax1 on the [http://forums.overclockers.com.au/showthread.php?t=780054 Overclockers forum].
 
== Prerequisites ==
 
== Prerequisites ==
* Bluetooth interface to your PC
+
* Bluetooth 1.2 compliant (or better) adapter to your PC. This can be in-built, such as on a modern notebook PC, or a USB dongle. You will '''NOT''' have success with Bluetooth adapters that are only compliant with the 1.0 or 1.1 specification.
* Ubuntu Hardy
+
* Ubuntu Jaunty 9.04.
* Internet access or other such access to the Ubuntu repositories to install extra software from
+
* Internet access or other such access to the Ubuntu repositories to install extra software from.
* Suitable Bluetooth headset. Should support Bluetooth 1.2 and 2.0, and the headset, handsfree A2DP and AVRCP profiles (typical function set of any headset/handsfree unit these days)
+
* Suitable Bluetooth headset (before purchasing please research your choice, to ensure that it is indeed supported and works in Ubuntu)
 
== Instructions ==
 
== Instructions ==
These instructions should be adaptable to other distributions.
 
 
<ol><li>Plug in or enable your Bluetooth adapter. Your Bluetooth adapter will be automatically detected and drivers loaded - there is nothing for you to do manually here.
 
<ol><li>Plug in or enable your Bluetooth adapter. Your Bluetooth adapter will be automatically detected and drivers loaded - there is nothing for you to do manually here.
</li><li>If you have NEVER used Bluetooth on your Ubuntu setup before, then go to the next step, otherwise skip to Step 11 because you're probably already setup properly.
+
</li><li>Turn on your Bluetooth headset.
</li><li>Open a terminal window
+
</li><li>Switch your headset into pairing mode (refer to your headset's manual).
</li><li>Verify that your Bluetooth adapter is running with:</li></ol>
+
</li><li>While the headset is in pairing mode, left click the Bluetooth icon in your system tray and choose '''Setup new device''' from the menu. Follow the wizard prompts to seek out and pair your headset.
 +
</li><li>Once paried, open a terminal, and type in the following:</li></ol>
  
<pre><nowiki>
 
hciconfig -a
 
  </nowiki></pre>
 
If you get details about hci0 listed including manufacturer's name, then your adapter is working.
 
You should see the second line with
 
<pre><nowiki>
 
UP RUNNING PSCAN
 
  </nowiki></pre>
 
If not then run
 
<pre><nowiki>
 
sudo hciconfig hci0 reset
 
  </nowiki></pre>
 
<ol><li>Type in the following to edit your Bluetooth configuration file:</li></ol>
 
 
<pre><nowiki>
 
sudo gedit /etc/bluetooth/hcid.conf
 
  </nowiki></pre>
 
This will bring up the Bluetooth configuration into the GEdit text editor
 
<ol><li>Change the following:</li></ol>
 
 
* '''security user''' line to read '''security auto'''
 
* '''passkey “1234”''' to '''passkey “0000”'''
 
<ol><li>Save and exit
 
</li><li>Restart Bluetooth by typing the following into the Terminal window:</li></ol>
 
 
<pre><nowiki>
 
sudo /etc/init.d/bluetooth restart
 
  </nowiki></pre>
 
When you do this, an informational bubble will appear in your task bar saying '''<hostname>-0 Device has been made connectable'''
 
E.g.: If your PC's name is ''gordon'', the message would say '''gordon-0 Device has been made connectable'''
 
<ol><li>Turn on your Bluetooth headset, but don't go into pairing mode just yet</li></ol>
 
 
10. Scan for Bluetooth devices by typing the following into a terminal:
 
 
<pre><nowiki>
 
<pre><nowiki>
 
hcitool scan
 
hcitool scan
 
   </nowiki></pre>
 
   </nowiki></pre>
Your PC will now scan for local Bluetooth devices and your headset should appear in the resulting list after a few seconds (along with anyone's Bluetooth-enabled mobile phones that are in range).  
+
Your PC will now scan for local Bluetooth devices and your headset should appear in the resulting list after a few seconds (along with any other Bluetooth-enabled devices that are in range).
 
The output will look something like:
 
The output will look something like:
 
<pre><nowiki>
 
<pre><nowiki>
第62行: 第28行:
 
00:33:44:DD:EE:FF BT81
 
00:33:44:DD:EE:FF BT81
 
   </nowiki></pre>
 
   </nowiki></pre>
In this example, my PC has found my Nokia mobile phone and my Bluetooth headset and shown me the MAC addresses for both of them.
+
In this example, hcitool has found a Nokia mobile phone and a Bluetooth headset and is displaying the MAC addresses for both of them.
'''NOTE:''' If your headset does ''NOT'' appear, you probably already have it paired with something else, like your mobile phone. In this case, switch the headset to pairing mode and then run the scan again.
+
'''NOTE:''' If your headset does not appear you probably already have it paired with something else, like your mobile phone. In that case switch the headset to pairing mode and then run the scan again.
11. Copy the MAC address of the headset. Then type into a Terminal window:
+
<ol><li>Highlight and copy the MAC address of your headset.
 +
</li><li>Then type in the following:</li></ol>
 +
 
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo gedit ~/.asoundrc
 
sudo gedit ~/.asoundrc
 
   </nowiki></pre>
 
   </nowiki></pre>
 
Note the period before ''asoundrc''. This will create a new hidden text file called .asoundrc in the root of your Home directory and open GEdit so you can add to it. The file is hidden because of the leading period.
 
Note the period before ''asoundrc''. This will create a new hidden text file called .asoundrc in the root of your Home directory and open GEdit so you can add to it. The file is hidden because of the leading period.
12. In the text editor, type in the following, replacing the MAC address with the one you copied earlier:
+
<ol><li>In the text editor, type in the following, replacing the MAC address with the one you copied earlier:</li></ol>
 +
 
 
<pre><nowiki>
 
<pre><nowiki>
pcm.bluetooth {
+
pcm.btheadset {
 
type bluetooth
 
type bluetooth
 
device 00:33:44:DD:EE:FF
 
device 00:33:44:DD:EE:FF
第77行: 第46行:
 
}
 
}
 
   </nowiki></pre>
 
   </nowiki></pre>
13. Save and exit
+
10. Save the file and exit GEdit
14. Enable sound drivers by typing the following into a terminal:  
+
11. Enable sound drivers by typing the following into a terminal:  
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo hciconfig hci0 voice 0x0060
 
sudo hciconfig hci0 voice 0x0060
sudo modprobe snd_bt_sco
 
sudo modprobe sco
 
 
   </nowiki></pre>
 
   </nowiki></pre>
This will enable sound on your adapter and load the modules necessary to carry bluetooth audio. Note that the two modprobe lines will only enable Bluetooth audio temporarily until you reboot. If you would like to load the drivers automatically on each boot, only add the two modprobe lines above to the end of the /etc/modules file (sudo gedit /etc/modules).
+
This will enable your Bluetooth adapter to carry Bluetooth audio.
Save and exit.
+
12. Now we need to tell PulseAudio that your Bluetooth headset exists:
15. Now we need to tell PulseAudio that your Bluetooth headset exists by running the following commands in a terminal:
+
 
<pre><nowiki>
 
<pre><nowiki>
pactl load-module module-alsa-sink device=bluetooth
+
pactl load-module module-alsa-sink device=btheadset
pactl load-module module-alsa-source device=bluetooth
+
pactl load-module module-alsa-source device=btheadset
 
   </nowiki></pre>
 
   </nowiki></pre>
This is only temporary. Make an executable script to run just after you pair your Bluetooth headset by copying the previous commands into a text file and saving it with executable permissions.
+
'''Note:''' This enables your Bluetooth headset for PulseAudio only temporarily. When you reboot, the PulseAudio configuration for Bluetooth will be lost. For future convenience, create a bash script with the above commands in it and create a launcher on your desktop to run the commands when you double-click on the launcher icon.
Right mouse click on the Bluetooth icon in your system tray and choose '''Preferences''', select the '''Services''' tab and ensure '''Audio Service''' is enabled. If not, check the box and then close the window.
+
Due to needing to have the headset paired ''BEFORE'' you run these commands, you can ''NOT'' have these commands run automatically during system startup. It will cause PulseAudio to fail.
[[UbuntuHelp:BluetoothPulseaudioTroubleshooting|BluetoothPulseaudioTroubleshooting]]
+
'''Caution:''' The second ''pactl'' command may cause unusual undesired system behaviour. Since the second command only exists to setup the microphone on your headset, if you do not have one or don't intend to use the microphone, you may omit this line.
16. Check soundcards by typing the following into a terminal:
+
13. Once pairing has completed, we can now test to see if we can send audio to the headset. In your terminal, type in the following:
 
<pre><nowiki>
 
<pre><nowiki>
sudo cat /proc/asound/cards
+
$ aplay -D btheadset -f s16_le /usr/share/sounds/ubuntu/stereo/dialog-question.wav
 
   </nowiki></pre>
 
   </nowiki></pre>
You should see similar output:
+
For Ubuntu 9.10 Karmic Koala use this:
 
<pre><nowiki>
 
<pre><nowiki>
0 [I82801DBICH4  ]: ICH4 - Intel 82801DB-ICH4
+
$ aplay -D btheadset -f s16_le /usr/share/sounds/alsa/Front_Center.wav
 
+
                        Intel 82801DB-ICH4 with STAC9750,51 at irq 5
+
 
+
1 [Headset        ]: Bluetooth SCO - BT Headset
+
 
+
                        BT Headset 1
+
 
+
 
   </nowiki></pre>
 
   </nowiki></pre>
This shows us that the system is ready to use the Bluetooth headset as device 1 (but we haven't paired it yet, so technically it won't be able to use it just yet).
+
This will attempt direct communication with your headset. Within a second or so you should suddenly hear the familiar Ubuntu "login ready" drum sound play through your headset! If you didn't hear it first time try the command a second time as there may be a delay between "activating" your headset and playing sound.
17. Switch your headset into pairing mode (refer to your headset's manual)
+
Unfortunately, only aplay will play anything through your headset at the moment. All other sounds such as from rhythmbox or totem are still coming through your speakers. Unless the application in question can redirect audio to another detected device it will always play through the standard-out.
Use this command to force pairing;
+
To fix this we need to make use of the PulseAudio Server which can redirect all output to another device.
 +
The PulseAudio Server is already installed by default in Jaunty, so we just need to install some tools to manipulate it.
 +
14. Go back to your terminal and type in the following:
 
<pre><nowiki>
 
<pre><nowiki>
gconftool -t string -s /system/gstreamer/0.10/default/musicaudiosink "alsasink device=bluetooth"
+
$ sudo apt-get install paprefs paman padevchooser
 
   </nowiki></pre>
 
   </nowiki></pre>
You will need to enter the code (0000) twice.
+
This will install the PulseAudio Preferences app, the PulseAudio Manager app and the PulseAudio Device Chooser app.
Check for bonded devices in the bluetooth applet preferences.
+
15. Once installed open the PulseAudio Device Chooser by going to '''Applications | Sound & Video | PulseAudio Device Chooser'''.  This will add a black microphone jack icon to your system tray.
Use this to repair your audio;
+
16. Open the PulseAudio Manager by left-clicking on the jack icon and choosing '''Manager.'''
 +
17. If not already connected, click on the '''Connect''' button to connect to your local PulseAudio server. When connected, you will see details about it listed.
 +
18. Click the '''Devices''' tab and under '''Sinks''' you should see an entry for ''alsa_output.btheadset''. This is picked up directly from your .asoundrc file.
 +
19. Now go to the Sample Cache tab. You are shown a list of sounds. Choose a WAV file from this list (it won't play any other format). At the bottom is a '''Playback on''' drop-down. Choose ''alsa_output.btheadset'' from this list and click on the Play button. You should hear the Ubuntu login sound through your headset. This proves to us that PulseAudio can play through your Bluetooth headset (but this is NOT the redirection - this is just a test).
 +
20. Close the PulseAudio Manager
 +
21. Left-click on the mic jack icon in your system tray.
 +
22. Go to '''Default Sink''' and then choose '''Other''' from the sub-menu. In the new window that opens type in:
 
<pre><nowiki>
 
<pre><nowiki>
gconftool -t string -s /system/gstreamer/0.10/default/musicaudiosink "autoaudiosink"
+
alsa_output.btheadset
 
   </nowiki></pre>
 
   </nowiki></pre>
18. Play a test sound by typing the following into a terminal:
+
Click OK
 +
23. Test the redirection by playing an audio or video file. You should now hear sound through your Bluetooth headset.
 +
'''NOTE:''' Existing audio streams at the time of changing the sink will continue to play through whatever they were playing through until stopped and started again.
 +
24. To switch back to your speakers simply click on the mic jack icon, in your system tray, choose '''Default Sink''' and then choose '''Default''' from the sub-menu. The next audio stream played will go back through your speakers.
 +
25. To make the PulseAudio Device Chooser start automatically on startup, click on the mic jack icon again, choose Preferences from the menu and then click on ''Start applet on Session Login'' in the window.
 +
== Known Issues ==
 +
* This does not work with Skype, despite the "btheadset" device being listed as a Sound Device option within Skype. You will get errors when it tries to playback or record audio via the headset and it will in fact kill the PulseAudio server forcing you to restart PulseAudio or restart Ubuntu to get it running again.
 +
* You cannot have your headset auto-pair and be auto-configured with PulseAudio upon startup (yet?). You will need to pair first, then run the two "pactl" commands in step 10 manually or via a script launcher. You cannot have these commands auto-run on startup or PulseAudio will hang or crash (because the pairing with your headset has not been established yet).
 +
* The Sound Recorder is unable to lock onto the headset for recording audio (in fact, it goes nuts when trying to record).
 +
== Possible autorun script ==
 +
Create a file called autorun_bt.headset:
 
<pre><nowiki>
 
<pre><nowiki>
aplay -D bluetooth -f s16_le /usr/share/sounds/login.wav
+
gedit autorun_bt.headset
 
   </nowiki></pre>
 
   </nowiki></pre>
This will attempt direct communication with your headset and you should hear the familiar Ubuntu login sound play through your headset.
+
Put the following into the file:
Unfortunately only aplay will play anything through your headset. All other sounds are still coming through your speakers. Unless the application in question can redirect audio to another detected device, it will always play through the standard-out, so applications such as Totem and Rhythmbox will still output via your speakers and not give a hoot about your Bluetooth headset.
+
To fix this, we need to make use of the PulseAudio Server which can redirect output to another device.
+
The PulseAudio Server is already installed by default in Ubuntu Hardy, so we just need to install some tools to manipulate it.
+
19. Install new PulseAudio-related software by typing the following in a terminal:  
+
 
<pre><nowiki>
 
<pre><nowiki>
sudo apt-get install paprefs paman padevchooser
+
echo "Enable sound drivers by typing the following into a terminal"
 +
clear
 +
gksudo hciconfig hci0 voice 0x0060
 +
sleep 1
 +
 
 +
echo "Now we need to tell PulseAudio that your Bluetooth headset exists"
 +
pactl load-module module-alsa-sink device=btheadset
 +
sleep 8
 +
pactl load-module module-alsa-source device=btheadset
 +
sleep 2
 +
 
 +
echo "Ready"
 +
sleep 2
 
   </nowiki></pre>
 
   </nowiki></pre>
20. Switch to PulseAudio by going into '''System | Preferences | Sound'''. Go into the '''Devices''' tab and change the ''Sound playback'' option for everything from ''Autodetect'' to ''PulseAudio Sound Server''.
+
Save the file and exit GEdit
Close
+
Type the following to make the file executable:
21. Test the PulseAudio sound by playing an MP3 or video or anything. This confirms that PulseAudio is working in general.
+
22. Open the PulseAudio Device Chooser by going to '''Applications | Sound & Video | PulseAudio Device Chooser'''.  This will add a black microphone jack icon to your system tray
+
23. Open the PulseAudio Manager by left-clicking on the jack icon and choosing '''Manager.''' If not already connected, click on the '''Connect''' button.
+
24. Check the '''Devices''' tab and under '''Sinks''' you should see an entry for '''alsa_output.bluetoot'''. This is picked up directly from your .asoundrc file. Now go to the Sample Cache tab. At the bottom is a '''Playback on''' drop-down. Choose '''Bluetooth''' from this list and click on the Play button. You should hear the Ubuntu login sound through your speakers. This proves to us that PulseAudio can play through your Bluetooth headset (but this is NOT the redirection - this is just a test)
+
25. Close the PulseAudio Manager
+
26. Do another left-click on the mic jack icon in your system tray and go to '''Default Sink''' and then choose '''Other''' from the sub-menu. In the new window that opens type in:
+
 
<pre><nowiki>
 
<pre><nowiki>
alsa_output.bluetooth
+
chmod a+x autorun_bt.headset
 
   </nowiki></pre>
 
   </nowiki></pre>
Click OK
+
Double click on the file.
27. Test the redirection by playing an MP3 or video or anything. You should now hear sound from your Bluetooth headset.
+
Alternatively, run the script from a terminal:
28. Switch back to your speakers by left-clicking on the mic jack icon in your system tray and go to '''Default Sink''' and then choose '''Default'''
+
<pre><nowiki>
 +
./autorun_bt.headset
 +
  </nowiki></pre>
 +
The script do a "sleep" or delay between the "pactl" instructions, due to the fact that the audio buffer may be working and we need to delay this. PulseAudio will crash if you run the second instruction too quickly, requiring you to kill it to start again.
 +
Instructions 21-25 are not automated, you will need to set up your headset as the default sink every time you re-connect your Bluetooth headset.
 
----
 
----
[[category:CategoryBluetooth]]  
+
[[category:CategoryBluetooth]]
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2010年5月19日 (三) 21:45的最新版本

Purpose

This guide should help you redirect music, audio and media players to your Bluetooth headset. To make this work properly all audio will have to be redirected through the PulseAudio Server Thanks to HyRax1 on the Overclockers forum.

Prerequisites

  • Bluetooth 1.2 compliant (or better) adapter to your PC. This can be in-built, such as on a modern notebook PC, or a USB dongle. You will NOT have success with Bluetooth adapters that are only compliant with the 1.0 or 1.1 specification.
  • Ubuntu Jaunty 9.04.
  • Internet access or other such access to the Ubuntu repositories to install extra software from.
  • Suitable Bluetooth headset (before purchasing please research your choice, to ensure that it is indeed supported and works in Ubuntu)

Instructions

  1. Plug in or enable your Bluetooth adapter. Your Bluetooth adapter will be automatically detected and drivers loaded - there is nothing for you to do manually here.
  2. Turn on your Bluetooth headset.
  3. Switch your headset into pairing mode (refer to your headset's manual).
  4. While the headset is in pairing mode, left click the Bluetooth icon in your system tray and choose Setup new device from the menu. Follow the wizard prompts to seek out and pair your headset.
  5. Once paried, open a terminal, and type in the following:
hcitool scan
  

Your PC will now scan for local Bluetooth devices and your headset should appear in the resulting list after a few seconds (along with any other Bluetooth-enabled devices that are in range). The output will look something like:

$ hcitool scan
Scanning ...
	00:11:22:AA:BB:CC	Nokia N95
	00:33:44:DD:EE:FF	BT81
  

In this example, hcitool has found a Nokia mobile phone and a Bluetooth headset and is displaying the MAC addresses for both of them. NOTE: If your headset does not appear you probably already have it paired with something else, like your mobile phone. In that case switch the headset to pairing mode and then run the scan again.

  1. Highlight and copy the MAC address of your headset.
  2. Then type in the following:
sudo gedit ~/.asoundrc
  

Note the period before asoundrc. This will create a new hidden text file called .asoundrc in the root of your Home directory and open GEdit so you can add to it. The file is hidden because of the leading period.

  1. In the text editor, type in the following, replacing the MAC address with the one you copied earlier:
pcm.btheadset {
	type bluetooth
	device 00:33:44:DD:EE:FF
	profile “auto”
}
  

10. Save the file and exit GEdit 11. Enable sound drivers by typing the following into a terminal:

sudo hciconfig hci0 voice 0x0060
  

This will enable your Bluetooth adapter to carry Bluetooth audio. 12. Now we need to tell PulseAudio that your Bluetooth headset exists:

pactl load-module module-alsa-sink device=btheadset
pactl load-module module-alsa-source device=btheadset
  

Note: This enables your Bluetooth headset for PulseAudio only temporarily. When you reboot, the PulseAudio configuration for Bluetooth will be lost. For future convenience, create a bash script with the above commands in it and create a launcher on your desktop to run the commands when you double-click on the launcher icon. Due to needing to have the headset paired BEFORE you run these commands, you can NOT have these commands run automatically during system startup. It will cause PulseAudio to fail. Caution: The second pactl command may cause unusual undesired system behaviour. Since the second command only exists to setup the microphone on your headset, if you do not have one or don't intend to use the microphone, you may omit this line. 13. Once pairing has completed, we can now test to see if we can send audio to the headset. In your terminal, type in the following:

$ aplay -D btheadset -f s16_le /usr/share/sounds/ubuntu/stereo/dialog-question.wav
  

For Ubuntu 9.10 Karmic Koala use this:

$ aplay -D btheadset -f s16_le /usr/share/sounds/alsa/Front_Center.wav
  

This will attempt direct communication with your headset. Within a second or so you should suddenly hear the familiar Ubuntu "login ready" drum sound play through your headset! If you didn't hear it first time try the command a second time as there may be a delay between "activating" your headset and playing sound. Unfortunately, only aplay will play anything through your headset at the moment. All other sounds such as from rhythmbox or totem are still coming through your speakers. Unless the application in question can redirect audio to another detected device it will always play through the standard-out. To fix this we need to make use of the PulseAudio Server which can redirect all output to another device. The PulseAudio Server is already installed by default in Jaunty, so we just need to install some tools to manipulate it. 14. Go back to your terminal and type in the following:

$ sudo apt-get install paprefs paman padevchooser
  

This will install the PulseAudio Preferences app, the PulseAudio Manager app and the PulseAudio Device Chooser app. 15. Once installed open the PulseAudio Device Chooser by going to Applications | Sound & Video | PulseAudio Device Chooser. This will add a black microphone jack icon to your system tray. 16. Open the PulseAudio Manager by left-clicking on the jack icon and choosing Manager. 17. If not already connected, click on the Connect button to connect to your local PulseAudio server. When connected, you will see details about it listed. 18. Click the Devices tab and under Sinks you should see an entry for alsa_output.btheadset. This is picked up directly from your .asoundrc file. 19. Now go to the Sample Cache tab. You are shown a list of sounds. Choose a WAV file from this list (it won't play any other format). At the bottom is a Playback on drop-down. Choose alsa_output.btheadset from this list and click on the Play button. You should hear the Ubuntu login sound through your headset. This proves to us that PulseAudio can play through your Bluetooth headset (but this is NOT the redirection - this is just a test). 20. Close the PulseAudio Manager 21. Left-click on the mic jack icon in your system tray. 22. Go to Default Sink and then choose Other from the sub-menu. In the new window that opens type in:

alsa_output.btheadset
  

Click OK 23. Test the redirection by playing an audio or video file. You should now hear sound through your Bluetooth headset. NOTE: Existing audio streams at the time of changing the sink will continue to play through whatever they were playing through until stopped and started again. 24. To switch back to your speakers simply click on the mic jack icon, in your system tray, choose Default Sink and then choose Default from the sub-menu. The next audio stream played will go back through your speakers. 25. To make the PulseAudio Device Chooser start automatically on startup, click on the mic jack icon again, choose Preferences from the menu and then click on Start applet on Session Login in the window.

Known Issues

  • This does not work with Skype, despite the "btheadset" device being listed as a Sound Device option within Skype. You will get errors when it tries to playback or record audio via the headset and it will in fact kill the PulseAudio server forcing you to restart PulseAudio or restart Ubuntu to get it running again.
  • You cannot have your headset auto-pair and be auto-configured with PulseAudio upon startup (yet?). You will need to pair first, then run the two "pactl" commands in step 10 manually or via a script launcher. You cannot have these commands auto-run on startup or PulseAudio will hang or crash (because the pairing with your headset has not been established yet).
  • The Sound Recorder is unable to lock onto the headset for recording audio (in fact, it goes nuts when trying to record).

Possible autorun script

Create a file called autorun_bt.headset:

gedit autorun_bt.headset
  

Put the following into the file:

echo "Enable sound drivers by typing the following into a terminal"
clear
gksudo hciconfig hci0 voice 0x0060
sleep 1

echo "Now we need to tell PulseAudio that your Bluetooth headset exists"
pactl load-module module-alsa-sink device=btheadset
sleep 8
pactl load-module module-alsa-source device=btheadset
sleep 2

echo "Ready"
sleep 2
  

Save the file and exit GEdit Type the following to make the file executable:

chmod a+x autorun_bt.headset
  

Double click on the file. Alternatively, run the script from a terminal:

./autorun_bt.headset
  

The script do a "sleep" or delay between the "pactl" instructions, due to the fact that the audio buffer may be working and we need to delay this. PulseAudio will crash if you run the second instruction too quickly, requiring you to kill it to start again. Instructions 21-25 are not automated, you will need to set up your headset as the default sink every time you re-connect your Bluetooth headset.