FORUMS
Remove All Ads from XDA
Honor 7x
Win an Honor 7X!

Getting bluetooth working in Hero [updated: 8/26/2009]

1,129 posts
Thanks Meter: 98
 
By shafty023, Senior Member on 17th June 2009, 04:39 AM
Post Reply Email Thread
*More progress 11:04pm CST 8/26/09*
Tracked down what calls the BTIP service, it's /system/lib/libandroid_runtime.so . Tried replacing it with a cupcake build, rebooted and ran into the issue where /system/framework/framework.jar is still referencing calls that were in the Hero libandroid_runtime.so . So replaced framework.jar and framework.odex from cupcake build and got the following error.

Code:
D/AndroidRuntime( 1517): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<                                                     
D/AndroidRuntime( 1517): CheckJNI is OFF                                                                                        
I/dalvikvm( 1517): DexOpt: mismatch dep signature for '/system/framework/core.odex'                                             
E/dalvikvm( 1517): /system/framework/framework.jar odex has stale dependencies                                                  
I/dalvikvm( 1517): Zip is good, but no classes.dex inside, and no valid .odex file in the same directory                        
D/libc-abort( 1517): abort() called in pid 1517
Any "educated" ideas?


*Questions & Progress 01:09pm CST 8/17/09*
So lately what I've been trying to do is find where a reference is made to actually call the BTIPS service. I've been lookiing in /system/framework and /data/app_s/Settings.apk but haven't found it yet. What I'm hoping to do is modify the file and have it call BT the same way cupcake did. Has anyone else found where a reference to "btips" is at?

Settings.apk, which is what pops up when on home screen and you hit menu->settings, only makes a call to "android:targetClass="com.android.settings.bluetoo th.BluetoothSettings"

Anywho, if you find it in any system libraries or framework files let me know. Please no PM's or posts about where you "THINK" it may be at. I've already tried the random guessing stuff, now I'm going through libraries one by one trying to find it.

*Some more notes 12:30pm CST 7/24/09*
Here are some notes of interest.

There are two versions of the /system/bin/bts daemon that are floating around on the Hero builds

Code:
md5sum bts
29ffa46f12c01e3690690752b4e2d58d  bts

md5sum bts
5aeaca42d67d3b3c64ceda9ee4bfec1a  bts
There are also two versions of the TIInit_5.3.53.bts firmware files. One is actually just the brf6300.bin file renamed to match what Hero is looking for in /etc/firmware

Code:
md5sum TIInit_5.3.53.bts
d7a214bdb9b4fbc2b4e2dd7e3ab95df0  TIInit_5.3.53.bts

md5sum TIInit_5.3.53.bts
cb3d2ecbfc97c026a0dcceb8c959b7db  TIInit_5.3.53.bts
If you run "strings" on /system/bin/bts and grep for "TII" you'll be able to tell which firmware files that version supports

Code:
TIInit_3.4.27.bts
TIInit_4.2.38.bts
TIInit_5.2.34.bts
TIInit_5.3.53.bts
TIInit_6.2.31.bts
*Nice picture illustrating BT architecture in Android 7:04pm CST 7/17/09*



*A note for ROM devs 02:27pm CST 7/17/09*
Something to note, Hero does not use any of the following legacy services and therefore they can be removed from init.rc & init.trout.rc . This is mainly something the ROM cookers should pay attention to. The btips service actually handles all of this now.

REMOVE THE FOLLOWING:
Code:
service hcid /system/bin/hcid -s -n -f /etc/bluez/hcid.conf
    socket bluetooth stream 660 bluetooth bluetooth
    socket dbus_bluetooth stream 660 bluetooth bluetooth
    # init.rc does not yet support applying capabilities, so run as root and
    # let hcid drop uid to bluetooth with the right linux capabilities
    group bluetooth net_bt_admin misc
    disabled

service hciattach /system/bin/hciattach -n -s 115200 /dev/ttyHS0 texas 4000000 flow
    user bluetooth
    group bluetooth net_bt_admin
    disabled

service hfag /system/bin/sdptool add --channel=10 HFAG
    user bluetooth
    group bluetooth net_bt_admin
    disabled
    oneshot

service hsag /system/bin/sdptool add --channel=11 HSAG
    user bluetooth
    group bluetooth net_bt_admin
    disabled
    oneshot
