Thursday 26 July 2012

Bluetooth headphones in linux

I obtained a relatively cheap pair of 'laser' bluetooth headphones today. It's lightweight, colorful, has a built in mic for calls and claims to have up to 10 hours of play time. But best of all it accomplishes all this without wires.

Getting this to work with android 2.3 was easy enough. During pairing just hold the power switch for 6 seconds. You hear a cute little tone and off you go.

To get this to work in slackware 13.37 required a little bit more work, but not much.

The steps to make it work were:

1) charge up the headphones until the light turns blue

2) in linux, start bluetoothd:
#/usr/sbin/bluetoothd

3) run blueman-manager
$ blueman-manager

4) make sure the device is on then hit search, if everything is configured okay then the headset device should appear

5) start the pairing process and hold the power switch for 6 seconds

6) after it has successfully paired it may still not be connected, so hit the trust button to trust the device

7) then run the 'Setup' on the device and choose A2DP Sink (Send Audio)

8) right click on the device and the option for 'audio sink' should appear. click on that to enable sending audio to the device. now leave blueman-manager open for the next step...

9) now, as root, edit /etc/asound.conf by adding the lines below. Make sure to substitute the XX:XX.. numbers with the address of the device which is visible in the blueman-manager window.

you may also replace pcm.btheadset with pcm.!default if you wish to make it the default device. alsa will need to be restarted with # /etc/rc.d/rc.alsa restart or similar

# /etc/asound.conf

pcm.btheadset {
   type plug
   slave {
       pcm {
           type bluetooth
           device XX:XX:XX:XX:XX:XX 
           profile "auto"
       }   
   }   
   hint {
       show on
       description "BT Headset"
   }   
}
ctl.btheadset {
  type bluetooth
} 


 
10) Save the file then type $ aplay -L to check the btheadset device is recognized

11) run mplayer or player of your choice with the device set to btheadset..

$ mplayer -ao alsa:device=btheadset ~/miku-hatsune-i-wanna-be-your-world.mp3


You might be wondering how do they sound? To be honest they sound a lot better than what I was expecting.


References:
https://wiki.archlinux.org/index.php/Bluetooth_Headset#Headset_and_Alsa_Devices

7 comments:

  1. I'm old skool, I can't wear those little things so I made my own =)

    Project cost $180 but you can use a cheap pair but money makes a difference.

    http://www.youtube.com/watch?v=NmoH2wDyqvM

    ReplyDelete
  2. Nice headphones coding dear. I suggest you for best Earmuff Headphones go to powermuff.com

    ReplyDelete
  3. Such a good information regarding to Best Bluetooth Headphones for athletes, Best Bluetooth Headset, Bluetooth Headphones, Bluetooth Headset, Bluetooth Earbuds and Bluebuds X. Thanks For sharing with us. .And keep share more blogs for us.

    ReplyDelete
  4. Good to know it !! thanks for sharing it . and also visit Credit Repair in Tacoma

    ReplyDelete
  5. Online shopping for Primed4U at Amazon.com you can get here different mobile accessories. we sale buy iphone cases, buy iphone accessories, mobile accessories, cell phone accessories, wireless headphones and bluetooth headphones.

    ReplyDelete
  6. I recommend a budget bluetooth headphones but has good quality at $29. Anyone can use it for its comfort. It's Bluedio Turbine T2.

    ReplyDelete
  7. Finding a good pair of cheap earbuds has almost become a lost art form. Not everyone has the money or the incentive to go out and spend hundreds of dollars on something that they are only going to use for casual listening or a commute to work.When it comes to convenience nothing beats being able to throw your headphones in your pocket until you need them again. Even the best over-the-ear headphones lack that level of portability. With earbuds, you used to have to sacrifice a great deal of quality if you wanted a pair of earbuds, but that isn’t necessarily the case anymore. So let’s get into it, latestone.com here are some of our top picks for the best ‘buds fifty bucks can buy

    ReplyDelete