A2DP (Stereo Bluetooth Headset) on Linux

Note: These instructions will eventually be obsolete. This will not work with Bluez 4 or above, included with Ubuntu 8.10+. PulseAudio is also set to get automatic A2DP configuration through a Google SoC project very soon.

Wires are for suckers. In this day and age, wireless headphones are where it's at. While we may not be able to drop the power cord for the time being, we can at least get rid of annoying, east-to-tangle headphone wires by using a Bluetooth headset.

But no, you say, Bluetooth audio sounds horrible. Well my friend, you were probably using a low-quality profile such as HSP. If you want full-quality stereo profile, you want A2DP.

The first requirement is a Bluetooth adapter on your PC or laptop. The second is a Bluetooth headset that supports the A2DP profile, such as the Jabra BT60s headphones. Most earbud headsets don't support A2DP, so you're out of luck if you own one. Finally, you'll need the BlueZ Utils package installed.

Now we're on to the actual setup. A lot of A2DP tutorials out there require you to install some custom system service or do some weird voodoo dance to get them to work. The reference I have found so far has worked every time for me. Most of this is simplified instructions from the BlueZ wiki, so if you are looking for additional setups I suggest you look there after trying this.

Feeling lazy and want me to do this all for you? Well, today is your lucky day. I've made a custom script that will automatically configure it all for you.

a2dp.sh (1.3 KB, Shell Script)
(Paranoid? View all of the scripts that will be installed.)

Simply run it as a normal user and follow all of the steps:
bash a2dp.sh

It will automatically download the connection script and ALSA configuration file to get the job done. All of the scripts will be installed into ~/.a2dp, with an autostart file in ~/.config/autostart.

After you run it, you probably want to use it with a media player. All you need to do is tell your music/video player to use the "bluetooth" output device. Some players, like Audacious and Amarok, let you specify this in their preferences. GStreamer-based applications, like Banshee and Rhythmbox, rely on GStreamer to output to the right device. To do this, a "toggle" script was included with the script above: ~/.a2dp/toggle.sh. To get the most use out of it, add it to your panel.

In GNOME, right-click a blank space and select Add to Panel, then Custom Application Launcher. Fill it in with the settings below. You must use a full path to the script. To see any dialogs, you must have Zenity. It will work without them, but there will be no notification.

To switch to and back from your Bluetooth headphones and speakers, just give it a click:

(Again, for non-GStreamer apps, this step is not required. Just set the ALSA device to "bluetooth" in the player preferences.)

Fire up your favorite music player and enjoy.

AVRCP (Remote Control)


Some headsets may have control buttons, such as pause, next, and rewind. These may work by default on some desktops, but if it doesn't, there is a good chance you don't have uinput enabled. Open the file /etc/modules with root permissions and add the line with uinput at the end. Save the file and reboot, and AVRCP should work.

Avatar for jacob Jacob Peddicord - http://jacob.peddicord.net/

Jacob is a web developer, student, and programmer from Ohio. He is a staff member at the Ubuntu Forums and is most likely a fanboy of the distribution. He loves to write in code and words, play video games, and rant about topics most would have abandoned long ago. Jacob uses GNOME and is never seen running stable software, much to the demise of his laptop.

Home » Articles »

