yashsingh1/xdaforums huggingface dataset:
[HD2 Android NAND Development] AngelDeath:
Greets all,

I just wanted to inform everyone that is using NAND builds Especially DFT's I have solved the G-Sensor Problem. After searching, and sorry for saying no one even giving me an idea even where to look, I finally after days of digging found it!

I can't Promise this will work for everyone, but This does work for me, and it should work for everyone else. Download the attached file, unzip it and then copy your existing bma150_user file from system/bin and make a backup (DO NOT DELETE THIS FILE from its location), then with root access copy the file I attached to the same location over-writing the existing one, then REBOOT, you can now calibrate your G-Sensor without it being facedown.

This MIGHT fix the G-Sensor freeze issues that some have also, again MIGHT

Worse case if this doesnt fix your G-Sensor problem, then copy back your backup and you wont have to hate me, but I think this should work for just about everyone!

(Filesource Credit: Ripped from Motomans234 Carbom EVO Remix SDCard Android)

*** Updated: 1/15/11 ***

Apparently It seems somethings have changed in certain Builds that have stopped the replacing of this file from working. I went on the hunt, and found another work around, but this file is still needed. Follow Below:

Before installing the file above, go to System/Bin and delete the bma150_usr, then navigate to Data/Misc, and delete the following files:

AK8973Prms.txt

AK8973.Prms.txt.tmp (If there)

bma150_usr.txt (If there)

After navigate to the above file and add it to System/BIN and then your calibrating will function correctly and adjust the values properly.

*** UPDATE 1/19/11 ***

This is for anyone that DOESNT have the G-Sensor under Display, but anyone can use it:

Go to market, and download a program called Bubble. Its a program to use your phone as a level. Install it and run it, you have to calibrate it 4 times. First vertical (Side without the volume rocker against something straight), Second horizontal (First volume rocker facing down, bottom against something straight), Third horizontal (Volume rocker facing up, top of phone against something straight). And lastly calibrate the phone laying flat on its back. After that your phone should be calibrated for use.

This workaround will NOT fix the auto-rotation problem.

Any issues, post, if it works for you post a comment so others know.
[HD2 Android NAND Development] bit3m3:
Hey! nice one!!!

Good job
[HD2 Android NAND Development] arashshahin:
hi thank you for you solving.

but my hd2 gsensor calibration was freezed yet.
[HD2 Android NAND Development] andreyxxl:
mda

well, it's not working for me :(

backup restored, sry man
[HD2 Android NAND Development] KrewsialNL:
I have no issues with my G-Sensor, though I do appreciate the continuous development by others :D

Well done!
[HD2 Android NAND Development] sirbilbo:
NICE - Great work

a big tnx to you for sorting this out

//SB
[HD2 Android NAND Development] AngelDeath:
Again just so everyone knows the only phone I can test this out on is the HD2 TMOUS made after June 2010. I seriously think this might have to do with some sort of hardware revision. But I cant be sure.

But I'm trying, as we all know all setups and phones arent the same, just like desktops, but anyone I can help Im happy.
[HD2 Android NAND Development] AngelDeath:
Just a quick bump for the people that are still having issues with the G-Sensor.
[HD2 Android NAND Development] henry.yeh0309:
Hi, thank you for working this out. I wanna ask a question, is this solution compatiable with all the NAND ROM?
[HD2 Android NAND Development] lextad666:
dont work for tested on mult nand rom
[HD2 Android NAND Development] henry.yeh0309:
It doesn't work on the rom I'm using now, either. Gonna try DFT ROM later, maybe it only works on it.
[HD2 Android NAND Development] AngelDeath:
Again, I dont know which phones it will work with, I do know with a USA HD2 TMOUS made after june 2010 which is what I have it works. The file in question is the bma150_usr file. The file I posted is from Motoman's Carbon EVO remix sdcard android, and it works with the DFT NAND Rom.

For anyone willing to read, or wishes to know how I found this, here is my reference point in finding the driver which controls G-Sensor:

http://www.slideshare.net/appleboy/introduction-to-gsensor-i2c-driver

Reference pages: 10 thru 24.
[HD2 Android NAND Development] henry.yeh0309:
Hey, thanks, man. You have given enough information so far. Good work! :)
[HD2 Android NAND Development] DungEps:
Please show me how to copy your file to system/bin, I tried but I has received a message : "This folder read only", although my hd2 rooted by z4root ?
[HD2 Android NAND Development] AngelDeath:
When in system/bin, depending on the explorer you are using you have to change to Mount R/W, by default you are viewing the folder as Mount R/O.

R/W = Read/Write

R/O = Read/Only
[HD2 Android NAND Development] DungEps:
Thanks! I did it, but i don't know why it doesn't work on my phone, although it's running on DFT NAND Rom :(
[HD2 Android NAND Development] lextad666:
Hey, thanks
[HD2 Android NAND Development] C0BRA01:
G-Sensor fix

Did NOT work for me.but I don't have the T-Mobile version either. Yours is probably the T8585, and I have a T9193 (Australian version which does 3G on AT&T) When I 1st did it, it seemed to work (right side calibrator was not going crazy anymore) but then would not rotate screen at all. A temporary work around is if you reinstall the rom, and do NOT use the calibrator at all, screen rotation works fine. Sort of like the old joke; "Doctor it hurts when I touch this!" Doctors reply; "Then don't touch it!"
[HD2 Android NAND Development] SoFaKiNgStOkeD:
Even though I didn't use this fix per se, (my G-Sensor was just freezing) this still fixed my issue. The last part where he said about calibrating it face down is what caught my eye. I just did that on the edge of a table and bam, its fixed! My G is now working as it should. So stoked!
[HD2 Android NAND Development] AngelDeath:
Main Post Updated with New Info
[HD2 Android NAND Development] canbl4:
On imilkas_hd2z_nand_v0.2 this method works fine. Thanks a lot for share it.
[HD2 Android NAND Development] LiFE1688:
There is another fix, just upgrade the kernel.

Like this one.

MDJ's Kernel
[HD2 Android NAND Development] hen_43:
just upgrade the kernel. and Gsensor work?!!
[HD2 Android NAND Development] LiFE1688:
Yup, provided you didn't try to calibrate the G-Sensor.

If you did, then you will need to find a level surface, and place the screen facing down on the surface to calibrate it again.
[HD2 Android NAND Development] nefanfaron:
It doesn't work on the rom I'm using now MDJs_CyanogenMod7_v.2.4_NAND_A2SD_

((((((((
[HD2 Android NAND Development] agentfazexx:
Um...the g sensor has been fixed for ages...
[HD2 Android NAND Development] LiFE1688:
The G-Sensor broke again in DFT LEO Desire "STOCK" build, because they used their own kernel which didn't incorporate the fix.
[HD2 Android NAND Development] TitusO:
no auto rotation g-sensor

I'm running the same rom and kernel. Is there any chance to fix the g-sensor. I can't rotate anymore.
[HD2 Android NAND Development] MattOG:
All you have to do is calibrate on the edge of a table face down.... been like this for ages. It's reported in the sticky FAQ (Check my sig)
[HD2 Android NAND Development] TitusO:
You're right, but MDJ removed the calibration-function from his build. (Or I'm to stupid to find it.)
[HD2 Android NAND Development] MattOG:
Settings - display ?
[HD2 Android NAND Development] TitusO:
Jep, I can't find a calibration funktion...sorry.
[HD2 Android NAND Development] Gushfevah:
Mine works perfectly, but no Matt, the calibrate function is not there in MDJ's CyanogenMod 7 v. 2.4.

Doing the new fix for GPS in gingerbread actually seemed to make my g-sensor alot more accurate too, but whether it did, i just can't be sure.
[HD2 Android NAND Development] TitusO:
What new fix do you mean? My device can't find the acceleration sensor anymore...and I didn't get any reaction on the insert of the bma150_usr...
[HD2 Android NAND Development] locomambo:
"this work like a freaking charm...thanks alot"
[HD2 Android NAND Development] dung8604:
I'm a little confused... I've never had any issues with g sensor, except MAYBE a little inaccurate. Am I just lucky? What kind of problems is everyone having?
[HD2 Android NAND Development] wirus0:
I have the same problem ,on the occasion of the GPS does not work

on other systems it works ok only Android not works.
[HD2 Android NAND Development] AngelDeath:
Unless you have the G-Sensor Calibration section under the display, it will not show. A Few roms I seen didnt have the G-Sensor at the bottom of the Display under settings, those systems it will not help with, If anyone wants a list, I can list the roms this works with.

And Again I will state, I cannot test these with 512rom HD2's I am in the US and can only test on my current HD2 1024 T-Mo.

I am currently about to get another one in about 1 hour, which is again T-MoUS for testing purposes, will let you know if anything changes or if I am just lucky with my current one.
[HD2 Android NAND Development] rizky_p:
Just wondering if i can use GPS Status app to calibrate g-sensor for those without calibration tool in their rom?
[HD2 Android NAND Development] nologin:
Awesome fix. It works flawlessly on my AF403 DesireHD stock based 1.0a on 512MB ROM Leo.
[HD2 Android NAND Development] AngelDeath:
Another sort of work around.

This is for anyone that DOESNT have the G-Sensor under Display, but anyone can use it:

Go to market, and download a program called Bubble. Its a program to use your phone as a level. Install it and run it, you have to calibrate it 4 times. First vertical (Side without the volume rocker against something straight), Second horizontal (First volume rocker facing down, bottom against something straight), Third horizontal (Volume rocker facing up, top of phone against something straight). And lastly calibrate the phone laying flat on its back. After that your phone should be calibrated for use. This workaround will NOT fix the auto-rotation problem.
[HD2 Android NAND Development] erestor6:
I searched for a long time, but I didn't find any application called "Bubble" that is used to calibrate the g-sensor, just to play. I downloaded (and purchased) "Superbubblelevel key" but no calibration was made. What is the author of "Bubble"? You can add a link or a barcode of this application?

Thank you very much ..
[HD2 Android NAND Development] AngelDeath:
http://www.ktk.bz/search/label/bubble

direct website but have to download from market on market
[HD2 Android NAND Development] erestor6:
thanks!!! In my market app this program is called "Livella" (maybe because my language system is italian).
[HD2 Android NAND Development] Markinus:
HI!

I fixed this problem in the kernel.

Markinus
[HD2 Android NAND Development] johnnyham89:
Could you please explain how?
[HD2 Android NAND Development] d4n13:
Thanks for the thread

Thanks for the thread. I was curious about the "Calibration" setting under Display, before I found this thread. I hit calibrate to see what it would do and all my G-Sensor stuff went wonky. That was about the time I searched for this thread. I didn't apply the patch, I simply calibrated my HD2 face-down and now all is well.

The trick to a good face down calibration is to grab droidVNC server. I lay the phone face down then vnc into it to hit the calibrate button.

Thx for mentioning that as the bug you were fixing... I would have never thought to try it.

11011011
[HD2 Android NAND Development] 00108929d:
dont work for tested on mult nand rom
[HD2 Android NAND Development] 00108929d:
not working...
[HD2 Android NAND Development] nenich78:
Can't fix it face down:(:(:(
[HD2 Android NAND Development] keymon:
Thank you, it helped :)
[HD2 Android NAND Development] nenich78:
Which kernel, did you use???:confused:
[HD2 Android NAND Development] AngelDeath:
This problem has since been fixed in the kernel. If you are using a rom that isnt working, let me know and I will test it, but the procedures I described works on any build.
[HD2 Android NAND Development] nenich78:
I'm using Bauner's -Standard V3 Final (deodexed)- build and have tried everything possible(including several kernels). So far nothing has worked.:confused:
[HD2 Android NAND Development] AngelDeath:
Try this, if you have a calibration section under display, tap it, and then you will see two levels, if you do, put the phone facedown on the edge of a table so that the calibrate button is hanging over the edge, tap the calibrate button and wait 10 seconds. After that pick up the phone click ok. and when you put the phone face up on the table the levels should be okay. But the bma150_usr should fix the calibration issue, if not then you will need to delete the txt files I stated in the first post. If you dont have a calibration section, then you need to download a program called bubble and follow my steps.

If that still doesnt work, then give me a link to the rom and I'll throw it on my test HD2 to see whats going on.
[HD2 Android NAND Development] nenich78:
I've tried the face down procedure a thousand times, deleted the txt files, changed bma150_usr and still nothing. I'm using this -Standard V3 Final (deodexed)- here's the link:http://www.anonym.to/?http://xdaforums.com/showthread.php?t=898778. But the Rom is not the problem. I've tried at least 12 or 13 Android roms(several SD builds) and have changed multiple kernels. It works like a charm with WinMo, why the fukc isn't working with Android. Half of the games and a lot of apps use this damn sensor and of course they aren't working on my phone.:mad::confused::mad:
[HD2 Android NAND Development] AngelDeath:
4 things:

1) is this a US HD2 or a EU hd2?

2) Have you tried the bubble program for leveling?

3) Backup your system and try Rafdroids 3.1 and see if that works.

4) When doing a clean install, and you go to the calibration screen are the two levels there and are they centered when the phone is face up?
[HD2 Android NAND Development] nenich78:
I'm using EU Hd2(I'm from Bulgaria, Gabrovo My name is Neno, wish you very best). I've tried the Rafdroids 3.1 and of course forgot to backup the system:mad::mad::mad:. It didn't work. When I go to Settings/display/calibrate G-sensor, I see two green bars, with bubbles inside. They don't move(of course). When I hit calibrate, the bubbles move up and down(left to right) and then position themselves in the centre of the bars and the phone says that it's OK(of course it's not). Honestly speaking I've had enough of this ****ty phone. Now it's for sale and I'm looking for another Hd 2(hopefully it will be ok) I appreciate the effort and time that you spend with me(really). If you ever come to my country I'll be glad to contact me and spend some quality time together(I'm not gay, have wife and two children:D).My e-mail is neno_cholakov@abv.bg. Live strong!!!;)
[HD2 Android NAND Development] tando2:
mine's a tmo hd2 and doesn't work with any of the above methods either. up side down calibration, changing kernels, roms, delete or edit files, sd or nand Android.... none of them works, but the damn g-sensor works perfectly well under wm in all builds. being search and try all kinds of methods for 5 months. really really frustrated, and seems like i am no the only one with the problem.

