Skip to main content

More Bluetooth Woes in Jaunty Jackalope

I'm adding this to my list of bugs I hope they fix soon.

Easiest way to get Bluetooth Audio I've found so far:

1. Follow these instructions up to step 9.
2. Follow these instructions after that.

Here's the text (sort of) for each:

#1:

  1. 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
  2. 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
  3. Save your changes and exit the editor.

  4. Now update your package lists with:
    $ sudo apt-get update
  5. 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
  6. Update your package lists again as per Step 4 and you should find the NO_PUBKEY error is gone now.

  7. 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
  8. 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)

  9. Once that completes, logout and log back in again so that the new applet loads up to replace the old one.

#2

  1. Fire up/install Ubuntu as normal.
  2. 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.
  3. Turn on your Bluetooth headset.
  4. Switch your headset into pairing mode (refer to your headset's manual).
  5. 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.
  6. Once paried, open a terminal, and type in the following:
    Code:
    $ 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 anyone's Bluetooth-enabled mobile phones that are in range). The output will look something like:
    Code:
    $ hcitool scan
    Scanning ...
    00:11:22:AA:BB:CC Nokia N95
    00:33:44:DD:EE:FF BT81
    $
    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.

  7. 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.
  8. Now type in:
    Code:
    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.

  9. 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:
    pcm.btheadset {
    type bluetooth
    device 00:33:44:DD:EE:FF
    profile "auto"
    }
  10. Save and exit.
  11. Now type in:
    Code:
    $ 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:
    Code:
    $ pactl load-module module-alsa-sink device=btheadset
    $ pactl load-module module-alsa-source device=btheadset
    Note that 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 cannot have these commands run automatically during system startup. It will cause PulseAudio to fail.

  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:
    Code:
    $ aplay -D btheadset -f s16_le /usr/share/sounds/ubuntu/stereo/dialog-question.wav
    This will attempt direct communication with your headset, and within a second or so, you should suddenly hear the familiar Ubuntu "login ready" drum sound play through your headset! If you didn't head 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. 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.

  14. 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
    This will install the PulseAudio Preferences app, the PulseAudio Manager app and the PulseAudio Device Chooser app.

  15. Once installed, go to Applications->Sound & Video->PulseAudio Device Chooser. This will add a black microphone jack icon to your system tray.
  16. Do a left-click on the jack icon and a menu appears. In this menu, choose "Manager". A new window appears.
  17. 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.
  18. 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.
  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 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).
  20. Close the PulseAudio Manager.
  21. Do another left-click on the mic jack icon in your system tray.
  22. Go to "Default Sink" and then choose "Other" from the sub-menu. A window appears.
  23. In this window, type in "alsa_output.btheadset" and click OK.
  24. 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.
  25. 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.
  26. 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.
  27. Enjoy!

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 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.

Comments

Popular posts from this blog

Black Cursors on Win7/2008 R2 Using rdesktop for Ubuntu 10.04

I recently setup a Win 2008 R2 VM and proceeded to remote connect to it from Ubuntu 10.04. Everything worked perfectly except the mouse cursors were black (and some were corrupt). Solution? Use a newer version of rdesktop that doesn't ship with Ubuntu. There is a handy PPA that can be added using the following command: sudo apt-add-repository ppa:ricolai/ppa sudo apt-get update sudo apt-get install rdesktop [UPDATE] It appears ricolai may have removed the package from his PPA. To remedy the situation, I've uploaded the working binaries for x64. Sorry, I don't have the x86 any longer. More information on the bug can be found here: https://bugs.launchpad.net/ubuntu/+source/rdesktop/+bug/385974?comments=all

Getting the Hauppauge WinTV-HVR-2250 to work in Ubuntu 10.04

Really just posting this for my own reference later, but here's the link and the details: Enter this into your Terminal it is the code for the firmware and to install it Code: wget http://www.steventoth.net/linux/hvr22xx/22xxdrv_27086.zip wget http://www.steventoth.net/linux/hvr22xx/HVR-12x0-14x0-17x0_1_25_25271_WHQL.zip wget http://www.steventoth.net/linux/hvr22xx/extract.sh Code: sh extract.sh;sudo cp *fw /lib/firmware you need to install mercurial and build essential for the next steps Code: sudo apt-get install mercurial libncurses5-dev then we need the driver using this command to fetch Code: hg clone http://kernellabs.com/hg/saa7164-stable/ now change to the directory Code: cd saa7164-stable then run make Code: make CONFIG_DVB_FIREDTV:=n that will take some time, go grab a drink and wait it out, when it completes run this command Code: sudo make install wait for that to complete and reboot from the command line Code: sudo reboot Note that an application like TVtime will not

Mounting VMware VMDK Disks in Ubuntu (Linux)

Took me a while to find the info on this, but it's fairly simple once you piece together all the information out there. First off, I'm not converting this to VirtualBox. I'm simply accessing the HD as though it were mounted on my local file system (Ubuntu). The VMDK image is for a WinXP virtual machine. First off, verify you have vmware-mount on your system. Drop to terminal, type "vmware-mount". You should get info regarding usage. If not, you need to install VMware Server or VMware Workstation (it's bundled with them). When prompted during the install, say 'Yes' to installing the additional tools packages. Not sure which one it's in, but it's there. Sorry, perhaps someone else can clarify this point. Next, navigate to the location of your VMDK and type "vmware-mount -p .vmdk". This will show you a list of mount points within the file (first column). Create /mnt/ using "mkdir /mnt/ " Next, type "sudo vmware-m