yashsingh1/xdaforums huggingface dataset:
[Galaxy S II General] JF-GINO:
This thread is in response to numerous posts/requests for a fix to a bluetooth A2DP soundquality problem.

As pointed out in other posts, the libraries for Bluetooth (liba2dp.so etc.) have a setting for ‘bitpool’ which is fixed to a low value by default.

People – including myself – are experiencing 2 major issues with Bluetooth audio over A2DP protocol with default bitpool values (or so we claim) :

1)	The highs tend to sound 'fuzzy' and sometimes crystalize.

2)	Higher bitrate mp3s will break up as if there is a buffer problem.

As someone who produces music and owns a media company, I have a keen ear and equipment that allows me to confirm this problem at least on my end.

It should be noted that this has been brought up in various threads Eg:

http://xdaforums.com/showpost.php?p=16021615&postcount=664

http://xdaforums.com/showthread.php?t=1082220&page=2&highlight=a2dp

The purpose of this thread is to establish a genuine problem and implement a fix.

We would welcome input or any user experiences relating to the above issues.
[Galaxy S II General] knightnz:
Are we also able to determine if A2DP is piping the audio over SBC or passing MPEG audio direct to the headunit to decode which should result in much better quality.

It would be helpful if we could find some documentation on the format of the /etc/bluetooth/audio.conf file as various settings in there can help/hinder connections and audio quality a bit.

I'm all for improving the bluetooth support/quality given that I rely on it in the car for hands-free, music and navigation.

@JF-GINO You would probably have access to an oscilloscope if you're running a media company, any chance of running the output from a bluetooth connected device through that with a few sine waves to see if it is compressing/clipping the audio?
[Galaxy S II General] pulser_g2:
Thanks guys. I will try and send the two lib files today.

For the purposes of testing, I ask you do not try and compare the files, as obviously that could influence results...

I'll post the files in a zip and anyone interested can try

- their stock bluetooth

- file A

- file B

And make any comments they wish on quality, both absolute and relative...
[Galaxy S II General] kawa636r:
you're great
[Galaxy S II General] JF-GINO:
As soon as we get the modded files, I can post the isolated diferences between waveforms from each as a comparison.
[Galaxy S II General] pulser_g2:
Yep, Unfortunately I don't have the files available until monday. If I posted links, then it would negate benefits of blind test unfortunately.

I am subscribed to this thread anyway. Remind me on Monday to get the files
[Galaxy S II General] arkadius41:
Hi Pulser, knock knock ;)
[Galaxy S II General] _Raziel666:
I'll be more than happy to help with this, since I bought a Bluetooth headset without searching around about any problems, and here I am, facing horrible sound quality... :(
[Galaxy S II General] andreiantal:
Samsung Charge here

and I have the same problem. I feel like taking my phone and drive my car over it. I would do anything for a library that works on this stupid droid phone.
[Galaxy S II General] pulser_g2:
Hello :)

Time to look out the files then?
[Galaxy S II General] arkadius41:
Yes my Master...pleassse :D
[Galaxy S II General] pulser_g2:
OK... As before, I ask that you do not try to work out the paths to these files or anything. Just try them out :) Then post feedback. And no hex editors, or comparing checksums... :) That's no fun.

File A: http://www.villainrom.co.uk/SGS2/VRTweaks/a2dp/A.so

File B: http://www.villainrom.co.uk/SGS2/VRTweaks/a2dp/B.so

Rename to liba2dp.so and put in /system/lib/ and reboot etc. Then comments welcomed :)
[Galaxy S II General] maxharl:
I've done all you said, but I'm not able to tell the differences about file A and file B, in my opinion the sound quality is the same as default liba2dp.so
[Galaxy S II General] andreiantal:
Droid Charge.

I get less hesitation with A than I get with B and I think both are doing better than my current stock. I will keep testing A more.
[Galaxy S II General] pulser_g2:
Ok very interesting.

