[ROM+Kernel] Inferior Human Organs unofficial CM7.1

mrg666

Well-known member
Jul 16, 2011
730
1,067
0
Visit site
Update-
I turned on bluetooth on the donor phone, and the bluetooth settings screen updated immediately. I checked the about phone screen again, and the bluetooth mac address was filled in. Turned bluetooth off, and the about phone screen again read Unknown. Turned bluetooth back on, and it read the same mac address again. Rebooted, and same behavior, same mac address.

So stock is not reading at init or boot, but from the module at each activation.
We need to discover the api request.

This is what we see in IHO as well. Just that the last three pairs are all zeros. Do you have the /data/bdaddr file? Can you please check that?
 

RyanJKremer

Well-known member
Aug 10, 2011
155
50
0
Visit site
@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!

Just taking out my "backside" here. I'm guessing if it uses 0-F it might be hexadecimal code. WAY more fun than binary code... :p

Sent from my LG-VM670 using Android Central Forums
 

Dannemand

Well-known member
Mar 28, 2011
445
170
0
Visit site
Just taking out my "backside" here. I'm guessing if it uses 0-F it might be hexadecimal code. WAY more fun than binary code... :p

LOL :D Yeah, yeah, you knew what I meant ;)

It's actually reading a string of colon separated hex digits as represented in ASCII. Even if they wanted to store it in a readable format (as in the build.prop), then why the colons? Of course that doesn't prove anything. But it just doesn't look like the kind of low level code that reads a hardware MAC.

Anyways, you were joking, I know ;)

Edit: BTW every time I see your Avatar... damn!
 
Last edited:

Dannemand

Well-known member
Mar 28, 2011
445
170
0
Visit site
I am not that rude to tell you that. Besides, it is puzzling to me too. I am looking at Broadcom's own code (brcm_patchram_plus.c) that I quoted the relevant part of it above. It requries a file in the file system for reading the value of bdaddr. There is another program (bdaddr_read.c) that reads another system property in build.prop and writes the value of bdaddr to that file (/data/bdaddr). Binaries of both codes are called in the same init script. And I didn't design this, I just followed the code. If there is a phone around with stock ROM, maybe someone can check this out.

On the other hand it is not a sin to assign a randomized bluetooth MAC. It is not an ethernet card in a WAN to cause catastrophic collisions. Why would you use bluetooth for networking while you have 3G and WiFi? As long as you don't use it for networking, only your car stereo or your headphone will see it. If you are too concerned about a "real" MAC, you can just flash a stock ROM and get the number from there. But with the mechanism I have seen, I will not be surprised if the bluetooth MAC is different every time you wipe clean and reflash the stock ROM. Now, that would be be very interesting.

I am tired .... nite nite.

