Jump to content

Improving A2DP, is it possible?


Recommended Posts

Guest DarkBytePH
Posted (edited)

Hello guys!

First of all, i like to say a big thank you to Paul for making this wonderful custom ROM for Pulse, i've just flashed the Vanilla ROM onto my phone, and really amazed how fast it become. :( I'm thinking about becoming an Ad-free member to help supporting this fantastic project!

Okay, so i got a Nokia BH-103 Stereo headset from one of my friends for testing on this weekend. It's the first A2DP headset what i can try out with the phone. I'm considering to buy one, a A2DP headset will solve my problem with the stupid rubber cover over the headphone connector. Because of that i haven't used the phone for listening to music at all. There was no problem with pairing the headset to the phone, in the Bluetooth settings i can see it connects to phone and media audio also. Sound is very strong, and the quality is more than okay for me (i heard so much worse about the SBC codec, looks like Android has a great SBC encoder). However, after some time the playback gets slower and then faster, like listening to a broken cassette player. :( I was very suprised to listen to this kind of sound with a digital device. :( The pitch changing gets VERY noticable, and annoying quickly. I've started googling for solutions, and found a similar topic with the HTC G1 at XDA: http://forum.xda-developers.com/showthread.php?t=518918

Looks like this kind of A2DP handling is common on Android devices (i've found a similar thread on the Android project's forum also: http://code.google.com/p/android/issues/detail?id=2807#c26 There are even reports for the Droid), the BlueZ Bluetooth stack handles A2DP packets the wrong way: it pushes all network related events to the headset when it's connected through the HFP profile, and when there's so much of these event, it starves out the A2DP protocol so much, that the headset has to slow down the playback to prevent skipping. After the channels gets free, the devices pushes all packet from the queue to the headset, and because of that the headset have to speeds up playback to catch the actual playing position. Sadly the fixing method described at the topic (Menu button>Settings>Wireless Controls>Bluetooth Settings>(long press) Your headset name>Options...>uncheck phone) isn't available on the Pulse (i can't disable the phone audio connection, because there isn't an Option item when i press long on the headset's name) :( I'm wondering is there any way to integrate this kind of functionality to the MCR ROM from the Haykuro ROM which does have it according to the topic?

I hope there are way to do this :(, it will be very useful. I really like to listen to music with my Pulse.

Edited by DarkBytePH
Guest BigBearMDC
Posted (edited)
Hello guys!

First of all, i like to say a big thank you to Paul for making this wonderful custom ROM for Pulse, i've just flashed the Vanilla ROM onto my phone, and really amazed how fast it become. :( I'm thinking about becoming an Ad-free member to help supporting this fantastic project!

Okay, so i got a Nokia BH-103 Stereo headset from one of my friends for testing on this weekend. It's the first A2DP headset what i can try out with the phone. I'm considering to buy one, a A2DP headset will solve my problem with the stupid rubber cover over the headphone connector. Because of that i haven't used the phone for listening to music at all. There was no problem with pairing the headset to the phone, in the Bluetooth settings i can see it connects to phone and media audio also. Sound is very strong, and the quality is more than okay for me (i heard so much worse about the SBC codec, looks like Android has a great SBC encoder). However, after some time the playback gets slower and then faster, like listening to a broken cassette player. :( I was very suprised to listen to this kind of sound with a digital device. :( The pitch changing gets VERY noticable, and annoying quickly. I've started googling for solutions, and found a similar topic with the HTC G1 at XDA: http://forum.xda-developers.com/showthread.php?t=518918

Looks like this kind of A2DP handling is common on Android devices (i've found a similar thread on the Android project's forum also: http://code.google.com/p/android/issues/detail?id=2807#c26 There are even reports for the Droid), the BlueZ Bluetooth stack handles A2DP packets the wrong way: it pushes all network related events to the headset when it's connected through the HFP profile, and when there's so much of these event, it starves out the A2DP protocol so much, that the headset has to slow down the playback to prevent skipping. After the channels gets free, the devices pushes all packet from the queue to the headset, and because of that the headset have to speeds up playback to catch the actual playing position. Sadly the fixing method described at the topic (Menu button>Settings>Wireless Controls>Bluetooth Settings>(long press) Your headset name>Options...>uncheck phone) isn't available on the Pulse (i can't disable the phone audio connection, because there isn't an Option item when i press long on the headset's name) :( I'm wondering is there any way to integrate this kind of functionality to the MCR ROM from the Haykuro ROM which does have it according to the topic?

I hope there are way to do this :(, it will be very useful. I really like to listen to music with my Pulse.

I bought this headset. I also noticed the disortion of the music... sometimes its really noticable and annyoing! I hope to see a fix soon. Maybe I'll try to add this to the kernel on my own :-)

Greetings,

BigBear

Edited by BigBearMDC
Guest DarkBytePH
Posted
I bought this headset. I also noticed the disortion of the music... sometimes its really noticable and annyoing! I hope to see a fix soon. Maybe I'll try to add this to the kernel on my own :-)

Greetings,

BigBear

That'll be nice :( I'm very new to all of these Android ROM cookings, don't even know where should i look for if i wan't the source of this Haykuro ROM. (guess it's not public anyway)

I think that this addition is not just a quick hack, because it has to send the switch off event from the java layer to BlueZ to disconnect the phone audio. But we can try of course :(

Guest Calamity James
Posted

I've had this happen on mine too, although via my Bluetooth car stereo. It doesn't happen too often though, usually what happens is I have to re-pair the phone completely as it stops the normal Bluetooth handsfree functions from working until I do (even after disconnecting the A2DP bit)!

I'm still not sure if it's an Android or Pioneer problem!

  • 2 weeks later...
Guest DarkBytePH
Posted (edited)

Just to make the topic go further.

I have bought a cheap A2DP headset from Deal Extreme on the previous week (DX BCK-08 Stereo Bluetooth), got the package in my hands today. Someone on a local forum said that he could use this headset with his Pulse flawlessly because it allows you to use it only in phone or in media mode. Although i still don't know exactly how can i switch between these modes, i could achive that the headset was connected only to the media audio of my Pulse. Sadly the pitch changing stuff is still there. <_< So i can surely say that the problem is Android related, but it looks like the workaround described above doesn't work, or it does more than i think.

I though about changing the process priority of some Android services, maybe with renice if it's available through adb, or search some program for this on Market.

Edited by DarkBytePH
Guest DarkBytePH
Posted (edited)

I went a bit further with adb to see what's happening on my device. I've set up some music playback with the headset connected to Pulse, and started to watch the output of dmesg. There are three lines which are constantly flooding it:

...

bluesleep_hostwake_task: hostwake line change

bluesleep_hostwake_task: hostwake line change

bluesleep_tx_timer_expire: Tx timer expired

bluesleep_tx_timer_expire: Tx data during last period

bluesleep_hostwake_task: hostwake line change

bluesleep_hostwake_task: hostwake line change

...

I'm wondering is there anyone else getting these line when A2DP streaming is on? Looks like there's a timer which sends constantly the collected audio data to the headset. I'm trying to find these lines in the Android source, sadly i'm a bit lost with GIT. <_< Maybe someone else who got the Cupcake branch checked out on his machine can search for "bluesleep" in the source code? (searching with Google doesn't drops out anything, maybe these debug strings are Huawei made? I'm currently on MCR 1.7 version just to see clear.)

While searching in the code, i found out that there are some performance optimizations in the BlueZ code which related to A2DP: platform/external/bluez.git Maybe we can patch the Cupcake source with this (or maybe the Éclair update brings in these, if it's finally released to the Pulse).

Speaking about patching: how hard is to compile the base Cupcake code and put in Huawei drivers so i can start playing with things on my device? I guess it's not so easy, but the buildroot system is familiar to me, and as i see Android uses this. Sadly i can check out the code only at the next week, i'm on mobile internet currently with a traffic limit.

Edited by DarkBytePH

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.