Tomorrow if everyone is done, I'll tell you what each file was...
[Galaxy S II General] Nebucatnetzer:
Please wait until the evening I would like to test it to but unfortunately I can't download it on Android I have to go via my computer. Android shows me just a ****ed up version of the code.

Greetz Nebucatnetzer
[Galaxy S II General] pulser_g2:
Sure thing mate
[Galaxy S II General] arkadius41:
You can use Opera to download the files, with stock browser and Dolphin there is no possibility.
[Galaxy S II General] Nebucatnetzer:
I tried with miren but something is wrong with my phone anyway I'm not able to open websites with both browsers it stops after 2/3 of loading but apps work ok confused. Already cleared data. Maybe a full wipe solves the problem. Anyway.

Greetz Nebucatnetzer
[Galaxy S II General] Nebucatnetzer:
So tested it a bit this morning and I think that a is clearer.

Greetz Nebucatnetzer
[Galaxy S II General] arkadius41:
A) sounds better, not so metal crappy in high frequences, however space is narrowed.

B) does nothing.
[Galaxy S II General] arkadius41:
Is there possibility to change bt values from 8000 in system/etc/asound.conf ?
[Galaxy S II General] dan0zone:
Finally some much needed attention for this issue on XDA .... I'm here to test ...
[Galaxy S II General] arkadius41:
I have to say that is, i mean bad sound quality specially on bt streaming ( i use jabra bt 3030 wich was very fine with HTC HD2 my recent pnone with CM7 onboard ) but now i truly suffer from this issue. I'm afraid this point can force me to discard SG2. Though i love this device for its another benefits :(

Anyway im not alone to consider serious donation to make this thread fruitful, i hope...
[Galaxy S II General] dan0zone:
Well I've been doing some research, and I found out that as far as bitpool goes, its being transcoded through sbc which seems to be set in some kind of auto mode, where, depending on what you are playing, mp3, wma ..... sbc will set the bitpool higher or lower ..... This all seems to be happening in the kernel and bluetooth stack .....will post the link soon ....

edit .... here's one of the links I came across ..

www.netmite.com/android/mydroid/external/bluez/utils/audio/gstsbcenc.c
[Galaxy S II General] arkadius41:
Looks interesting, im too noob to understand it properly however, but except this bitrate in a2dp is very low too, see my image above, isnt it ?
[Galaxy S II General] MeX_DK:
What I usually do is download them to Dropbox and then download them from my phone then.
[Galaxy S II General] _Raziel666:
So I found some time and did the test as follows:

1) Ripped an mp3 in 320kbps with LameMP3, from a cd of my collection, a song I know very well

2) Downloaded the two offered .so files

3) Listened to the song with the liba2dp.so from my ROM (Cog 1.31) and the two offered while rebooting each time I changed the .so

Final verdict: I can't say I noticed any differences in the three cases, the high frequencies suffered the same (or almost the same) and I couldn't enjoy the track like I used to in my old SE walkman.
[Galaxy S II General] andreiantal:
One of the functionality that has changed is the ability to skip forward the tracks using Slacker. I was not able to that previously. I tested A in the office and it was good but I went to Starbucks and I think the interference outside is very bad to the bluetooth signal. I was getting more drops than I was getting inside. I will keep using A for now.
[Galaxy S II General] andreiantal:
Samsung charge

I was testing with 48kbs and 92kbs AAC, and 192Kbs MP3 and I cannot really tell which one skips most I feel like they skip the same.
[Galaxy S II General] knightnz:
Prior to testing Pulser's mod, I'd recommend editing your /etc/bluetooth/audio.conf file and changing the value for Master to true and for MaxConnections to 2 or 3. These can help with the skipping problem.

Either use Rootexplorer, or adb pull /etc/bluetooth/audio.conf audio.conf then edit the file with "Edit" or Notepad, then adb push audio.conf /etc/bluetooth/audio.conf and then reboot.

I'm hoping that people are rebooting after installing pulser's files so it updates properly?

If I get a chance I'll give it a blast in the car tonight assuming the g/f will stay off my case for 5 minutes. I'd still love to know how to determine what protocol(s) are in use for a given audio connection.
[Galaxy S II General] Nebucatnetzer:
Hm I don't want to be offensive but 192kbs is not a quality man. 320kbs okay but 192kbs not really.

Greetz Nebucatnetzer
[Galaxy S II General] knightnz:
If the compression software used is good, then 192kbps should be pretty hard to discern from source unless you're running it through fairly high-end equipment (or if you're an audiophile who buys $200+ RCA leads). The on-device and bluetooth processing would be a bigger issue than the bitrate beyond ~160kbps (or less if a better codec than MP3 is used).
[Galaxy S II General] Nebucatnetzer:
Fair point but I meant more in general then just for the phone.

By the way does someone know what happens with a flac file wich goes through bluetooth?

Greetz Nebucatnetzer
[Galaxy S II General] knightnz:
My guess is it'd send through as raw audio, probably via the SBC protocol. This is why I'd like to know what protocols are in use, for just such purposes. Most bluetooth-audio devices will recognise "standard" uncompressed audio (.WAV etc) and MPEG1/2 (MP3) compressed audio and more modern ones will also understand MPEG4 (AAC/MP4) and process it on-device. If it's a fairly "dumb" device that can't handly compressed sources then the source unit should be able to basically transcode to pure audio.
[Galaxy S II General] Nebucatnetzer:
I gave all my thanks to Pulser today so you receive a written thanks :D.
[Galaxy S II General] dan0zone:
Well this is why I've been asking kernel devs to look at the bluetooth stack at the kernel level .... when you go through the lib files the keep referring to the source ( bluetooth stack).. My thinking is, until we know where and what Cyanogen edited, we'll just be chasing our tails, because some think the edit point is on the rom and some think its on the kernel ... We need to know where to look and then concentrate all our efforts there ..
[Galaxy S II General] andreiantal:
Thanks for the advice but on droid charge the changes are creating even more skipping. I reverted back the file for now.
[Galaxy S II General] Nebucatnetzer:
So which one is now the better. Would like to know if my ears are still ok or if should buy a hearing aid.

Greetz Nebucatnetzer
[Galaxy S II General] arkadius41:
Yes Master, we are wating for judgement :D
[Galaxy S II General] BWA80:
Hi!

About the bluetooth stacks, klquicksall took out all the stock bt stacks from his kernel (htc incredible s) and replaced them with the stacks from cyanogenmod. I found no difference in the audio quality.. nada :(

just my 2 cents..
[Galaxy S II General] Nebucatnetzer:
Hm just a thought but sry if say something stupid I'm not really good in things like that.

The bitrate of bluetooth 2.0 could 2.1 Mbit/s and a normal CD has 1.411kbit/s which means it would be easily possible to stream a full CD through bluetooth or do I miss something essential?

So if I'm right why the hell should someone use a lower value that doesn't make sense.

Greetz Nebucatnetzer
[Galaxy S II General] pulser_g2:
So the promised results?

www.villainrom.co.uk/SGS2/VRTweaks/a2dp/hello.txt

By obvious deduction, the other one was increased to 52 (iirc)

I have not mentioned the filename, so only click that link if you want to know which was which...
[Galaxy S II General] dan0zone:
Thanks for your reply .... but it's not just the bluetooth stack, its a combination of the two ... It has been reported that google has fixed this issue already and for some reason both Samsung and Htc has chosen to overwrite the stack with their own ... the Motorola defy sounds great at its new default of 53 ...
[Galaxy S II General] andreiantal:
Ok increasing to 52 helped over the stock but it is still not consistent. Today I got a little bit more skipping than the other day for example.

Sent from Super gummy charged droid.
[Galaxy S II General] dan0zone:
Here's another thread where they were trying to fix the issue .. There you can see what was already tested ...

xdaforums.com/showthread.php?t=708685&highlight=a2dp

After that thread I came across pulser's edited liba2dp.so which did improve sound a little, I think my issue is that im testing with my ears and logcat .... to my ears it sounds ok but logcat still reports a bitpool of 32 .....
[Galaxy S II General] andreiantal:
I think the new file with 52 is ok. The next thing we need is a script like V6 super charge to make a bulletproof bluetooth. I don't think I have the proper android knowledge to make the required changes to that script to add the bulletproof bluetooth option to it.

I will look into it.

Sent from Super gummy charged droid.
[Galaxy S II General] Nebucatnetzer:
Okay I realised that I should correct my question with someone I mean the manufacturers and not the devs here.

Greetz Nebucatnetzer
[Galaxy S II General] arkadius41:
Nobody can explains this ?
[Galaxy S II General] pulser_g2:
This is a self service thread :)

Change it, tell us what happens :) remember to do a backup etc
[Galaxy S II General] arkadius41:
As you wish my Master :) So lets go to work...

few minutes after...

Hi, ive opened system/tc/asound.conf with text editor, changed bt rate value from 8000 to 44100, saved, rebooted and ...nothing has been changed with bt sound. Well it means ... hmmm i really dont know ;)
[Galaxy S II General] andreiantal:
So I made a little discovery that helped me to solve my BT problems. As I said after installing library A the one which had the bitpool increased to 52 I noticed a difference but the behaviour was not consistent. The other day I got an update for my kernel and it was beta so I said what the heck :) it cannot get much worse. I flashed and after that I realized that most of my skipping was gone. Also I did a factory reset just to make sure. The quality is just BT quality so I got used to it. One other thing that I did is I didn't install GO launcher ex which I previously had. Not sure if related. I will test that soon. Anyone interested in reflashing the kernel after installing the A library and share the results? Maybe a factory reset?

Sent from my gummy supercharged droid
[Galaxy S II General] arkadius41:
Hi, which kernel have you flashed ?
[Galaxy S II General] andreiantal:
http://cl.ly/94tK

http://cl.ly/94tK

As far as I know this works for charge with froyo and voodoo.

Sent from my gummy supercharged droid
[Galaxy S II General] NatTheCat:
This A2DP skipping has been a major concern of mine since the beginning.

I have found out that it happens with every rom and kernel ive used so far. But only with my car "Fiesta 2011 Sony Headunit" and not my "jf3 Freedom bluetooth headphones".

Ive tried Pulser's fixes on his Rom and they dont seem to help much. Thanks tho Pulser

I had a HTC Sensation for a few days and the problem is even worse on the stock rom.

Im here to help fix this problem. Give me a shout if you need me to test anything.
[Galaxy S II General] andreiantal:
Try to put the fix in and reflash the kernel - even your current one. Installing the fix alone doesn't seem to do much.

Sent from my gummy supercharged droid
[Galaxy S II General] yoqxi:
I have been flashing a lot of ROMs recently, in the hope of finding one with better A2DP Quality, and found out that MoDaCos Custom Rom sounds significantly better. I switched back to Light'ning ROM 6 afterwards, but after flashing MoDaCos liba2dp.so I got the good quality again. Because I don't know if MoDaCos a2dp file is subject to copyright or something, I'll just post the link for the whole ROM:

android.modaco.com/topic/344911-19-aug-gr5-xxkh3-modaco-custom-rom-for-the-samsung-galaxy-s-ii-stock-stylevanilla-with-online-kitchen

I downloaded the Vanillia Edition.

In the kitchen section, the bluetooth mod is descibed as "Enhanced bluetooth configuration recommended by stevenz" but I couldn't find it anywhere else.
[Galaxy S II General] pulser_g2:
The stevenz info :

The /etc/audio/bluetooth.conf file could optionally be modified similar to the current CM github to improve bluetooth audio support & generally reduce dropouts:

[General]

Enable=Sink,Control,Headset,Gateway,Source

Disable=

Master=true

#SCORouting=PCM

AutoConnect=true

[Headset]

HFP=true

MaxConnections=3

[A2DP]

SBCSources=1

MPEG12Sources=0

[AVRCP]

InputDeviceName=AVRCP
[Galaxy S II General] arkadius41:
Thanks mate, have to try out this rom.
[Galaxy S II General] 0ryn:
The BT values of 8000 are the sample rate for (mono headset or handsfree profile) This is used for voice comms as there is very little latency. The audio bandwidth is limited as continuously variable slope delta modulation requires a higher clock rate for higher frequency’s. In order to maintain compatibility with the hands free and headset profiles. Changing this value may cause skipping or strange whistles / squeaks etc when using a bluetooth headset to make a phone call

This has no effect on a2dp which is using compression
[Galaxy S II General] BWA80:
Anybody still tinkering around with this issue? ..or is this out of our hands. :(
[Galaxy S II General] yoqxi:
Just in case, someone finds this thread: The A2DP quality in Android 2.3.5 has become way better.
[Galaxy S II General] arkadius41:
Can confirm that, much better.
[Galaxy S II General] rzasharp:
Android 2.3.5 = best bluetooth audio quality EVER.
[Galaxy S II General] aragna:
i just updated to Leomar's 2.3.5 rom and just tried out bluetooth audio and the quality is the same. Sounds like crap on my galaxy s2 but perfect on my bold 9780... did you guys have to do anything to enable better quality or something haha. thanks.
[Galaxy S II General] michalhaj:
This helped me to this problem:

http://xdaforums.com/showthread.php?t=1293239&highlight=music+ice.

I use Omega rom 2.0. I believe it would help elsewhere.
[Galaxy S II General] arkadius41:
Best results with Villain 3.0 rom, Androidmeda from Pongster seems to be not so good. I use Jabra BT3030 which increase volume to the acceptable level itsefl. However i can confirm better audio with 2.3.5 anyway.
[Galaxy S II General] nfsking2:
Well, I just want to say, I don‘t recognize anything wrong with SGSII's sound via bluetooth headset.

I have an iPhone4 at the same time, and after I had read this thread, I compared the sound quality between SGSII 3.5mm earphone output, SGSII stereo bluetooth and the same thing on iPhone4, but I've found no difference.

I experienced a bad sound quality only after I had flashed the CM-7.1.0 ROM. Now I’m using SiyahKernel and stock ZSKI3 2.3.5 ROM(as I need the interface of Chinese).

In my experience, the sound quality always get worse after the EQ or any other sound effect tweak has been used, no matter what device it is. So check your music option, make sure these functions are disabled.

Btw, my bluetooth earphone is SonyEricsson MW600 and the earphone is a Shure SE535.

Hope my experiences can help you guys:)
[Galaxy S II General] _Raziel666:
Well, you're alone in that. The difference in bluetooth sound quality between all the ROMs circulating vs. CM7 is very big.
[Galaxy S II General] facco89:
You say that the best bluetooth audio quality is with CM7. Because CM7 uses the native aosp driver or something like that?
[Galaxy S II General] chucky2002:
After I tried a lot of rom (including CM 7.1), I use MIUI 10.1.28

It's not perfect, but for now it fits my needs.
[Galaxy S II General] ghoticx:
I've been looking for the solution to this problem in the last month, changing rom every 4 or 5 days, the sound problem seems the same in all stock roms.

On the contrary in CM7 and MIUI since he repaired the problems with the bluetooth audio, I found that my sgs2 was able to transmit clean sound, unfortunately both are unstable and ended up returning to some based on the stock rom.

The question is: will it be possible to use the CM7 drivers and configurations?

Secondly, there is only waiting for the stable version of CM7 & MIUI, either of the 2 are excellent.
[Galaxy S II General] gg48gg:
I was able to resolve my BT A2DP skipping issues with my Galaxy Nexus and my Kenwood DNX8120 using the instructions in the post above. THANK YOU! No skips any more except for an initial stutter shortly after connect. Rock solid after that and sounds great.
[Galaxy S II General] nuraniharun:
Thanks....
[Galaxy S II General] pepemosca:
Does anyone found a better Bluetooth audio.conf file?
[Galaxy S II General] reflush:
Thanks pulser this fixed my bt audio streaming stuttering
[Galaxy S II General] pepemosca:
I have just found another option in the CyanogenMod audio.conf file.

Says:

Does anyone knows if it useful to have it set as true?
[Galaxy S II General] computermaster87:
it works with ics??? i have an evo 3d by htc, and a parrot mki9200, the streaming audio is horrible...
[Galaxy S II General] MrDowntown12:
I have S2: E4GT and have been having trouble with bluetooth streaming. My experience is chronicled here

Upon searching for more info, I stumbled upon this thread. I used the audio file edit that that was detailed by stevenz and had some success with this, though I am still experiencing some clipping and static, no skipping.

Is anyone else having this problem still? I know for most it went away with ICS, but it seems to have crept back in somehow. There must be some configuration that can be edited to fix this issue.
[Galaxy S II General] dorkultra:
I have the same issue, the bitrate when streaming over bluetooth sounds very low. cymbals sound distorted, everything sounds like it is under water
[HD2 Android Q&A, Help & Troubleshooting and Genera] Dimension2035:
I'm looking for an app that would give me the status of the SD EXT. Is there one out there? If so can anyone provide me with a link or name?
[HD2 Android Q&A, Help & Troubleshooting and Genera] xabhi:
try titanium backup :)
[HD2 Android Q&A, Help & Troubleshooting and Genera] j4n87:
Quick system info works also..

or just typing “free“ in your terminal emulator
[Thunderbolt Q&A, Help & Troubleshooting] nagmier:
Is there a version available for download? Search revealed little none relating to the tbolt
[Thunderbolt Q&A, Help & Troubleshooting] sonami:
Best thing would be to find the gtalk 1.3 downloader and give it a go, if it doesn't work, it won't work.

Sent from my TBolt using my f***king thumbs...
[Thunderbolt Q&A, Help & Troubleshooting] jschecter:
Nope, won't work b/c it requires android 2.3.4.
[Thunderbolt Q&A, Help & Troubleshooting] ltredbeard:
it works half way on my wifes inc2 on 2.3.3

she gets full video and chat i cant see her though
[Dell Streak 7] sergio81:
Hello. I have a dllemma. I went back to stock 2.2.2 using a tutorial i found on xda. However, once i booted the device i noticed that it was still rooted. i unrooted it using gingerbreak and i wanted to do a factory reset. I did the volume + and the power button and i wanted to erase everything, so i chose that option, but it sent me to clockworkmod recovery. My question is, how can i remove clockworkmod recovery from my dell streak 7, so it can be entirely "out of the box" state? i've been searching all day for a way, with no luck. any help will be greatly appreciated. Thanks.
[Dell Streak 7] Sxybob:
Ditto

I have the same question and am anxiously awaiting to see the response.
[Dell Streak 7] sergio81:
BUMP

So no one can help me out huh? i've searched high and low. believe me. There has to be someone out there that knows how. i've tried to adb the original rom and recovery img's to no avail. i'm not sure what else to do.
[Dell Streak 7] CriolaBrazuka:
Have a you tried superone click UNROOT?
[Hero CDMA General] Indirect:
It's completely messed up. I took it apart to see if the digitizer was out of place and it wasn't. It just flat out won't work. I wish I could buy a hero off someone but I have no money and now I have to deal with the LG Rumor. :(
[Hero CDMA General] eXplicit815:
Ditch it, get an EVO 3D. Glad I made that decision...