#8 Bluetooth support

Alpha
fixed
bluetooth (5)
feature-request
hardware-driver
2012-10-12
2012-01-11
Alvin Wong
No

Bluetooth is supported on Angstrom so current kernel driver should be working.
Just have to make Android use the driver.

When trying to enable Bluetooth in the UI it simply does nothing, even with BOARD_HAVE_BLUETOOTH := true.

Related

Tickets: #23

Discussion

  • Alvin Wong

    Alvin Wong - 2012-01-24

    All I can get is this in logcat:

    D/BluetoothService(  865): Bluetooth state 10 -> 11
    V/BluetoothEventRedirector( 1135): Received android.bluetooth.adapter.action.STATE_CHANGED
    D/BluetoothService(  865): Bluetooth state 11 -> 10
    V/BluetoothEventRedirector( 1135): Received android.bluetooth.adapter.action.STATE_CHANGED
    

    I've already tried to modify the code of bluedroid to make it use the specific device for switching bluetooth power, but it doesn't even try to start the hciattach service.

    service hciattach /system/bin/hciattach /dev/ttyS0 any 115200 flow
        user bluetooth
        group bluetooth net_bt_admin
        disabled
        oneshot
    

    The parameters are the same as the script in Angstrom. I've chown'ed /dev/ttyS0 for bluetooth already.

    A bit messing up with bttest enable seems to make hcitool dev show a device, but is different from the MAC address when I see in Windows Mobile.

    I can perform hcitool scan and hcitool inq.

    The problem is that Bluetooth still doesn't start from the Settings UI.

     
  • Alvin Wong

    Alvin Wong - 2012-02-01

    OK, finally done a clean build and more happens. It finally does what bttest enable does when switching from the UI.

    Then the system server restarted.

    02-01 15:52:50.990 D/BluetoothService(874): Bluetooth state 10 -> 11
    02-01 15:52:51.050 V/BluetoothEventRedirector(1119): Received android.bluetooth.adapter.action.STATE_CHANGED
    02-01 15:52:51.160 I/bluedroid(874): Starting hciattach daemon
    02-01 15:52:52.330 I/bluedroid(874): Starting bluetoothd deamon
    02-01 15:52:55.390 I/DEBUG   (833): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    02-01 15:52:55.390 I/DEBUG   (833): Build fingerprint: 'Android/full_ipaq214/ipaq214:2.3.7/GWK74/eng.alvin.20120201.144711:eng/test-keys'
    02-01 15:52:55.390 I/DEBUG   (833): pid: 874, tid: 1214  >>> system_server <<<
    02-01 15:52:55.390 I/DEBUG   (833): signal 7 (SIGBUS), code 128 (?), fault addr 00000000
    02-01 15:52:55.400 I/DEBUG   (833):  r0 ae718c6c  r1 ae734e60  r2 fffe3e0c  r3 00000000
    02-01 15:52:55.400 I/DEBUG   (833):  r4 4712faf7  r5 0023f190  r6 00000031  r7 4712fa54
    02-01 15:52:55.400 I/DEBUG   (833):  r8 4712fb58  r9 43c40f80  10 43c40f68  fp 41e97920
    02-01 15:52:55.400 I/DEBUG   (833):  ip 00000073  sp 4712f978  lr ae718c2b  pc ae718c6c  cpsr a0000030
    02-01 15:52:55.680 I/DEBUG   (833):          #00  pc 00018c6c  /system/lib/libdbus.so
    02-01 15:52:55.680 I/DEBUG   (833):          #01  pc 0001b5b0  /system/lib/libdbus.so
    02-01 15:52:55.680 I/DEBUG   (833):          #02  pc 0001f96a  /system/lib/libdbus.so
    02-01 15:52:55.680 I/DEBUG   (833):          #03  pc 0002023e  /system/lib/libdbus.so
    02-01 15:52:55.690 I/DEBUG   (833):          #04  pc 00020384  /system/lib/libdbus.so
    02-01 15:52:55.690 I/DEBUG   (833):          #05  pc 0006567a  /system/lib/libandroid_runtime.so
    02-01 15:52:55.690 I/DEBUG   (833):          #06  pc 0006580a  /system/lib/libandroid_runtime.so
    02-01 15:52:55.700 I/DEBUG   (833):          #07  pc 00065944  /system/lib/libandroid_runtime.so
    02-01 15:52:55.710 I/DEBUG   (833):          #08  pc 00011d74  /system/lib/libdvm.so
    02-01 15:52:55.710 I/DEBUG   (833):          #09  pc 00042f08  /system/lib/libdvm.so
    02-01 15:52:55.710 I/DEBUG   (833):          #10  pc 0003bab6  /system/lib/libdvm.so
    02-01 15:52:55.710 I/DEBUG   (833):          #11  pc 00016fd4  /system/lib/libdvm.so
    02-01 15:52:55.720 I/DEBUG   (833):          #12  pc 0001c0dc  /system/lib/libdvm.so
    02-01 15:52:55.720 I/DEBUG   (833):          #13  pc 0001afd0  /system/lib/libdvm.so
    02-01 15:52:55.730 I/DEBUG   (833):          #14  pc 00059430  /system/lib/libdvm.so
    02-01 15:52:55.730 I/DEBUG   (833):          #15  pc 00059656  /system/lib/libdvm.so
    02-01 15:52:55.730 I/DEBUG   (833):          #16  pc 0004db4e  /system/lib/libdvm.so
    02-01 15:52:55.730 I/DEBUG   (833):          #17  pc 00011a7c  /system/lib/libc.so
    02-01 15:52:55.740 I/DEBUG   (833):          #18  pc 00011640  /system/lib/libc.so
    02-01 15:52:55.740 I/DEBUG   (833): 
    02-01 15:52:55.740 I/DEBUG   (833): code around pc:
    02-01 15:52:55.740 I/DEBUG   (833): ae718c4c d0552c00 2f002001 3601d052 e04f603e 
    02-01 15:52:55.740 I/DEBUG   (833): ae718c5c 1c288822 9b0a1c31 f7ff9700 e047fdef 
    02-01 15:52:55.750 I/DEBUG   (833): ae718c6c 1e536822 e000419a 1c286822 9b0a1c31 
    02-01 15:52:55.750 I/DEBUG   (833): ae718c7c f7ff9700 e03bfe39 6822990a 1c286863 
    02-01 15:52:55.750 I/DEBUG   (833): ae718c8c 1c319100 f7ff9701 e031ff2b 491e6820 
    02-01 15:52:55.750 I/DEBUG   (833): 
    02-01 15:52:55.750 I/DEBUG   (833): code around lr:
    02-01 15:52:55.760 I/DEBUG   (833): ae718c08 9f0b9203 fae6f00d 41981e43 493b4b3a 
    02-01 15:52:55.760 I/DEBUG   (833): ae718c18 447b4a3b 93003354 4b3a4479 f7fd447a 
    02-01 15:52:55.760 I/DEBUG   (833): ae718c28 9b03fca7 2b173b62 4937d85d 44790098 
    02-01 15:52:55.760 I/DEBUG   (833): ae718c38 18505842 78224687 1c311c28 fddcf011 
    02-01 15:52:55.760 I/DEBUG   (833): ae718c48 20001c04 d0552c00 2f002001 3601d052 
    02-01 15:52:55.760 I/DEBUG   (833): 
    02-01 15:52:55.760 I/DEBUG   (833): stack:
    02-01 15:52:55.770 I/DEBUG   (833):     4712f938  0023f154  [heap]
    02-01 15:52:55.770 I/DEBUG   (833):     4712f93c  0031b6e8  [heap]
    02-01 15:52:55.770 I/DEBUG   (833):     4712f940  00000062  
    02-01 15:52:55.770 I/DEBUG   (833):     4712f944  ae73d5b7  /system/lib/libdbus.so
    02-01 15:52:55.770 I/DEBUG   (833):     4712f948  0001c26e  [heap]
    02-01 15:52:55.780 I/DEBUG   (833):     4712f94c  ae726205  /system/lib/libdbus.so
    02-01 15:52:55.780 I/DEBUG   (833):     4712f950  ae736928  /system/lib/libdbus.so
    02-01 15:52:55.780 I/DEBUG   (833):     4712f954  0023f154  [heap]
    02-01 15:52:55.780 I/DEBUG   (833):     4712f958  002772b0  [heap]
    02-01 15:52:55.780 I/DEBUG   (833):     4712f95c  ae736928  /system/lib/libdbus.so
    02-01 15:52:55.780 I/DEBUG   (833):     4712f960  002772b0  [heap]
    02-01 15:52:55.780 I/DEBUG   (833):     4712f964  4712faf7  
    02-01 15:52:55.780 I/DEBUG   (833):     4712f968  4712faf7  
    02-01 15:52:55.780 I/DEBUG   (833):     4712f96c  0023f190  [heap]
    02-01 15:52:55.790 I/DEBUG   (833):     4712f970  df002777  
    02-01 15:52:55.790 I/DEBUG   (833):     4712f974  e3a070ad  
    02-01 15:52:55.790 I/DEBUG   (833): #00 4712f978  ae735160  /system/lib/libdbus.so
    02-01 15:52:55.790 I/DEBUG   (833):     4712f97c  002772b0  [heap]
    02-01 15:52:55.790 I/DEBUG   (833):     4712f980  00000001  
    02-01 15:52:55.790 I/DEBUG   (833):     4712f984  00000062  
    02-01 15:52:55.790 I/DEBUG   (833):     4712f988  ae735d78  /system/lib/libdbus.so
    02-01 15:52:55.790 I/DEBUG   (833):     4712f98c  4712fa44  
    02-01 15:52:55.790 I/DEBUG   (833):     4712f990  00000062  
    02-01 15:52:55.790 I/DEBUG   (833):     4712f994  4712faf7  
    02-01 15:52:55.790 I/DEBUG   (833):     4712f998  ae735d78  /system/lib/libdbus.so
    02-01 15:52:55.790 I/DEBUG   (833):     4712f99c  ae71b5b5  /system/lib/libdbus.so
    02-01 15:52:55.790 I/DEBUG   (833): #01 4712f9a0  0000006c  
    02-01 15:52:55.790 I/DEBUG   (833):     4712f9a4  4712fa54  
    02-01 15:52:55.790 I/DEBUG   (833):     4712f9a8  ae73c078  /system/lib/libdbus.so
    02-01 15:52:55.800 I/DEBUG   (833):     4712f9ac  ae738278  /system/lib/libdbus.so
    02-01 15:52:55.800 I/DEBUG   (833):     4712f9b0  ae742478  /system/lib/libdbus.so
    02-01 15:52:55.800 I/DEBUG   (833):     4712f9b4  ae71f96f  /system/lib/libdbus.so
    02-01 15:53:11.420 D/Zygote  (835): Process 874 terminated by signal (7)
    02-01 15:53:11.420 I/Zygote  (835): Exit zygote because system server (874) has terminated
    ......
    

    Still can't start Bluetooth normally from UI.

     
  • Alvin Wong

    Alvin Wong - 2012-02-01

    OK, fixed the above problem. Reference: http://tassardge.blog.163.com/blog/static/17230170820114125337103/ (Chinese)

    Solution is to modify [root]/frameworks/base/core/jni/android_server_BluetoothEventLoop.cpp
    In function register_agent change oob from type bool to int.

    I can search for devices and connect, though no actual use at the moment.

    P.S. I keep getting this logcat message:

    E/bluetooth_ScoSocket.cpp(  949): accept_work socket() failed: Protocol not supported
    

    It's just like flooding.

     
    Last edit: Alvin Wong 2012-02-01
  • Alvin Wong

    Alvin Wong - 2012-02-05

    OK, now I try to use brcm_patchram_plus instead of hciattach. With the firmware extracted in Windows Mobile, I get this:

    /system/etc/firmware # /system/bin/brcm_patchram_plus -d --enable_hci --baudrate
     115200 --patchram /system/etc/firmware/BCM2045B2_002.002.011.0211.0000.hcd /dev
    /ttyS0
    Read default bdaddr of (masked address)
    ��AV.�Ĕ
    option enable_hci
    option baudrate with arg 115200
    option patchram with arg /system/etc/firmware/BCM2045B2_002.002.011.0211.0000.hcd
    /dev/ttyS0 
    writing
    01 03 0c 00 
    received 7
    04 0e 04 01 03 0c 00 
    writing
    01 2e fc 00 
    received 7
    04 0e 04 01 2e fc 00 
    writing
    01 4c fc 8b 70 5c 08 00 01 06 00 ee c4 ec 42 07 
    19 c1 5e 00 ec c4 1e 85 b4 ec c4 1e 85 b4 26 02 
    57 02 58 02 58 02 59 02 59 02 5a 02 5a 02 5b 02 
    5b 02 5c 02 5c 02 5d 02 5d 02 5e 02 5e 02 5f 02 
    5f 02 60 02 60 02 61 02 61 02 62 02 62 02 63 02 
    63 02 64 02 64 02 65 02 65 02 66 02 66 02 67 02 
    67 02 68 02 68 02 69 02 69 02 6a 02 6a 02 6b 1f 
    1f 0a fd 04 00 ff ff ff ff 40 06 00 9a 95 00 00 
    5c 0a 02 0a 00 f7 5c 08 00 00 00 00 00 00 00 
    received 7
    04 0e 04 01 4c fc 00 
    writing
    01 4c fc ff f7 5c 08 00 c3 02 00 14 28 c0 3c 00 
    94 8a 0e 00 ff ff ff ff 00 00 00 00 68 00 0f 00 
    00 00 ff ff 00 00 0d 0d 70 fc 0e 00 ff ff ff ff 
    0b 09 00 00 74 fc 0e 00 ff ff ff ff 2e 01 00 00 
    84 fc 0e 00 ff ff ff ff 10 01 00 00 41 30 00 42 
    43 4d 32 30 34 35 42 32 20 33 57 69 72 65 20 43 
    6f 65 78 20 43 6f 6e 66 69 67 75 72 61 74 69 6f 
    6e 20 66 6f 72 20 4d 6f 74 6f 72 6f 6c 61 00 64 
    01 00 02 57 0f 00 00 10 0e 00 00 c2 01 00 59 01 
    3c 00 05 00 00 5b 09 00 f9 03 50 04 28 04 05 05 
    03 69 02 00 00 00 6c 01 00 01 71 01 00 01 6f 0d 
    00 02 b0 bd 7f cb 01 00 00 96 14 58 4b 01 03 01 
    00 01 0a 78 00 88 15 08 00 14 4b 59 68 18 68 1a 
    6a 01 23 1b 02 12 07 01 d5 59 1a 06 e0 02 07 12 
    0f 00 09 80 18 59 1a 09 01 41 18 00 22 0c 48 01 
    e0 40 1a c8 32 88 42 fb d2 0a 48 0b 49 8b 1a 0c 
    c0 0a 48 
    received 7
    04 0e 04 01 4c fc 00 
    writing
    (Many other similar lines...)...
    received 7
    04 0e 04 01 4c fc 00 
    writing
    01 4e fc 04 ff ff ff ff 
    received 7
    04 0e 04 01 4e fc 00 
    writing
    01 03 0c 00 
    <==(And it got stuck here)
    

    Without patchram it's working fine. But is there some problem considering patchram?

     
    Last edit: Alvin Wong 2012-10-11
  • Alvin Wong

    Alvin Wong - 2012-08-30
    • status: open --> accepted
    • assigned_to: Alvin Wong
     
  • Alvin Wong

    Alvin Wong - 2012-08-30

    Bluetooth has been working, but still missing the firmware download part and bdaddr.

     
  • Alvin Wong

    Alvin Wong - 2012-10-12

    Bluetooth address configure support added. Closing.

     
  • Alvin Wong

    Alvin Wong - 2012-10-12
    • status: accepted --> fixed
    • type: feature_request --> feature-request
    • component: Unsure --> hardware-driver
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks