[Guide]Galaxy Note 10.1 (2014) How to calibrate accelerometer sensor ? - Galaxy Note 10.1 (2014 Edition) Q&A, Help & Troubl

Tablet is rooted.
My accelerometer sensor was misscalibrated, about 10 degrease to left. In any racing game the steering was going to the left side.
I have tried different apps, nothing work.
In android 4.3 there is not an option to do it.
EDIT : Here is " How to do it "
PROBLEM SOLVED !!! Here is what i've done : Only for rooted tablets.
You need to be rooted. Install root explorer ( you will need it )
1. Install any Terminal Emulator.
2. Run this :
su
cd sys/devices/virtual/sensors/accelerometer_sensor/
echo 0 > calibration (this will reset your sensor )
echo 1 > calibration (this will calibrate your sensor )
Hit "Enter" after each command line.
(!!!!! before runing the last command, tablet must be with face up, on a leveled surface )
Now reboot your tablet. You have succesfully calibrated your accelerometer sensor. Calibration will survive even when install another room (tested).
Now every racing game run perfect, no deviation .

says no such file or directory help me plz

manav113 said:
says no such file or directory help me plz
Click to expand...
Click to collapse
second line: start with a "/" before sys
su
cd /sys/devices/virtual/sensors/accelerometer_sensor/
echo 0 > calibration (this will reset your sensor )
echo 1 > calibration (this will calibrate your sensor )

Do you know how to increase the accelerometer sensetivity? My Note seems to take a long time to sense when I've turned the display.

Related

Screen calibration config

I'd like to know where are stored the parameters of the screen calibration.
I ask this because at every reboot they reset to factory default so I want to mod it directly.
Kisses to all
seems to be stored in
Code:
/data/data/org.isageek.dasbrennen.CalibrateScreen/databases/calvalues
which is a sqlite database (which I know nothing about!)
You could try making a copy of it before and after rebooting and see if it changes (binary diff). If it does, maybe you could replace it on every boot in your userinit .sh
If not, maybe the CalibrateScreen app just needs to be started to load the custom values, but you could probably do that on startup too.
mmec2 said:
seems to be stored in
Code:
/data/data/org.isageek.dasbrennen.CalibrateScreen/databases/calvalues
which is a sqlite database (which I know nothing about!)
You could try making a copy of it before and after rebooting and see if it changes (binary diff). If it does, maybe you could replace it on every boot in your userinit .sh
If not, maybe the CalibrateScreen app just needs to be started to load the custom values, but you could probably do that on startup too.
Click to expand...
Click to collapse
Thank you very much for your reply, however I was trying to figure out the place where these values are stored into android system and not into the app... because I think that the app it's only a bridge for the real calibration of the system... or maybe I'm wrong?
TuoNonno said:
Thank you very much for your reply, however I was trying to figure out the place where these values are stored into android system and not into the app... because I think that the app it's only a bridge for the real calibration of the system... or maybe I'm wrong?
Click to expand...
Click to collapse
For some reason, I assumed it was a built in part of the system, but it's not!
Anyway, your question has got me interested now, so I took CalibrateScreen.apk from Scoot's CM6.1 build, decompiled the apk with apktool and searched the source for "write"
I believe the values you are looking for are
Code:
/sys/class/vogue_ts/xmin
/sys/class/vogue_ts/xmax
/sys/class/vogue_ts/ymin
/sys/class/vogue_ts/ymax
(found in CalibrateScreen/smali/org/isageek/dasbrennen/CalibrateScreen/Calibrator.smali)
so you could just add
Code:
echo NUMBER > /sys/class/vogue_ts/xmin
etc. etc.... to your userinit.sh
mmec2 said:
For some reason, I assumed it was a built in part of the system, but it's not!
Anyway, your question has got me interested now, so I took CalibrateScreen.apk from Scoot's CM6.1 build, decompiled the apk with apktool and searched the source for "write"
I believe the values you are looking for are
Code:
/sys/class/vogue_ts/xmin
/sys/class/vogue_ts/xmax
/sys/class/vogue_ts/ymin
/sys/class/vogue_ts/ymax
(found in CalibrateScreen/smali/org/isageek/dasbrennen/CalibrateScreen/Calibrator.smali)
so you could just add
Code:
echo NUMBER > /sys/class/vogue_ts/xmin
etc. etc.... to your userinit.sh
Click to expand...
Click to collapse
you are the man! You solved a issue that was drilling me since months!
Many many thanks!
It wooooooooooooooorks! HUAHAHAHAHA!
step by step:
1) calibrated screen with screencalibration app.
2) copied
Code:
/sys/class/vogue_ts/xmin
/sys/class/vogue_ts/xmax
/sys/class/vogue_ts/ymin
/sys/class/vogue_ts/ymax
/system/bin/userinit.sh
to sdcard root
3) edited userinit.sh with notepad++ like that:
Code:
#!/system/bin/sh
#
# Fix su so that we use the one supplied with the build. This allows the Superuser Permissions app to do it's stuff
#
/bin/umount /bin/su
/bin/umount /system/bin/su
busybox mount -o rw,remount /system
echo 708 > /sys/class/vogue_ts/xmin
echo 3660 > /sys/class/vogue_ts/xmax
echo 257 > /sys/class/vogue_ts/ymin
echo 3551 > /sys/class/vogue_ts/ymax
chmod 04777 /system/bin/su
chmod 04777 /sys/class/vogue_ts
busybox mount -o ro,remount /system
/bin/mount --bind /system/bin/su /bin/su
4) created a androidupdate.tar file with 7zip containing system/bin/userinit.sh
5) dpad during startup, installed androidupdate and fixed permissions
Happy ^^
could you upload the standard calibrate file to me ?
I dont understand why my kaiser seem to be crazy because touch screen seem to be rotate 90 degrees. it mean .... the app button ( in the center of the bottom screen ) will become middle of the left screen. I mean if I want to touch app button, I must touch the middle left of the screen
I cant do anything with this !!!
Fuk my kaiser >.< sorry for my bad emotion !!!
dai_thang said:
could you upload the standard calibrate file to me ?
I dont understand why my kaiser seem to be crazy because touch screen seem to be rotate 90 degrees. it mean .... the app button ( in the center of the bottom screen ) will become middle of the left screen. I mean if I want to touch app button, I must touch the middle left of the screen
I cant do anything with this !!!
Fuk my kaiser >.< sorry for my bad emotion !!!
Click to expand...
Click to collapse
Sure, here it is, install it like a normal update from dpad menu on boot (remember to fix permission after the install)
thanks for your quick response ! however, my fukin kaiser didnot change in positive way. Comparing to my friend device, I realize that different Kaiser has Different compatibility. I try 3 panel mode but the screen did not work well ! How can I mod a unique sceen calibration for me ? I mean rotate 90 degree counter clockwise T_T ?
I'm waiting for for help, TuoNonno, my own hero !
dai_thang said:
thanks for your quick response ! however, my fukin kaiser didnot change in positive way. Comparing to my friend device, I realize that different Kaiser has Different compatibility. I try 3 panel mode but the screen did not work well ! How can I mod a unique sceen calibration for me ? I mean rotate 90 degree counter clockwise T_T ?
I'm waiting for for help, TuoNonno, my own hero !
Click to expand...
Click to collapse
LOL...
have you tried to follow the instruction that I posted above to extract the correct values for your touch? remember also to do the calibration with the sliding keyboard closed!
TuoNonno said:
It wooooooooooooooorks! HUAHAHAHAHA!
step by step:
1) calibrated screen with screencalibration app.
2) copied
Code:
/sys/class/vogue_ts/xmin
/sys/class/vogue_ts/xmax
/sys/class/vogue_ts/ymin
/sys/class/vogue_ts/ymax
/system/bin/userinit.sh
to sdcard root
Happy ^^
Click to expand...
Click to collapse
How can I generate this information ???
What did U mean .... by saying "copied" ?
Those are the steps I did, so I wrote "copied".
Just follow those steps, nothing more to do
Basically, you need to run the calibration screen app, then you copy the 5 files in "/sys/class/vogue_ts" to your sd card root in order to be more handy and do those steps.
dai_thang said:
thanks for your quick response ! however, my fukin kaiser didnot change in positive way. Comparing to my friend device, I realize that different Kaiser has Different compatibility. I try 3 panel mode but the screen did not work well ! How can I mod a unique sceen calibration for me ? I mean rotate 90 degree counter clockwise T_T ?
I'm waiting for for help, TuoNonno, my own hero !
Click to expand...
Click to collapse
actually i cant speak english properly. but ill try to answer ur questions.
i have a stupid solution for the problem of calibrating the screen. i use Incubus26Jc's Super Froyo 2.2 [Deodexed] [RLS15] on my kaiser.
i do the screen calibration once a week. for the screen calibration on my android, will appear a black screen with two red dots on the screen to the left top, and bottom right. all i have to do is touch one red spot twice, until the recalibration text does not appear. (or other writings that tell you to re-calibration).
finished ...!!! what i have to do is press the "OK" to apply. i hope now ur screen is not mad anymore.
TuoNonno said:
It wooooooooooooooorks! HUAHAHAHAHA!
step by step:
1) calibrated screen with screencalibration app.
2) copied
Code:
/sys/class/vogue_ts/xmin
/sys/class/vogue_ts/xmax
/sys/class/vogue_ts/ymin
/sys/class/vogue_ts/ymax
/system/bin/userinit.sh
to sdcard root
3) edited userinit.sh with notepad++ like that:
Code:
#!/system/bin/sh
#
# Fix su so that we use the one supplied with the build. This allows the Superuser Permissions app to do it's stuff
#
/bin/umount /bin/su
/bin/umount /system/bin/su
busybox mount -o rw,remount /system
echo 708 > /sys/class/vogue_ts/xmin
echo 3660 > /sys/class/vogue_ts/xmax
echo 257 > /sys/class/vogue_ts/ymin
echo 3551 > /sys/class/vogue_ts/ymax
chmod 04777 /system/bin/su
chmod 04777 /sys/class/vogue_ts
busybox mount -o ro,remount /system
/bin/mount --bind /system/bin/su /bin/su
4) created a androidupdate.tar file with 7zip containing system/bin/userinit.sh
5) dpad during startup, installed androidupdate and fixed permissions
Happy ^^
Click to expand...
Click to collapse
Awesome! my Kaiser 100 now holds screen calibration, even after a dead battery or a power cycle. Really enjoying Dark_Prince's Froyo 2.2.2 on this AT&T tilt. But the method of creating a androidupdate.tar did not work for me. The update reported it worked as a success, then a fix permission seemed to finish, but still no calibration save.
This is what worked on my device:
As TuoNonno said I copied the four files containing the needed values, and in the end I went to market and got a file manager that had root permissions and edited ' /system/bin/userinit.sh ' to reflect the values those four files held.
my userinit.sh on my device now looks like this:
Code:
/bin/umount /bin/su
/bin/umount /system/bin/su
busybox mount -o rw,remount /system
echo 1345 > /sys/class/vogue_ts/xmin
echo 3387 > /sys/class/vogue_ts/xmax
echo 334 > /sys/class/vogue_ts/ymin
echo 3615 > /sys/class/vogue_ts/ymax
chmod 04777 /system/bin/su
chmod 04777 /sys/class/vogue_ts
busybox mount -o ro,remount /system
/bin/mount --bind /system/bin/su /bin/su
Not sure if that is the 'proper' way to fix, but it surely seems to work - I no longer have to use the physical buttons to navigate to and open the screen calibrate app.
Thank you to all that had a part in developing this fix. The knowledge of the gurus on this forum is outstanding!

