Author Topic: Bluetooth Audio  (Read 7313 times)

Da_Blitz

  • Hero Member
  • *****
  • Posts: 1579
    • View Profile
    • http://www.pocketnix.org
Bluetooth Audio
« on: August 10, 2006, 07:46:02 am »
Well after much fiddling i managed to get bluetooth alsa to work,

what does this mean?, well it means that any program running under linux with sound support can send its audio to bluetooth headphones with 48000hz stereo sound (aka CD quality or slightly better than)

i havent tried it on the Z yet however it should involve a compile and i am busy compiling a compiler

anyway to compile it you have to download the btsco package off of sf.net. i recomend you get the cvs version as that is what i am using. then go into the btsco/bt dirictory and read the BUILD file

it will instruct you to check out another project from sf.net with CVS but keep in mind that the sf CVS server address changed recently so it is easier to go to the project site and click CVS to get the new web address

once that is done you need to add a entry to your .asoundrc file
Code: [Select]
pcm.bluetooth {
        type a2dp
        bdaddr "00:00:00:00:00:00" <<< put the device mac address here
}

to find the mac address put your headphones in pair mode and do a "hcitool scan" it should spit out the correct address to put in the config file

next type
Code: [Select]
hcitool cc
now if everything is working well and your distro maintainer set it up properly you will be prompted for the pin number of the device, in 99.999999999999999999999999999% of cases its 1234 or 0000

if you are not prompted for a key then i recomend that you edit /etc/bluetooth/pin and replace the data in there with 1234 then open /etc/bluetooth/hcid.conf and change the pinhelper line to /etc/bluetooth/pinhelper.sh. open this file and make it look like this

Code: [Select]
#!/bin/sh

echo PIN:$(cat /etc/bluetooth/pin)

this will use the pin that remote devices must enter to talk to you as the pin for connections you make to other people, as i dont allow people to connect to me at random i think this works well however if you are offering services such as Personal area networking then changing the pin file is not a good idea if you still want to talk to remote devices

anyway hard part over lets play some music !!!!!!!!!!!!!!!!!!!!!!!

i will show you how with mplayer first :
Code: [Select]
mplayer -ao alsa:device=logitech
i recomend that you put these settings in your config file as a profile OR set up your asoundrc file and its default profile to point to the bluetooth pcm. if using the asound method then you can write a helpor program that switches the default output device between whatever you normally use and bluetooth, if you are that intrested post a reply and i will look up the final details on how to do this

basically it will give you one button switching of all sound on the system if implemented with .asoundrc rather than editing mplayer's conf files

basically anytime you want a specific program to use the headphones rather than the default you tell it to use the device "bluetooth" normally this is done by using the -D or -d flag but check the man pages

you can change the name you use to refer to the device to somthing other than bluetooth by editing your .asoundrc file and changing bluetooth to whatever. if you have more than one device that has bluetooth audio (such as a headset and headphones or in my case to sets of headphones) then you can specify them with 2 diffrent names (i use blueant and logitech) then just change all refrences mentioned above to point to the new device (ie change refrrences to "bluetooth" to whatever name you use in asoundrc)

now for hardware recomendations:
I have had sucsess with blueant's X5 and logitechs bluetooth headsets, you might be tempted to get the blueant set because it has a microphone however the sound sucks, i have had nothing but problems however its my own fault that i didnt return it. that said i dont know how they can call that A2DP sound, looking on thier site you wont find refrences to "cd quality sound" like every other manufacturer and i can see why

for calls hawever its a good unit, a bit of static all the time but not bad

logitech on the otherhand is near flawless, the only problem is that they snap in half after about 1 month, they say they have fixed the problem but i am still hearing diffrently from new buyers. i repaced them in some altec lansing headphones the improved the sound quality quite substantially. with a bit of bass boost i would say that they are better than most headphones on the market. of course you end up doing a bit of soldering but it can be done in about an hour

