oowuag / android-bluez-ime

Automatically exported from code.google.com/p/android-bluez-ime
0 stars 1 forks source link

100% CPU in Bluez IME on JS1 disconnect. #8

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Connect JS1 as normal, play games.
2. Turn off JS1.
3. Bluez IME 100% CPU, BT daemon 100% CPU. Phone hangs and cannot do anything.

What is the expected output? What do you see instead?
Expected: disconnection notice from Bluez IME, program closes or enters standby 
disconnected state.

What version of the product are you using? On what operating system?
Latest version from android marketplace. On Froyo 2.2 with Galaxy S.

Please provide any additional information below.
I killed Bluez IME when I saw it start to slow the system down but couldn't 
kill the BT daemon, which then took 100% CPU. Bluez IME needs to realise the 
JS1 (or other) isn't there anymore and trigger a disconnect with the BT daemon.

Original issue reported on code.google.com by stephenh...@gmail.com on 9 Feb 2011 at 11:51

GoogleCodeExporter commented 9 years ago
I have not seen this problem, but I will investigate.

Original comment by kenneth@hexad.dk on 9 Feb 2011 at 11:59

GoogleCodeExporter commented 9 years ago
HTC Desire Z, SIM-free, stock Android 2.2.1. top showed /system/bin/btld 
consuming upwards of 80% CPU, the entire system is incredibly sluggish and can 
only be brought back to normal condition with a restart.

Original comment by gotenx...@gmail.com on 11 Feb 2011 at 10:07

GoogleCodeExporter commented 9 years ago
I just tried replicating this, and I cannot :(

I just use the Zeemote a bit, then hold the power off button down on the 
Zeemote.
This causes the Zeemote to turn off, and after 2-3 seconds BluezIME sees it and 
responds "disconnected from xx:xx:xx...", then it tries to reconnect for a few 
seconds and after this, nothing else happens.

If I try to use the phone, it will sometimes try to reconnect (when the IME is 
activated) and that causes a minor cpu spike (10-30%) but then it settles with 
a "host down" message.

I use "top" from adb to examine usage, do you have more info, eg. does it only 
happen after long use, or all the time?
What tools do you use to examine how much CPU is being used?

Original comment by kenneth@hexad.dk on 19 Mar 2011 at 4:21

GoogleCodeExporter commented 9 years ago
You'll need to install something like "Pandora Internet Radio" which starts a 
bluetooth service listener. This then triggers the bug where btld consumes 100% 
cpu and makes the system crawl to a halt.

(pandora internet radio is only available on the american android market)

Original comment by piemm...@googlemail.com on 1 Jun 2011 at 7:20

GoogleCodeExporter commented 9 years ago
Sorry, should have said 'in addition to using your app'. It won't happen on 
it's own. Pandora needs to be installed, then you need to connect (and then 
*disconnect*) to a bluetooth device to trigger it.

Original comment by piemm...@googlemail.com on 1 Jun 2011 at 7:21

GoogleCodeExporter commented 9 years ago
Thanks, I will try to reproduce.

Original comment by kenneth@hexad.dk on 3 Jun 2011 at 2:48

GoogleCodeExporter commented 9 years ago
Does this still happen if you use the "Manage Bluetooth" feature, so that 
Bluetooth is turned off after disconnect?

Original comment by kenneth@hexad.dk on 2 Dec 2011 at 12:12

GoogleCodeExporter commented 9 years ago
Doesn't seem to - a toast comes up with 'Error: Software caused connection 
abort', followed by another toast with 'Disconnected from <device MAC>'. Seems 
to be the same with Manage Bluetooth on or off.

Original comment by gotenx...@gmail.com on 2 Dec 2011 at 12:20

GoogleCodeExporter commented 9 years ago
Ok, so the problem has gone away?

Original comment by kenneth@hexad.dk on 2 Dec 2011 at 12:26

GoogleCodeExporter commented 9 years ago
The same problem seems to happen with me,I use Samsung Galaxy Mini with stock 
ROM Android Foryo.
It can be reproduced on the Bluetooth chat example provided with Android 
samples 
http://developer.android.com/resources/samples/BluetoothChat/index.html
http://developer.android.com/guide/topics/wireless/bluetooth.html

The problem can be described as when process com.broadcom.bt.app is closed 
(after a while of runing the application and connected to Bluetooth device) 
gives the following log:

INFO/ActivityManager(180): No longer want com.broadcom.bt.app (pid 663): hidden 
#18
11-23 16:22:00.075: INFO/BTL-IFS-WRAPPER(452): rx_data: socket disconnected.
11-23 16:22:00.075: INFO/BTL-IFS(452): detach_client: ########  Detached client 
subsystem (BTS) fd -1 ######## 
11-23 16:22:00.075: INFO/BTL-IFS(452): detach_client: 
@*@*@*@*@*@*@*@*@*@*@*@*@* (BTS) - close(-1)

