yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] MortICi:
When launching bts, in the logs it sepecifies its looking for 4.2.38.bts, when i looked at the source for the bts (when patched to hciattach) it checks the chip info and specifies which .bts file to use for that chip. So the 5.3.53 will not work.

Check the header hex of the two bts files. The one that comes on the latest jachero rom, doesn't have the magic number, the ASCII value is BTSB(or BTBS) its the first byte in the hex editor.

Im not sure which chip the Hero is using but i don't htink that the one in the current hero builds is valid for our chip.

Googling HTC TyTN II (kaiser) shows that it also has the brf6300 chip, but it uses the TIInit_4.2.38.bts script, not the bin file. However, it might not be using BTS to initilaize but rather the patched bts hciattach binary, thus it would be launched as hciattach -S /etc/firmware/*.bts ttyXX <spped> etc.

I got the latest Kaiser 4.2.38.bts script, and put it in /etc/firmware, but i get the error you see above, where it can find a uart speed of 4000, it should be 4000000. Not sure if the script is not valid or what. However without the script in /etc/firmware, it states that it loads it from "memory" i dunno where this is, but it does the self checks, once it gets to hcill, it either gets an invalid "len" (this is basd on hci_ll.c in the bluez pacakged), the source for the hcill.c file used in BTS i can't find, so i can't look at the source to see what exactly its complaining about.

Either we need a valid 4.2.38.bts script, or figure out why hcill (not hci) is failing, thus causeing HCI to fail.

You mentioned in the first post something about the qlen, and i think you are on the right track with that. But without the source its a little hard to figure out what is causing the problem.

Also it could be that this pre release of the hero WWE build did not have bluetooth working properly yet and the proper .bts scripts were not injected. I think the only way to get the scripts would be either through TI or HTC directly.... but good luck with that.

I seriously don't know why the kaiser script doesn't work. I wish we could get the "original" version not the hotfix version of the bts script.
[G1 Android Development] MortICi:
I got the original 4.2.38.bts from the kaiser, and same error:

unkown UART speed: 4000

So, i guess getting the script is not going to help, the last thing is to figure out why hcill.c fails out.

Messing with the qlen gets different HCI failures....
[G1 Android Development] shafty023:
Well we're going to want to get bts to be able to fully initialize BT on its own, rather than finding a way to get it working via hciattach or bttest. Otherwise we'll end up in the same position where we can't get BT enabled in the UI, but its working from commandline. If you use bttest (its floating around in these forums) you can turn on BT by using the brf6300.bin file. But it doesn't activate in the UI b/c the bts daemon doesn't see it.

Good progress and glad to see someone else contributing. Thanks MortICi
[G1 Android Development] funfobia:
I'm not sure whether anyone aware of that fatal1ty build sapphire hero has a working A2DP. I've been use it for a few weeks already
[G1 Android Development] andonnguyen:
Since there are problems enabling it in the UI via settings, but working from commandline (As I was also able to do), can we just have it run via commandline in a script at startup (as a workaround)? Just a thought.
[G1 Android Development] shafty023:
No b/c it would still only be enabled from the linux environment and not working in the UI. That means you wouldn't be able to place a call and it run through the BT headset.
[G1 Android Development] 8gr0wn8:
so What rom out there do have bluetooth since hero still doesnt???
[G1 Android Development] MortICi:
Im aware of this, however, the sapphire builds, have working bt, and according to the logs, its asking for the same bts script. So they have the same chip.
[G1 Android Development] illusive817:
i swap back and forth between hero and cupcake , The Dude's cupcake has long be tweaked and everything works well
[G1 Android Development] MortICi:
Also, shafty, if the sapphire build is using the same kernel as our current hero builds, it can't be a kernel issue.

There is something we are missing, either in files, or in settings.

The Hero, the orange uk one, is running kernel 2.6.27 so that really doesn't change things.

Like i said i do not think they changed anything in the kernel, and i hardly doubt they re-wrote the stack. Personally i think all three phones are using the same chip, its just we are "missing" something on the Dream.
[G1 Android Development] MortICi:
Here is some info:

Config from the Orange UK HERO offical:

This is the config from the 2.6.29 daproy kernel:

Notice that the FIB option is missing.

Not sure if it will make a difference, but im trying to find out what that options does.

Also im looking into why the error about enabling the uart clock comes up.
[G1 Android Development] MortICi:
I think in reality, it has something to do with enabling/disabling the UART clock.

I have tried everything i can, i do not know why it can not enable or disable the UART clock. It fails in the logs with an unknown error. The only thing i can think of is the fact that some persmissions might be jacked up.

EDIT:Yep, untill we can figure out why it can not enable or disable the UART clock, this isn't going anywhere

I ran strings on /system/bin/bts for different types of key values. The *.bts scripts are in the bts binary, so no need for firmware files or .bts files, not to mention the scripts i got from the kaiser are VERY dated compared to whats in the binary. Second, HCI will not initialize until the UART clock is enabled.

Fix the UART clock problem and you fix BT.

The bigger question is why is it failing at enabling the UART clock on the G1 and not on the Magic/Sapphire

So basically you were on the right track Shafty. Need to get the UART clock enabled.
[G1 Android Development] shafty023:
The FIB_RULES pertains to an IPV4 implementation and shouldn't affect BT. I do agree that it must be something in the kernel configs.

https://dev.mobileread.com/svn/iliados/trunk/kernel/linux-2.4.19/net/ipv4/fib_rules.c
[G1 Android Development] ebg10:
BTIPS

have gotten bluetooth working from command line, and the log says,

E/sky ( 845): turn on/off BT from UI

V/BluetoothDeviceService.cpp( 139): enableNative

V/BluetoothDeviceService.cpp( 139): Starting btips daemon--BtStartBts()

V/bluetooth_common.cpp( 139): Current bts daemon state: BTS_DISABLED

I/bluetooth_common.cpp( 139): BT Start btips daemon

V/BluetoothEventRedirector( 845): Received android.bluetooth.intent.action.BLUETOOTH_STATE_CH ANGED

I/bluetooth_common.cpp( 139): Current bts daemon state: BTS_BT_ENABLED

I/bluetooth_common.cpp( 139): com.ti.btips, /com/ti/btips, com.ti.btips.bmg, Create

E/bluetooth_common.cpp( 139): dbus_func_args_timeout_valist: D-Bus error in Create: org.freedesktop.DBus.Error.ServiceUnknown (The name com.ti.btips was not provided by any .service files)

V/BluetoothDeviceService.cpp( 139): Error BMG Create!

I/bluetooth_common.cpp( 139): com.ti.btips, /com/ti/btips, com.ti.btips.bmg, Create

V/BluetoothDeviceService.cpp( 139): Sucess BMG Create!

I/bluetooth_common.cpp( 139): com.ti.btips, /com/ti/btips, com.ti.btips.ag, Create

I/bluetooth_common.cpp( 139): com.ti.btips, /com/ti/btips, com.ti.btips.ag, Enable

I/bluetooth_common.cpp( 139): com.ti.btips, /com/ti/btips, com.ti.btips.a2dp, Create

I/bluetooth_common.cpp( 139): com.ti.btips, /com/ti/btips, com.ti.btips.a2dp, Enable

I/bluetooth_common.cpp( 139): com.ti.btips, /com/ti/btips, com.ti.btips.avrcp, Create

I/bluetooth_common.cpp( 139): com.ti.btips, /com/ti/btips, com.ti.btips.avrcp, Enable

I/bluetooth_common.cpp( 139): com.ti.btips, /com/ti/btips, com.ti.btips.common, RadioOn

V/BluetoothEventLoop.cpp( 139): setUpEventLoopNative

V/BluetoothEventLoop.cpp( 139): ... BTIPS ignored

D/libc-abort( 860): abort() called in pid 860

V/BluetoothEventLoop.cpp( 139): ... BTIPS ignored

V/BluetoothEventLoop.cpp( 139): ... BTIPS ignored

will this help get bluetooth working?

EDIT: I replaced dbus-daemon, added btld, replaced libbluedroid.so, libbluetooth.so with files from the galaxy

Where is BTIPS located, in the boot.img?
[G1 Android Development] johnnylicious:
any word on any new development on this :/
[G1 Android Development] ebg10:
New Development

Any new development on this with the new hero releases?
[G1 Android Development] Shaquiel Harris:
looks like all we need is the UART clock to enable and we will be good. cmon guys i know you guys can do it :)
[G1 Android Development] ebg10:
If bluetooth is working on the magic because it has the updated bluetooth firmware, couldn't we just put that bluetooth firmware on to the g1?
[G1 Android Development] shafty023:
added some to the main thread, check it out
[G1 Android Development] myshyak:
Who told you that it works on magic? Have not seen any hero room with working BT in magic
[G1 Android Development] Mighty07:
Maybe this can give a help! :-)

http://developer.htc.com/
[G1 Android Development] Lakers3408:
Better question for you would be, who has NOT told you that it DOES work on a magic/mytouch.
[G1 Android Development] myshyak:
Have tried about 5 different roms based on hero. None of them have working bt audio. Even if you will open saphire thread, most of them would have that written in the description.

If needed could help testing it on magic
[G1 Android Development] sirocyl:
I might not be too experienced in developing for this platform, but isn't the libandroid_runtime.so part of AOSP? Perhaps we could pull the code from Cupcake or Donut and find out what calls it's taking and either translate them to equivalent functions in the Dream androids or just drop them if they have no purpose in the Dream (extraneous hardware, for instance)

I'll begin looking into this, as the only thing keeping me from using a Hero build as my main system is the bluetooth problem.
[G1 Android Development] shafty023:
libandroid_runtime.so is standard on Android and manages a lot of the system service calls. The issue at hand is we don't have the HTC Android source code (I'm not talking about the HTC kernel source code) so we can't "edit" the source code to work with Hero. The libandroid_runtime.so that comes with cupcake/donut work just fine if you're running cupcake/donut, they are useless if you drop it on a hero build b/c you then have other framework files looking for methods in that .so file that are no longer there.
[G1 Android Development] quadmux:
Ya.. BT doesnt work on any of the Hero ROM on 32A's. I tied all 8 of them.
[G1 Android Development] miketaylor00:
Thanks Sherlock.
[G1 Android Development] quadmux:
LLOOOLL - right..
[G1 Android Development] Lakers3408:
Some people just don't know how to read :rolleyes:

xdaforums.com/showthread.php?t=552454
[G1 Android Development] myshyak:
2Lakers: Sorry, this solution work for music only.... Need it for the phone hardly
[G1 Android Development] Lakers3408:
But still a SOLUTION none the less.

So bluetooth does work, although at this time its NOT 100% functional, just 50%

Half way there! :D
[G1 Android Development] Aquilo:
So, run the linux strings command on libandroid_runtime.so from the Hero build, to get function names, etc, it calls.

Write dummy functions to log the calls on this library, and work out what it's intending to do. Also, run the dex decompiler on the framework.dex, to get the details of parameters, etc, and confirm the function names.

Do this, and then write an emulation function. It's what I'm trying with the Hero LED trick ;)
[G1 Android Development] axlastro:
It's great that someone is actually trying to make bluetooth work. I have the feeling that most developers are just not interested in getting this feature to work like they are "above this stuff" . Hope you make it work.
[G1 Android Development] rpmccormick:
Ok, this is my idea, is it at all possible...?

You guys say it kinda works through the command prompt or something right? All I want to do is pair the phone with my car and have BT always on so it auto-connects and uses my cars speaker phone. I don't mind having to set it all up through the command prompt, and I don't mind having to go to the command prompt to re-enable BT after a reboot.

Is this bare-minimum functionality currently achievable? If yes, can someone post directions or an sh script or something?
[G1 Android Development] sabin123:
Can any one give me link of site from which i can download bluetooth software as i cannot connect to internet in phone.
[G1 Android Development] axlastro:
OMFG Can't you read what the topic is about!!! Please Ban Ban Ban!!! Go buy an Iphone or Nokia if you can't figure out this one...
[G1 Android Development] sirocyl:
.... this is a perfect example of a non-contributing, unhelpful, and more importantly, attacking/demeaning post.

I mean, this member only has nine posts. He's probably new to HTC devices, has a G1, and liked the look of Hero. You can't all be elitist and demeaning to those of us who just want some information. And he wasn't doing anything ban-worthy.

You, however....

2. Be polite and respect your fellow xda-dev user.

Anyway, if you read the topic, it's not just as simple as getting a download link. And it's still not complete. They just got it half-working on the Magic and work is still to be done on the Dream. I tell you, Hero with bluetooth on Magic was voodoo, and Hero with bluetooth on the Dream is a nightmare. :eek:
[G1 Android Development] q426669:
Keep up the good work!
[G1 Android Development] SG_Shadow:
I'm Ready

I'm Ready

I'm Ready

Let's get this working guys! Keep up the work. I got a feeling we are almost there.
[G1 Android Development] kingklick:
yah let us know if theres anything else we can do :D
[G1 Android Development] prince.siraj:
very nice :D i wish there was any way i could help... but i don't know jack about code... only thing i know is some HTML lol. but good luck: you've come this far...
[G1 Android Development] Yahrghrr:
Has anyone tried it on the Dream/G1? Looks like its working fairly well for music on the Sapphire forums.
[G1 Android Development] pagubg:
Is there any chance to get it really working on Hero roms?
[G1 Android Development] axlastro:
I have a bad feeling

I have a bad feeling that it's either impossible or it's just one dev trying to get it done (shafty) and the other developers are racing with each other who will make hero run faster but they don't care about bluetooth. I guess Bluetooth is actually not signifficant for most US users, as they usually have unlimited data plans and merely turn on their WiFi or BT. Correct me if I'm wrong. So. If you want to run Hero , get a Hero. My opinion is that G1 to Hero is not a worthy upgrade. There are much faster devices coming so you will regret not having a 1ghz processor. I foyu can't wait - then get a Magic with 288 ram. It's cheaper than a Hero I think...
[G1 Android Development] pagubg:
I have Magic, but the bluetooth issues are the same :) Still no file transfer.

I am whit Hero rom on the magic. It is fast as hell, but there is no bt file transfer.
[G1 Android Development] axlastro:
Well, it's more likely that bluetooth will work on magic soon. There are still great roms such as rogers and cyanogen untill someone decides to help shafty to make this work.
[G1 Android Development] TheMorpheus:
Yeah it is cheaper but with Hero roms still has the same problems!!
[G1 Android Development] axlastro:
Sorry to hear that. I thought magics have the same board as Hero but there are some differences I guess... Let's hope the Tatoo is compatible to either magic or dream hardware. That is very unlikely though...

I hope Drizzy, Twisted, Jac and all the other great developers start working on the bluetooth, coz I think their roms are fast enough...
[G1 Android Development] darkwire:
Since I live in California, it's pretty much a prereq for any rom that Bluetooth work because we must go hands free while driving.

Kind of sucks since it limits the roms I can test, and I always have to test Bluetooth first lol.

Keep up the good fight shafty!
[G1 Android Development] axlastro:
You can try this app - CarMode - it turns on speakerphone automatically...
[G1 Android Development] moosefist:
maybe if someone would organize a bounty for whoever fixes bluetooth more people would work on it. an incentive is always good motivation....
[G1 Android Development] axlastro:
I second that!

Ok people. Let's vote. that's one from me

2 votes to organize a bounty. Let someone more experienced give their word - is it actually possible to get it done and what would be a reasonable amount of money and we could start collecting.
[G1 Android Development] shafty023:
There already was a bounty put out, that wasn't the issue. The real issue is the fact that we don't have access to the source code that HTC created. Without that we can't modify the API calls that Hero makes to turn on BT. It's quite obvious Hero is looking for a specific chipset/spec that is plainly not there in the G1. It then causes the UART disable failure and causes BT to fail starting.

HTC integrates the entire phone into its Sense UI (Rosie) which makes changing anything very tough. If you started BT from the commandline the Phone application wouldn't be able to use it b/c Hero doesn't acknowledge anything outside of the UI. So replace Phone.apk from one that came from cupcake/donut you say? NO! B/c the older phone.apk doesn't provide Intents that Hero would be looking for and we'd have catastrophic failure. This same logic continues if we try replacing small pieces. What we'd end up with is cupcake as we'd have to get rid of the Sense UI to make BT work.

So barring some freak of nature release of the HTC modified Android source code, you can kiss BT goodbye.......errr I guess goodbye isn't the right word since we never had it. Perhaps kissing the idea of getting it working goodbye is a better analogy. I tried hacking at it for a good 1 1/2 months with no success besides a greater understanding of how Rosie launches BT.
[G1 Android Development] SG_Shadow:
Thank You!

For the 1st time in these forums I got an educated reason why BT doesn't work in HERO ROMS. Thank you so much for that. Looks like I will just stick with Donut from Cyanogen experimental ROMS. I thought I could live without BT, but I guess not! The future is ever changing, so I will still keep an eye out for HERO BT updates.
[G1 Android Development] axlastro:
Well explained. Now we won't flood the thread with junk :) I hope that the tatoo uses the same hardware as the dream as it's cheaper but seriously doubt it... If

by chance it does, then we'd have some chance.
[G1 Android Development] sirocyl:
So basically we're saying that it would be easier to port the entire Sense to Cyanogen or a Rogers ROM, or wait for HTC to put Sense in the Rogers than reverse-engineer bluetooth under Hero on the Dream.

All I really want in Hero is the awesome UI, twitter integration, and a functional, desktop-like flash player (I'm surprised the Droids beat iPhone/Blackberry on this). Oh well, back to a good, fast, functional Cyan rom
[G1 Android Development] shafty023:
Yes as soon as HTC releases the Sense UI for the Rogers, which they said they would for any Android phone that does not bear the Google name, then it will be extremely easy to port over to the dream. We'll just need to change the APN files and some Locale stuff but it'll be painless. What'll be great is that would also make LEDs 100% functional without any hacking needed.
[G1 Android Development] zambezy:
If someone can figure out what the UI is looking for, shouldnt it be possible to get a process that would translate this and interface the UI and the BT handler. UI sends a request (chipset) translate send command. Return what UI is looking for. may lag a bit but it might be a start.
[G1 Android Development] rainabba:
Actually, on the 32B "BLUETOOTH" is working 100%. The A2DP Profile works 100%. The HSP/HFP does NOT work. Bluetooth is an RF protocol. The profiles are what make Bluetooth useful and from what I know (which is more theory than application), getting HSP/HFP working shouldn't be any harder than finding the appropriate Bluez profile files to go in the same folder as the A2DP files and/or in the Blues Profiles folder.

Call it semantics or tell me I'm being pedantic, but there are a LOT of inaccurate to blatantly wrong statements going around.
[G1 Android Development] shafty023:
Yes Bluetooth is built around a set of profiles which dictate which features/functionality that chipset will be implementing. These profiles have already been coded and implemented into Android. More can be added but that's up to developers. As far as the TI instruction set driver, that is located in /etc/firmware on the phone and is the correct script for our phone's chipset. It's all a matter of what SPECS the Sense UI is attempting to communicate with. For instance, it could be attempting a serial communication (yes BT is based off serial) at 115200 whereas it needs 400000 (HSP). This probably isn't the issue but a mismatch in speeds would help explain why the timing is off when the UI (UI meaning /system/framework) tries to disable the UART clock and fails. Turning BT on/off is not a difficult process. It's the fact that HTC implemented the BTIPS daemon (/system/bin/bts) to handle all of the BT functionality and we don't have the source code. We don't even have the source code for the framework changes they made (/system/framework). For BT, they modified services.jar svc.jar and quite a few others.
[G1 Android Development] rainabba:
NOW we're talking! Lost me about half way through there and that gives me some perspective on this problem. I just don't see how it is that someones managed to get the BT radio working and even a single profile (A2DP at that) working, but not another, more basic profile, that works on the same device with non-hero roms, and on other devices, with the same rom, when the profile (HFP/HSP) SHOULDN'T be hardware specific.

I'll just troll for a while now. :D
[G1 Android Development] G_won:
Yea I read about this and giving up on flashing towards Hero since this would probably also mean better integration with the Dream's hardware and better speed... especially if the SenseUI can become integrated with default builds and ROMs like Cyanogen ;D~
[G1 Android Development] SG_Shadow:
http://www.engadgetmobile.com/2009/...se-upgrade-for-magic-in-october-wont-be-free/

I will still keep an eye out for it. I really can't wait. It will be like an early Christmas for me, LOL! I see these wonderful developers getting this done no later then November. Keep up the good work.

P.S. My prediction is based on HTC releasing the "sense ui" to Rogers in October.
[G1 Android Development] SG_Shadow:
Check HTC website!

www.htc.com

Change the country to Brazil. Select Produtos (Products). You will see the HTC magic with hero sense ui on it. Urgh! I can't wait!
[G1 Android Development] SG_Shadow:
Now that the "Cyanogen vs Google" issue has been put to rest. Let's get back to working on bluetooth for HERO builds. Thanks, LOL!
[G1 Android Development] yggdrasil:
Bump

Alot of dev on nice hero roms, but I cant give them serious consideration w/o bluetooth.
[G1 Android Development] psxx:
yes please try to solve this issue... as far as bluetooth is a must have for the most of use....

@ big thanks to all who spend there time in this Projects!!!!
[G1 Android Development] rainabba:
To be clear, you're saying that A2DP and HSP/HFP can be made to work through scripts/command-line on ?ANY? HERO ROM?

Once pairing is done, will connections be made automatically as they should? IOW, a phone call comes in and my Headset is on, a connection would be established? I turn on my headphones/speakers and tell them to connect to last paired device, my phone will respond to the request and establish an A2DP connection?
[G1 Android Development] shafty023:
No, I said it will NOT work on the frontend. The frontend being the actual user interface. Means it will not work with the phone or anything else in the Hero interface