we really need some one to rescue our hd2!!!!
[HD2 Android NAND Development] justin0679@gmail.com:
I dont understand it. I have x2 HTC HD2's both VFUK setup as below:

Android version

2.3.3

Baseband version

15.42.5011U_2.15.50.14

Kernel version

2.6.32.15-HyperKernel-6.0ga8bf8f2-dirty

sar@CLX #11

CPU info

ARMv7 Processor rev 2 (v71)

Mem info (avail/total)

241 MB / 411 MB

Mod version

HyperDroid-CM7-v1.0.2 "Cheerful Cheetah"

Build number

GR140

ABOVE WORKING EXCELENT IN EVERY WAY INCLUDING THE G-SENSOR

2ND DEVICE KERNEL DIFFERS AS BELOW AND THE G-SENSOR IS

NOT WORKING :

Is it due to a HTC up-dated (changed) g-sensor?
[HD2 Android NAND Development] sabhain:
Just to post a follow up:

On at T-MO US HD2, I appear to have had success with the solution posted here.

I'm running the NexusHD2 CWM NAND version found HERE. This is a gingerbread ROM from tytung.

I haven't rooted the phone (shouldn't it be rooted already ..?) so what I did was to insert the file from the first post into the update.zip and then re-install the update from sdcard. Once I did that, things seem to be stable. This is my wife's phone, so I'm sure I'll here about it if it isn't fixed.

FYI, the other 3 files that we are instructed to delete did not exist on my HD2.

Thanks for this solution.
[HD2 Android NAND Development] Bas2ct:
No tilt -->NexusHD2-Gingerbread V2.6 [Android2.3.3][Kernel:tytung_r9]

I tried your solution, for me it did not work. But then again, I had no g-sensor what so ever. WM works with it like a charm, Android doesn't even recognize it (or at least, it seams that way). So I tried to find as much info as I could find, to no suffice yet. I do have the idea it is a driver issue more than anything else, but I don't have the slightest idea to fix it.

