Jump to content

Welcome to CyanogenMod

Welcome to our forum. Like most online communities you must register to post, but don't worry this is a simple free process that requires minimal information for you to signup. Be a part of the CyanogenMod Forum by signing in or creating an account. You can even sign in with your Facebook or Twitter account.
  • Start new topics and reply to others
  • Subscribe to topics and forums to get automatic updates
  • Get your own profile and make new friends
  • Download files attached to the forum.
  • Customize your experience here
  • Share your CyanogenMod experience!
Guest Message by DevFuse
 

Touch screen calibration?


  • Please log in to reply
6 replies to this topic

#1 Twizdedsista

Twizdedsista
  • Members
  • 8 posts
  • Country:
    us - United States
  • Device Model:
    Droid Incredible
  • CM Version:
    Cyanogenmod nightlies
  • Recovery Image:
    ClockworkMod

Posted 25 September 2011 - 08:09 PM

Are we going to get this in the future? My typing is way off without it! :-(

#2 riko540

riko540
  • Members
  • 54 posts
  • Country:
    us - United States
  • Device Model:
    HTC Droid Incredible
  • CM Version:
    CyanogenMod-7.1.0-Inc
  • Recovery Image:
    ClockworkMod

Posted 26 September 2011 - 08:35 PM

Wow I never noticed it was missing.  I don't know what to tell you.

#3 BeastofFarEast

BeastofFarEast
  • Donators
  • 57 posts
  • Country:
    us - United States
  • Location:
    Los Angeles, CA
  • Device Model:
    HTC Incredible
  • CM Version:
    7.1.0 w/Incredikernel 2.6.38.8
  • Recovery Image:
    ClockworkMod

Posted 26 September 2011 - 10:25 PM

I think you can adjust that if you modify your kernel.  Someone smarter than I will have to confirm/list instructions.

#4 Twizdedsista

Twizdedsista
  • Members
  • 8 posts
  • Country:
    us - United States
  • Device Model:
    Droid Incredible
  • CM Version:
    Cyanogenmod nightlies
  • Recovery Image:
    ClockworkMod

Posted 11 October 2011 - 06:50 AM

Is there anywhere for me to request this? My typing has slowed to a crawl...

#5 jbcode42

jbcode42
  • Members
  • 94 posts
  • Country:
    us - United States
  • Device Model:
    HTC Incredible
  • CM Version:
    CM7.1
  • Recovery Image:
    ClockworkMod

Posted 11 October 2011 - 07:11 AM

I tried to look into this a little bit. It does not seem to be in the kernel. It appears to be handled in the InputReader and InputManager files in android_frameworks_base. It also appears that some devices have a .idc file which houses the configuration for the screen. The strange thing, is I do not seem to have a .idc file for my HTC Incredible build as I am trying to go through it. Then again my build setup is horribly broken. I guess maybe the base configuration is detected for certain devices or passed to the input manager through the system? In that case maybe there is a way to over-ride that default configuration? I have not had enough time to thoroughly read the before mentioned files, but I am pretty sure a lot of answers are hidden in there.

I am not sure if I will be able to look into this further, but hopefully this can give someone interested in it a possible entry point. If this can be implemented in a way that it can work with all the CM builds, I know that a friend of mine on a HTC Hero has said they would like a calibration tool for the touch screen as well....

#6 Twizdedsista

Twizdedsista
  • Members
  • 8 posts
  • Country:
    us - United States
  • Device Model:
    Droid Incredible
  • CM Version:
    Cyanogenmod nightlies
  • Recovery Image:
    ClockworkMod

Posted 11 October 2011 - 11:40 PM

Thanks for at least trying! :)

#7 jbcode42

jbcode42
  • Members
  • 94 posts
  • Country:
    us - United States
  • Device Model:
    HTC Incredible
  • CM Version:
    CM7.1
  • Recovery Image:
    ClockworkMod

Posted 12 October 2011 - 12:20 AM

I did a little more research into this issue. ADB gives this on boot:


I/InputReader(  178): Device added: id=0x20003, name=h2w headset, sources=00000101
I/InputReader(  178): Device added: id=0x10002, name=atmel-touchscreen, sources=00001002
I/InputReader(  178): Device added: id=0x0, name=incrediblec-keypad, sources=00000101
I/InputReader(  178): Device added: id=0x10000, name=curcial-oj, sources=00010105
I/InputManager-Callbacks(  178): No input device calibration properties found for device h2w headset.
I/InputManager-Callbacks(  178): No input device calibration properties found for device atmel-touchscreen.
I/InputManager-Callbacks(  178): No input device calibration properties found for device incrediblec-keypad.
I/InputManager-Callbacks(  178): No input device calibration properties found for device curcial-oj.

The significance of this is it goes with a piece of code in the InputManager file:

public InputDeviceCalibration getInputDeviceCalibration(String deviceName) {
			// Calibration is specified as a sequence of colon-delimited key value pairs.
			Properties properties = new Properties();
			File calibrationFile = new File(Environment.getRootDirectory(),
					CALIBRATION_DIR_PATH + deviceName + ".idc");
			if (calibrationFile.exists()) {
				try {
					properties.load(new FileInputStream(calibrationFile));
				} catch (IOException ex) {
					Slog.w(TAG, "Error reading input device calibration properties for device "
							+ deviceName + " from " + calibrationFile + ".", ex);
				}
			} else {
				Slog.i(TAG, "No input device calibration properties found for device "
						+ deviceName + ".");
				return null;
			}
		   
			InputDeviceCalibration calibration = new InputDeviceCalibration();
			calibration.keys = properties.keySet().toArray(new String[properties.size()]);
			calibration.values = properties.values().toArray(new String[properties.size()]);
			return calibration;
		}

From this I assume, and possibly wrongly, if one could understand the input device calibration (idc) file format, they could make an application that can be used to spit out an IDC for devices that normally do not have one, such as the HTC Incredible as well as update devices that normally do, such as the Samsung Vibrant (To choose a random one I see in the list containing an idc file).

From the code, the application would need to place the file in the CALIBRATION_DIR_PATH = "usr/idc/"

A lot of questions still remain however. I may try to make this tool in my free time, but I do not think I can make it quickly. Unless someone minds, I would like to keep posting information as I find it, incase someone more dedicated is interested in trying to make an app that may allow for input device calibration.