*Found something 01:48pm CST 7/17/09*
I was looking through init.trout.rc and noticed the following lines
Code:
chown bluetooth bluetooth /sys/devices/platform/msm_serial_hs.0/serial_lock_cpu
chmod 0660 /sys/devices/platform/msm_serial_hs.0/serial_lock_cpu
This may not seem like much but this node does not actually exist in our builds. It's possible, and probably likely, that HTC modified their kernel to support the changes that were made in the bts (btips) daemon.

We all are pretty much not using the HTC kernel, we're using custom compiled kernels from JAC or Cyanogen. I tried using the RUU kernel but couldn't boot at all. Is anyone able to get their phone booting off the RUU kernel and NOT one of the custom kernels that are floating around in these ROMs? If so, can you check if this device node exists?

I believe booting off that kernel could be the answer to the UART clock issues I'm getting and missing devices in /sys .

NEXT
I have been toying around with the following value in init.rc that seems to affect whether or not I get an error.
Code:
/proc/sys/net/unix/max_dgram_qlen
The default is 10, the RUU release of Hero sets it to 999. If I change that to 10000 then it pauses the BT services and just sits there. If I revert to default I get the same error that I see when its set to 999. Wondering if there's a happy medium in queue length (qlen). Just me thinking out loud.

*Latest progress 11:43pm CST 7/15/09*
I wanted to post some newer results I've been having with BT debugging on Hero. I found out how to circumvent the UART disable error. This is done by having the service btips statement in init.rc to look as follows

Code:
service btips /system/bin/bts
    socket bluetooth stream 666 bluetooth bluetooth
    socket dbus_bluetooth stream 666 bluetooth bluetooth
    group bluetooth net_bt_admin root misc
    disabled
    oneshot
The most important part is "oneshot" which tells Android to NOT restart the btips service after it dies. If you leave this off then it will relaunch btips service and tie up the I2C bus.

The newest error I'm getting is the inability to launch HCI. This is hopefully the LAST error before I can get BT functional! Anyways, just wanted to update everyone that I have not stopped working on bluetooth.

Code:
1247718990.888806 BTSTACK(778) INFO  | UATRAN: HCI Command was not acknowledged with an event                     
[ vendor/ti/btips-linux/B_TIPS/btstack/hcitrans/uart/uarttran.c:298 ]                                             
1247718990.889935 BTSTACK(778) INFO  | HCI: HCI_Process detected transport failure                                
[ vendor/ti/btips-linux/B_TIPS/btstack/stack/hci/hci_proc.c:1596 ]                                                
1247718990.890179 BTSTACK(778) INFO  | RADIOMGR:  RmgrHciCallback: 0x6                                            
[ vendor/ti/btips-linux/B_TIPS/btstack/stack/radiomgr.c:364 ]                                                     
1247718990.890362 BTSTACK(778) INFO  | RADIOMGR:  HCI init failed (retrying)                                      
[ vendor/ti/btips-linux/B_TIPS/btstack/stack/radiomgr.c:386 ]                                                     
1247718990.890484 BTSTACK(778) INFO  | RADIOMGR:  HCI init error                                                  
[ vendor/ti/btips-linux/B_TIPS/btstack/stack/radiomgr.c:335 ]                                                     
1247718990.890637 BTSTACK(778) INFO  | ME: HCI Init complete status: 22                                           
[ vendor/ti/btips-linux/B_TIPS/btstack/stack/me/me.c:1220 ]                                                       
1247718990.890789 BTSTACK(778) INFO  | CMGR: Received event HCI_INIT_ERROR                                        
[ vendor/ti/btips-linux/B_TIPS/btstack/profiles/common/conmgr.c:591 ]                                             
1247718990.890942 BTSTACK(778) INFO  | Dbus | inside _BTBUS_COMMON_BTL_callback with event: 6 0[ vendor/ti/btips-linux/EBTIPS/apps/btbus_wrap_common.c:62 ]                                                                         
1247718990.893536 BTSTACK(778) INFO  | sending dbus message from  BTBUS_COMMON_BTL_callback in {vendor/ti/btips-linux/EBTIPS/apps/btbus_wrap_common.c:84}[ vendor/ti/btips-linux/EBTIPS/apps/btbus_wrap_utils.c:189 ]               
1247718990.898022 BTSTACK(778) INFO  | Dbus | _BTBUS_COMMON_BTL_callback signal sent: 6 0[ vendor/ti/btips-linux/EBTIPS/apps/btbus_wrap_common.c:87 ]                                                                               
1247718990.898358 BTSTACK(778) FATAL | HCI Init Status Received while neither FM nor BT On in progress[ vendor/ti/btips-linux/EBTIPS/btl/ti_chip_mngr/ti_chip_mngr.c:1232 ]                                                         
1247718990.898541 BTSTACK(778) Assert | 0[ vendor/ti/btips-linux/EBTIPS/btl/ti_chip_mngr/ti_chip_mngr.c:1232 ]    
1247718990.899121 BTSTACK(778) FATAL | signal 11 sent to our program from address 0xdeadbaad and code 1[ vendor/ti/btips-linux/EBTIPS/apps/btt_task.c:102 ]

