Easiest way to get Bluetooth Audio I've found so far:
Here's the text (sort of) for each:
- First we need to add the Blueman Project’s PPA to your Ubuntu Jaunty installation. Open a terminal and type in:
$ sudo gedit /etc/apt/sources.list.d/blueman.list
- You will be presented with a blank text editor. Type or copy & paste the following lines in:
deb http://ppa.launchpad.net/blueman/ppa/ubuntu jaunty main
deb-src http://ppa.launchpad.net/blueman/ppa/ubuntu jaunty main
- Save your changes and exit the editor.
- Now update your package lists with:
$ sudo apt-get update
- At the end you will see a NO_PUBKEY error because your setup does not yet have the GPG key for the Blueman repository to authenticate the packages with. To fix this, import the key with:
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6B15AB91951DC1E2
- Update your package lists again as per Step 4 and you should find the NO_PUBKEY error is gone now.
- By now your system is probably prompting you that there are updates to the Bluetooth stack available to install. We may as well stay at the terminal and do the updates there:
$ sudo apt-get upgrade
- Once that completes, the Bluetooth stack is now up to date, but we now need to install the Blueman applet to replace the Gnome version of it:
$ sudo apt-get install blueman
(this will automatically uninstall the bluez-gnome package as we don’t want it anymore)
- Once that completes, logout and log back in again so that the new applet loads up to replace the old one.
- Fire up/install Ubuntu as normal.
- 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.
- Turn on your Bluetooth headset.
- Switch your headset into pairing mode (refer to your headset's manual).
- 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.
- Once paried, open a terminal, and type in the following:Code:
$ hcitool scanCode:
$ hcitool scan
00:11:22:AA:BB:CC Nokia N95
- Highlight and copy the MAC address of the headset to the clipboard using your mouse and CTRL + SHIFT + C. In this example my headset's MAC address is "00 : 33 : 44 : DD : EE : FF". Yours will be different - copy YOUR address, not this example's address.
- Now type in:Code:
sudo gedit ~/.asoundrc
- In the text editor, type in the following, replacing the MAC address in the example with the one you copied earlier from YOUR output (paste with CTRL + V):Code:
- Save and exit.
- Now type in:Code:
$ sudo hciconfig hci0 voice 0x0060
- Now we need to tell PulseAudio that your Bluetooth headset exists:Code:
$ pactl load-module module-alsa-sink device=btheadset
$ pactl load-module module-alsa-source device=btheadset
- 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:Code:
$ aplay -D btheadset -f s16_le /usr/share/sounds/ubuntu/stereo/dialog-question.wav
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 Jaunty, so we just need to install some tools to manipulate it. Go back to your terminal and type in the following:Code:
$ sudo apt-get install paprefs paman padevchooser
- Once installed, go to Applications->Sound & Video->PulseAudio Device Chooser. This will add a black microphone jack icon to your system tray.
- Do a left-click on the jack icon and a menu appears. In this menu, choose "Manager". A new window appears.
- If it's not already connected, click on the "Connect" button to connect to your local PulseAudio server. When connected, you will see details about it listed.
- Click on the Devices tab. Under "Sinks" you should see an entry for "alsa_output.btheadset". This is picked up directly from your .asoundrc file.
- 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 ready" 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).
- Close the PulseAudio Manager.
- Do another left-click on the mic jack icon in your system tray.
- Go to "Default Sink" and then choose "Other" from the sub-menu. A window appears.
- In this window, type in "alsa_output.btheadset" and click OK.
- Play a sound from somewhere, eg: MP3 or movie in Totem. You should now hear your audio coming 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.
- To switch back to your speakers, simply click on the mic jack icon again, choose "Default Sink" and choose "Default" from the sub-menu. The next audio stream played will go back through your speakers.
- 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.
- 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 your PC to get it running again. I have not figured this one out yet.
- 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. Before you say "can't I put those commands in startup?", 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).
- The second "pactl" command in Step 12 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.