remeber i havent tested this on a Z, and i havent fully tested the sound out yet as i have my mplayer settings set up to convert to 96khz to remove sound artifacts that crop up with my sound card however when i get them back to normall i mill retest and tell you how the sound compares to those external dongles you are supplied with. at the moment i am getting clicking which is what happened with my sound card when i set the sample rate wrong
Personal Blog
Code
Twitter

Gemini Order: #95 (roughly)
Current Device: Samsung Chromebook Gen 3
Current Arm Devices Count: ~30
Looking to acquire: Cavium Thunder X2 Hardware

Da_Blitz

  • Hero Member
  • *****
  • Posts: 1579
    • View Profile
    • http://www.pocketnix.org
Bluetooth Audio
« Reply #1 on: August 10, 2006, 07:55:58 am »
Ok looks like thier are some artifacts, mainly sharp high frequnecy buzzing on higher notes, bass is slightly diminished

so i am assuming the codec needs a bit of polishing however if you are just a casual listener on a bus i dobght you would notice it with all the ambient sound

anyone know enogh about thi code to give it better quality?

one other thing to note is that thier is specific support for the xscale platform in (an int only converter) so sound quality on the Z may be better

another thing to note is that some headsets have a latency that can be up to 1 second so keep that in mind if you watch video
Personal Blog
Code
Twitter

Gemini Order: #95 (roughly)
Current Device: Samsung Chromebook Gen 3
Current Arm Devices Count: ~30
Looking to acquire: Cavium Thunder X2 Hardware

Da_Blitz

  • Hero Member
  • *****
  • Posts: 1579
    • View Profile
    • http://www.pocketnix.org
Bluetooth Audio
« Reply #2 on: August 10, 2006, 07:57:33 am »
one quick thing is that you will get abd sound quality if you force your audio program to use anything other than 44100 hz at least this was the case with mplayer
Personal Blog
Code
Twitter

Gemini Order: #95 (roughly)
Current Device: Samsung Chromebook Gen 3
Current Arm Devices Count: ~30
Looking to acquire: Cavium Thunder X2 Hardware

bam

  • Hero Member
  • *****
  • Posts: 1213
    • View Profile
    • http://thegrinder.ws
Bluetooth Audio
« Reply #3 on: August 11, 2006, 09:33:37 pm »
anyone figured how to do this with sharp rom?
SL-C3100 current: Stock/Tetsu 18h
Socket BT CF Card
Linksys WCF-12 802.11b/Cheapie USB Ethernet

The Grinder

Da_Blitz

  • Hero Member
  • *****
  • Posts: 1579
    • View Profile
    • http://www.pocketnix.org
Bluetooth Audio
« Reply #4 on: August 12, 2006, 03:08:33 am »
well the only thing stopping you is the fact that you have to compile it, and that you need alsa support in your kernel (cant remeber if sharp does or not see if /proc/asound exsists)

i am still trying to get a cross compiler working. when i do i will try and get modules up for the 3 main distros (OZ Sharp/cacko, PDAXROM)
Personal Blog
Code
Twitter

Gemini Order: #95 (roughly)
Current Device: Samsung Chromebook Gen 3
Current Arm Devices Count: ~30
Looking to acquire: Cavium Thunder X2 Hardware

wrc4

  • Full Member
  • ***
  • Posts: 114
    • View Profile
Bluetooth Audio
« Reply #5 on: August 12, 2006, 04:45:31 am »
Quote
well the only thing stopping you is the fact that you have to compile it, and that you need alsa support in your kernel (cant remeber if sharp does or not see if /proc/asound exsists)

i am still trying to get a cross compiler working. when i do i will try and get modules up for the 3 main distros (OZ Sharp/cacko, PDAXROM)
[div align=\"right\"][a href=\"index.php?act=findpost&pid=138348\"][{POST_SNAPBACK}][/a][/div]

Great! I'm looking forward to trying your package. I have a MOTO HT820 and want to use it with my Z.

BTW, does 2.4 kernel support ALSA? I'm using pdaXrom but there seems to be no stable 2.6 kernel release for either of the Zaurus I have.
Zaurus SL-C1000 (Debian)
Zaurus SL-7500C
Nokia N810
KOHJINSHA SC3
ASUS EEEPC 701
ASUS WL-HDD 2.5
ASUS WL-500GPv2
WD MyBookWorldEdition (with a Segate 500G HD inside)

Overgauss

  • Newbie
  • *
  • Posts: 14
    • View Profile
Bluetooth Audio
« Reply #6 on: August 12, 2006, 07:33:51 pm »
I'm thinking of getting a coupla pairs of Oakley O rokr's so we (my gal and I) can stream music from our c1000's to the sunglasses stereo earbuds and also recieve and answer cell phone calls from our razr's.

I was thinking of getting the razrwire then I realised I wouldn't be able to listen to tunes in my ride and answer the phone very well as I use the Z as my car stereo. Therefore I'm curious about bluetooth  A2DP (Advanced Audio Distribution Profile) and AVRCP (Audio Visual Remote Control Profile to allow customers to remotely control functions such as mute, volume level or track forward/back) support on the C1000 (Cacko 1.23).
Here's a review snippet on the O ROKR and streaming audio....
http://www.bonafidereviews.com/article.php?id=177&page=4



To test the O ROKR we used multiple devices. We used two cell phones the LG-VX8100 and Samsung A640 for call testing. We also used a Apple iPod Nano with a iCombi bluetooth adapter and Dell Axim pocket PC for audio streaming. Pairing the O ROKR with all of the devices was very easy. Above is the screen of the Samsung A640 during the pairing process.

Using the O ROKR with the cellphones was a very easy process. Depending on the phone, the interaction between the O ROKR and the phone was different. For the LG-VX8100, once the phone was paired all sound made on the phone was sent to the O ROKR and none was heard from the phone itself. This includes navigating menus and key press sounds. However the Samsung phone kept playing all sound through the phone's speaker unless a call was being made. Once the phone was dialing the sound was transferred to the O ROKR. Also, when paired with the Samsung phone, if we pressed the phone button the O ROKR a voice recognition menu was loaded on the phone from which we could simply call out the name of the contact entry and it would dial. On both units, once the call connected, the quality of sound was quite good when comparing it to typical phone quality. The person on the other line was easily understood, not being able to hear them due to poor quality was never a problem. It should be noted that the call button on the O ROKR can also be used to answer incoming calls so pulling the cell phone out of a pocket or purse isn't required.

When using the O ROKR with the pocket PC, audio quality was decent but had a bit of static in it. When getting further than 11 feet away from the pocket pc the audio became extremely static filled. The iPod Nano was a more positive experience with sound quality significantly better but keep in mind the quality heavily depends on the bluetooth adapter used with the iPod Nano. It's important to note that the audio device's bluetooth must support the A2DP profile for listening to music and the AVRCP profile to enable controlling the player through the play controls on the O ROKR.

Like the THUMP 2, the O ROKR glasses fit snugly to the head and face so using them during rigorous activity like running, playing tennis, or snowboarding is ideal. During these types of usage the real value having no cords or an external player to worry about really shines. Plus the added ability of answering the phone without having to touch it is a major convenience for those always on the run.

As previously mentioned, the battery life of the O ROKR is typically around 4-5 hours. This short battery life could be a drawback for users looking to use the glasses for very long periods of time. If pairing with both a MP3 player and cell phone separately the battery life would be even less.
« Last Edit: August 12, 2006, 07:35:12 pm by Overgauss »

Da_Blitz

  • Hero Member
  • *****
  • Posts: 1579
    • View Profile
    • http://www.pocketnix.org
Bluetooth Audio
« Reply #7 on: August 13, 2006, 07:22:46 am »
still battleing with compilers, cant get the native OZ tool chain to work and cross tools seems to not want to build a tool chain so i have resorted to learning how to actually compile gcc by hand (seems its not that hard onec you work out the target string)
Personal Blog
Code
Twitter

Gemini Order: #95 (roughly)
Current Device: Samsung Chromebook Gen 3
Current Arm Devices Count: ~30
Looking to acquire: Cavium Thunder X2 Hardware