I'll update this main post as I, or others, come up with progress or advancements.

The directories for this are already created in the latest Hero init.rc . Just need to create the ddb file
Code:
touch /data/btips/TI/BtDeviceDb.ddb
chmod 666 /data/btips/TI/BtDeviceDb.ddb
The results of making these changes is you are able to get ALL bluetooth services and sockets created. Bluetooth is working from the commandline, just not on the frontend where we need it.
 
 
17th June 2009, 10:17 PM |#2  
Senior Member
Thanks Meter: 12
 
More
Going to go ahead and bump this up there
17th June 2009, 10:37 PM |#3  
UnkzDomain's Avatar
Senior Member
Flag Louisville
Thanks Meter: 4
 
More
Yeah, I posted in the other thread that I had talked to Haykuro about this. He told me that he got this working 100% without adding any other files; he just used the ones already in the Hero build.

He hasn't been responding to me recently, so I can't get any more info, but when he does, I'll ask him what else we need to do to eliminate the few errors that we are getting.
17th June 2009, 10:58 PM |#4  
OP Senior Member
Flag Austin,TX
Thanks Meter: 98
 
More
Quote:
Originally Posted by amgupt01

Yeah, I posted in the other thread that I had talked to Haykuro about this. He told me that he got this working 100% without adding any other files; he just used the ones already in the Hero build.

He hasn't been responding to me recently, so I can't get any more info, but when he does, I'll ask him what else we need to do to eliminate the few errors that we are getting.

Hmmm no other files huh, well that helps me keep my focus on what is already in the build then. Thanks, I'll keep hammering at this. I wonder why if Haykuro got bluetooth working, he didn't release Hero with the fix? Strange.
17th June 2009, 11:43 PM |#5  
UnkzDomain's Avatar
Senior Member
Flag Louisville
Thanks Meter: 4
 
More
Yeah, he told me that he had Hero 2.0 (yeah, it exists along with Rosie 2.0) working 100%, but he had better Android things to do... I wonder what else Haykuro was working on (before his hard drive got wiped)
17th June 2009, 11:55 PM |#6  
OP Senior Member
Flag Austin,TX
Thanks Meter: 98
 
More
Quote:
Originally Posted by amgupt01

Yeah, he told me that he had Hero 2.0 (yeah, it exists along with Rosie 2.0) working 100%, but he had better Android things to do... I wonder what else Haykuro was working on (before his hard drive got wiped)

Hero/Rosie 2.0 is most likely the GOLD/Production version of the Hero software whereas we have the alpha/beta version. Would be really nice to get my hands on the production version.....
18th June 2009, 01:52 AM |#7  
Senior Member
Thanks Meter: 12
 
More
Doubt he's going to ever give it to anyone.
18th June 2009, 01:52 AM |#8  
Zarboz's Avatar
Known Scammer
Flag Denver
Thanks Meter: 9,259
 
Donate to Me
More
MUST HAVE ROSIE 2.0 hahaha

i wonder where he got it from ...

maybe if we bribe him with a new phone he'lll share?
18th June 2009, 01:56 AM |#9  
Senior Member
Thanks Meter: 12
 
More
If the idiots who tricked him hadn't and people were more respecting and patient, i'll put my $0.02 in that we would have rosie 2.0 by now.
18th June 2009, 02:00 AM |#10  
Zarboz's Avatar
Known Scammer
Flag Denver
Thanks Meter: 9,259
 
Donate to Me
More
Quote:
Originally Posted by alritewhadeva

If the idiots who tricked him hadn't and people were more respecting and patient, i'll put my $0.02 in that we would have rosie 2.0 by now.

I wasnt following these forums too closely when all that happened... sorry to get off topic shafty.. just curious what happened someone pm me with the downlow? ... any way back to shafty ... gettin bt enabled "D
18th June 2009, 06:42 AM |#11  
OP Senior Member
Flag Austin,TX
Thanks Meter: 98
 
More
Made some more progress, check the main thread guys
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes