I now have stereo bluetooth on my desktop :)

remember my attempt in getting the Sony Ericsson HBH DS 970 to work with my desktop? It was puzzling in February when i first got it, and i gave up trying since then. However since a few days i got a link from thoughtfix, and excitingly got bluetooth stereo working with the n800. yes, i can now start up a music player on the n800, and receive the sound via bluetooth on the DS 970. That is great for me, since i can basically have my handphone paired to the headset, while having the music still sent from the n800 simultaneously. neat.

that brought me to the thought - how about my desktop? has anything changed lately? if it works on the Nokia N800, it should also work on a normal linux installation right? here i went. a night wastedspent. And i got at least a2dp working via bluetooth-alsa.

for you there with a nice bluetooth stereo headset, and wish to use a2dp to stream music from computer to the headset, you can try the following steps. I am using now Ubuntu feisty 7.04, with standard stuffs (i think so). So it should also work for you guys with standard installation.

1. install the right stuffs.
i am a normal user. So i will not compile and do anything manually. That is the reason i went and searched for binaries of bluetooth-alsa. In the project page you only have source, so i went and look for it. The next version of ubuntu already has it in universe, but the the package is not compatible with current ubuntu release (a few dependencies upgrade needed). I do not want to go into gutsy, neither do i want to upgrade packages to testing ones, which might break my beloved working desktop. So, debian repo here i went. 

I learnt something yesterday. If a current package is too new, you can actually went back to previous releases. Sure, somethings might be broken then, but if it works, then at least you don really need to do a dist-upgrade. So i got the bluetooth-alsa package from March. Besides bluetooth-alsa, you need to also download the libsbc0 from debian too. They worked for me, at least. 

if your installation does not have bluez-gnome and other needed bluetooth tools, use apt-get to install them. I did that once dpkg complained about missing packages. i love apt-get and dpkg :)

2. configure a2dp and alsa sound.
assuming you have no problem installing the needed package, you need to now make the right configuration. 2 files are needed at your home directory: .a2dprc and .asoundrc. I got my help and steps from ubuntu forum, so i use the configuration file provided by Roner. However, following are the configuration file for your reference.


.a2dprc

[a2dpd]
rate=44100
sbcbitpool=53
flags=0
enablereversestereo=1
enableautoconnect=1
timeout=2000
cmdplay=xmms --play
cmdpause=xmms --pause
cmdprev=xmms --rew
cmdnext=xmms --fwd
cmdnew=xmms --play
cmdstop=xmms --stop
enableavrcp=1
enablerereadconfig=1
enabledebug=1
flags=0
enablestdin=1
enableredirectalsa=0
address=XX:XX:XX:XX:XX:XX
alsaoutput=

the part XX:XX:XX:XX:XX:XX you have to change to your bluetooth headset. use hcitools scan to locate it, when you headset is in pairing mode.


.asoundrc

pcm.headset {
  @args [BDADDR TIMEOUT]
  @args.BDADDR {
    type string
    default "00:13:1B:00:1F:02"
  }
  @args.TIMEOUT {
    type integer
    default 6000
  
}
  type sco
  bdaddr $BDADDR
  timeout $TIMEOUT
}

ctl.headset {
  type sco
}

pcm.a2dpd {
  type a2dpd
}

the 2 files are to be saved under your home directory. 

3. Configuring your favourite music player.
since you saved the trouble to configure all your driver, now you need to configure the music player :) look at the list provided at bluetooth-alsa, and follow their steps. i use vlc mainly, so i just do the quicky change to ~/.vlc/vlcrc. 

4. start streaming!
first start a2dpd as root,

sudo a2dpd

then start your favourite music palyer and it should just work(tm).  

 

Finally....
i also tried to get it working with skype and other software, but i have no time and luck so far. No problem. i still use my handphone, so no rush now. Hope the steps here will be helpful to you guys who wants things working. I believe when the next ubuntu is released, we will have things ready and easier. let's see. 

 

