Thats the thing. I m not able to find out why 2 times of hciattach is required. Also start hciattach and start bluetoothd didn't do anything.
can't i just use this in init.rc like i do in command line. But the thing is this also didn't work. Any modification required? on boot start dbus exec /system/bin/hciattach -s 115200 /dev/s3c_serial1 any 460800 flow NULL exec /system/bin/hciattach -s 115200 /dev/s3c_serial1 bcm2035 460800 flow NULL I m badly stuck on this.. Is there anything to be done in hciattach.c file?? Thanks, Ajith On Wed, Aug 4, 2010 at 2:36 PM, Pavan Savoy <pavan.sa...@gmail.com> wrote: > ok basic BT start-up on android happens in system/bluetooth/bluedroid.. > it has to do .. > 1. set power i.e write 1 to /sys/class/rfkill/rfkill0/state > 2. run hciattach ..via the start hciattach .. > 3. ioctl DEVUP to hci0 .. > 4. run bluetooth via doing a start bluetoothd.. > > I have no idea why in your case hciattach need to be run twice.. it need > not.. > and also when I mentioned start bluetoothd i meant > $ start bluetoothd > > basically start <service> starts up the service mentioned in init.rc.. > so in your case mention hciattach in your init.rc > and then try and do start hciattach from cmd line... if this doens't > work then BT on from UI will also not work.. > > > > > On Wed, Aug 4, 2010 at 2:31 PM, Ajith Kamath <sjce.aj...@gmail.com> wrote: > > Hiattach has bcm specific initialisation. > > > > Till now to run BT I didn't do start bluetoothd command. > > Also after 2 hciattach's when i manaually give hciconfig hci0 up, it > gives > > me Connection timed out(110) error. > > But inspite of this BT will be start when clicked , since i have given > those > > 2 commands( i guess) > > > > I used to check /sys/class/rfkill/rfkill0 for power state. > > Here state will be 1 when boot up. > > Is this right parameter to check? > > > > I also checked with 2 hciattach's in init.rc , It didn't work either. > > Also , if i give bluetoothd -start i get this : > > # bluetoothd -start > > bluetoothd -start > > ** (process:2648): CRITICAL (recursed) **: g_convert_with_fallback: > > assertion `to_codeset != NULL' failed > > aborting... > > [1] + Stopped (signal) bluetoothd -start > > > > Further, When bluetooth starts successfully(cmd line - 2 commands) heres > > log: > > > > 01-01 00:24:58.711: INFO/ActivityManager(2509): Displayed activity > > com.android.settings/.bluetooth.BluetoothSettings: 310 ms (total 310 ms) > > 01-01 00:24:59.806: DEBUG/BluetoothService(2509): Bluetooth state 0 -> 1 > > 01-01 00:25:02.030: INFO/bluedroid(2509): Starting hciattach daemon > > 01-01 00:25:02.061: INFO/bluedroid(2509): Starting bluetoothd deamon > > 01-01 00:25:05.311: ERROR/BluetoothEventLoop.cpp(2509): event_filter: > > Received signal org.freedesktop.DBus:NameAcquired from > /org/freedesktop/DBus > > 01-01 00:25:05.416: DEBUG/BluetoothService(2509): Bluetooth state 1 -> 2 > > 01-01 00:25:05.456: DEBUG/dalvikvm(2616): GC freed 1276 objects / 95736 > > bytes in 440ms > > 01-01 00:25:05.471: VERBOSE/A2dpAudioInterface(1880): setParameters() > > bluetooth_enabled=true > > 01-01 00:25:05.551: ERROR/BluetoothEventLoop.cpp(2509): event_filter: > > Received signal org.bluez.Adapter:PropertyChanged from > /org/bluez/2482/hci0 > > 01-01 00:25:05.571: INFO/bluetooth_ScoSocket.cpp(2550): Listening SCO > > socket... > > 01-01 00:25:05.671: INFO/BluetoothPbapService(2616): Starting PBAP > service > > 01-01 00:25:05.706: DEBUG/dalvikvm(2976): GC freed 3503 objects / 212264 > > bytes in 167ms > > 01-01 00:25:14.666: INFO/BtOpp RfcommListener(2616): Accept thread > started > > on channel 12 > > 01-01 00:25:15.816: ERROR/BluetoothEventLoop.cpp(2509): event_filter: > > Received signal org.bluez.Adapter:PropertyChanged from > /org/bluez/2482/hci0 > > > > > > When error, this is the log: > > > > 01-01 00:01:24.536: INFO/ActivityManager(1928): Displayed activity > > com.android.settings/.bluetooth.BluetoothSettings: 306 ms (total 306 ms) > > 01-01 00:01:25.181: DEBUG/BluetoothService(1928): Bluetooth state 0 -> 1 > > 01-01 00:01:27.386: INFO/bluedroid(1928): Starting hciattach daemon > > 01-01 00:01:30.411: DEBUG/dalvikvm(2020): GC freed 2082 objects / 181736 > > bytes in 67ms > > 01-01 00:01:37.571: ERROR/bluedroid(1928): bt_enable: Timeout waiting for > > HCI device to come up > > 01-01 00:01:37.571: DEBUG/BluetoothService(1928): Bluetooth state 1 -> 0 > > 01-01 00:01:37.681: ERROR/libdbus(1928): arguments to > > dbus_message_new_method_call() were incorrect, assertion "path != NULL" > > failed in file external/dbus/dbus/dbus-message.c line 1070. > > 01-01 00:01:37.681: ERROR/libdbus(1928): This is normally a bug in some > > application using the D-Bus library. > > 01-01 00:01:37.681: DEBUG/libc-abort(1928): abort() called in pid 1928 > > 01-01 00:01:37.721: INFO/DEBUG(1877): *** *** *** *** *** *** *** *** *** > > *** *** *** *** *** *** *** > > 01-01 00:01:37.721: INFO/DEBUG(1877): Build fingerprint: > > > 'Samsung/SPH-M900/SPH-M900/SPH-M900:2.1-update1/ECLAIR/DH02:eng/test-keys' > > 01-01 00:01:37.721: INFO/DEBUG(1877): pid: 1928, tid: 2033 >>> > > system_server <<< > > 01-01 00:01:37.721: INFO/DEBUG(1877): signal 11 (SIGSEGV), fault addr > > deadbaad > > 01-01 00:01:37.721: INFO/DEBUG(1877): r0 00000027 r1 afe2f218 r2 > > afe2f23d r3 afe10635 > > 01-01 00:01:37.721: INFO/DEBUG(1877): r4 afe37e08 r5 afe2f218 r6 > > deadbaad r7 ae833d7d > > 01-01 00:01:37.721: INFO/DEBUG(1877): r8 47b5eb80 r9 444e6eb8 10 > > 444e6ea0 fp 002554e0 > > 01-01 00:01:37.721: INFO/DEBUG(1877): ip 000a3832 sp 47b5ea18 lr > > afe1f34d pc afe1063e cpsr a0000030 > > 01-01 00:01:37.781: DEBUG/dalvikvm(2104): GC freed 3477 objects / 211640 > > bytes in 174ms > > 01-01 00:01:37.851: INFO/DEBUG(1877): #00 pc 0001063e > > /system/lib/libc.so > > 01-01 00:01:37.851: INFO/DEBUG(1877): #01 pc 0002c28c > > /system/lib/libdbus.so > > 01-01 00:01:37.851: INFO/DEBUG(1877): #02 pc 00016086 > > /system/lib/libdbus.so > > 01-01 00:01:37.851: INFO/DEBUG(1877): #03 pc 00020db0 > > /system/lib/libdbus.so > > 01-01 00:01:37.851: INFO/DEBUG(1877): #04 pc 0004d450 > > /system/lib/libandroid_runtime.so > > 01-01 00:01:37.851: INFO/DEBUG(1877): #05 pc 0004d56a > > /system/lib/libandroid_runtime.so > > 01-01 00:01:37.861: INFO/DEBUG(1877): #06 pc 0004f176 > > /system/lib/libandroid_runtime.so > > 01-01 00:01:37.861: INFO/DEBUG(1877): #07 pc 0000f174 > > /system/lib/libdvm.so > > 01-01 00:01:37.861: INFO/DEBUG(1877): #08 pc 00037f16 > > /system/lib/libdvm.so > > 01-01 00:01:37.861: INFO/DEBUG(1877): #09 pc 0003159a > > /system/lib/libdvm.so > > 01-01 00:01:37.861: INFO/DEBUG(1877): #10 pc 00013ed8 > > /system/lib/libdvm.so > > 01-01 00:01:37.866: INFO/DEBUG(1877): #11 pc 000196b4 > > /system/lib/libdvm.so > > 01-01 00:01:37.866: INFO/DEBUG(1877): #12 pc 00018c88 > > /system/lib/libdvm.so > > 01-01 00:01:37.866: INFO/DEBUG(1877): #13 pc 0004dbd2 > > /system/lib/libdvm.so > > 01-01 00:01:37.866: INFO/DEBUG(1877): #14 pc 0003b324 > > /system/lib/libdvm.so > > 01-01 00:01:37.866: INFO/DEBUG(1877): #15 pc 0002d674 > > /system/lib/libdvm.so > > 01-01 00:01:37.871: INFO/DEBUG(1877): #16 pc 0003d202 > > /system/lib/libandroid_runtime.so > > 01-01 00:01:37.871: INFO/DEBUG(1877): #17 pc 0003d514 > > /system/lib/libandroid_runtime.so > > 01-01 00:01:37.871: INFO/DEBUG(1877): #18 pc 0001540c > > /system/lib/libbinder.so > > 01-01 00:01:37.871: INFO/DEBUG(1877): #19 pc 00018ae4 > > /system/lib/libbinder.so > > 01-01 00:01:37.896: INFO/DEBUG(1877): #20 pc 00018cb2 > > /system/lib/libbinder.so > > 01-01 00:01:37.896: INFO/DEBUG(1877): #21 pc 0001f33c > > /system/lib/libbinder.so > > 01-01 00:01:37.896: INFO/DEBUG(1877): #22 pc 0001b60c > > /system/lib/libutils.so > > 01-01 00:01:37.896: INFO/DEBUG(1877): #23 pc 0002886e > > /system/lib/libandroid_runtime.so > > 01-01 00:01:37.896: INFO/DEBUG(1877): #24 pc 0001ba36 > > /system/lib/libutils.so > > 01-01 00:01:37.901: INFO/DEBUG(1877): #25 pc 0000f8d0 > > /system/lib/libc.so > > 01-01 00:01:37.901: INFO/DEBUG(1877): #26 pc 0000f3a4 > > /system/lib/libc.so > > 01-01 00:01:37.901: INFO/DEBUG(1877): stack: > > 01-01 00:01:37.901: INFO/DEBUG(1877): 47b5e9d8 47b5ea14 > > 01-01 00:01:37.901: INFO/DEBUG(1877): 47b5e9dc afe13ab3 > > /system/lib/libc.so > > 01-01 00:01:37.901: INFO/DEBUG(1877): 47b5e9e0 afe3802c > > /system/lib/libc.so > > 01-01 00:01:37.901: INFO/DEBUG(1877): 47b5e9e4 afe37fd8 > > /system/lib/libc.so > > 01-01 00:01:37.901: INFO/DEBUG(1877): 47b5e9e8 00000000 > > 01-01 00:01:37.901: INFO/DEBUG(1877): 47b5e9ec afe13ce5 > > /system/lib/libc.so > > 01-01 00:01:37.901: INFO/DEBUG(1877): 47b5e9f0 00000000 > > 01-01 00:01:37.901: INFO/DEBUG(1877): 47b5e9f4 be596834 > > 01-01 00:01:37.901: INFO/DEBUG(1877): 47b5e9f8 00015e58 [heap] > > 01-01 00:01:37.901: INFO/DEBUG(1877): 47b5e9fc afe37e08 > > /system/lib/libc.so > > 01-01 00:01:37.901: INFO/DEBUG(1877): 47b5ea00 afe2f218 > > /system/lib/libc.so > > 01-01 00:01:37.901: INFO/DEBUG(1877): 47b5ea04 00002ed8 > > 01-01 00:01:37.901: INFO/DEBUG(1877): 47b5ea08 ae833d7d > > /system/lib/libdbus.so > > 01-01 00:01:37.901: INFO/DEBUG(1877): 47b5ea0c afe10635 > > /system/lib/libc.so > > 01-01 00:01:37.901: INFO/DEBUG(1877): 47b5ea10 df002777 > > 01-01 00:01:37.901: INFO/DEBUG(1877): 47b5ea14 e3a070ad > > 01-01 00:01:37.901: INFO/DEBUG(1877): #00 47b5ea18 afe37fd8 > > /system/lib/libc.so > > 01-01 00:01:37.901: INFO/DEBUG(1877): 47b5ea1c ae83a22c > > /system/lib/libdbus.so > > 01-01 00:01:37.901: INFO/DEBUG(1877): 47b5ea20 ae833d7d > > /system/lib/libdbus.so > > 01-01 00:01:37.921: INFO/DEBUG(1877): 47b5ea24 afe176cf > > /system/lib/libc.so > > 01-01 00:01:37.921: INFO/DEBUG(1877): 47b5ea28 ae833d7d > > /system/lib/libdbus.so > > 01-01 00:01:37.921: INFO/DEBUG(1877): 47b5ea2c fffffbdf > > 01-01 00:01:37.921: INFO/DEBUG(1877): 47b5ea30 ae8423c4 > > /system/lib/libdbus.so > > 01-01 00:01:37.921: INFO/DEBUG(1877): 47b5ea34 afe37fd8 > > /system/lib/libc.so > > 01-01 00:01:37.921: INFO/DEBUG(1877): 47b5ea38 ae83a22c > > /system/lib/libdbus.so > > 01-01 00:01:37.921: INFO/DEBUG(1877): 47b5ea3c ae82c28f > > /system/lib/libdbus.so > > 01-01 00:01:37.921: INFO/DEBUG(1877): #01 47b5ea40 ae8423c4 > > /system/lib/libdbus.so > > 01-01 00:01:37.921: INFO/DEBUG(1877): 47b5ea44 ae81608b > > /system/lib/libdbus.so > > 01-01 00:01:40.816: INFO/ActivityThread(2094): Removing dead content > > provider: settings > > 01-01 00:01:40.821: ERROR/BluetoothAdapter(2073): > > android.os.DeadObjectException > > 01-01 00:01:40.821: ERROR/BluetoothAdapter(2073): at > > android.os.BinderProxy.transact(Native Method) > > 01-01 00:01:40.821: ERROR/BluetoothAdapter(2073): at > > android.bluetooth.IBluetooth$Stub$Proxy.getAddress(IBluetooth.java:400) > > 01-01 00:01:40.821: ERROR/BluetoothAdapter(2073): at > > android.bluetooth.BluetoothAdapter.getAddress(BluetoothAdapter.java:168) > > 01-01 00:01:40.821: ERROR/BluetoothAdapter(2073): at > > > com.android.bluetooth.pbap.BluetoothPbapService.onCreate(BluetoothPbapService.java:196) > > 01-01 00:01:40.821: ERROR/BluetoothAdapter(2073): at > > android.app.ActivityThread.handleCreateService(ActivityThread.java:2686) > > 01-01 00:01:40.821: ERROR/BluetoothAdapter(2073): at > > android.app.ActivityThread.access$3100(ActivityThread.java:116) > > 01-01 00:01:40.821: ERROR/BluetoothAdapter(2073): at > > android.app.ActivityThread$H.handleMessage(ActivityThread.java:1848) > > 01-01 00:01:40.821: ERROR/BluetoothAdapter(2073): at > > android.os.Handler.dispatchMessage(Handler.java:99) > > 01-01 00:01:40.821: ERROR/BluetoothAdapter(2073): at > > android.os.Looper.loop(Looper.java:123) > > 01-01 00:01:40.821: ERROR/BluetoothAdapter(2073): at > > android.app.ActivityThread.main(ActivityThread.java:4208) > > 01-01 00:01:40.821: ERROR/BluetoothAdapter(2073): at > > java.lang.reflect.Method.invokeNative(Native Method) > > 01-01 00:01:40.821: ERROR/BluetoothAdapter(2073): at > > java.lang.reflect.Method.invoke(Method.java:521) > > 01-01 00:01:40.821: ERROR/BluetoothAdapter(2073): at > > > com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:850) > > 01-01 00:01:40.821: ERROR/BluetoothAdapter(2073): at > > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:608) > > 01-01 00:01:40.821: ERROR/BluetoothAdapter(2073): at > > dalvik.system.NativeStart.main(Native Method) > > 01-01 00:01:40.826: INFO/ServiceManager(1875): service 'batteryinfo' died > > 01-01 00:01:40.826: INFO/ServiceManager(1875): service > 'activity.services' > > died > > 01-01 00:01:40.826: INFO/ServiceManager(1875): service 'usagestats' died > > > > and all service die and it restarts. > > > > Can you please advice on this > > > > Thanks , > > Ajith > > > > > > > > > > > > On Wed, Aug 4, 2010 at 2:02 PM, Pavan Savoy <pavan.sa...@gmail.com> > wrote: > >> > >> there should really be on 1 hciattach, i.e it needs to be run once.. > >> I guess with mentioning bcmxxxx, the hciattach would have a custom > >> _init and _post function which does BCM specific initialization, like > >> setting baud-rate via HCI-VS and fw download... > >> > >> but via cmd line.. you should probably be doing an start bluetoothd > >> before doing hciattach, in case hciattach also needs hci0 to be up ... > >> > >> also how do you make sure chip is ON ? > >> Is it ON always? on boot ? > >> > >> On Wed, Aug 4, 2010 at 1:59 PM, Ajith Kamath <sjce.aj...@gmail.com> > wrote: > >> > Hi Pavan, > >> > But doing only hciattach with device type as 'any' doesn't work.( I > >> > tried > >> > that now , inside init.rc) > >> > Do i need to put second hciattach with dev type as 'bcm2035' in > >> > init.rc??? > >> > > >> > Also in command line only after exceution of both commands , i get > >> > buletooth > >> > running. > >> > I stumbled across this by accident. But to do have anyidea why is it > >> > needed > >> > twice? > >> > > >> > When I run command with dev type any i get : > >> > #hciattach -s 115200 /dev/s3c_serial1 any 460800 flow NULL > >> > hciattach -s 115200 /dev/s3c_serial1 any 460800 flow NULL > >> > Device setup complete > >> > > >> > Next when I run with bcm2035 i get: > >> > # hciattach -s 115200 /dev/s3c_serial1 bcm2035 460800 flow NULL > >> > hciattach -s 115200 /dev/s3c_serial1 bcm2035 460800 flow NULL > >> > Failed to write reset command > >> > Can't initialize device: Unknown error: 0 > >> > > >> > > >> > But only after I completed both the steps, BT will be up. Else, it > will > >> > restart the device. > >> > Also if i directly start off with bcm2035 it give me initialization > >> > timed > >> > out error. > >> > Any advice?? > >> > > >> > Thanks, > >> > Ajith > >> > > >> > On Wed, Aug 4, 2010 at 12:19 PM, Pavan Savoy <pavan.sa...@gmail.com> > >> > wrote: > >> >> > >> >> On Wed, Aug 4, 2010 at 12:19 PM, Pavan Savoy <pavan.sa...@gmail.com> > >> >> wrote: > >> >> > #service hciattachd /system/bin/hciattach -s 115200 > /dev/s3c_serial1 > >> >> > any 460800 flow NULL > >> >> > #user root > >> >> > #group bluetooth net_bt_admin > >> >> > #disabled > >> >> > #oneshot > >> >> > > >> >> > is almost correct except for the hciattach"d" part.. > >> >> > so your entry should be ... > >> >> > > >> >> > service hciattach /system/bin/hciattach -s 115200 /dev/s3c_serial1 > >> >> > any > >> >> > 460800 flow NULL > >> >> > user root > >> >> > group bluetooth net_bt_admin > >> >> > disabled > >> >> > oneshot > >> >> > > >> >> > And no there is no hcid anymore since bluez4.x.. it is now > >> >> > bluetoothd.. which you have it properly.. > >> >> > > >> >> > Assuming you have your rfkill driver in right place, and it has > >> >> > exposed the /sys/class/rfkill/rfkill0/state entry .. everything > >> >> > should > >> >> > automagically work !! > >> >> > > >> >> > > >> >> > On Wed, Aug 4, 2010 at 11:57 AM, Ajith Kamath < > sjce.aj...@gmail.com> > >> >> > wrote: > >> >> >> Hi all, > >> >> >> > >> >> >> I'm able to start bluetooth after porting only from command line. > >> >> >> I give following commands and it works > >> >> >> > >> >> >> #hciattach -s 115200 /dev/s3c_serial1 any 460800 flow NULL > >> >> >> #hciattach -s 115200 /dev/s3c_serial1 bcm2035 460800 flow NULL > >> >> >> > >> >> >> Doing this brings bluetooth up for me. > >> >> >> But I want to put this in init.rc file so that it happens in boot > >> >> >> itself. > >> >> >> But its not working. > >> >> >> Can someone tell how to put it in init.rc > >> >> >> > >> >> >> Also from references i have realised that hcid is not at all there > >> >> >> in > >> >> >> system/bin or in data/misc/hcid > >> >> >> Can some one please advice on this. > >> >> >> > >> >> >> commented parts in init.rc relating to bluetooth are things I > tried > >> >> >> but > >> >> >> didn't work > >> >> >> > >> >> >> Thanks, > >> >> >> Ajith > >> >> >> > >> >> >> > >> >> >> > >> >> >> -- > >> >> >> unsubscribe: > >> >> >> android-porting+unsubscr...@googlegroups.com<android-porting%2bunsubscr...@googlegroups.com> > >> >> >> website: http://groups.google.com/group/android-porting > >> >> >> > >> >> > > >> >> > > >> >> > > >> >> > -- > >> >> > --Pavan Savoy > >> >> > > >> >> > >> >> > >> >> > >> >> -- > >> >> --Pavan Savoy > >> >> > >> >> -- > >> >> unsubscribe: > >> >> android-porting+unsubscr...@googlegroups.com<android-porting%2bunsubscr...@googlegroups.com> > >> >> website: http://groups.google.com/group/android-porting > >> > > >> > > >> > >> > >> > >> -- > >> --Pavan Savoy > > > > > > > > -- > --Pavan Savoy > -- unsubscribe: android-porting+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-porting