Android @ MoDaCo: Improving A2DP, is it possible? - Android @ MoDaCo

Jump to content

Galaxy Nexus Review
We put the Galaxy Nexus and Ice Cream Sandwich through their paces.

Google Music Launch
Google bring Music out of beta and launch their music store.

MoDaCo Plus / Ad Free
Hate ads? Want cool stuff? Sign up for a MoDaCo Plus / MoDaCo Ad Free account with Online Kitchen access!

Close
Open
Close
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Improving A2DP, is it possible?
-----


#1 User is offline   DarkBytePH 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 38
  • Joined: 27-February 10
  • Gender:Male
  • Location:Hungary
  • Devices:T-Mobile Pulse
  • Twitter:@darkbyte_ph

Posted 28 February 2010 - 03:59 PM

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-dev...ad.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.c...ail?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.

This post has been edited by DarkBytePH: 28 February 2010 - 04:39 PM

0

Sponsored Links


#2 User is offline   BigBearMDC 

  • MOD - Mode ;)
  • Group: Moderator Team
  • Posts: 1,933
  • Joined: 07-December 09
  • Location:Carinthia, Austria
  • Interests:I'm interested in µC's, programming, physics and astrophysics :)
  • Devices:3x T-Mobile Pulse, 5 others ;)
  • Twitter:@BigBearMDC

Posted 28 February 2010 - 05:37 PM

View PostDarkBytePH, on Feb 28 2010, 16:59, said:

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-dev...ad.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.c...ail?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

This post has been edited by BigBearMDC: 28 February 2010 - 05:39 PM

Visit our git repos [2.6.32 porting project, FroYo vendor config]Got a question? No problem, write me an email :)

If you like what I'm doing, help me buying an Orange San Francisco Posted Image
Posted Image
Donors:

  • Niels Heeren, David Dawkins, Mark Leman, James Baker, Heinz Peter Hippenstiel, KenBW2, flibblesan, GraviticVortex, bear807, TDK29
look for the Posted Image
0


#3 User is offline   DarkBytePH 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 38
  • Joined: 27-February 10
  • Gender:Male
  • Location:Hungary
  • Devices:T-Mobile Pulse
  • Twitter:@darkbyte_ph

Posted 28 February 2010 - 11:21 PM

View PostBigBearMDC, on Feb 28 2010, 18:37, said:

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 :(

0


#4 User is offline   Calamity James 

  • An accident waiting to happen!
  • PipPip
  • Group: Members
  • Posts: 72
  • Joined: 11-December 09
  • Gender:Male
  • Location:Maidstone, Kent
  • Devices:HTC Desire
  • Twitter:@JamesH

Posted 01 March 2010 - 05:24 PM

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!

Had: T-Mobile Pulse (dropped down a drain!)
Have: HTC Desire
0


#5 User is offline   DarkBytePH 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 38
  • Joined: 27-February 10
  • Gender:Male
  • Location:Hungary
  • Devices:T-Mobile Pulse
  • Twitter:@darkbyte_ph

Posted 12 March 2010 - 08:38 PM

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.

This post has been edited by DarkBytePH: 12 March 2010 - 08:39 PM

0


#6 User is offline   DarkBytePH 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 38
  • Joined: 27-February 10
  • Gender:Male
  • Location:Hungary
  • Devices:T-Mobile Pulse
  • Twitter:@darkbyte_ph

Posted 13 March 2010 - 08:53 AM

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.

This post has been edited by DarkBytePH: 13 March 2010 - 08:57 AM

0


Sponsored Links

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users

MoDaCo is part of the MoDaCo.network, © Paul O'Brien 2002-2012. MoDaCo uses IntelliTxt technology. Privacy Policy / Contact Details.

Skin and Language

Sign in here


Sign in options
Log in with Facebook Log in with Twitter   Go to advanced login Register Now!