I did manage to get some info from the flash sequence, full of errors when it comes to the initialization of the drivers for the g-sensor (or at least, that's what I think it says). I'm not familiar with this kind of code. I did program a little bit in the past, but my skills are quite low and the languages I used are old (Basic, html and Step 7).

Log:

[ 2.857635] AKM8973 compass driver: init

[ 2.857757] msm_i2c msm_i2c.0: error, status c8 (1C)

[ 2.857818] msm_i2c msm_i2c.0: Error during data xfer (-5) (1C)

[ 2.867950] msm_i2c msm_i2c.0: error, status 43c8 (1C)

[ 2.868011] msm_i2c msm_i2c.0: Error during data xfer (-5) (1C)

[ 2.878051] msm_i2c msm_i2c.0: error, status 83c8 (1C)

[ 2.878112] msm_i2c msm_i2c.0: Error during data xfer (-5) (1C)

[ 2.888153] msm_i2c msm_i2c.0: error, status 83c8 (1C)

[ 2.888183] msm_i2c msm_i2c.0: Error during data xfer (-5) (1C)

[ 2.898223] msm_hsusb_phy_reset

[ 2.898254] msm_i2c msm_i2c.0: error, status c8 (1C)

[ 2.898345] msm_i2c msm_i2c.0: Error during data xfer (-5) (1C)

[ 2.908416] msm_i2c msm_i2c.0: error, status 83c8 (1C)

[ 2.908447] msm_i2c msm_i2c.0: Error during data xfer (-5) (1C)

[ 2.918518] msm_i2c msm_i2c.0: error, status 43c8 (1C)

[ 2.918579] msm_i2c msm_i2c.0: Error during data xfer (-5) (1C)

[ 2.928619] msm_i2c msm_i2c.0: error, status 83c8 (1C)

[ 2.928680] msm_i2c msm_i2c.0: Error during data xfer (-5) (1C)

[ 2.938720] msm_i2c msm_i2c.0: error, status 63c8 (1C)

[ 2.938751] msm_i2c msm_i2c.0: Error during data xfer (-5) (1C)

[ 2.948822] msm_i2c msm_i2c.0: error, status 83c8 (1C)

[ 2.948852] msm_i2c msm_i2c.0: Error during data xfer (-5) (1C)

[ 2.958862] AKI2C_TxData retry over 10

[ 2.958892] AKM8973 akm8973_probe: set power down mode error

[ 2.958953] akm8973: probe of 0-001c failed with error -5

After that it continues initializing other components and I couldn't find anything else what looks like the g-sensor. I've got the complete log, so if you need more info, I'll post it.

This is where I start thinking it must be a driver issue. It looks like the driver can't find the device it is looking for, but why? Is it set for the right addresses? what are the right addresses in that case?

If the addresses are fixed for every device (which seem quite logical to me), it is probably looking for another device or reaction. Since I don't know what the messages mean, I can't really figure out what the problem is.

Does anyone have any documentation or ideas / knowledge to share with me so I can solve this thing?

Thanks in advance!

Best regards,

Bas
[HD2 Android NAND Development] AngelDeath:
I still believe that there was a hardware revision possible that would cause this not to work, or it could be possible that a EU HD2 could be using different hardware, again not absolutely sure, but I can try this rom with my test phone and see if I have the same results, will kepp you posted. The driver bma150_usr is the driver for the g-sensor, and the akm8973 also is part of it, the unfortunate part is if I cant produce the error I cant fix it, and like I said this error or problem should have been long fixed. But I'll look.
[HD2 Android NAND Development] Bas2ct:
It might be because it is an early EU model, but even if so, it still probably works the same way. Allthough the ROMs we use are specifically for the HD2, Android is not. So who delivers the driver package? If it is because of a driver incompattibility, we could probably try to find the right driver and make sure to swap it with the incompatible one. (Or add it so the flash sequence recognizes the right one and every device works with the same package.)

If Android delivers the driver package, it is most likely that all drivers compatible with Android phones are there allready and it might be an address issue..

Maybe a list of error codes would help to figure out what is happening. Right now I don't have a clue what happened, just that it did not do what it is supost to.

I am thankful for your efforts, lets hope we can crack this thing and make sure to come up with a solution for future builds.
[HD2 Android NAND Development] AngelDeath:
Just out of dumb curiosity try something for me and post the results. Go to market and download a program called GPS Status if you dont have it already, after you install it, run it (I know its a gps program, just trust me). Now tap the windows key and you will get a menu go to tools, then choose calibrate pitch and roll, and follow the directions, let me know what happens.

I still think this might be a hardware revision issue, but I cant prove it.
[HD2 Android NAND Development] justin0679@gmail.com:
My tech guy reckons...

Gentlemen,

My tech guy reckons that there has been a change in the g-sensor drivers - he reckons that the windows operating system has the ability to be far more sensitive than the Android equivalent which he says explains why it works on WM and not our beloved Droid...

Can anyone confirm or otherwise this possibility?

The best as always,

Jay
[HD2 Android NAND Development] Bas2ct:
Sensor - driver issue?

Heyy AngelDeath, (any other name I could use? ;) )

Did what you asked, gps fix is no problem, height is off, but location is dead on. I tried to use the tools, but I just get my home screen of recent apps when using the windows button. Since there is no soft key; no tools. There is no detection from g-sensor, no magnetic field, no stepping / rolling, etc.

I did do some other things to try however, I've tried bubble (shows no response) and 'sensor debug', which gave me no data at all. Which seems to me (like I expected) that the g-sensor is not installed at all. Just to figure out why not...

Is there some workaround to get to the tools?

Heyy Jay,

This sounds like a plausible explanation for the lagging and freezing g-sensor. Makes sense. Makes me wonder if it's really the driver itself or the way it has been programmed to communicate between hardware and software platform.

But your tech guy is probably right if you ask me. I'm no expert when it comes to this, but I just compare it to windows :P If you install the wrong driver, everything goes bonky....

But, on the other hand, It could also be a difference in hardware as well. Maybe Android phones use different g-sensors (more sensitive) and the Android sensors could be restricted by the drivers because your screen would go all over the place if they weren't restricted.... Although I guess in mass production, they would like the hardware to be the same for every device.

So, actually I did not answer your question, just thought about it... If you do get an answer, please keep us posted?

Best,

Bas