Now that we can change the BT MAC address, the next problem is again the same. If I set a MAC number in build.prop and release the ROM, all of the phones will have the same value again. The user can change this now but it is not an elegant solution. I am looking into giving each phone a different MAC address and keep it persistent between the ROM updates. Well, I can't help with a clean wipe though
@mrg666: I have to give it to you, that simply worked first try after updating brcm_patchram_plus and my build.prop. Bingo, just like that
Even without an Academy Award for Most Elegance in Bluetooth MAC Randomizing, this would already be a GREAT solution for me, just as it is. Having to do this when I update ROM is still nothing, considering that my wife I can both use our car now
Thanks a lot, man. Again!
Have you tried making a phone call yet? I can't hear any call audio. Pandora works though.
Also, when I press the voice dial on my cars head unit I get a terrible sound instead of "Please say a command".
Dunno, what's going on. Is it just me I hope?
Edit: Tried making a call again and I get terrible sounds like the voice command button gave. If no one else is getting this I'll just reflash.
Sent from my LG-VM670 using Android Central Forums
How does the vendor ROM get its mac?
Have you tried making a phone call yet? I can't hear any call audio. Pandora works though.
Also, when I press the voice dial on my cars head unit I get a terrible sound instead of "Please say a command".
Dunno, what's going on. Is it just me I hope?
Edit: Tried making a call again and I get terrible sounds like the voice command button gave. If no one else is getting this I'll just reflash.
Yeah I was just thanking about that, would it be possible to have script run at install that sets the Mac, that way the script does not have to be installed?
Sent from my LG-VM670 using Android Central Forums
I just tried with a bluetooth headphone. Sound is crystal clear. We only set the MAC number without changing anything else.
I am not sure. They probably get the first part (first three ?) and they assign the rest. I said first three because the phone only knows the first three. The followings are just zero if we don't set them.
Macs are not just assigned at random, they are retrieved from somewhere. We just need to find out how and where.
#ifdef ANDROID
void
read_default_bdaddr()
{
int sz;
int fd;
char path[PROPERTY_VALUE_MAX];
char bdaddr[18];
int len = 17;
memset(bdaddr, 0, (len + 1) * sizeof(char));
property_get("ro.bt.bdaddr_path", path, "");
if (path[0] == 0)
return;
fd = open(path, O_RDONLY);
if (fd < 0) {
fprintf(stderr, "open(%s) failed: %s (%d)", path, strerror(errno),
errno);
return;
}
sz = read(fd, bdaddr, len);
if (sz < 0) {
fprintf(stderr, "read(%s) failed: %s (%d)", path, strerror(errno),
errno);
close(fd);
return;
} else if (sz != len) {
fprintf(stderr, "read(%s) unexpected size %d", path, sz);
close(fd);
return;
}
if (debug) {
printf("Read default bdaddr of %s\n", bdaddr);
}
parse_bdaddr(bdaddr);
}
#endif
Macs are not just assigned at random, they are retrieved from somewhere. We just need to find out how and where.
Ok, so I reflashed and applied the fix again no problem. This time I just left the line with the XX:XX:XX 's in instead of making something up.(accidentally).
I got a new address as wished anyway. Or was that the way intended?
However, phone calls were still horribly garbled. Pandora sounded beautiful. A2DP vs some other protocol?
Anyway, I was able to fix the problem by removing the fix.
The fix must be doing something other than change the address, I suppose.
Sent from my LG-VM670 using Android Central Forums
@mrg666: I am sorry, I know l should keep quiet and let you guys work, but listen: that simply doesn't look to me as the kind of code that would read the hardware MAC. Even if that property file was somehow mapped to firmware or EEPROM, why would they store it as formatted ASCII only to parse it again first time they read it?
I think there's got to be some lower level code in the kernel which reads the hardware MAC, then formats and saves it by setting the property being read in the code you posted.
OK, now tell me to shut up. I can take it. Seriously!
No colons or X's. The string must be 12 character long and each character is from 0 to F. See the example here
I've succesfully changed my Bluetooth address three times as different ones, but each time phone call audio is terrible but Pandora is fine.
As soon as I remove the fix it's fine.
Just a warning before you push this out. Maybe it something I'm doing, I dunno.
I last did a clean install of your latest and greatest rom, applied the fix, tried phone call, sounds garbled, tried Pandora, sounds fine, removed fix, rebooted and all was good again as far as bt audio quality.
Only voice calls and voice commands are garbled, a2dp is fine.
I don't understand what is happening if only MAC is changing.
Sent from my LG-VM670 using Android Central Forums