Hello everybody,

I'm trying to build an application to connect and Android phone via Bluetooth 
through an RFCOMM serial channel.

Unfortunately I'm hitting a really nasty bug which make development 
impossibile.

I tried starting with the examples provided that explain how to open an RFCOMM 
connection:
http://developer.android.com/resources/samples/BluetoothChat/index.html
http://developer.android.com/guide/topics/wireless/bluetooth.html
but when the application gets closed the process /system/bin/btld consumes all 
CPU cycles (verified tons of time with "top -n 1"). It starts consuming that 
much exactly when the application gets closed for the first time.

There are several reports about this problem:
http://talk.sonyericsson.com/thread/8270
http://forum.xda-developers.com/showthread.php?t=1005141
http://code.google.com/p/android-bluez-ime/issues/detail?id=8
http://android.modaco.com/topic/321044-bug-btld-eating-up-100-cpu/
They seem to indicate (for right or wrong, I don't know) that the problem is 
related to a problematic Broadcom stack used in several devices using the 
associated chipset.

I've verified personally that the problem is related to calling either:
mBluetoothAdapter.listenUsingRfcommWithServiceRecord(NAME, MY_UUID);
or:
device.createRfcommSocketToServiceRecord(MY_UUID);
Commenting one of those lines causes the problem to disappear. And no: closing 
correctly the BluetoothServerSocket or the BluetoothSocket doesnt' change 
anything.

I'm testing using a Samsung Galaxy Next GT-S5570 with Android 2.2.1, but the 
issue seems to be quite common among other devices.

Is there any possible solution / know workaround to this serious issue? Is 
there anyone I can contact to get this sorted out?

Thank you in advance, regards,
Diego

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting

Reply via email to