links: 

1. ubuntu forum guide - http://ubuntuforums.org/showthread.php?t=426828
2. bluetooth alsa page - http://bluetooth-alsa.sourceforge.net/

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

fixed ok btsco (or gbtsco)

fixed

ok btsco (or gbtsco) does the job to pair.
I made it work with VLC, but this audio is NOT stereo A2DP, it's SCO (8000khz mono).
Any idea?

mine worked

Hi,

are you having the same setup like me (Ubuntu, SE HBH DS 970 and an al-cheapo bluetooth dongle?). It has to do with your .asoundrc, if i may guess... you should check whether under Sound if you are using ALSA for music and movie.

 

my config

ubuntu feisty, jabra BT320s (A2DP stereo + RC) + cheapo BT dongle.
.asoundrc and .a2dp were copy pasted from your blog.
sound config is ALSA (and not AUTO).
Now I have: "errno=9:Bad file descriptor" when I run a2dp as user.
I ran it as root but now it just show nothing if I run it as root.

run a2dpd as root

i think you should run a2dpd as root. I did that in my test... and you should get verbose output in the console. From there you should see the error message telling you what can be wrong.

i will mail you to follow up. hope this helps.

how did you paired? gbtsco?

how did you paired?
gbtsco? or else?
please copy reply to my email, thanks
J2L

a2dpd working - pairing

I pair my set using "sudo hidd --connect" with the phones in paring mode. Now mind you I use Kubuntu so I have nicer support for Bluetooth stuff in the system tray.

Be sure to put the exact MAC address of the headset into the .a2dpd settings file.. I recommend making several versions depending on use...
i.e. I use one for my xmms another for audacious and yet another for vlc. That way I can remote FFwd or Rev to next song / movie and play/pause without touching the PC. I have the Motorola BT-820 headset.

I also run this as root... Its the only way right at this moment... the command I use is "sudo a2dpd -o -g -v -n -f .a2xmms" for my xmms version.

Word of warning... and irritation: New kernel with Gutsy almost breaks a2dpd... With full debugging on the kernel reports a2dpd_transfer_raw: send (retry), over and over until the ring buffer reports an "is full" and I hear nice skips in the music. Sure its great quality sound, but this is not good. Reportedly this is due to the new kernel timing feature...

I receive phone calls via my cellphone thru this device too with the notifying beep in the left ear... I tap the middle button and connect, then have to hit the play button (sometimes) to get music going, which always seems to start over instead of pausing as it should.... I'm just happy to get something more than the mono I was getting with btsco.

I'll check this posting to see what reply I get (our you can email me - jeff AT mgalug DOT org)

sorry for the late reply

hi jeff,

i have so far not tried anything else... only plan to play with it again when i get Gutsy installed, and that would have been say end of October. have you more luck since your last try with a2dp?

Gutsy

I start my a2dpd as root... always seems I have to do so...
using a line similar to this ... a2dpd -o -b -g -v -n -f /home/userj/.a2xmms

Depends on the media player I use, but I will have several .a2dpdrc files in my ~ I use.

Gutsy has issues with the new kernel and the bluetooth-properties settings have to be modified EVERY time I restart the system to disable the bluetooth audio under services. If not, then I get no sound from my phones, eventhough things are working in xmms.

As for the kernel, the thing reports this junk... ad infinitum
a2dp_transfer_raw: send (retry).
A2DPD[08:00:54.622]: a2dp_transfer_raw: send (retry).

until the ringbuffer becomes full then it might skip a beat or two in the songs... not fun at all... but it is playing tunes still.

will check back with you later...

Jeff

Fix for Audio Service

I soon discovered the fix to disable the Audio.Service...

sudo nano /etc/bluetooth/audio.service

change Autostart=true to Autostart=false

Ctrl+X, Ctrl+Y, enter

enjoy bluetooth stereo again... without the hassle of turning that service off every reboot.

until bluez-utils works, this is what I do...

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.