[APP] DHD Proximity Sensor Recalibrator 1.10 (26-Sep-12)

Search This thread

iphonoid

Senior Member
Dec 12, 2010
55
14
The Ghetto
And to those who are having problems with lee update to latest version for both the app and rom (and check you've got kernel that works with this) and all is well:)
 

Beamen1

Senior Member
Nov 16, 2010
281
35
And to those who are having problems with lee update to latest version for both the app and rom (and check you've got kernel that works with this) and all is well:)

I am using "DHD Proximity Recalibrator-1.6.apk" + LeeDrOiD-Ace-GB-V3.1.6-KERNEL-2.6.35.13-CFS.zip

Still getting the same error.

I can edit the settings fine, and the sensor works perfectly, but after a reboot I get the error that I posted on the last page.
 

fvs

Senior Member
Jan 2, 2009
133
18
I am using the latest leedroid kernel and prox. App, and all works well!

Sent from my Desire HD using XDA Premium App
 

leppie

Senior Member
Dec 21, 2008
566
284
Cape Town
Dude, whats your paypal account I want to buy you a beer my dhd was really annoying without this running it would keep turning on whilst I was on the phone and hanging up on the person!

Not taking donations anymore, due to silly government policy with PayPal :(

Here is what I got from them:

Thank you for receiving your online payments with PayPal.

Now that you are using PayPal to receive payments, we want to be sure you're aware of the following important South African exchange control regulations:


1. Funds you receive via PayPal can't be sent to other PayPal users.


2. You need to withdraw the received funds from your PayPal balance to a South African bank account within 30 days of receiving these funds.


In order to help you quickly and easily withdraw funds from your PayPal account, we have partnered with First National Bank (FNB). Together, we created the Top Up and Withdraw service with PayPal. To register for this service, follow these 4 steps:


1. If you don't already have one, open a FNB account by visiting the online FNB Product Shop or the FNB Branch nearest you.


2. Once you have a FNB account, register for FNB Online Banking.


3. Log in to your Online Banking profile and register for the Top Up and Withdraw service with PayPal.


4. Link your verified PayPal account to your FNB Online Banking profile using the 'PayPal services' link on the 'accounts' tab.


Once you have registered, you can transfer funds (U.S. dollars) from your PayPal account to your qualifying FNB account in rands. Please note that FNB charges a small fee for each Withdrawal.
 

iphonoid

Senior Member
Dec 12, 2010
55
14
The Ghetto
hmm well that was me hazerding a guess maybe it's because you need to do a wipe of your current rom (I updated so wiped when upgrading from 3.2 to 3.2.1 leedroid) and put new version of proximity sensor and it worked a treat.
 
  • Like
Reactions: Beamen1

Beamen1

Senior Member
Nov 16, 2010
281
35
It worked after flashing Revolution 5.1.11 and LeeDroid 3.1.6 kernel :D

Thanks for your help :)
 

Prodelin

Senior Member
Apr 17, 2011
80
4
This app is still not working with LeeDroid latest from 25th June, tried it tonight and it crashes as soon as you reboot the phone.

Version 1.6 will just error out a huge file with errors when starting the application, version 1.5 is not working at all because it complains about error writing to the kadc file, but i have changed the permisson but it defaults back after reboot and changes the permissions to default.

Something is not working good here....
 

Beamen1

Senior Member
Nov 16, 2010
281
35
I am having problems again.

I have to re-adjust my values every reboot. I have to open the program 2x times. First time I get a error (same error as before). The 2nd time, the values are set as a default and I have to readjust.

It seems Superuser is not getting root access granted before the program is fully opened resulting in permission denied when the program is trying to set the values in ps_kadc.

EDIT: I did a FULL wipe, then Revolution 5.1.11 install, reboot, and Lee Kernel 3.1.8 CFS and I am still getting this problem.
 
Last edited:

Hharry100

New member
Apr 20, 2011
1
0
would it be possible to get this working on a hd2, as i and many other have the issue of the screen going to sleep when a call is initiated and the only way to wake the screen is to shine bright light on the sensor your help is appreciated
 

The PyroPath

Member
Nov 20, 2008
22
0
You know what the really weird thing is? Is that I have to apply different settings/values in froyo then in gingerbread:confused: but it works non the less! tnx!

too early, settings don't stick after a reboot...:(
 

leppie

Senior Member
Dec 21, 2008
566
284
Cape Town
would it be possible to get this working on a hd2, as i and many other have the issue of the screen going to sleep when a call is initiated and the only way to wake the screen is to shine bright light on the sensor your help is appreciated

No.

can i use this for htc desire?

No.

HTC hd2
rom - TyphooN CyanogenMod 7 Nightly v3.4.1


ps_kadc not found ((((((((

No.

Please read the thread.
 
S

srikanth.naidu

Guest
Does not work with leedriod 3.2.1 and miui1.6.17 (freshly sqeezed) , please update or any workaround ?
 

svscorp

Member
Jul 6, 2011
7
0
Hello!
In default ROM i have a same problem an i try your APK.
I've got an error: "ps_polling_ignore not found"

use 1.6 ver
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 155
    Due to many DHD's being incorrectly factory calibrated with regards to the proximity sensor, I wrote a little app to allow one to change the calibration on-the-fly and persist it over reboots.

    This app is specifically for those experience issues with the proximity sensor.

    Well known symptoms include the following:

    - Screen fails to turn off when holding to face on a call
    - Screen does turn off when holding to face on a call, but fails to come back on, requiring taking out the battery

    These problems are common in custom kernels/ROM's. HTC has addressed this issue however in their kernels from 1.32 onwards, but have failed to provide an acceptable solution for some.

    I present DHD Proximity Sensor Recalibrator. Download from the attachments below.

    Here are some screenshots:

    attachment.php
    attachment.php


    attachment.php


    Usage:

    1. Install app.
    2. Run app.
    3. Press the toggle button to start monitoring.
    4. Move your finger over the proximity sensor (the little LED next to the front facing speaker).
    5. Adjust the High and Low threshold values to your liking.

    For those whose screen does not turn off, it probably means the factory values are set too high.

    For those whose screen does not turn back on, it probably means the factory values are set too low.

    The setting will be saved, and will be applied every time you reboot your phone. No need to go through any of the steps unless you want to change the calibration. When the settings are applied at boot time, you will get a toasty indicating the calibration value applied.

    Possible calibration procedure:

    1. Put both values high (will show FAR).
    2. Cover sensor with finger.
    3. Lower High threshold till it says NEAR.
    4. Lower Low threshold by a notch or 2.
    5. Test behavior

    Removal:

    If for whatever reason you find the application does not work, or you do not want it anymore, just uninstall the app, and reboot. Your original factory settings will be in effect again. This application does not modify your system. It might require root rights.

    Source code repo:

    https://github.com/leppie/DHD-Proximity-Sensor-Recalibrator

    Known issues:

    - Permissions have changed in CM7 RC2, preventing the application from working correctly. The application will need root. Will investigate how to add that, if needed.

    - Some reports that the Gingerbread leaked ROM is not working.

    Gingerbread/newer kernel update:

    Due to changes in the source code made by HTC to overcome this issue in the kernel, this app will probably not run correctly.

    There are 2 problems (as found from latest CM kernel source):

    1. When the kernel recalibrates the proximity on the fly, it fails to update the internal structures in the kernel. This makes the kernel not report correct values. I have made a kernel patch to rectify the issue. Please ask your kernel developer to apply the following changes: https://github.com/leppie/htc-kernel-msm7x30/commit/b1d0a85f3fe5252c8ab43ba98261bcb1b8498d8a

    2. Secondly and more seriously, depending on the initial calibrated value (if LT is greater or equal to 0x50), the kernel will kick off a polling thread. This will overwrite the changes made by this app, as soon as you use the proximity sensor for the first time (eg the phone). Afterwards you can apply the values from this app again, and from my experiments the value sticks then (up to the next reboot). Unfortunately, this polling mechanism fixes the issue for most users, so it cannot just be disabled. It is easy to disable in the kernel source however, but will probably break most other people's proximity behavior if they do not have this app installed. As you can see, there is not much I can do about this. The best option is to compile your own kernel.

    Manual cleaning of the sensor:

    After time the sensor will become dirty from the environment. See http://xdaforums.com/showpost.php?p=28495941&postcount=357 for details on cleaning it.

    Please report any bug and suggestions.

    Cheers ;)

    Revisions:

    1.0

    - Initial public release

    1.1

    - Replaced toggle button with normal one to resolve known issue

    1.2

    - Removed amount from Paypal, feel free to donate whatever you feel like. Beers are around US$2 here.

    1.3

    - Add some better handling when something goes not as planned (likely on non-DHD hardware).

    1.4

    - Added some alert dialogs to aid with the problems people are experiencing. (In case of error, please note both the title text, and the first few lines in the text of the alert dialog.)

    1.5

    - Only for CM7 users. Use nightly 92 or above. This includes the necessary kernel patch.
    - Should work on SENSE with custom kernel. Apply this patch (or ask your kernel 'builder' to do so).
    - Removed Beer button due to crappy paypal policy...

    1.6

    - Added support for calling 'su' when permissions are wrong. Thanks VampireWicked.

    1.7

    - Correct boot permissions for ICS

    1.8

    - Prevent app from being installed on SD card (which will cause issues) (thanks makarand14)

    1.9

    - Fix issues with sensor listener not getting disabled (thanks Roberto_Lim and Stoffl_)

    1.10

    - Fix issues with slow process manager in Android, notably in BlackOut ROM (thanks tonylee000 and others)

    Supported kernels:

    - CM7 nightly #92 or later
    - LorDModUE V2.6 or later
    5
    I fixed it! I started having problems a while back. The screen didn't turn off when I was in a phone call. It got worse and worse until I had the settings down to 5/6.

    The kernel I have is not fully supported, so after each reboot I had to start the program 2 times to get it to work.

    I took the phone apart - How to here: http://www.youtube.com/watch?v=2Zc0k994Pl4

    Do everything until 2:27. Clean the proximity sensor and the surrounding areas and put it back together. It works like new now :)

    I also did the GPS fix by connecting a wire between the antenna contacts inside the LED cover. 10 satellites now!
    4
    new version. ICS support.
    3
    Sorry, it has nothing to do with your app. Its the fault of the kernel not supporting your app (which support should be built in - a no brainer).

    ARHD 6.3.3 RCMix Kernel - Cannot write on autostart
    ARHD 6.3.3 Lord's Kernel - Works Great
    Virtuous Infinity - Cannot write on autostart
    Blackout ICS - Cannot write on autostart
    Ice Cold Sandwich - Works Great
    JellyTime - - Works Great

    I can post a screenie... but its really a kernel issue.

    It's not a kernel issue. It's a permissions issue. I had it working fine on blackout but had the cannot write problem. use root explorer to change the permissions for the file //sys/devices/virtual/optical_sensors/proximity/ps_kadc and tick all the read and write boxes.

    Hope this helps.
    3
    New version out. See OP.

    There were 2 issues:

    1. Big oopsie by me, I never fixed the permissions when applying values on a reboot. Thanks all for making this clear :D

    2. The android process manager does seem to take a while to load so the broadcast receiver was timing out (10 second limit). Had to add a service now, that will deal with this delay, and quit when done.