[Need Root] Is blinking screen annoying? Here's a guide to disable autobrightness

Step 1. Open /sys/class/leds/lcd-backlight/als/enable , you will see "1", change it to "0" and save.
Step 2. Open /sys/class/leds/lcd-backlight/als/params , set it "0,0,0,0" and save.
Step 3. May need reboot or may not.
Step 4(OPTIONAL). If you have /system/etc/init.d/ , you can try to create a file name it as "S10abdisable" and put the quote in.
#!/system/bin/sh
#
# Disable Autobrightness
dev=/sys/class/leds
echo 0,0,0,0 > $dev/lcd-backlight/als/params
echo 0 > $dev/lcd-backlight/als/enable
Click to expand...
Click to collapse
Also need to be deodexed, at least for the Ion. If not it will turn back on with time.
I also found for the Ion only the enable to 0 was needed
~Jaramie
Sent from my ION

[Q] Proximity Sensor Calibration

I found out that the proximity sensor on my Note II isn't working as it should. Whenever I am on call, the screen goes off, but doesn't lit up when I move the phone away from my ear. I've investigated and found that calibrating the proximity sensor could solve the problem.
I've searched around but haven't found the right steps to calibrate the proximity sensor on Note 2. The 'Phone Tester' app shows weird behavior of the sensor. It sometimes just keeps waiting for the data and sometimes shows 'Far' , 'Near' status correctly. But once I move my hand near the sensor and then move it away, the status remains 'Near'.
I'd really appreciate recalibration procedure & any other recommended fix.
I would like to know the solution too
Handwritten from my Note 2
I have same problem too
Sent from my GT-N7100 using xda app-developers app
CrazyEngineer said:
I found out that the proximity sensor on my Note II isn't working as it should. Whenever I am on call, the screen goes off, but doesn't lit up when I move the phone away from my ear. I've investigated and found that calibrating the proximity sensor could solve the problem.
I've searched around but haven't found the right steps to calibrate the proximity sensor on Note 2. The 'Phone Tester' app shows weird behavior of the sensor. It sometimes just keeps waiting for the data and sometimes shows 'Far' , 'Near' status correctly. But once I move my hand near the sensor and then move it away, the status remains 'Near'.
I'd really appreciate recalibration procedure & any other recommended fix.
Click to expand...
Click to collapse
I think from check list call *#0*#:laugh:
Did any of you figure out a fix to this issue?
To calibrate the proximity sensor you need to edit the build.prop, file. Quickest way I do this is by using Romtoolbox pro which has that option. Once in the build prop up editor you'll see the option to recalibrate the proximity sensor. You'll need root access.
Sent from the Rabbit Hole
bushako said:
To calibrate the proximity sensor you need to edit the build.prop, file. Quickest way I do this is by using Romtoolbox pro which has that option. Once in the build prop up editor you'll see the option to recalibrate the proximity sensor. You'll need root access.
Sent from the Rabbit Hole
Click to expand...
Click to collapse
Where exactly in the build.prop is this setting. I access it using root explorer and scanned through the entire file and saw nothing that would hint at the proximity sensor calibration.
rumy said:
Where exactly in the build.prop is this setting. I access it using root explorer and scanned through the entire file and saw nothing that would hint at the proximity sensor calibration.
Click to expand...
Click to collapse
Sent from the Rabbit Hole
bushako said:
Sent from the Rabbit Hole
Click to expand...
Click to collapse
I don't have that in my build.prop I am running ARHD9.0
What exactly does that do. Does it just delay the screen from going of when on your face? In that case I have already disabled the proximity sensor during calls.
I am starting to wonder if this is a hardware fault.
Can you try this? If you use and it does not work once removing it will restore your factory values.
http://db.tt/C7PJnQgt
Sent from my GT-N7100 using xda premium
It looks like the proximity threshold is set too low in the kernel and causes this to misbehave when the sensor gets a little dirty.
For example: If you open the diagnostic menu by dialing *#0*# and look under sensors if your ADC value for the sensor is anything over 12, the proximity sensor will register that something is close to the phone. That value can be temporarily adjusted by setting prox_thresh under /sys/devices/virtual/sensors/proximity_sensor to something higher (like 30).
Unfortunately, it looks like changing this value doesn't "stick" and the next time the sensor is accessed, something changes it back to the default of 12.
I'm guessing that the default value is set in the kernel at compile time. Maybe someone can talk of the kernel devs into tweaking the value.
anyone found a solution to this yet?
Hi, is rooting the phone the only way to get this working? So annoying... Maybe will just send this galaxy note 2 back for a refund, tried for a long time to get this fixed, I think it started after the last android update I thought they'd have done something about it by now...
On Samsung devices like i9100 (Galaxy S3) or N7100 (Note II) you can do the following if you have root permissions:
On Android Terminal App or adb shell do:
Code:
$ su
$ echo 0 > /sys/class/sensors/proximity_sensor/prox_cal
$ echo 1 > /sys/class/sensors/proximity_sensor/prox_cal
The zero resets the actual calibration offset.
The one does an auto calibration (read sensor value, set offset to this sensor value, write calibration offset to "/efs/prox_cal" which is read while device is booting).
Best for calibrate your sensor is to keep it dark, the glass have to be clean and the sensor free (so that the sensor doesn't measure anything).
The calibration offset is stored in efs, thats why you can make full wipe and use other ROMs without the need of recalibration.
You can check the running config by:
Code:
$ cat /sys/class/sensors/proximity_sensor/state
The first value is the calibration Offset, the second one is the sensor threshold (threshold is set at compile time).
Open *#0*# to see "sensors" and check if your proximity sensor is now working properly.
Because in Kernel code (copyright by Samsung) for the device driver is somthing like this autocalibration, i bet that there is a secret menue or code that does the calibration too. But until someone discovers this secret we have to have root permissions to do a proximity sensor calibration.
greaty said:
On Samsung devices like i9100 (Galaxy S3) or N7100 (Note II) you can do the following if you have root permissions:
On Android Terminal App or adb shell do:
Code:
$ su
$ echo 0 > /sys/class/sensors/proximity_sensor/prox_cal
$ echo 1 > /sys/class/sensors/proximity_sensor/prox_cal
The zero resets the actual calibration offset.
The one does an auto calibration (read sensor value, set offset to this sensor value, write calibration offset to "/efs/prox_cal" which is read while device is booting).
Best for calibrate your sensor is to keep it dark, the glass have to be clean and the sensor free (so that the sensor doesn't measure anything).
The calibration offset is stored in efs, thats why you can make full wipe and use other ROMs without the need of recalibration.
You can check the running config by:
Code:
$ cat /sys/class/sensors/proximity_sensor/state
The first value is the calibration Offset, the second one is the sensor threshold (threshold is set at compile time).
Open *#0*# to see "sensors" and check if your proximity sensor is now working properly.
Because in Kernel code (copyright by Samsung) for the device driver is somthing like this autocalibration, i bet that there is a secret menue or code that does the calibration too. But until someone discovers this secret we have to have root permissions to do a proximity sensor calibration.
Click to expand...
Click to collapse
Hey, I've been looking for a fix for prox sensor on my Note 2 ever since I installed Paranoid back in december/january, went back to stock and it was still broken. This fixed it!! So thank you I have just one issue, it seems to go back to being broken when I reboot the phone. Is there any way to prevent this? Also the *#0*# doesn't work for me and the cat command returns just a 0. Thanks.
EDIT: it might help to note that I'm running cyanogenmod 10.1 nightly now
EDIT2: I figured it out! I did a search for prox_cal and found one in /sys/devices/virtual/sensors/proximity_sensor with the values 18,9. i put those values in the empty /efs/prox_cal. It now works on boot.
marcmy said:
... it seems to go back to being broken when I reboot the phone. Is there any way to prevent this? Also the *#0*# doesn't work for me and the cat command returns just a 0. Thanks.
EDIT: it might help to note that I'm running cyanogenmod 10.1 nightly now
EDIT2: I figured it out! I did a search for prox_cal and found one in /sys/devices/virtual/sensors/proximity_sensor with the values 18,9. i put those values in the empty /efs/prox_cal. It now works on boot.
Click to expand...
Click to collapse
I described the sensor recalibration on Samsung rom or Samsung based roms. " *#0*# "is a "secret code" that starts a samsung test tool - only included in stock or stock rom based.
I have read from other users that "cat state" returns zero. I don't know exactly why. But it could be because:
1. that the sensor is powered down (on my phone the sensor never sleeps)
2. the calibration offset is too high
3. the calibration offset is optimal
To test the sensor is on and working you should read the value with finger put on. (there should be value around 127-calibration offset). I guess to do the calibration/sensor reading with display on and phone unlocked. Another user told me that it helped to start an app which reads the sensor values (so the sensor wake up).
But in your case proximity_sensor with the values 18,9 means that the sensor is already calibrated to 18 which can cause a zero at "cat state".
Note that the offset is read from file calibration file at boot time and from that on holded in ram. The RAM value can only be influenced by "/sys/class/sensors/proximity_sensor/prox_cal" or by calibration file (on boot). The auto calibration process not only try to create a /efs/prox_cal file but also changes the calibration value in ram at run time .
So if you try "echo 0 > /sys/class/sensors/proximity_sensor/prox_cal; echo 1 > /sys/class/sensors/proximity_sensor/prox_cal" -> "mmh auto calibration does not work there is no prox_cal file, i will try it manually" can be the wrong way because the calibration offset can be already changed to a calibrated value and so you wont get the correct blank value read out "state".
The other path in virtual filesystem to the sensor control you mentioned is also correct. I don't know which is the most common one.
But since both pathes are available in samsung stock i guess it should be " /sys/devices/virtual/sensors/proximity_sensor".
Be careful of putting in the calibration value manually. In Samsung stock rom the kernel which is reading the calibration value at boot time don't make a character conversion. So if you write the config file like this:
Code:
echo '18,9' > /efs/prox_cal
Ends Up with Calibration value of 49 because the kernel will read the first byte of file. This is a "1" which is the ASCII code for "0x31" which is 49 in decimal. That should work too but throw away half of the sensor sensivity.
If you would like to calibrate it manually you have to:
Code:
cd /sys/devices/virtual/sensors/proximity_sensor/
Read the blank value ( glass have to be clean and fingers away from sensor ).
Code:
$ cat state #finger on the sensor to test if the sensor is working properly
120
$ cat state #blank value
10
Read the actual configuration:
Code:
$ cat prox_cal
0,9
The first value is the "sensor offset" and the second one is "Cancelation Threshold" (threshold can not stored in calibration file)
So you calculate your calibration value: 0 (actual sensor offset) + 10 (blank value) = 10 (new offset) = 0x0a HEX. Make shure your efs partition is mounted writeable and then:
Code:
$ su
$ echo -en $'\x[B]0a[/B]' > /efs/prox_cal
$ sync
If the prox_cal is created first you should change the permisssions. Kernel sets 666 by default :
Code:
$ chown system:system /efs/prox_cal
$ chmod 644 /efs/prox_cal
$ sync
After reboot you can confirm the calibration
Code:
$ cat /sys/devices/virtual/sensors/proximity_sensor/prox_cal
10,9
$ cat /sys/devices/virtual/sensors/proximity_sensor/state
0
If you have to calibrate to a lower sensor value and want to do it the "manual way" you have to reset the calibration or delete the calibration file and reboot. because state value = sensor value - offset . And if offset gets to big the state is alway zero.
greaty said:
On Android Terminal App or adb shell do:
Code:
$ su
$ echo 0 > /sys/class/sensors/proximity_sensor/prox_cal
$ echo 1 > /sys/class/sensors/proximity_sensor/prox_cal
The zero resets the actual calibration offset.
The one does an auto calibration (read sensor value, set offset to this sensor value, write calibration offset to "/efs/prox_cal" which is read while device is booting).
Click to expand...
Click to collapse
working great on my i9505 thanks !!!!
Hello, so I had a very similar experience in flashing Paranoid and then my sensor went bezerk. It seems to be just not turning on with the phone, but the front camera does work fine. I was able to get it working a few days ago by flashing the stock rom and kernel multiple times, but I decided to get bold and reflash the Neak kernel and poof, that was over. Not another few flashes would bring my sensor back. At this point I don't even know what to do.
Thought it might also be worthwhile to mention: the light sensor also does not work and when I looked through the files in the sys/class/sensors for both proximity and light sensors the runtime status is unsupported.
A full Odin restore should reset all these values and the whole thing should work right immediately as long as the sensor hardware hasn't gone bad, right?
Easy FIX!!!!!
I took a can of compressed air and blew it through the top earpiece grill a few times and Voila, it works great now!!
I actually used a Old perfume can which perfume was over and it was only pressing Gas OFF!! :good::good::good::good:
Finally Fixed My Sensor
greaty said:
I described the sensor recalibration on Samsung rom or Samsung based roms. " *#0*# "is a "secret code" that starts a samsung test tool - only included in stock or stock rom based.
I have read from other users that "cat state" returns zero. I don't know exactly why. But it could be because:
1. that the sensor is powered down (on my phone the sensor never sleeps)
2. the calibration offset is too high
3. the calibration offset is optimal
To test the sensor is on and working you should read the value with finger put on. (there should be value around 127-calibration offset). I guess to do the calibration/sensor reading with display on and phone unlocked. Another user told me that it helped to start an app which reads the sensor values (so the sensor wake up).
But in your case proximity_sensor with the values 18,9 means that the sensor is already calibrated to 18 which can cause a zero at "cat state".
Note that the offset is read from file calibration file at boot time and from that on holded in ram. The RAM value can only be influenced by "/sys/class/sensors/proximity_sensor/prox_cal" or by calibration file (on boot). The auto calibration process not only try to create a /efs/prox_cal file but also changes the calibration value in ram at run time .
So if you try "echo 0 > /sys/class/sensors/proximity_sensor/prox_cal; echo 1 > /sys/class/sensors/proximity_sensor/prox_cal" -> "mmh auto calibration does not work there is no prox_cal file, i will try it manually" can be the wrong way because the calibration offset can be already changed to a calibrated value and so you wont get the correct blank value read out "state".
The other path in virtual filesystem to the sensor control you mentioned is also correct. I don't know which is the most common one.
But since both pathes are available in samsung stock i guess it should be " /sys/devices/virtual/sensors/proximity_sensor".
Be careful of putting in the calibration value manually. In Samsung stock rom the kernel which is reading the calibration value at boot time don't make a character conversion. So if you write the config file like this:
Code:
echo '18,9' > /efs/prox_cal
Ends Up with Calibration value of 49 because the kernel will read the first byte of file. This is a "1" which is the ASCII code for "0x31" which is 49 in decimal. That should work too but throw away half of the sensor sensivity.
If you would like to calibrate it manually you have to:
Code:
cd /sys/devices/virtual/sensors/proximity_sensor/
Read the blank value ( glass have to be clean and fingers away from sensor ).
Code:
$ cat state #finger on the sensor to test if the sensor is working properly
120
$ cat state #blank value
10
Read the actual configuration:
Code:
$ cat prox_cal
0,9
The first value is the "sensor offset" and the second one is "Cancelation Threshold" (threshold can not stored in calibration file)
So you calculate your calibration value: 0 (actual sensor offset) + 10 (blank value) = 10 (new offset) = 0x0a HEX. Make shure your efs partition is mounted writeable and then:
Code:
$ su
$ echo -en $'\x[B]0a[/B]' > /efs/prox_cal
$ sync
If the prox_cal is created first you should change the permisssions. Kernel sets 666 by default :
Code:
$ chown system:system /efs/prox_cal
$ chmod 644 /efs/prox_cal
$ sync
After reboot you can confirm the calibration
Code:
$ cat /sys/devices/virtual/sensors/proximity_sensor/prox_cal
10,9
$ cat /sys/devices/virtual/sensors/proximity_sensor/state
0
If you have to calibrate to a lower sensor value and want to do it the "manual way" you have to reset the calibration or delete the calibration file and reboot. because state value = sensor value - offset . And if offset gets to big the state is alway zero.
Click to expand...
Click to collapse
Finally, this fixed my problem. I don't know why, but the other solution worked one time while using a CM 10.2 nightly
Code:
$ su
$ echo 0 > /sys/devices/virtual/sensors/proximity_sensor/prox_cal
$ echo 1 > /sys/devices/virtual/sensors/proximity_sensor/prox_cal
But, when I upgraded to the latest nightly, this stopped working. It wouldn't work even if y restored my stock ROM backup using TWRP, I even flashed a stock image with odin and the sensor would still malfunction.
Today I followed this steps using the values returned for my phone and it finally worked! I did this.
Code:
$ cat state #finger on the sensor to test if the sensor is working properly
120
$ cat state #blank value
10
This returned 255 #finger on the sensor and 69 #blank value
and when I did
Code:
cat /sys/devices/virtual/sensors/proximity_sensor/prox_cal
this returned 47,60,45.....so my offset was 47. Ths sum of offset and #blank value was 47 + 69 = 116 that is equal to 74 in HEX.
so I did
Code:
$ echo -en $'\x74' > /efs/prox_cal
and then
Code:
$ chown system:system /efs/prox_cal
$ chmod 644 /efs/prox_cal
$ sync
After that I rebooted my phone from the terminal using que command
Code:
$ reboot
and that was it! Now my sensor is fixed and survives reboot. Thanks!

[Q] Problems calling with multiple ROMs

Hi Guys,
I have a Samsung Galaxy S3 SGH-T999 (Tmobile). When I had the stock ROM the phone worked fine, but now I am having the same issue with multiple ROMs.
Whenever I make or receive a phone call, the screen turns black (LED off and everything) and it will not come back on until the other person has hung up (I can't, because I have no buttons). I have tried Cyanogenmod 10.2.1 stable, Cyanogen mod 11 nightly (newest), and Paranoid Android 4.4.2 BETA 3.
I read on another forum that this may have something to do with the proximity sensor, and I went to settings>devices>more and under "Sensors and Motors" there is only vibrator intensity. I also checked the call app settings and there are not any options relating to proximity sensor. I also tried several USSD codes to check that which I found online but have been unsuccessful in getting any of those to work.
Any help would be greatly appreciated!
Thanks,
EvilWoodchuck
Try a CM 11 Stable (Don't go for latest nightly but the last stable) and recalibrate your Sensors. Make a CLEAN install no restoring apps or data. Also do you happen to have any Kernel tweaks of any sort ?
Last but not least, try a single light tap on Power button. That will bring the screen back.
If that fails, odin full stock firmware to see if it helps. If not its likely a faulty sensor. Easy and cheap to fix surprisingly.
Sent from my SGH-T999 using Tapatalk
Perseus71 said:
Try a CM 11 Stable (Don't go for latest nightly but the last stable) and recalibrate your Sensors. Make a CLEAN install no restoring apps or data. Also do you happen to have any Kernel tweaks of any sort ?
Last but not least, try a single light tap on Power button. That will bring the screen back.
Click to expand...
Click to collapse
Got it working, had to manually recalibrate the proximity sensor with terminal emulator. Thanks for the help guys
Edit:
I am not able to post links yet, but here is the method used for recalibration if anyone needs it (credit to Viraj Kshatriya of androidlegend.com):
Prerequisites:
1. Enable USB Debugging
2. Root Access
3. Terminal Emulator
All commands will be done in terminal emulator as Root:
1. Enter superuser mode
su <enter>
2. Obtain offset value
cat /sys/devices/virtual/sensors/proximity_sensor/prox_cal <enter>
This will return a few numbers, the first one is your offset value
3. Obtain normal value
cat /sys/devices/virtual/sensors/proximity_sensor/state <enter>
This will return one number, this is your normal value
4. Modify /efs/prox_cal
Take your offset value, and add it with your normal value
Convert sum of these to hexadecimal
echo -en $ '\x**' > /efs/prox_cal (** being your hexadecimal number from above step) <enter>
chown system:system /efs/prox_cal <enter>
chmod 644 /efs/prox_cal <enter>
sync <enter>
reboot <enter>
5. Wait for phone to reboot and you should be good to go!!! :good:
EvilWoodchuck
Care to share how you did that exactly? Good job getting it to work!
I am curious and im sure itll help others in the future though.
Sent from my SGH-T999 using Tapatalk
See edit
Sent from my SGH-T999 using xda app-developers app

[Q] Proximity Sensor does not work

Proximity sensor on my phone doesn't work. Whenever I get a call or make a call, the screen goes black. Then after the call ends, the screen comes back.
Things I have done so far to solve the issue, but didn't work:
1. Blown air through earpiece.
2. Cleaned the proximity sensor by opening the phone.
3. When I dial *#*#7269#*#*, nothing happens.
4. Tried apps like, "Hardware Disabler", "Screebl", "Proximity Screen Off", etc.
5. There is no option like "proximity off", in settings.
How can I disable proximity sensor?
My Phone : Samsung Galaxy Grand Duos i9082 with Android 5.1.1 (with this ROM http://forum.xda-developers.com/gal...m-resurrection-remix-lollipop-v5-2-8-t3000749)
You doesn`t needed to disabled Proximity sensor
hammadfaisal007 said:
Proximity sensor on my phone doesn't work. Whenever I get a call or make a call, the screen goes black. Then after the call ends, the screen comes back. .
..........
Sorry this post reply look so messi ( I m cannot speak English better )
..........
Hello my brother ( im currently using i9082 CM 12.1 Android V 5.1.1 too )
That so easy brother
You doesn`t needed to disabled Proximity sensor on your devices
Just needed calibrating Proximity sensor value to make it working correctly without bugs when incoming a call / make a call
i Allways using this method & this method may be worked on other Samsung too. :highfive:
Firsty
Activated root access in your devices.
I sure you already know for activated ROOT access
Download
> Root Explorer
> Terminal emulator android.apk
NEXT :
Here the best manual guide for me
1) Open Root explorer
go to /sys/devices/virtual/sensors/proximity_sensor/
Open & look at files with name prox_cal
In my devices that showing
0, 12 { Note : Very Important }
Then
/sys/devices/virtual/sensors/proximity_sensor/
Open & look at files with name
state
In my devices that showing
0 { Note : Very Important too }
......................................................................................
In other devices that files will showing different number
......................................................................................
Next
you need to + that, but remember dont add " , "
0 + 12 = 12
0 & 12 has came from prox_cal files
After that, result 12 needed to convert fromm assci into hexadecimal
As the result that will showing
31 32
Oke You already to fix them in Terminal Emulator app
Terminal Emulator app in your devices
.....::::::::Lastly::::::::.....
1} type
su
{ENTER}
(make sure your work has gained root access)
then
2} type
echo -en $ '\x{(PLACE HERE YOUR HEXADECIMAL VALUE'> /efs/prox_cal
So as the result it will be apear like this
echo -en $ '\x31 32' > /efs/prox_cal
{ENTER}
3} type
chown system:system /efs/prox_cal
{ENTER}
4}type
chmod 644 /efs/prox_cal
{ENTER}
5}type
sync
{ENTER}
& reboot devices normally
Finish you has been fixed problem when incoming calls / when make a call in your devices :good: :highfive: :fingers-crossed:
Click to expand...
Click to collapse
You can try with the stock rom
Hadi_K.t(t_t)t said:
hammadfaisal007 said:
Proximity sensor on my phone doesn't work. Whenever I get a call or make a call, the screen goes black. Then after the call ends, the screen comes back. .
..........
Sorry this post reply look so messi ( I m cannot speak English better )
..........
Hello my brother ( im currently using i9082 CM 12.1 Android V 5.1.1 too )
That so easy brother
You doesn`t needed to disabled Proximity sensor on your devices
Just needed calibrating Proximity sensor value to make it working correctly without bugs when incoming a call / make a call
i Allways using this method & this method may be worked on other Samsung too. :highfive:
Firsty
Activated root access in your devices.
I sure you already know for activated ROOT access
Download
> Root Explorer
> Terminal emulator android.apk
NEXT :
Here the best manual guide for me
1) Open Root explorer
go to /sys/devices/virtual/sensors/proximity_sensor/
Open & look at files with name prox_cal
In my devices that showing
0, 12 { Note : Very Important }
Then
/sys/devices/virtual/sensors/proximity_sensor/
Open & look at files with name
state
In my devices that showing
0 { Note : Very Important too }
......................................................................................
In other devices that files will showing different number
......................................................................................
Next
you need to + that, but remember dont add " , "
0 + 12 = 12
0 & 12 has came from prox_cal files
After that, result 12 needed to convert fromm assci into hexadecimal
As the result that will showing
31 32
Oke You already to fix them in Terminal Emulator app
Terminal Emulator app in your devices
.....::::::::Lastly::::::::.....
1} type
su
{ENTER}
(make sure your work has gained root access)
then
2} type
echo -en $ '\x{(PLACE HERE YOUR HEXADECIMAL VALUE'> /efs/prox_cal
So as the result it will be apear like this
echo -en $ '\x31 32' > /efs/prox_cal
{ENTER}
3} type
chown system:system /efs/prox_cal
{ENTER}
4}type
chmod 644 /efs/prox_cal
{ENTER}
5}type
sync
{ENTER}
& reboot devices normally
Finish you has been fixed problem when incoming calls / when make a call in your devices :good: :highfive: :fingers-crossed:
Click to expand...
Click to collapse
It shows nothing in "/sys/devices/virtual/sensors/proximity_sensor/state". There is no value in it. What to do now? BTW thanks for your efforts.
P.S: In prox_cal, there is 0,12.
Click to expand...
Click to collapse
hammadfaisal007 said:
Proximity sensor on my phone doesn't work. Whenever I get a call or make a call, the screen goes black. Then after the call ends, the screen comes back.
Things I have done so far to solve the issue, but didn't work:
1. Blown air through earpiece.
2. Cleaned the proximity sensor by opening the phone.
3. When I dial *#*#7269#*#*, nothing happens.
4. Tried apps like, "Hardware Disabler", "Screebl", "Proximity Screen Off", etc.
5. There is no option like "proximity off", in settings.
How can I disable proximity sensor?
My Phone : Samsung Galaxy Grand Duos i9082 with Android 5.1.1 (with this ROM http://forum.xda-developers.com/gal...m-resurrection-remix-lollipop-v5-2-8-t3000749)
Click to expand...
Click to collapse
Dude I have also the same problem after installing the cm12.1 in my samsung galaxy grand duos and my phone is f**ked up. I also need the solution. I cant access the state folder.It says root explorer was unable to read this file
Please give us the solution
P.S.:- prox_cal is 0,65535
Thanks Hadi_K.t(t_t)t it's work for me
open root access
Hadi_K.t(t_t)t said:
hammadfaisal007 said:
Proximity sensor on my phone doesn't work. Whenever I get a call or make a call, the screen goes black. Then after the call ends, the screen comes back. .
..........
Sorry this post reply look so messi ( I m cannot speak English better )
..........
Hello my brother ( im currently using i9082 CM 12.1 Android V 5.1.1 too )
That so easy brother
You doesn`t needed to disabled Proximity sensor on your devices
Just needed calibrating Proximity sensor value to make it working correctly without bugs when incoming a call / make a call
i Allways using this method & this method may be worked on other Samsung too. :highfive:
Firsty
Activated root access in your devices.
I sure you already know for activated ROOT access
Download
> Root Explorer
> Terminal emulator android.apk
NEXT :
Here the best manual guide for me
1) Open Root explorer
go to /sys/devices/virtual/sensors/proximity_sensor/
Open & look at files with name prox_cal
In my devices that showing
0, 12 { Note : Very Important }
Then
/sys/devices/virtual/sensors/proximity_sensor/
Open & look at files with name
state
In my devices that showing
0 { Note : Very Important too }
......................................................................................
In other devices that files will showing different number
......................................................................................
Next
you need to + that, but remember dont add " , "
0 + 12 = 12
0 & 12 has came from prox_cal files
After that, result 12 needed to convert fromm assci into hexadecimal
As the result that will showing
31 32
Oke You already to fix them in Terminal Emulator app
Terminal Emulator app in your devices
.....::::::::Lastly::::::::.....
1} type
su
{ENTER}
(make sure your work has gained root access)
then
2} type
echo -en $ '\x{(PLACE HERE YOUR HEXADECIMAL VALUE'> /efs/prox_cal
So as the result it will be apear like this
echo -en $ '\x31 32' > /efs/prox_cal
{ENTER}
3} type
chown system:system /efs/prox_cal
{ENTER}
4}type
chmod 644 /efs/prox_cal
{ENTER}
5}type
sync
{SM-G530H ENTER}
& reboot devices normally
Finish you has been fixed problem when incoming calls / when make a call in your devices :good: :highfive: :fingers-crossed:
Click to expand...
Click to collapse
samsung galaxy grand prime
Sent from my SM-G530H using XDA Free mobile app
---------- Post added at 09:13 AM ---------- Previous post was at 09:06 AM ----------
sanket katoch said:
Dude I have also the same problem after installing the cm12.1 in my samsung galaxy grand duos and my phone is f**ked up. I also need the solution. I cant access the state folder.It says root explorer was unable to read this file
Please give us the solution
P.S.:- prox_cal is 0,65535
Click to expand...
Click to collapse
Sent from my SM-G530H using XDA Free mobile app
Click to expand...
Click to collapse

Categories

Resources