I'll try tonight and restore my original 2.2.1 stock and compare its BT address with the one I got from the ZV9 stock. I have a feeling they're going to be the same and that they're reading a "real" hardware MAC stored deep some place where it's not easily flashed over (what I referred to as EEPROM because that's what it would have been in the old days).

That said, I agree 100% not to obsess over a "real" MAC for Bluetooth. As I said in a previous post, even the solution you already posted is a great leap forward and would be fine for me (assuming audio actually works in the car when I test it - I saw your post about a newer fix on its way).

I already did as you suggested, and used ZV9 stock ROM to get my "real" BT address, which is what I put in my build.prop. And it's what shows up in my About-Status screen.

Thanks again for everything you do!
 

mrg666

Well-known member
Jul 16, 2011
730
1,067
0
Visit site
Okay, here is my final solution. This should fix the sound problems in calls as well.

No editing of build.prop is necessary anymore. You can just revert build.prop to original. Boot process will create a MAC number with B0:89:91:XX:XX:XX where XX are randomly generated, i.e. 16 million possibilities. If the number has been created before it will not be changed in the subsequent boots, i.e. the MAC number will be persistent. If you want to change the MAC number by yourself, you can edit the file /data/rnd_bdaddress or just restore from your backup after a complete wipe.

You can flash this zip file which will replace /system/bin/bdaddr_read and /system/bin/brcm_patchram_plus. I am confident that the bluetooth will work as before with the new MAC number. You will only need to re-pair your connections.

For anyone who wants to see what has been changed, the source files are below for download. I have revised both C files. You should know where they go.
brcm_patchram_plus.c
bdaddr_read.c
 
Last edited:

Tejer

Well-known member
Jan 16, 2012
80
14
0
Visit site
Okay, here is my final solution. This should fix the sound problems in calls as well.

No editing of build.prop is necessary anymore. You can just revert build.prop to original. Boot process will create a MAC number with B0:89:91:XX:XX:XX where XX are randomly generated, i.e. 16 million possibilities. If the number has been created before it will not be changed, i.e. the MAC number is persistent. If you want to change the MAC number by yourself, you can edit the file /data/rnd_bdaddress or just restore from your backup after a complete wipe.

You can flash this zip file which will replace /system/bin/bdaddr_read and /system/bin/brcm_patchram_plus. I am confident that the bluetooth will work as before with the new MAC number. You will only need to re-pair your connections.

For anyone who wants to see what has been changed, the source files are below for download. I have revised both C files. You should know where they go.
brcm_patchram_plus.c
bdaddr_read.c

Awesome work! So just to double check, this can be flashed on any IHO rom or just Mirage? Also, is the in call fix for regular speaker in cal volume, or for Bluetooth headsets?
 

mrg666

Well-known member
Jul 16, 2011
730
1,067
0
Visit site
Awesome work! So just to double check, this can be flashed on any IHO rom or just Mirage? Also, is the in call fix for regular speaker in cal volume, or for Bluetooth headsets?

You can flash on any IHO ROM if they have the same IHO boot scripts. The call fix is about the complaints for the blueooth connection on phone calls after my first iteration discussed in the previous and this page.
 

Schlidel

Well-known member
Dec 16, 2011
100
33
0
Visit site
You can flash on any IHO ROM if they have the same IHO boot scripts. The call fix is about the complaints for the blueooth connection on phone calls after my first iteration discussed in the previous and this page.

I've clean installed your latest rom + fix.

Successful Bluetooth address change.

I'll be able to test in car later tonight.

Edit: I just tested. Perfect. You're the man. :D

Sent from my LG-VM670 using Android Central Forums
 
Last edited:
  • Like
Reactions: mrg666

ulmeck

Member
Dec 2, 2011
8
3
0
Visit site
Re: MiRaGe 05152012

I have also updated the data indicators in the status bar (made myself). The bluetooth indicator icon was plain ugly and 3G/1X indicators had always the arrows in wrong directions. Nobody noticed since the up/down arrows were so tiny that the direction they point was not easy to see.

BTW, I like the new indicators, along with the changed BT icon. It's a subtle change but nice.

Thanks,

jf
 
  • Like
Reactions: mrg666

mrg666

Well-known member
Jul 16, 2011
730
1,067
0
Visit site
Edit: I just tested. Perfect. You're the man. :D

Sent from my LG-VM670 using Android Central Forums

This means that we are done with the same-MAC problem of Bluetooth. Now everybody (who wants) has a different bluetooth MAC address. This is transparent to the user and implementation in IHO is extremely simple. Thanks to everyone who helped with testing and ideas. This will be integrated in the next MiRaGe build.

Just to clarify, you can still update your ROM without changing the Bluetooth address as long as you don't do a complete wipe (i.e. wipe /data as well). In that case, you can edit /data/rnd_bdaddr file or just restore that file from backup to keep using the same Bluetooth address.
 

EarthnFire78

YAY!!! ME :)
Jan 1, 2012
964
232
0
Visit site
This means that we are done with the same-MAC problem of Bluetooth. Now everybody (who wants) has a different bluetooth MAC address. This is transparent to the user and implementation in IHO is extremely simple. Thanks to everyone who helped with testing and ideas. This will be integrated in the next MiRaGe build.

Just to clarify, you can still update your ROM without changing the Bluetooth address as long as you don't do a complete wipe (i.e. wipe /data as well). In that case, you can edit /data/rnd_bdaddr file or just restore that file from backup to keep using the same Bluetooth address.

With my rom because of the ad2sdx script I use everything needs to be wiped and since my rom wiped's everything (but sd-ext) at install, I will include a script that will backup the file and restored after install is finished.
 

MrJedi

Active member
Apr 28, 2011
33
5
0
Visit site
So I just updated to the current build from the 12162011 build. I had stayed at that build for a while because the next build I tried (02122012) gave me issues. I decided at that time not to try to fix something that wasn't broken and went back to the 12162011 build.

