Welcome to theMikMik!

We are a friendly community of Android custom Roms developers and users. If this is your first visit, be sure to check out the forum rules. You will need to register before you can post, and as a registered user you will also see fewer advertisements. Join us now to become a part of one of the most helpful Android community online and get the max from your phone!

Results 1 to 5 of 5
  1. #1
    Senior Member
    Join Date
    Jul 2011
    Posts
    132
    Thanks
    11
    Edit: Just one more note, I just realized that when viewing this thread from a mobile device using themikmik forumrunner app, it doesn't show the highlighted portions that help make things easier to understand as they're being explained. I highly recommend viewing this thread in an actual browser to get the full effect.

    Just wanted to share a tid-bit of information that I've been researching for a while, now, on how to recalibrate your Proximity sensor for the Rezound (and likely most any other Android powered HTC device) without having to always have an application installed.

    The first thing to do is to install the Rezound Proximity Sensor Calibration app, and determine what settings work best for your phone.

    Once you have the settings figured out using that app, next, using a file browser (I use Root Explorer), navigate to /sys/devices/virtual/optical_sensors/proximity/ps_kadc.

    Once you open that file, you will see something along the lines of the following:
    P-sensor calibrated, INTE_PS1_CANC = (0x0C), INTE_PS2_CANC = (0x2F)


    Note: Your values will likely differ, as they are dependent upon what settings you selected via the application. In my case, I have a low threshold of 12, and a high threshold of 47. The INTE_PS1_CANC value is the hexidecimal equivalent to your selected value of the "low theshold", and the INTE_PS2_CANC value is the hexidecimal equivalent of your selected value for the "high threshold".

    Now that you know what values you are wanting to use for the proximity sensor calibration, it's time to build a script. If this scares you, then I will be providing a download link in this thread with a pre-built script that you can modify using a file explorer (such as Root Explorer) to the values that work for you.

    To build this script, it should look something along the lines of the following:

    >#!/system/bin/sh
    >
    >echo "0x0a0f 0x140b2F0C" > /sys/devices/virtual/optical_sensors/proximity/ps_kadc
    >

    Note: The ">" symbol at the beginning of each line won't exist in the script. I simply added it here to show each individual line of the script to demonstrate the format in which the script should be written. Be sure to leave an empty line at the bottom of your script as is shown.

    Now, you may be wondering where the magical values come into play that we discovered by following the path to the ps_kadc file. They are found within the long string of Hex numbers within the quotation marks of the script, only without the parenthasis, and without the "0x" portion. Here, I'll show you.

    Remember, my values that work well with my phone are 0x0C for the low threshold, and 0x2F for the high threshold.

    Now, the code in the script, I'll highlight the numbers that matter: "0x0a0f 0x140b2F0C"


    Notice: Again, the values in the script are expressed without the parenthasis, and without the "0x" prefix. They are also in reverse order of how you see them in the ps_kadc file. The high threshold is shown first, the low threshold second. Don't worry about the long string of other values preceding the values that you want to change. I am not sure exactly what they represent, and as far as I can tell, they are unimportant since they don't change, anyway.

    So, if your low threshold value were to be 0x1A, and your high threshold value 0x61, then your string of Hex values would look like this:
    "0x0a0f 0x140b611A"

    And your script would reflect that:

    >#!/system/bin/sh
    >
    >echo "0x0a0f 0x140b611A" > /sys/devices/virtual/optical_sensors/proximity/ps_kadc
    >

    Important Notice - Disproved as of 1/10/2013 - see update at end of this post: I have noticed that, after adding this script to my init.d folder to auto-execute on start-up, my wallpaper selection resets to the default ROM wallpaper that is present upon a clean flash of the ROM. I have yet to determine if it is truly the proximity sensor script that is the cause of this, or if it's some other fluke. I'm still looking into it. For now, I have changed the default wallpaper inside the build.prop to the one I prefer to use as my background, thus avoiding it changing on me every time I reboot the phone.

    And last, but not least, the download to the pre-built script that I am currently using on my phone (remember to modify the values to the ones that work best on your phone for the best results).

    Click to download ----> 02ProximitySensor

    Remember to place this file in the /system/etc/init.d/ folder, and change the permission to an executeable. AKA: 755 (rwxr-xr-x). Once the script is added to the init.d folder, you can uninstall the Rezound Proximity Sensor Calibration app from your device.

    If you guys would, let me know if your wallpaper is changing from your selected wallpaper to the default wallpaper upon a reboot.

    Wallpaper Issue Update (1/10/2013): I have done a clean flash of the ROM with this script pre-added to the ROM.zip, and it has remedied the wallpaper issue I was having. So, I suppose it was something else that caused it to have that issue. What it may have been, I have no idea. But for a few days now, I haven't had the wallpaper switch upon a reboot at all (and I reboot every day, at least twice).
    Last edited by Boostjunky; 01-10-2013 at 09:40 PM.

  2. #2
    Super Moderator prdog's Avatar
    Join Date
    May 2011
    Location
    Texas
    Posts
    5,665
    Thanks
    1,691
    Good write up. A large can of compressed air does wonders for the proximity sensor also.


    Current Devices:
    Samsung Galaxy SIII

    If I helped you please hit the Thanks Button. If I really, really helped you feel free to hit the Donate Button.






  3. The Following 2 Users Say Thank You to prdog For This Useful Post:       Show/Hide
    kmd612 (03-03-2013), sn2hotty (01-05-2013)
  4. #3
    Senior Member
    Join Date
    Jul 2011
    Posts
    132
    Thanks
    11
    Just wanted to bump this thread for an update regarding the wallpaper issue, which has disappeared after a clean flash of the ROM with the script pre-added to the ROM.zip.

    Everything works exactly as it should, now.

  5. #4
    Developer snuzzo's Avatar
    Join Date
    Jun 2012
    Location
    Youngstown, Ohio, United States
    Posts
    1,965
    Thanks
    921
    Sounds like it was a permissions issue.

    Sometimes I have Alzheimer's.

  6. #5
    Junior Member
    Join Date
    Jul 2013
    Posts
    2
    Thanks
    0
    Can't wait to try it out. Thank you for your time Chingy. You put out some of the most stable and ground breaking stuff. I really appreciate it.


 

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •