Disabling bluetooth in i.MX53 QSB

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Disabling bluetooth in i.MX53 QSB

1,527 Views
Goi
Contributor II

Hi,

I'm trying to forcefully disable bluetooth in an i.MX53 quick start board. I'm doing so by modifying certain files, specifically setting BOARD_HAVE_BLUETOOTH to false in BoardConfigCommon.mk, and commenting out all bluetooth related services in init.rc.

The services commented out are dbus, bluetoothd, hfag, hsag, opush and pbap.

I notice that once I disable dbus, I go into a boot loop. From my research it seems that dbus is used as a simple IPC system for the system server sitting in the Android framework to talk to the hcid. I notice my original init.rc doesn't have the hciattach service as several online resources state. Does anyone know why I'd go into a boot loop with dbus commented out?

Thanks.

Labels (2)
4 Replies

832 Views
xinyu_chen
NXP Employee
NXP Employee

Hi Goi

Only bluez and BT framework using the DBUS, so there maybe other component not disabled correctly.

Please delete the bt capability in device/fsl/imx53_xxx/required_hardware.xml to have a try.

0 Kudos

832 Views
Goi
Contributor II

Hi,

Thanks. Was not aware of required_hardware.xml. What exactly does this file do?

Anyway, I tried removing bt capability there, but I still get the same problem. Here's the logcat output I managed to capture.

I/BluetoothProfileState( 2298): Message:Entering Stable State

I/BluetoothProfileState( 2298): Message:Entering Stable State

E/BluetoothEventLoop.cpp( 2298): initializeNativeDataNative: Could not get onto the system bus!

E/libdbus ( 2298): arguments to dbus_connection_set_exit_on_disconnect() were incorrect, assertion "connection != NULL" failed in file external/dbus/dbus/dbus-connection.c line 2887.

E/libdbus ( 2298): This is normally a bug in some application using the D-Bus library.

I/InputManager-Callbacks( 2298): No input device calibration properties found for device CHICONY USB Keyboard.

I/InputManager-Callbacks( 2298): No input device calibration properties found for device CHICONY USB Keyboard.

I/InputManager-Callbacks( 2298): No input device calibration properties found for device da9052_tsi.

I/DEBUG   ( 2288): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***

I/DEBUG   ( 2288): Build fingerprint: 'freescale/imx53_loco/imx53_loco:2.3.4/GRJ22/eng.goister.20120912.223017:eng/test-keys'

I/DEBUG   ( 2288): pid: 2298, tid: 2311  >>> system_server <<<

I/DEBUG   ( 2288): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad

I/DEBUG   ( 2288):  r0 00000027  r1 deadbaad  r2 a0000000  r3 00000000

I/DEBUG   ( 2288):  r4 00000001  r5 00000000  r6 6e734028  r7 6e743478

I/DEBUG   ( 2288):  r8 00000b47  r9 00000000  10 2ea5ae54  fp 401a5368

I/DEBUG   ( 2288):  ip 6fd46668  sp 2fbfcac8  lr 6fd191d9  pc 6fd15ca4  cpsr 60000030

I/DEBUG   ( 2288):  d0  2073692073696872  d1  796c6c616d726f79

I/DEBUG   ( 2288):  d2  692067756220612e  d3  6120656d6f73200a

I/DEBUG   ( 2288):  d4  69746163696c7070  d5  676e697375206e6f

I/DEBUG   ( 2288):  d6  422d442065687420  d7  617262696c207375

I/DEBUG   ( 2288):  d8  0000000b1bf90898  d9  0000000000000000

I/DEBUG   ( 2288):  d10 0000000000000000  d11 0000000000000000

I/DEBUG   ( 2288):  d12 0000000000000000  d13 0000000000000000

I/DEBUG   ( 2288):  d14 0000000000000000  d15 0000000000000000

I/DEBUG   ( 2288):  d16 000000000023fe98  d17 3ff0000000000000

I/DEBUG   ( 2288):  d18 4030000000000000  d19 412e848000000000

I/DEBUG   ( 2288):  d20 4059000000000000  d21 3fd99a27ad32ddf5

I/DEBUG   ( 2288):  d22 3fd24998d6307188  d23 3fcc7288e957b53b

I/DEBUG   ( 2288):  d24 3fc74721cad6b0ed  d25 3fc39a09d078c69f

I/DEBUG   ( 2288):  d26 0000000000000000  d27 0000000000000000

I/DEBUG   ( 2288):  d28 0000000000000000  d29 0000000000000000

I/DEBUG   ( 2288):  d30 0000000000000000  d31 0000000000000000

I/DEBUG   ( 2288):  scr 80000012

I/DEBUG   ( 2288):