or even forcing stop application (either from task manager or by reinistalling 
during the debugging ) while connected also to Bluetooth device 

the following process consumes almost all the CPU cycles
11-17 16:13:31.335: ERROR/ActivityManager(176): ANR in com.broadcom.bt.app
11-17 16:13:31.335: ERROR/ActivityManager(176): Reason: Broadcast of Intent { 
act=android.bluetooth.adapter.action.STATE_CHANGED flg=0x10000000 
cmp=com.broadcom.bt.app/.bluetoothpbap.BluetoothPbapReceiver (has extras) }
11-17 16:13:31.335: ERROR/ActivityManager(176): Load: 14.86 / 12.88 / 9.18
11-17 16:13:31.335: ERROR/ActivityManager(176): CPU usage from 17979ms to 
1004ms ago:
11-17 16:13:31.335: ERROR/ActivityManager(176):   btld: 101% = 101% user + 0% 
kernel / faults: 53 minor 2 major
11-17 16:13:31.335: ERROR/ActivityManager(176):   system_server: 2% = 1% user + 
1% kernel / faults: 88 minor 7 major
11-17 16:13:31.335: ERROR/ActivityManager(176):   ndroid.settings: 1% = 0% user 
+ 0% kernel / faults: 26 minor 3 major
11-17 16:13:31.335: ERROR/ActivityManager(176):   m.android.phone: 0% = 0% user 
+ 0% kernel / faults: 33 minor
11-17 16:13:31.335: ERROR/ActivityManager(176):   .app.twlauncher: 0% = 0% user 
+ 0% kernel / faults: 24 minor 1 major
11-17 16:13:31.335: ERROR/ActivityManager(176):   e.process.gapps: 0% = 0% user 
+ 0% kernel / faults: 43 minor 1 major
11-17 16:13:31.335: ERROR/ActivityManager(176):   d.process.media: 0% = 0% user 
+ 0% kernel / faults: 73 minor
11-17 16:13:31.335: ERROR/ActivityManager(176):   pp.MmsProvision: 0% = 0% user 
+ 0% kernel / faults: 56 minor
11-17 16:13:31.335: ERROR/ActivityManager(176):   droid.bluetooth: 0% = 0% user 
+ 0% kernel / faults: 257 minor
11-17 16:13:31.335: ERROR/ActivityManager(176):   com.android.mms: 0% = 0% user 
+ 0% kernel / faults: 61 minor 1 major
11-17 16:13:31.335: ERROR/ActivityManager(176):   sung.am3:remote: 0% = 0% user 
+ 0% kernel / faults: 52 minor
11-17 16:13:31.335: ERROR/ActivityManager(176):   broadcom.bt.app: 0% = 0% user 
+ 0% kernel / faults: 34 minor
11-17 16:13:31.335: ERROR/ActivityManager(176):  -logwrapper: 0% = 0% user + 0% 
kernel
11-17 16:13:31.335: ERROR/ActivityManager(176):  -logwrapper: 0% = 0% user + 0% 
kernel
11-17 16:13:31.335: ERROR/ActivityManager(176):  -bluetoothd: 0% = 0% user + 0% 
kernel
11-17 16:13:31.335: ERROR/ActivityManager(176):  -abtfilt: 0% = 0% user + 0% 
kernel
11-17 16:13:31.335: ERROR/ActivityManager(176): TOTAL: 100% = 97% user + 2% 
kernel

so all what you need to do to reproduce the bug is to install the application, 
run it and connect to a device then force stop the application  from the Task 
Manager or even re-install the application with the application connected to 
other device the whole device become totally irresponsive

After upgrading to non official upgrade to Android 2.3.4, the bug seems to be 
fixed and no longer happens.
So my question is: is there any version of android before 2.3.4 that has the 
bug fixed if so kindly tell me the least version that fixes the problem to 
support only the highier versio of android for my application

Original comment by dr.moham...@gmail.com on 8 Dec 2011 at 2:32

GoogleCodeExporter commented 9 years ago
I have not had time to try the sample app.
But does the error occur even without BluezIME, or do I need to use both 
BluezIME and the sample app?

Right now I have Android 2.3.4, but I may have access to another phone with an 
older Android version.

Original comment by kenneth@hexad.dk on 15 Dec 2011 at 3:07

GoogleCodeExporter commented 9 years ago
Yes, it has nothing to do with the BluezIME and the problem occurs regardless 
its presence or absence, so I think it is something related to Bluetooth stack 
in older android versions

Original comment by dr.moham...@gmail.com on 18 Dec 2011 at 11:45