Touch Screen Issue Please suggest some approach

by Elvis Dowson » Tue, 23 Jun 2009 03:31:44 GMT


Sponsored Links
 i,       Try applying this patch.

diff --git a/services/java/com/android/server/InputDevice.java
b/services/java/com/android/server/InputDevice.java
index 7b8a2a4..d9304c1 100644
--- a/services/java/com/android/server/InputDevice.java
+++ b/services/java/com/android/server/InputDevice.java
@@ -21,10 +21,15 @@ import android.view.Display;
import android.view.MotionEvent;
import android.view.Surface;
import android.view.WindowManagerPolicy;
+import java.io.FileInputStream;
+import java.util.StringTokenizer;

public class InputDevice {
/** Amount that trackball needs to move in order to generate a key
event. */
static final int TRACKBALL_MOVEMENT_THRESHOLD = 6;
+
+ /** Touchscreen calibration file. */
+ static final String CALIBRATION_FILE = "/etc/pointercal";

final int id;
final int classes;
@@ -33,6 +38,7 @@ public class InputDevice {
final AbsoluteInfo absY;
final AbsoluteInfo absPressure;
final AbsoluteInfo absSize;
+ final TransformInfo tInfo;

long mDownTime = 0;
int mMetaKeysState = 0;
@@ -86,12 +92,24 @@ public class InputDevice {
h = tmp;
}
if (device.absX != null) {
- scaledX = ((scaledX-device.absX.minValue)
- / device.absX.range) * w;
+ if (device.tInfo != null)
+ scaledX = (device.tInfo.x1 * x +
+ device.tInfo.y1 * y +
+ device.tInfo.z1)
+ / device.tInfo.s;
+ else
+ scaledX = ((scaledX-device.absX.minValue)
+ / device.absX.range) * w;
}
if (device.absY != null) {
- scaledY = ((scaledY-device.absY.minValue)
- / device.absY.range) * h;
+ if (device.tInfo != null)
+ scaledY = (device.tInfo.x2 * x +
+ device.tInfo.y2 * y +
+ device.tInfo.z2)
+ / device.tInfo.s;
+ else
+ scaledY = ((scaledY-device.absY.minValue)
+ / device.absY.range) * h;
}
if (device.absPressure != null) {
scaledPressure =
@@ -199,6 +217,16 @@ public class InputDevice {
int fuzz;
};

+ static class TransformInfo {
+ float x1;
+ float y1;
+ float z1;
+ float x2;
+ float y2;
+ float z2;
+ float s;
+ };
+
InputDevice(int _id, int _classes, String _name,
AbsoluteInfo _absX, AbsoluteInfo _absY,
AbsoluteInfo _absPressure, AbsoluteInfo _absSize) {
@@ -209,5 +237,38 @@ public class InputDevice {
absY = _absY;
absPressure = _absPressure;
absSize = _absSize;
+ TransformInfo t = null;
+
+ try {
+ FileInputStream is = new FileInputStream(CALIBRATION_FILE);
+ byte[] mBuffer = new byte[64];
+ int len = is.read(mBuffer);
+ is.close();
+
+ if (len > 0) {
+ int i;
+ for (i = 0 ; i < len ; i++) {
+ if (mBuffer[i] == '\n' || mBuffer[i] == 0) {
+ break;
+ }
+ }
+ len = i;
+ }
+
+ StringTokenizer st = new StringTokenizer( new String(mBuffer, 0, 0, len)
);
+
+ t = new TransformInfo ();
+ t.x1 = Integer.parseInt( st.nextToken() );
+ t.y1 = Integer.par



Touch Screen Issue Please suggest some approach

by zhou kejun » Tue, 23 Jun 2009 20:02:35 GMT


 Hi Shridhar,
I want to known your kernel version and rootfs. My kernel based on
android-2.6.27 works well with the system.img that maked from the repo
right now. But locked in "Press the Menu Key ", if the system.img
picked up from SDK-1.5 and before.


Regards

zhou kejun

--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---


Sponsored Links


Touch Screen Issue Please suggest some approach

by shridhar desai » Wed, 24 Jun 2009 15:18:15 GMT


 i Anil,

I am trying to connect the USB-keyboard to my board and upon pressing
any key I get the message as shown below. My primary purpose of
interfacing a keyboard is to get my homescreen unlocked

<6>usb 1-2: USB disconnect, address 2
usb 1-2: USB disconnect, address 2
<6>usb 1-2: new low speed USB device using at91_ohci and address 3
usb 1-2: new low speed USB device using at91_ohci and address 3
<6>usb 1-2: configuration #1 chosen from 1 choice
usb 1-2: configuration #1 chosen from 1 choice
<6>usb 1-2: USB disconnect, address 3
usb 1-2: USB disconnect, address 3
<6>usb 1-2: new low speed USB device using at91_ohci and address 4
usb 1-2: new low speed USB device using at91_ohci and address 4
<6>usb 1-2: configuration #1 chosen from 1 choice
usb 1-2: configuration #1 chosen from 1 choice
<6>usb 1-2: USB disconnect, address 4
usb 1-2: USB disconnect, address 4
<6>usb 1-2: new low speed USB device using at91_ohci and address 5
usb 1-2: new low speed USB device using at91_ohci and address 5
<6>usb 1-2: configuration #1 chosen from 1 choice
usb 1-2: configuration #1 chosen from 1 choice
<6>usb 1-2: USB disconnect, address 5
usb 1-2: USB disconnect, address 5
<6>usb 1-2: new low speed USB device using at91_ohci and address 6

Thanks & Regards,
Shridhar

On Tue, Jun 23, 2009 at 12:54 AM, Anil Sasidharan<anil...@gmail.com> wrote:

--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



Touch Screen Issue Please suggest some approach

by shridhar desai » Mon, 29 Jun 2009 12:50:11 GMT


 i All,

I enabled CONFIG_SLEEP_WAKEUP in my kernel configuration file.
After this now when I press the external keyboards keys which are
mapped to "menu", I get a pop-up above my locked homescreen saying
"System UIDs inconsistent
UIDs on the system are inconsistent, you need to wipe your data
partition or your device will be unstable
I'm feeling lucky"
I have no clues as to what it is.
Plesase guide me as to how to proceed.

Thanks & Regards,
Shridhar


On Wed, Jun 24, 2009 at 10:39 PM, shridhar desai<shri.desa...@gmail.com> wrote:

--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



Touch Screen Issue Please suggest some approach

by Christopher Friedt » Mon, 21 Sep 2009 01:46:23 GMT


 hanks for your post Elvis!

Android was having an issue with my touchscreen (both the x and y axis
were inverted) and this was the perfect patch! I just copied over my
existing tslib calibration to /pointercal (I changed the default
filename) and now it's quite precise. Naturally, I generated the tslib
calibration using a different distro (Gentoo).

Touchscreen calibration is a bit of a tricky issue - even identical
touchscreen models will have some variance in their calibration. Even
though that variance is often only be a few pixels, it's still naive
to think that Android does not need a calibration utility. Seriously,
even WinCE has one.

One simple way to fix this issue is to use set average pointer
calibration data in /default.prop. The defaults will be good enough
for devices with the same touchscreen hardware (i.e. vendor-product),
and the user could override those values by using a calibration
utility, updating the property inside of the sqlite database.

Properties could be named something along the lines of

com.android.server.InputDevice.TransformInfo.x1
com.android.server.InputDevice.TransformInfo.y1
com.android.server.InputDevice.TransformInfo.z1
com.android.server.InputDevice.TransformInfo.x2
com.android.server.InputDevice.TransformInfo.y2

Again, thanks for your patch, it was quite helpful.

Cheers,

Chris

On Mon, Jun 22, 2009 at 9:31 PM, Elvis Dowson <elvis.dow...@gmail.com> wrote:

--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---