Discussion: A2DP (Stereo Bluetooth Headset) on Linux

  1. Lukas Stejskal (guest)

    # Posted on 24 January 2008 at 12:12 PM

    Is there any way (im sure there is :) ) how to improve sound quality ??? Please let me know (using my mail :) )



  2. shanks (guest)

    # Posted on 25 January 2008 at 12:37 PM

    I have a headset that needs to be paired using the key 0000 (it's a Kyocera headset if that matters) before pairing can actually complete. How can I modify your scripts to include using the key?



  3. Jacob (guest)

    # Posted on 25 January 2008 at 01:08 PM

    shanks:

    As long as you have some sore of Bluetooth manager installed (ie, bluez-gnome or gnome-bluetooth) the passkey entry will automatically appear the first time you try to play a song.



  4. Andreas (guest)

    # Posted on 26 January 2008 at 05:55 AM

    Thank you, brilliant script. It worked out of the box on my Gutsy installation in combination with the Jabra BT 620s. Is there any way to use the remote control functions? I can't find the "Blue Remote" Plug-in for Rhythmbox.



  5. Jacob (guest)

    # Posted on 26 January 2008 at 08:08 AM

    Andreas:

    The control functions use AVRCP, a profile that isn't yet supported by the bluez-alsa package (or I'm just not looking hard enough).



  6. tom (guest)

    # Posted on 29 January 2008 at 03:11 PM

    One word: thank you. OK, two words.

    I had to manually type "bluetooth" into audacious. (And restart it, but my amd64 build has been having issues that way--not your fault.)



  7. aegis (guest)

    # Posted on 30 January 2008 at 06:29 PM

    Ive installed the application above, everything has installed properly, although when i go to test the bluetooth headset(in sound settings) as i have no other way, it does have a faint hiss sound. But soon after my whole computer crashes.Im running 7.10 Gutsy

    Any advice would appreciated

    Thanks



  8. Pat (guest)

    # Posted on 03 February 2008 at 07:03 PM

    Very nice. I spent all day trying to get this working, and your script worked right away.

    Thank you, and I hope you get visited with appropriate karma.

    Pat



  9. kchaja (guest)

    # Posted on 05 February 2008 at 09:44 AM

    I made little change in your toggle.sh script for mplayer. I use geexbox script mp_set_option and it isn't hard to use it (it use sed with one if). So it is only idea how to make your great script perfect :)



  10. ebex (guest)

    # Posted on 07 February 2008 at 07:34 PM

    This is excellent! I want the last 2 days of my life back. Got my new Insignia NS-BTHDP working in minutes in Gutsy.

    So far I can get the movie and audio players working no problem but I have yet to get the headset to be the default system sounds or even more importantly for me for firefox flash-plugin use the bluetooth... any pointers?



  11. rothgar (guest)

    # Posted on 10 February 2008 at 12:15 PM

    Thank you so much! one step closer to not having to use vista.



  12. # Posted on 10 February 2008 at 12:59 PM

    [...] to Jacob over at FOSSwire I now have my headphones working and a easy way to switch between them and my internal speakers. I [...]



  13. Andrew Webb (guest)

    # Posted on 22 February 2008 at 06:44 PM

    Hi, I've installed the script, but the audio is not being routed to my headphones... what do I do. I'm using ubuntu on an ibm t60



  14. Finnish (guest)

    # Posted on 05 March 2008 at 05:39 PM

    It's working!!! I was previously using Blueman Bluetooth-applet & Audacious-combo. This is working now also with other applications!!! Wuhuu!



  15. Finnish (guest)

    # Posted on 05 March 2008 at 05:46 PM

    Except... When I manyally change next song, it says "xine was unable to initialize any audio drivers."

    And in other occations "audio output unavailable the device is busy"

    Darn, so close...



  16. Zoli (guest)

    # Posted on 07 March 2008 at 03:41 PM

    it's not working for me. I get this error message: 00:16:20:ff:f0:5f Installing .asoundrc Bluetooth device... done. Installing autostart script in ~/.config/autostart... done. Preparing optional GStreamer support...-e done.

    Starting up... Traceback (most recent call last): File "a2dp.py", line 11, in sink.Connect() File "/var/lib/python-support/python2.5/dbus/proxies.py", line 63, in call return self._proxy_method(*args, keywords) File "/var/lib/python-support/python2.5/dbus/proxies.py", line 135, in __call__ keywords) File "/var/lib/python-support/python2.5/dbus/connection.py", line 603, in call_blocking message, timeout) dbus.exceptions.DBusException: org.bluez.audio.Error.Failed: Stream setup failed All set up! You will need to log out for the changes to take effect. -e Trust me, it won't work unless you do.

    Thanks for reading FOSSwire!

    Any ideas?

    <em>[Try installing bluetooth-alsa. -Jacob]</em>



  17. Naresh (guest)

    # Posted on 08 March 2008 at 04:22 PM

    awesome. your script is working perfectly. I'd faced the same error in comment #16, but i resolved it by starting bluetooth service in Fedora 8 (/etc/init.d/bluetooth start)



  18. kanigit (guest)

    # Posted on 11 March 2008 at 09:23 AM

    I get the same error as Finnish.... does anyone have any idea why?



  19. Zoli (guest)

    # Posted on 13 March 2008 at 01:41 PM

    Jacob, it was already installed :(

    I checked the system logs. It has problems with authentication. My a2dp device is a Sony Ericsson MBS-100. It DOES support a2dp. so i don't really understand it.

    Time to learn Python :)



  20. Xobb (guest)

    # Posted on 14 March 2008 at 01:53 PM

    That's awesome, dude! It works



  21. Dan Johansson (guest)

    # Posted on 20 March 2008 at 08:57 AM

    It works perfect with my Sonyericsson HBH-DS970. Thanks Jacob



  22. jjordan (guest)

    # Posted on 23 March 2008 at 11:46 PM

    For Lukas Stejskal,

    Install the latest Alsa package. Mine sounded like the headphones were full of mud until I did. Install the whole set not just the driver.

    Jacob,

    Thanks for the script. I just loaded up Gnome after using KDE for years and had no idea how to get Gstreamer to see bluetooth audio.

    Thanks, -j



  23. # Posted on 25 March 2008 at 01:52 PM

    [...] checked out bluetooth-alsa again - came across this site to ease the installation of a2dp (stereo bluetooth headset) on Linux. Worked incredibly well - comes with a nice script to toggle between speaker/headset. VLC &#38; [...]



  24. Alex (guest)

    # Posted on 03 April 2008 at 02:12 PM

    Thanks for these scripts. They work great. I had to change the permissions on the python script, and I added "#!/usr/bin/python" to the top of it, so it could just be called without the python. But that's just me being picky. :)



  25. # Posted on 19 April 2008 at 01:56 PM

    [...] used the code from this blog http://fosswire.com/2008/01/11/a2dp-stereo-linux/ to get it [...]



  26. Ken (guest)

    # Posted on 23 April 2008 at 07:21 PM

    This is great except that I can't figure out how to get audio from the flash plugin in Firefox to send audio to bluetooth. It still uses the Intel soundcard on my laptop. I've tried figuring out how to change my default ALSA device in Gnome, but I'm not sure I'm doing it right. I have the custom playback device selected in Sound playback in the Sound Preferences, but that doesn't seem to have worked. Any thoughts?



  27. varun (guest)

    # Posted on 25 April 2008 at 03:11 AM

    Thanks a ton..:))

    it working superbly.. :)



  28. Max (guest)

    # Posted on 26 April 2008 at 10:46 PM

    I'm having the same problem as Ken above. I can get sound via bluetooth headphones for rhythmbox and totem player. flash videos in firefox still play over my Intel audio card ( Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller) on Dell D620 laptop.

    Also, my pidgin sound alerts no longer work if I'm using bluetooth headphones. If in pidgin, the sound method is "Automatic" and I run the toggle.sh script, sounds stop in pidgin. But, if I set the Sound Method to "ALSA ", in pidgin, sound will play over the internal speakers, and not the bluetooth headphones.



  29. Amit (guest)

    # Posted on 28 April 2008 at 10:01 AM

    Well... why do you have to put '\n' in echo statements ? It won't work... Haven't checked the script if it works. Will let you know once i do. Thx



  30. Erik (guest)

    # Posted on 06 May 2008 at 06:00 AM

    I put the following in my ~/.asoundrc and firefox hangs:

    pcm.!default { type bluetooth device 00:18:E4:0C:4F:29 profile "hifi" }



  31. # Posted on 13 May 2008 at 10:15 AM

    [...] http://fosswire.com/2008/01/11/a2dp-stereo-linux/ [...]



  32. Eric (guest)

    # Posted on 18 May 2008 at 01:57 AM

    Really? Just that easy? Someone should tell Microsoft how it's done. Ubuntu Linux running on my laptop now officially has better hardware support than the OEM installed Vista!



  33. Raymond (guest)

    # Posted on 21 May 2008 at 08:13 PM

    Thanks, worked perfectly on Hardy on my Dell Inspiron 6000 Laptop. Only issue is I have to restart Rhythmbox when switching



  34. Dan (guest)

    # Posted on 22 May 2008 at 04:36 PM

    I have tried at least 5 a2dp tutorials for my Bluetooth Hifi and none have been successful - yours worked first time. Thanks so much!



  35. Romolo (guest)

    # Posted on 23 May 2008 at 02:55 PM

    It's work well on a Dell Inspirion 1525 with headset Dell DH200 and Ubuntu 8.04. Thank you Jacob



  36. Harri (guest)

    # Posted on 25 May 2008 at 06:33 AM

    Didn't work for me. First I had to edit .wgetrc to comment out verbose mode, then I had to install some python-dbus support, and finally a2dp.py died with

    Traceback (most recent call last): File "a2dp.py", line 9, in path = audio.CreateDevice(mac) File "/var/lib/python-support/python2.5/dbus/proxies.py", line 68, in call return self._proxy_method(*args, keywords) File "/var/lib/python-support/python2.5/dbus/proxies.py", line 140, in __call__ keywords) File "/var/lib/python-support/python2.5/dbus/connection.py", line 607, in call_blocking message, timeout) dbus.exceptions.DBusException: org.bluez.Error.ConnectionAttemptFailed: Host is down

    Surely the headset is on. ???



  37. Harri (guest)

    # Posted on 25 May 2008 at 07:23 AM

    PS: Adding the headset address and pin to

    /var/lib/bluetooth//pincodes

    did the trick. See /usr/share/doc/bluez-utils/README.Debian . But I still have to run the a2dp.py script again and again.



  38. Harri (guest)

    # Posted on 25 May 2008 at 07:28 AM

    PPS: The file is

    /var/lib/bluetooth/XX:XX:XX:XX:XX:XX/pincodes .



  39. IcoNyx (guest)

    # Posted on 30 May 2008 at 05:45 AM

    BROKEN!!!

    I ran your script and get this: Getting a2dp.py connection script...Cannot specify -r, -p or -N if -O is given. Usage: wget [OPTION]... [URL]... done.

    I checked your script and it appears you are using some wget options that fail in fedora 9... HELLLP!!!!



  40. Harri (guest)

    # Posted on 02 June 2008 at 10:14 PM

    Maybe it helps if you temporarily rename the .wgetrc file in your $HOME directory?



  41. Raymond (guest)

    # Posted on 04 June 2008 at 06:05 AM

    [SOLVED] dbus.exceptions.DBusException: org.bluez.audio.Error.Failed: Stream setup failed

    I had this problem after an automatic kernel update and trying to reconfigure my headset. I had to delete the bonding with my headset and then rebond and this fixed my problem.



  42. One Elf (guest)

    # Posted on 10 June 2008 at 03:23 AM

    Your are magician :)Thanks



  43. connettg (guest)

    # Posted on 13 June 2008 at 08:56 PM

    I have a Parrot Boombox. Does any one know how to configure it. I have tried the steps above to no avail.



  44. Robert (guest)

    # Posted on 17 June 2008 at 05:22 AM

    Jacob!!!! We need more people like you!!! I spent hours and hours of efforts... well... maybe im exaggerating, but I worked a lot trying to use my hbh-ds970 from sony, and now Ihave this great script doing it so simple... Thnx a lot from Argentina!!!!



  45. bjerngaard (guest)

    # Posted on 20 June 2008 at 09:57 AM

    Brilliant!! Works great on Ubuntu 8.04! I've been fighting a lot with this using earlier Bluez releases. Thanks to the Bluez project for adding a2dp and (finally) some decent documentation. And thanks to Jacob for making it so easy.



  46. helmi03 (guest)

    # Posted on 22 June 2008 at 07:14 AM

    Cool! Works perfectly for my i.Tech BlueBAND R. Playing music using Rhythmbox on Ubuntu Hardy



  47. Shehriar (guest)

    # Posted on 30 June 2008 at 09:56 PM

    As most of the above who've tried, I wasted a lot of time trying to get it to work and then I stumbled upon your post. Worked first time. The rest as they say is history.



  48. fatih (guest)

    # Posted on 19 July 2008 at 11:45 PM

    Your script works great. Thank you! However, what is disappointing is that I can't listen to music over a2dp and at the same time use my bluetooth mouse. The music almost stops - one second of music comes out of the headset about every 15 seconds. On my windows boot, hifi music and mouse work together without any problems. Is this because of the linux drivers?? Has anyone noticed such an interference as well?



  49. Jens (guest)

    # Posted on 25 July 2008 at 09:32 PM

    For Bluetooth Mouse and A2DP support at the same time edit your /etc/bluetooth/hcid.conf:

    Change "lm accept;" to "lm accept,master;" and change "lp rswitch,hold,sniff,park;" to "lp hold,sniff,park;"

    Now it should work. At least for me :-)



  50. Jens (guest)

    # Posted on 27 July 2008 at 12:17 AM

    my fault: "lm accept;" should be changed to "lm master;"

    Cheers



  51. Zach Loeber (guest)

    # Posted on 30 July 2008 at 01:54 PM

    Very well done, thanks for sharing



  52. Tomi (guest)

    # Posted on 07 August 2008 at 05:44 PM

    Works great with my Jabra BT8010! It was all a matter of minutes. I have tried to get it to work yesterday the whole day long! :q After trying it with several guides today i tried it with your script and it works like a charm. I'm using Kubuntu Hardy.

    Thank you very much for this script!!!

    Tomi



  53. MURZEAU (guest)

    # Posted on 09 August 2008 at 02:10 AM

    Hi, I have passed a night in order to find a way for my HBH-DS970. No solution until I found your script. My OS is Ubuntu 8.04. I have just do "sudo bash /Bureau/a2dp.sh". Thank you very much.

    Have a nice days.



  54. Tom Tarrant (guest)

    # Posted on 16 August 2008 at 08:27 AM

    Thanks Jacob, was pulling my hair out trying to get a Tevion BT USB adaptor/Nokia BT-H to work on Hardy.....but they're going great with Rythmbox look forward to trying the other apps out now.



  55. Dave (guest)

    # Posted on 27 August 2008 at 05:41 PM

    Ran the install script with no problems on Ubuntu Hardy 8.04. But when I toggle to bluetooth, Rythmbox won't play at all. If I test the output using the "sound" system tool I get:

    "audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! gconfaudiosink profile=music: Could not open audio device for playback."

    Any ideas? Trying desperately to get my Dell BH200 working!



  56. Oli (guest)

    # Posted on 28 August 2008 at 04:08 PM

    Can you tell me what I am missing with dbus? Thanks. Starting up... Traceback (most recent call last): File "a2dp.py", line 7, in bus_id = manager.ActivateService('audio') File "/usr/lib/python2.5/site-packages/dbus/proxies.py", line 64, in call return self._proxy_method(*args, keywords) File "/usr/lib/python2.5/site-packages/dbus/proxies.py", line 136, in __call__ keywords) File "/usr/lib/python2.5/site-packages/dbus/connection.py", line 607, in call_blocking message, timeout) dbus.exceptions.DBusException: org.bluez.Error.NoSuchService: No such service



  57. jemyzhang (guest)

    # Posted on 01 September 2008 at 02:11 PM

    Thanks for your great luck gift, I will reboot to have a try



  58. Neal (guest)

    # Posted on 06 September 2008 at 01:14 PM

    Thanks for some great scripts. Word of note: If you have OpenSUSE 10.3 or any other distro that uses GConf2 you need to edit the .a2dp/toggle.sh file to use gconftool-2 otherwise it will never switch the output.



  59. Sean (guest)

    # Posted on 07 September 2008 at 10:09 PM

    I've been trying to get my Motorola S9 headset to work with Ubuntu for ages. Thank you so much for sharing this script with us!! It work flawlessly. You kick ass! :D



  60. grant (guest)

    # Posted on 12 September 2008 at 07:17 AM

    Thanks for the script. its great. I am however having trouble with my bt8010. the music starts and then stops after 20 - 30 seconds. Any thoughts? 'm running ubunte eee

    Thanks in advance!



  61. grant (guest)

    # Posted on 15 September 2008 at 04:56 PM

    bump ...

    more info, I'm using the smk nano dongle with edp



  62. Brad Pitcher (guest)

    # Posted on 18 September 2008 at 05:44 PM

    Very very nice script. Thank you. It still works great in Hardy Heron. I just wish I could get it working with Ekiga.



  63. Mohamed Yehiya (guest)

    # Posted on 25 September 2008 at 01:31 AM

    Guys provide any clues on this... I'm stuck up in configuring this bluetooth device.

    =================== We're now going to scan for a bluetooth device. Please put your headset in pairing mode and press Enter.

    Scanning ... 00:1A:7D:0E:55:C2 BSH01 Copy the address of your headphones above and paste it below: 00:1A:7D:0E:55:C2 Installing .asoundrc Bluetooth device... done. Installing autostart script in ~/.config/autostart... done. Preparing optional GStreamer support... done.

    Starting up... Traceback (most recent call last): File "a2dp.py", line 9, in path = audio.CreateDevice(mac) File "/usr/lib/python2.5/site-packages/dbus/proxies.py", line 68, in call return self._proxy_method(*args, keywords) File "/usr/lib/python2.5/site-packages/dbus/proxies.py", line 140, in __call__ keywords) File "/usr/lib/python2.5/site-packages/dbus/connection.py", line 622, in call_blocking message, timeout) dbus.exceptions.DBusException: org.bluez.Error.ConnectionAttemptFailed: Permission denied All set up! You will need to log out for the changes to take effect. Trust me, it won't work unless you do.

    Thanks for reading FOSSwire! [yehiya@yehiya-pc Download]$

    ====================



  64. Mohamed Yehiya (guest)

    # Posted on 25 September 2008 at 01:53 AM

    Guys please help me in sorting out this issue. I even tried executing this script in root also. Still getting the same error

    =========================== Getting a2dp.py connection script... done.

    We're now going to scan for a bluetooth device. Please put your headset in pairing mode and press Enter.

    Scanning ... 00:1A:7D:0E:55:C2 BSH01 Copy the address of your headphones above and paste it below: 00:1A:7D:0E:55:C2 Installing .asoundrc Bluetooth device... done. Installing autostart script in ~/.config/autostart... done. Preparing optional GStreamer support... done.

    Starting up... Traceback (most recent call last): File "a2dp.py", line 9, in path = audio.CreateDevice(mac) File "/usr/lib/python2.5/site-packages/dbus/proxies.py", line 68, in call return self._proxy_method(*args, keywords) File "/usr/lib/python2.5/site-packages/dbus/proxies.py", line 140, in __call__ keywords) File "/usr/lib/python2.5/site-packages/dbus/connection.py", line 622, in call_blocking message, timeout) dbus.exceptions.DBusException: org.bluez.Error.ConnectionAttemptFailed: Permission denied All set up! You will need to log out for the changes to take effect. Trust me, it won't work unless you do.



  65. Michel Jacobs (guest)

    # Posted on 03 October 2008 at 10:06 PM

    Wonderful! Thank you for sharing!



  66. wangyu (guest)

    # Posted on 08 October 2008 at 10:33 AM

    Hello,

    The script works perfectly for almost all my multimedia software, but Skype not. I use Skype very often for my business, but, as I install the script, the Skype block times. And if I open the configure of Skype and click "voice device", It looks like crash for 5 min, and then it can show the detail. And any message will wait 5 min then it can send out.

    Do you have any ideas?



  67. wangyu (guest)

    # Posted on 09 October 2008 at 02:40 AM

    With my check, If my bluetooth headphone close, the skype works wrong. I think the skype will try to send voice to bluetooth, but it can not find it.

    How to avoid of that? I don't want open bluetooth headphone all the time.



  68. wangyu (guest)

    # Posted on 09 October 2008 at 02:43 AM

    And in skype, the voice device set as "default device". I don't know why it check all the voice device.



  69. Abel (guest)

    # Posted on 09 October 2008 at 03:31 PM

    Un millon de gracias!! (A million thanks!!) Run with my nokia-501. Fast and easy. :D



  70. # Posted on 10 October 2008 at 12:08 AM

    [...] Enlace: Fosswire [...]



  71. Freaking Awesome. (guest)

    # Posted on 12 October 2008 at 08:41 PM

    I spent hours trying to figure out use of my Jabra headset in Ubuntu - your script worked immediately. Rhythmbox works perfectly, though I still haven't found where to change to Bluetooth in Amarok.



  72. blastfm (guest)

    # Posted on 15 October 2008 at 06:21 PM

    Great script.. Spent an entire day trying to get my iTech Blueband R to work without success, until I tried this script. I finally got sound out from my headset... Except for 1 problem, the sound comes out "choppy." I'm not sure if its the BT signal problem or anything but playing music or video, sound comes out in bits (1 to 2 seconds intervals) from my headset. Hope anybody help :-)

    Thanks



  73. mb (guest)

    # Posted on 22 October 2008 at 07:35 PM

    Receiving the following error:

    Traceback (most recent call last): File "a2dp.py", line 11, in sink.Connect() File "/var/lib/python-support/python2.5/dbus/proxies.py", line 68, in call return self._proxy_method(*args, keywords) File "/var/lib/python-support/python2.5/dbus/proxies.py", line 140, in __call__ keywords) File "/var/lib/python-support/python2.5/dbus/connection.py", line 607, in call_blocking message, timeout) dbus.exceptions.DBusException: org.bluez.Error.Failed: Stream setup failed

    Any ideas?

    <em>[ Make sure your headphones are on and your system's Bluetooth is enabled. -Jacob ]</em>



  74. Romke van der Meulen (guest)

    # Posted on 23 October 2008 at 11:13 PM

    Thank you so much for an easy and working install!

    The one thing that had me stomped for a short time: after switching from speakers to bluetooth you need to restart rhythmbox before audio is piped to the new sink.



  75. # Posted on 25 October 2008 at 01:32 AM

    [...] Earlier this year, I showed you how to get high-quality A2DP audio streaming to your Bluetooth headphones. And while that method of connecting your headphones to a music player does work fine, it really only works with media players and anything else set up to specifically play to your headset. What if you want to watch a Flash video with A2DP audio? How about play a game of Nexuiz through the headset? Well, with that implementation, you can&#8217;t. [...]



  76. ruX (guest)

    # Posted on 06 November 2008 at 10:09 AM

    Great script! Thanks a lot! There is best sound from BH-501!

    But i can't get skype working..



  77. # Posted on 08 November 2008 at 05:14 PM

    [...] FOSSwire (To get A2DP working). [...]



  78. # Posted on 12 November 2008 at 11:44 PM

    [...] BT3030 as a headset in Ubuntu Linux&nbsp;(8.04) These instructions worked great for me with Audacious on my Ubuntu laptop with built-in bluetooth. I got a new bluetooth headset [...]



  79. Dave Haakenhout (guest)

    # Posted on 25 November 2008 at 07:36 PM

    Hi,

    Is it my stupidy or is the whole api changed in Ubuntu Intrepid, i just can't get you're script working on Intrepid.

    Let me know please what you think of this.

    Thnx in advance,

    Dave

    The Netherlands



  80. Jacob (guest)

    # Posted on 25 November 2008 at 08:11 PM

    Dave:

    Did you read the top of the post? :) The linked article has the details.



  81. Andrew (guest)

    # Posted on 20 December 2008 at 06:06 AM

    Fantastic. Thanks a lot for that. One thing, though: It gives me an error message when it runs the Python script. It doesn't seem to matter, but yeah. I don't recall exactly what it was, but everything now works just fine for me! :D



  82. # Posted on 30 December 2008 at 07:22 PM

    [...] I have successfully gotten my bluetooth headset to work in&#8230; though some modifications to the fosswire script were necessary to do [...]



  83. vivek (guest)

    # Posted on 31 December 2008 at 01:44 PM

    Thank u for making it so easy. one step config! great work



  84. Michael (guest)

    # Posted on 06 January 2009 at 04:32 PM

    I can only get rhythmbox to work.

    How can I send all of my audio to the headphones simply?



  85. Andy Fong (guest)

    # Posted on 11 January 2009 at 02:37 PM

    Someone might fount this useful. I had the same connection problem as some of the users here. None of the solution mentioned worked. I tried putting the pincodes in /var/lib/bluetooth/XX:...../pincodes but it still didn't work. Then I installed gnome-bluetooth. When I run the connection script, the gnome-bluetooth windows pop up and I can enter a passphase there, then the connection script finished with no error.

    Now only if I can get the mic to work too. Thanks for the howto. It's great.



  86. Niall Parker (guest)

    # Posted on 20 January 2009 at 12:55 AM

    Has anyone ever got the microphone part of a headset working ?



  87. Jacob (guest)

    # Posted on 20 January 2009 at 01:01 AM

    Niall:

    That's a different profile called HSP. A2DP does not allow for two-way transmission. You could use HSP for both microphone and audio, but you will notice a significant drop in quality.



  88. Jan (guest)

    # Posted on 23 January 2009 at 08:38 AM

    Thanks a lot, worked almost out of the box on my Ubuntu 8.04 (hardy). The other part is a windows xp box running bluesoleil which is connected to my stereo.

    greetings from germany jan



  89. wickdc (guest)

    # Posted on 25 January 2009 at 03:31 PM

    getting this weird error : using ubuntu 8.10

    any help would be appreciated. thanks

    Installing autostart script in ~/.config/autostart... done. Preparing optional GStreamer support... done.

    Starting up... Traceback (most recent call last): File "a2dp.py", line 7, in bus_id = manager.ActivateService('audio') File "/var/lib/python-support/python2.5/dbus/proxies.py", line 68, in call return self._proxy_method(*args, keywords) File "/var/lib/python-support/python2.5/dbus/proxies.py", line 140, in __call__ keywords) File "/var/lib/python-support/python2.5/dbus/connection.py", line 607, in call_blocking message, timeout) dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method "ActivateService" with signature "s" on interface "org.bluez.Manager" doesn't exist

    All set up! You will need to log out for the changes to take effect. Trust me, it won't work unless you do.

    <em>[ Please read the top of this post. -Jacob ]</em>



  90. Erik (guest)

    # Posted on 10 February 2009 at 10:11 AM

    There is a problem using your script. Please can you help me.

    Installing .asoundrc Bluetooth device... done. Installing autostart script in ~/.config/autostart... done. Preparing optional GStreamer support...-e done.

    Starting up... Traceback (most recent call last): File "a2dp.py", line 7, in bus_id = manager.ActivateService('audio') File "/var/lib/python-support/python2.5/dbus/proxies.py", line 68, in call return self._proxy_method(*args, keywords) File "/var/lib/python-support/python2.5/dbus/proxies.py", line 140, in __call__ keywords) File "/var/lib/python-support/python2.5/dbus/connection.py", line 622, in call_blocking message, timeout) dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method "ActivateService" with signature "s" on interface "org.bluez.Manager" doesn't exist

    All set up! You will need to log out for the changes to take effect. -e Trust me, it won't work unless you do.

    Thanks for reading FOSSwire!

    Thank you. Erik



  91. progreSS (guest)

    # Posted on 19 February 2009 at 02:25 AM

    Installing .asoundrc Bluetooth device... done. Installing autostart script in ~/.config/autostart... done. Preparing optional GStreamer support... done.

    Starting up... Traceback (most recent call last): File "a2dp.py", line 7, in bus_id = manager.ActivateService('audio') File "/var/lib/python-support/python2.5/dbus/proxies.py", line 68, in call return self._proxy_method(*args, keywords) File "/var/lib/python-support/python2.5/dbus/proxies.py", line 140, in __call__ keywords) File "/var/lib/python-support/python2.5/dbus/connection.py", line 607, in call_blocking message, timeout) dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method "ActivateService" with signature "s" on interface "org.bluez.Manager" doesn't exist

    All set up! You will need to log out for the changes to take effect. Trust me, it won't work unless you do.

    Thanks for reading FOSSwire!



  92. thagrasshoppa (guest)

    # Posted on 23 March 2009 at 06:12 PM

    I wanted to take the time to thank you for your script, and the time taken to share it in the true FOSS spirit!

    I ultimately found that I could not use it, but the linked article worked for me all the same, so the result was still positive for me.

    For all those who have the trackback error, try the article link above that looks like this:

    Instructions from BlueZ wiki...this worked for me when the script failed.

    Seems like some issue with dbus under 8.10?

    Tim 'thagrasshoppa' Cusack



  93. Cryingshame (guest)

    # Posted on 29 March 2009 at 07:33 PM

    First of all the script worked awesome under Ubuntu 8.10 had no problems. Thanks for writing the script man, I have been looking for a script like this for ages.

    I did get some errors while running the script simular to the one Erik posted, but still worx fine.

    "If it worx why fix it" lol

    Shot for the script man.



  94. skybinary (guest)

    # Posted on 06 April 2009 at 06:03 PM

    I thought i would add my issues here. Initially i was noob to bluetooth and it took me several days to realize i had to push the answer button on the headset before i could input the key, always a DUH! moment. When i got it connected, i followed 101 instructions from the whole world :O. i could not get sound until i created the .asoundrc file. Now it kinda works, i come home power on my pc, login then 'bleep' connected. I can surf and listen for a few minutes but then out of the bluez it just stops, [[SHRUGS]], i only surfed some web pages, what can it be, its all down hill and i am playing ketcup with what in hell is going on. REBOOT! same thing happens, i can hear web pages for a while then, nuffin. Why do i bother



  95. Jeff (guest)

    # Posted on 16 April 2009 at 04:32 PM

    Can someone tell me what I'm missing? Thanks!

    Starting up... Traceback (most recent call last): File "a2dp.py", line 7, in <module> bus_id = manager.ActivateService('audio') File "/var/lib/python-support/python2.5/dbus/proxies.py", line 68, in call return self._proxy_method(*args, keywords) File "/var/lib/python-support/python2.5/dbus/proxies.py", line 140, in __call__ keywords) File "/var/lib/python-support/python2.5/dbus/connection.py", line 607, in call_blocking message, timeout) dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method "ActivateService" with signature "s" on interface "org.bluez.Manager" doesn't exist

    All set up! You will need to log out for the changes to take effect. Trust me, it won't work unless you do.

    Thanks for reading FOSSwire!



  96. skybinary (guest)

    # Posted on 18 April 2009 at 02:14 AM

    Update! I re-paved a new install of jaunty, i didnt follow a 1001 examples from the whole wide world, all i did was added .asoundrc, now i have ZERO issues :D I swap the comments on the last two lines so pSX will work properly if my headset is missing

    Thanks for the opportunity to share Jacob. .asoundrc pcm.bluetooth_hw { type bluetooth device 00:0D:FD:10:##:## profile "hifi" } pcm.btheadset { type plug slave { pcm "bluetooth_hw" } } pcm.!default { type plug slave { pcm "bluetooth_hw" } }

    pcm.!default { type hw card 0 }



  97. Ajay Kalla (guest)

    # Posted on 07 May 2009 at 03:23 AM

    Preparing optional GStreamer support... done.

    Starting up... Traceback (most recent call last): File "a2dp.py", line 7, in <module> bus_id = manager.ActivateService('audio') File "/usr/lib/python2.5/site-packages/dbus/proxies.py", line 68, in call return self._proxy_method(*args, keywords) File "/usr/lib/python2.5/site-packages/dbus/proxies.py", line 140, in __call__ keywords) File "/usr/lib/python2.5/site-packages/dbus/connection.py", line 630, in call_blocking message, timeout) dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method "ActivateService" with signature "s" on interface "org.bluez.Manager" doesn't exist

    All set up! You will need to log out for the changes to take effect. Trust me, it won't work unless you do.

    Thanks for reading FOSSwire!



  98. Sid (guest)

    # Posted on 18 July 2009 at 08:19 AM

    Pulse audio 0.9.15 and blueman in Jaunty is so much easier now people... There is no spoon.....



  99. aki (guest)

    # Posted on 24 July 2009 at 12:13 PM

    It works Thank you so much!



  100. # Posted on 04 September 2009 at 07:13 PM

    Thanks for the uinput module tip. That was the last bit I need to get my bluetooth stereo headset working in Jaunty with blueman and pulse audio. I hope Karmic betas don't break it again when I try them.



  101. # Posted on 23 September 2009 at 11:39 AM

    hi, i get the following error.. when running: python2.6 a2dp.py

    Traceback (most recent call last): File "a2dp.py", line 7, in <module> bus_id = manager.ActivateService('audio') File "/var/lib/python-support/python2.6/dbus/proxies.py", line 68, in call return self._proxy_method(*args, keywords) File "/var/lib/python-support/python2.6/dbus/proxies.py", line 140, in __call__ keywords) File "/var/lib/python-support/python2.6/dbus/connection.py", line 622, in call_blocking message, timeout) dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method "ActivateService" with signature "s" on interface "org.bluez.Manager" doesn't exist



  102. manish (guest)

    # Posted on 12 August 2010 at 11:03 AM

    Hi please help me it was working fine with ubuntu 9.04, but not working in ubuntu 10.04

    got below Error :

    We're now going to scan for a bluetooth device. Please put your headset in pairing mode and press Enter.

    Scanning ... 00:25:E5:B8:DF:93 LG KP500 00:19:7E:ED:60:3A SHASHI 75:DB:E1:9F:66:01 BY300 00:16:44:FD:A0:AA DELL BH200 Copy the address of your headphones above and paste it below: 00:16:44:FD:A0:AA Installing .asoundrc Bluetooth device... done. Installing autostart script in ~/.config/autostart... done. Preparing optional GStreamer support... done.

    Starting up... Traceback (most recent call last): File "a2dp.py", line 7, in <module> bus_id = manager.ActivateService('audio') File "/usr/lib/pymodules/python2.6/dbus/proxies.py", line 68, in call return self._proxy_method(*args, keywords) File "/usr/lib/pymodules/python2.6/dbus/proxies.py", line 140, in __call__ keywords) File "/usr/lib/pymodules/python2.6/dbus/connection.py", line 620, in call_blocking message, timeout) dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method "ActivateService" with signature "s" on interface "org.bluez.Manager" doesn't exist

    All set up! You will need to log out for the changes to take effect. Trust me, it won't work unless you do.

    Thanks for reading FOSSwire!



  103. Name (guest)

    # Posted on 01 January 2011 at 01:06 AM

    Unknown message



  104. usr (guest)

    # Posted on 08 May 2011 at 04:58 PM

    It works Thank you so much! :)



Home » Articles » A2DP (Stereo Bluetooth Headset) on Linux

Sign In