I/DEBUG   ( 2288):          #00  pc 00015ca4  /system/lib/libc.so

I/DEBUG   ( 2288):          #01  pc 0002cd1c  /system/lib/libdbus.so

I/DEBUG   ( 2288):          #02  pc 0001635c  /system/lib/libdbus.so

I/DEBUG   ( 2288):          #03  pc 0000e95e  /system/lib/libdbus.so

I/DEBUG   ( 2288):          #04  pc 00062472  /system/lib/libandroid_runtime.so

I/DEBUG   ( 2288):          #05  pc 00017e34  /system/lib/libdvm.so

I/DEBUG   ( 2288):          #06  pc 0004968c  /system/lib/libdvm.so

I/DEBUG   ( 2288):          #07  pc 0001d034  /system/lib/libdvm.so

I/DEBUG   ( 2288):          #08  pc 000220e4  /system/lib/libdvm.so

I/DEBUG   ( 2288):          #09  pc 00020fdc  /system/lib/libdvm.so

I/DEBUG   ( 2288):          #10  pc 0005fc40  /system/lib/libdvm.so

I/DEBUG   ( 2288):          #11  pc 0005fe54  /system/lib/libdvm.so

I/DEBUG   ( 2288):          #12  pc 000541aa  /system/lib/libdvm.so

I/DEBUG   ( 2288):          #13  pc 000118e4  /system/lib/libc.so

I/DEBUG   ( 2288):          #14  pc 000114b0  /system/lib/libc.so

I/DEBUG   ( 2288):

I/DEBUG   ( 2288): code around pc:

I/DEBUG   ( 2288): 6fd15c84 2c006824 e028d1fb b13368db c064f8df

I/DEBUG   ( 2288): 6fd15c94 44fc2401 4000f8cc 49124798 25002027

I/DEBUG   ( 2288): 6fd15ca4 f7f57008 2106ec7c edd8f7f6 460aa901

I/DEBUG   ( 2288): 6fd15cb4 f04f2006 95015380 95029303 e93ef7f6

I/DEBUG   ( 2288): 6fd15cc4 462aa905 f7f62002 f7f5e94a 2106ec68

I/DEBUG   ( 2288):

I/DEBUG   ( 2288): code around lr:

I/DEBUG   ( 2288): 6fd191b8 4a0e4b0d e92d447b 589c41f0 26004680

I/DEBUG   ( 2288): 6fd191c8 686768a5 f9b5e006 b113300c 47c04628

I/DEBUG   ( 2288): 6fd191d8 35544306 37fff117 6824d5f5 d1ef2c00

I/DEBUG   ( 2288): 6fd191e8 e8bd4630 bf0081f0 00028344 ffffff88

I/DEBUG   ( 2288): 6fd191f8 b086b570 f602fb01 9004460c a804a901

I/DEBUG   ( 2288):

I/DEBUG   ( 2288): stack:

I/DEBUG   ( 2288):     2fbfca88  6fd42664 

I/DEBUG   ( 2288):     2fbfca8c  000a8f38 

I/DEBUG   ( 2288):     2fbfca90  00000093 

I/DEBUG   ( 2288):     2fbfca94  6fd182a1  /system/lib/libc.so

I/DEBUG   ( 2288):     2fbfca98  6fd4270c 

I/DEBUG   ( 2288):     2fbfca9c  6fd426b8 

I/DEBUG   ( 2288):     2fbfcaa0  00000000 

I/DEBUG   ( 2288):     2fbfcaa4  6fd191d9  /system/lib/libc.so

I/DEBUG   ( 2288):     2fbfcaa8  00000001 

I/DEBUG   ( 2288):     2fbfcaac  2fbfcadc 

I/DEBUG   ( 2288):     2fbfcab0  6e734028  /system/lib/libdbus.so

I/DEBUG   ( 2288):     2fbfcab4  6e743478 

I/DEBUG   ( 2288):     2fbfcab8  00000b47 

I/DEBUG   ( 2288):     2fbfcabc  6fd184fb  /system/lib/libc.so

I/DEBUG   ( 2288):     2fbfcac0  df002777 

I/DEBUG   ( 2288):     2fbfcac4  e3a070ad 

I/DEBUG   ( 2288): #00 2fbfcac8  6e743478 

I/DEBUG   ( 2288):     2fbfcacc  6e734028  /system/lib/libdbus.so

I/DEBUG   ( 2288):     2fbfcad0  6e743478 

I/DEBUG   ( 2288):     2fbfcad4  6fd1cf75  /system/lib/libc.so

I/DEBUG   ( 2288):     2fbfcad8  6e73e9a7  /system/lib/libdbus.so