After I flashed the most recent build and recovery I have gone from 65MB of user available storage to 15MB of user available storage and my phone is much slower. I tried clearing cache, rebooting, nothing did much than give me a few extra megs. I restored the back-up of my old build and everything is as it should be. Running smooth with 65MB available for user storage. Was there a bug in older builds that under reported usage?
 

Schlidel

Well-known member
Dec 16, 2011
100
33
0
Visit site
MrG666, I'm curious.

What did you figure out was causing the garbled phone audio? Not that important for me to know but I was wondering.

Sent from my LG-VM670 using Android Central Forums
 

Dannemand

Well-known member
Mar 28, 2011
445
170
0
Visit site
@mrg666: Way late too the party again today. But I finally flashed your latest Bluetooth patch, it randomized my BT address, I was able to pair with my car, and I had a phone conversation there no problem. I have yet to pair my wife's phone and see that that works, but I see no reason why not.

I actually did have an odd glitch about an hour after flashing, where suddenly I FC'ed on two different apps. I NEVER have FCs and was quite surprised. Tonight I restored my latest nandroid and flashed your patch again. (I re-downloaded the patch.zip, but they they were identical.) Everything is working, must've been some odd glitch after messing around yesterday.

Do note that the patch.zip isn't signed.

I am truly impressed with how you just hit these curveballs out of the park whenever I throw them at you ;) Seriously, thanks a lot. I cannot think of anything else in MiRaGe now that isn't pretty much perfect.
 
  • Like
Reactions: mrg666

mrg666

Well-known member
Jul 16, 2011
730
1,067
0
Visit site
MrG666, I'm curious.

What did you figure out was causing the garbled phone audio? Not that important for me to know but I was wondering.

Sent from my LG-VM670 using Android Central Forums

Remember the first brcm...c code I linked? I had checked only a small part of it. That new code was actually passing the kernel driver's API some different parameters than the original. Instead of using the new one, I went back to the original and patched it with useful part of the new version.
 

kwknott

Well-known member
Oct 18, 2011
284
60
0
Visit site
Anyone else having issues downloading from mediafire. Trying to get mrg's patch and just getting blank page. Tried some other files too.

Sent from my LG-VM670 using Tapatalk 2
 

mrg666

Well-known member
Jul 16, 2011
730
1,067
0
Visit site
@mrg666: Way late too the party again today. But I finally flashed your latest Bluetooth patch, it randomized my BT address, I was able to pair with my car, and I had a phone conversation there no problem. I have yet to pair my wife's phone and see that that works, but I see no reason why not.

I actually did have an odd glitch about an hour after flashing, where suddenly I FC'ed on two different apps. I NEVER have FCs and was quite surprised. Tonight I restored my latest nandroid and flashed your patch again. (I re-downloaded the patch.zip, but they they were identical.) Everything is working, must've been some odd glitch after messing around yesterday.

Do note that the patch.zip isn't signed.

I am truly impressed with how you just hit these curveballs out of the park whenever I throw them at you ;) Seriously, thanks a lot. I cannot think of anything else in MiRaGe now that isn't pretty much perfect.

Thanks for the appreciation. It has been another good team work.

I have not seen or heard any problems about the latest build. It was probably an isolated problem. Yeah the patch was not signed. Since the content were not Android apps but just binaries, I didn't bother.
 
  • Like
Reactions: Dannemand

RT78

Well-known member
Feb 26, 2011
45
9
0
Visit site
Anyone else having issues downloading from mediafire. Trying to get mrg's patch and just getting blank page. Tried some other files too.

Sent from my LG-VM670 using Tapatalk 2

If you are trying from your phone (as your signature states), make sure your browser is in desktop view. I had problems like this with mediafire but after switching from mobile to desktop it works everytime.
 

braxton355

Well-known member
Mar 17, 2012
252
28
0
Visit site
I downloaded and flashed this today, and I've had this rom freeze on me like 5 times. I'm not overclocked my phone wont do that. Is there any solutions to this problem?

Sent from my LG-VM670 using Android Central Forums
 

Trending Posts

Forum statistics

Threads
943,088
Messages
6,917,203
Members
3,158,815
Latest member
kemberley1