BMW E46 Bluetooth Fix - Android 6.0/7.0 - N6

joaortnt

Member
May 16, 2010
5
0
0
So you use the string method because replacing the file doesn't work? Only replacing bluetooth.default.so always works for me, even in android 8.1, but it may need to be compiled in the same android revision.
No, none of your versions works in my phone (android 7.0) that's why I'm trying other ways .. but without any success :(
 

shimodax

Member
Mar 3, 2015
24
23
0
I'm not sure if this will work for Android-8 because it seems that Google moved to another Bluetooth library there (the thing is called flouride).

I've looked at the new sources (I'm the guy who made the original change and patch instructions), and I think I found the coresponding place, but I can't compile Android and don't have a Nexus or Pixel (I have a oneplus 5t, so I might be able to use Pixel-2 libraries because it's the same processor or we could try to make patch instructions).

Let me know if you're interested.
 

hewewe

Member
Jan 30, 2011
39
12
8
izmir
I'm not sure if this will work for Android-8 because it seems that Google moved to another Bluetooth library there (the thing is called flouride).

I've looked at the new sources (I'm the guy who made the original change and patch instructions), and I think I found the coresponding place, but I can't compile Android and don't have a Nexus or Pixel (I have a oneplus 5t, so I might be able to use Pixel-2 libraries because it's the same processor or we could try to make patch instructions).

Let me know if you're interested.
I also switched to Pixel 2 XL after screen break. Isn't the old file bta_ag_sdp.c the same as bta_ag_sdp.cc in 8.x source? I tried modifying bta_ag_sdp.cc on lineage rom (same lines in it) but my pixel 2 xl still can't connect to the car, only synchronization is successful.
 

shimodax

Member
Mar 3, 2015
24
23
0
I also switched to Pixel 2 XL after screen break. Isn't the old file bta_ag_sdp.c the same as bta_ag_sdp.cc in 8.x source? I tried modifying bta_ag_sdp.cc on lineage rom (same lines in it) but my pixel 2 xl still can't connect to the car, only synchronization is successful.
I had a quick look at the file bta_ag_sdp.cc initially when I got my new phone, and while the file looked similar. it wasn't exactly the same. I don't have the sources anymore and don't have a computer with git at the moment, but I was following the instructions here: https://android.googlesource.com/pl...f1a9de115b66bececf892588075595b263f/README.md

I can look into it again though.

Markus

---------- Post added at 08:29 AM ---------- Previous post was at 08:13 AM ----------

I also switched to Pixel 2 XL after screen break. Isn't the old file bta_ag_sdp.c the same as bta_ag_sdp.cc in 8.x source? I tried modifying bta_ag_sdp.cc on lineage rom (same lines in it) but my pixel 2 xl still can't connect to the car, only synchronization is successful.
I think this is the source I saw:

https://android.googlesource.com/platform/system/bt/+/master/bta/ag/bta_ag_sdp.cc

Removing/commenting lines 388-390 would be my first shot.

Markus
 

hewewe

Member
Jan 30, 2011
39
12
8
izmir
I had a quick look at the file bta_ag_sdp.cc initially when I got my new phone, and while the file looked similar. it wasn't exactly the same. I don't have the sources anymore and don't have a computer with git at the moment, but I was following the instructions here: https://android.googlesource.com/pl...f1a9de115b66bececf892588075595b263f/README.md

I can look into it again though.

Markus

---------- Post added at 08:29 AM ---------- Previous post was at 08:13 AM ----------



I think this is the source I saw:

https://android.googlesource.com/platform/system/bt/+/master/bta/ag/bta_ag_sdp.cc

Removing/commenting lines 388-390 would be my first shot.

Markus
You're right, the original source is different from the lineage source I once tried with. I'll try to download the source from aosp or somewhere else and modify those lines. But it'll take a while.
 

shimodax

Member
Mar 3, 2015
24
23
0
You're right, the original source is different from the lineage source I once tried with. I'll try to download the source from aosp or somewhere else and modify those lines. But it'll take a while.
It will probably build into a different binary (I would guess they probably leave the old bluetooth.default.so for older apps and link their own stuff into another lib for the new bluetooth stack).

Also, if you experiment, try adding lines like

APPL_TRACE_WARNING("%s: is at HFP_SDP_BRSF_FEATURES_MASK", __func__);

to the source. When pairing, they should show in the phone's syslog (via CatLog app), so you will see if you have the right lib and source.

But no hurry from my side, I just wanted to mention it and share know-how (it's unlikely my phone will be able to work with a Pixel build library and I'm going to replace the ULF anyway).

Markus
 

hewewe

Member
Jan 30, 2011
39
12
8
izmir
It will probably build into a different binary (I would guess they probably leave the old bluetooth.default.so for older apps and link their own stuff into another lib for the new bluetooth stack).

Also, if you experiment, try adding lines like

APPL_TRACE_WARNING("%s: is at HFP_SDP_BRSF_FEATURES_MASK", __func__);

to the source. When pairing, they should show in the phone's syslog (via CatLog app), so you will see if you have the right lib and source.

But no hurry from my side, I just wanted to mention it and share know-how (it's unlikely my phone will be able to work with a Pixel build library and I'm going to replace the ULF anyway).

Markus
I've just downloaded the aosp source for android-8.1.0_r29 and the bta_sg_adp.cc file is not like in the link you sent. It's like the lineage source I tried before and the same lines in bta_ag_sdp.c are present in it. Should I download the master instead?

Oh, it seems the master is android P.
 
Last edited:
  • Like
Reactions: shimodax

shimodax

Member
Mar 3, 2015
24
23
0
I've just downloaded the aosp source for android-8.1.0_r29 and the bta_sg_adp.cc file is not like in the link you sent. It's like the lineage source I tried before and the same lines in bta_ag_sdp.c are present in it. Should I download the master instead?

Oh, it seems the master is android P.
Oh, so maybe the new lib will start with Android Pi ...

In that case I guess the old source fix should work.

But you could still add a
APPL_TRACE_WARNING("Bluetooth before peer features");
to the source before the line containing
if (p_scb->peer_features == 0) ....

When you do that and rebuild, have a look which parts are compiled (e.g. if it gives a new bluetooth.default.so library) and if that warning then appears in the syslog when you try to pair the car.

Meanwhile I'll see if I can set up a server where I can run an AOSP build.
 

shimodax

Member
Mar 3, 2015
24
23
0
I've just downloaded the aosp source for android-8.1.0_r29 and the bta_sg_adp.cc file is not like in the link you sent. It's like the lineage source I tried before and the same lines in bta_ag_sdp.c are present in it. Should I download the master instead?

Oh, it seems the master is android P.
I can't believe it ... I think they broke it in a new way so that it doesn't even get to the point where the old fix would work.

Android Bluetooth is such a mess.

I still have an Android 6 phone available, will test there.
 

shimodax

Member
Mar 3, 2015
24
23
0
I can't believe it ... I think they broke it in a new way so that it doesn't even get to the point where the old fix would work.
I think my first error was, when pairing I forgot to give the bluetooth connection permissions to access the contact list. Without these permission, after pairing, it failed within 1-2 seconds.

Now that I gave permissions, it fails the old way (after 5 seconds). This could be the old error, so if you can build/try something, make sure you pair with Contact permissions and then check if the phone stays connected or disconnects after 5 seconds.
 

kgiri247

Senior Member
Oct 18, 2013
107
30
0
Denver
I had a similar issue with my Nexus 6 and pioneer deck. I could place the call via Bluetooth but it would switch back to the phones speaker while in a call at random for 10 seconds and reconnect. The issue for me seems to have resolved itself on the last two Oreo ROMs with the June security patch. Both Aosip and Pixel experience I have tested and not a single problem with BT calling.
 

kaboyawa

New member
Aug 9, 2018
1
0
0
Hi guys ,
first of all i thank all of you for your effort trying to make things goes well and people become happy :)
Same issue here with a 2005 X3 , the connection drops after few seconds of pairing .
Does someone tried this method on a XIAOMI phone , android 7.0 ?
Good day
 

gdroid666

Senior Member
Feb 23, 2016
246
6
0
can someone here please help me with this POS
i have 6p running stock N 7.1.2 and i do not feel like rooting
i got a grom for my BMW e46 , 1st one was DOA , paired to bluetooth fine but radio would not detect it
second unit worked perfectly for about a day and a half ,then i noticed really brief drop outs like only for a split second about 2 or 3 times a song ,but worse was that ID3 tag data was not displaying on the radio display after the 1st song
i would get track info for one song then it just says aux or BT stream after that with both Pandora and GPM
so i decided to test it with my LG Gpad v410 LTE tablet lolipop , and after a few tries it paired and the track info was coming through to the radio display for every song and audio was not cutting out at all
so i tried the phone again and rebooted a few times and still the same issues
so then i decided to go to settings >wireless networks&more>more>network settings reset
BIG MISTAKE
now the phone will not pair to the grom at all , it only even detects about 1 out of 500 tries , when it does detect it and i select it it says pairing for a second then says can not communicate with grom
how can i get it to pair again?
 

antonijo78

Member
Aug 7, 2014
11
8
0
Postojna
For those who have BMW E46 series car, attached is the recompiled bluetooth.default.so file to make it work with this model. Just replace the file in the archive with the one in \system\lib\hw. As you may know, a modification must be done for the bluetooth to stay connected with this specific model of BMW. I compiled the file and thought some people may also need it.

source: https://android-review.googlesource.com/#/c/48164/1/bta/ag/bta_ag_sdp.c

Edit: added file for android 8.x
I can confirm it works on latest ResurrectionRemix for Samsung Galaxy S5+ in my E39. :good:
 
Sep 12, 2008
32
0
0
Toulouse
Hi guys, some news !

I did some hardware upgrade (I managed to source a late BMW BT module from Lituania). From the other thread on XDA on the same topic, it seems to be the best option to solve the problem. However, now, my phone connects to the BT module, but the connection drops as soon as a call starts (tried both ways)... has someone faced the same issue ? Is there any BT settings (in the dev options) to change the behavior ? I tried on 2 AOSP based roms (bootleggers 9 and Bliss 10). My last hope would be to try with a LOS based rom, as the BT source is not the same...

Thank you !