I/DEBUG   ( 2288):     2fbfcadc  fffffbdf 

I/DEBUG   ( 2288):     2fbfcae0  2fbfcacc 

I/DEBUG   ( 2288):     2fbfcae4  6e743478 

I/DEBUG   ( 2288):     2fbfcae8  6e743478 

I/DEBUG   ( 2288):     2fbfcaec  6e72cd1f  /system/lib/libdbus.so

I/DEBUG   ( 2288): #01 2fbfcaf0  6fd426b8 

I/DEBUG   ( 2288):     2fbfcaf4  6e716361  /system/lib/libdbus.so

I/DEBUG   ( 2288): debuggerd committing suicide to free the zombie!

I/DEBUG   ( 2333): debuggerd: Sep  6 2012 11:40:14

Thanks.

0 Kudos

832 Views
xinyu_chen
NXP Employee
NXP Employee

Hi

You can disable BT services in: fameworks/base/services/java/com/android/server/SystemServer.java. Like:

diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.ja

index efb88a6..6d301d2 100644

--- a/services/java/com/android/server/SystemServer.java

+++ b/services/java/com/android/server/SystemServer.java

@@ -203,30 +203,7 @@ class ServerThread extends Thread {

             ((ActivityManagerService)ServiceManager.getService("activity"))

                     .setWindowManager(wm);

-            // Skip Bluetooth if we have an emulator kernel

-            // TODO: Use a more reliable check to see if this product should

-            // support Bluetooth - see bug 988521

-            if (SystemProperties.get("ro.kernel.qemu").equals("1")) {

-                Slog.i(TAG, "Registering null Bluetooth Service (emulator)");

-                ServiceManager.addService(BluetoothAdapter.BLUETOOTH_SERVICE, null);

-            } else if (factoryTest == SystemServer.FACTORY_TEST_LOW_LEVEL) {

-                Slog.i(TAG, "Registering null Bluetooth Service (factory test)");

-                ServiceManager.addService(BluetoothAdapter.BLUETOOTH_SERVICE, null);

-            } else {

-                Slog.i(TAG, "Bluetooth Service");

-                bluetooth = new BluetoothService(context);

-                ServiceManager.addService(BluetoothAdapter.BLUETOOTH_SERVICE, bluetooth);

-                bluetooth.initAfterRegistration();

-                bluetoothA2dp = new BluetoothA2dpService(context, bluetooth);

-                ServiceManager.addService(BluetoothA2dpService.BLUETOOTH_A2DP_SERVICE,

-                                          bluetoothA2dp);

-

-                int bluetoothOn = Settings.Secure.getInt(mContentResolver,

-                    Settings.Secure.BLUETOOTH_ON, 0);

-                if (bluetoothOn > 0) {

-                    bluetooth.enable();

-                }

-            }

+       ServiceManager.addService(BluetoothAdapter.BLUETOOTH_SERVICE, null);

         } catch (RuntimeException e) {

             Slog.e("System", "Failure starting core service", e);

832 Views
Goi
Contributor II

Thanks.

I applied the patch, but upon Android build, I get several errors.

prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/imx53_loco/obj/EXECUTABLES/netd_intermediates/PanController.o: in function PanController::startPan():system/netd/PanController.cpp:51: error: undefined reference to 'bt_is_enabled'

prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/imx53_loco/obj/EXECUTABLES/netd_intermediates/SoftapController.o: in function wifi_load_profile(bool):system/netd/SoftapController.cpp:260: error: undefined reference to 'wpa_ctrl_reload'

prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/imx53_loco/obj/EXECUTABLES/netd_intermediates/SoftapController.o: in function wifi_close_hostapd_connection():system/netd/SoftapController.cpp:249: error: undefined reference to 'wpa_ctrl_close'

prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/imx53_loco/obj/EXECUTABLES/netd_intermediates/SoftapController.o: in function wifi_connect_to_hostapd():system/netd/SoftapController.cpp:232: error: undefined reference to 'wpa_ctrl_open'

prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/imx53_loco/obj/EXECUTABLES/netd_intermediates/SoftapController.o: in function wifi_connect_to_hostapd():system/netd/SoftapController.cpp:238: error: undefined reference to 'wpa_ctrl_attach'

prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/imx53_loco/obj/EXECUTABLES/netd_intermediates/SoftapController.o: in function wifi_connect_to_hostapd():system/netd/SoftapController.cpp:239: error: undefined reference to 'wpa_ctrl_close'

prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/imx53_loco/obj/EXECUTABLES/netd_intermediates/SoftapController.o: in function wifi_start_hostapd():system/netd/SoftapController.cpp:140: error: undefined reference to 'wpa_ctrl_cleanup'


0 Kudos