GingerBread Touch Issue

1,146 views
Skip to first unread message

Retti

unread,
Jan 4, 2011, 11:23:13 AM1/4/11
to android-porting
Hello,
I have a running Port of Android 2.2.1 for my Hardware.
Now, after some Building problems, I have a Gingerbread image.
That one starts, but the Touch won`t work.

I can check the kernelside working touchscreen by using "getevent".
So I can see, that the touch-driver is working, but android won`t
react on inputs.
I have seen, that in 2.3 there`s no KeyInputQueue, but an
InputManager.

here are the relevant logs:

I/InputManager( 551): Initializing input manager
I/InputManager( 551): Starting input manager
I/EventHub( 551): New device: path=/dev/input/event0 name=ADS7846
Touchscreen id=0x10000 (of 0x1) index=1 fd=85 classes=0x4
I/InputReader( 551): Device added: id=0x10000, name=ADS7846
Touchscreen, sources=00001002
######### at this line, in Froyo, the KeyInputQueue
shows the values of x,y,pressure ... ##############
I/InputManager-Callbacks( 551): No input device calibration
properties found for device ADS7846 Touchscreen.
...
D/InputManager( 551): Setting display #0 size to 800x480
...
I/InputReader( 551): Device reconfigured: id=0x10000, name=ADS7846
Touchscreen, display size is now 800x480
I/InputManager-Callbacks( 551): No virtual keys found for device
ADS7846 Touchscreen.


W/InputManager-Callbacks( 541): Error reading input device
calibration properties for device ADS7846 Touchscreen from /system/usr/
idc/ADS7846 Touchscreen.idc.
W/InputManager-Callbacks( 541): java.io.FileNotFoundException: /
system/usr/idc/ADS7846 Touchscreen.idc (No such file or directory)


My first idea was to test it with implementing ts_lib/ts_calibrate, to
create a pointercal, but nothing changes.

Can someone tell me what`s an .idc-file and how to create it!?

Or have anybody some other ideas?


I would be very greatful!!

freakingtux

unread,
Jan 4, 2011, 4:47:49 PM1/4/11
to android-porting
Hi,

On Jan 4, 5:23 pm, Retti <retti...@googlemail.com> wrote:
>     W/InputManager-Callbacks(  541): Error reading input device
> calibration properties for device ADS7846 Touchscreen from /system/usr/
> idc/ADS7846 Touchscreen.idc.
>     W/InputManager-Callbacks(  541): java.io.FileNotFoundException: /
> system/usr/idc/ADS7846 Touchscreen.idc (No such file or directory)
>
> My first idea was to test it with implementing ts_lib/ts_calibrate, to
> create a pointercal, but nothing changes.

I think the tscalibrate stuff was never officially part of the Android
code
>
> Can someone tell me what`s an .idc-file and how to create it!?

IDC files are "standard" java property files containing key/value
pairs
a checkout of gingerbread shows two samples:
./device/samsung/crespo/mxt224_ts_input.idc
./device/htc/passion-common/synaptics-rmi-touchscreen.idc

From reading the comments in these files it looks like there is no
tool to perform the calibration.

com.android.server.InputManager reads this file when the native
services requests this
I don't know the exact values try looking at
frameworks/base/include/ui/InputReader.[h|cpp] to see what the
properties are used for

>
> Or have anybody some other ideas?
There are also "dump" methods in the InputReader.cpp perhaps this can
be used

Greetings

Retti

unread,
Jan 5, 2011, 5:05:19 AM1/5/11
to android-porting
Hi,
thanks for the fast reply.

Yes, tscalibrate is not part of officially Android Code.
I`ve build an tscalibrate for my android.
I can use this and am able to get a pointercal.
The problem is, that i have no idea how to say Android to use this
pointercal instead of .idc-file.

I`ve checked the .idc samples, but don`t know how to modify for my
ADS7846 Tochscreen.
Normally, this file must be created independently at Android startup,
is that right?

If I just copy any sample idc-file in system/usr/idc, the output
"Error reading input device calibration properties for device .."
goes away, but still no Touch-function.

Is it possible to get the idc cofiguration values from the pointercal-
file?

Elvis Dowson

unread,
Jan 5, 2011, 5:13:13 AM1/5/11
to android-porting
Hi,
The following patch should fix this issue:

diff --git a/services/java/com/android/server/
WindowManagerService.java b/services/java/com/android/server/
WindowManagerService.java
index a8dad88..f5e3e5e 100644
--- a/services/java/com/android/server/WindowManagerService.java
+++ b/services/java/com/android/server/WindowManagerService.java
@@ -6338,8 +6338,13 @@ public class WindowManagerService extends
IWindowManager.Stub
return true;
}

+ String hwNoPMStr = SystemProperties.get("hw.nopm");
+ boolean hwNoPM = Boolean.parseBoolean(hwNoPMStr);
+
switch (event.type) {
case RawInputEvent.EV_KEY: {
+ if (hwNoPM)
+ return true;
// XXX begin hack
if (DEBUG) {
if (event.keycode == KeyEvent.KEYCODE_G) {
@@ -6389,6 +6394,8 @@ public class WindowManagerService extends
IWindowManager.Stub
}

case RawInputEvent.EV_REL: {
+ if (hwNoPM)
+ return true;
boolean screenIsOff = !
mPowerManager.isScreenOn();
boolean screenIsDim = !
mPowerManager.isScreenBright();
if (screenIsOff) {
@@ -6406,6 +6413,8 @@ public class WindowManagerService extends
IWindowManager.Stub
}

case RawInputEvent.EV_ABS: {
+ if (hwNoPM)
+ return true;
boolean screenIsOff = !
mPowerManager.isScreenOn();
boolean screenIsDim = !
mPowerManager.isScreenBright();
if (screenIsOff) {

Ensure that you have set hw.nopm=true in your init.rc file.

Elvis Dowson

Retti

unread,
Jan 5, 2011, 6:12:37 AM1/5/11
to android-porting
Hi,
thanks for the patch, but I think that only works for Android 2.2

And at the moment I don`t know how to do these Changes in
WindowManagerService.java of Android 2.3!
Any idea?

In Gingerbread there are a lot of changes in Window- and
InputManagement.

G2

unread,
Jan 5, 2011, 3:24:32 PM1/5/11
to android-porting
Yes, this patch applies only to 2.2, and 2.3 has indeed some serious
modifications: both files have been moved around, and the structure of
framework has changed. I'm facing the same issue. If you google about
it and read some log pasted on pastebin.com, you will see that we are
not the only ones to face this same issue.

I have tested both with a single touch and multi touch devices, I see
that touchscreens are recognised but there is no event going up. I've
started to read the code but I haven't figured out yet the problem.

It would be great if Google could publish a how-to upgrade from Froyo
to Gingerbread... in order to highlight the differences.

Anyway, in this special case, it would be great if we can get some
hints where we should investigate the problem,

Grégoire

Dianne Hackborn

unread,
Jan 5, 2011, 3:54:36 PM1/5/11
to greg...@gentil.com, android-porting, Jeffrey Brown
There isn't much to publish -- the entire event dispatching code was redesigned and rewritten as native code. :}  The .idc file it is not required, it is just to help generate better data from the touch screen.




--
Dianne Hackborn
Android framework engineer
hac...@android.com

Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails.  All such questions should be posted on public forums, where I and others can see and answer them.

Jeffrey Brown

unread,
Jan 5, 2011, 5:28:31 PM1/5/11
to Dianne Hackborn, greg...@gentil.com, android-porting
Documentation about the .idc format and purpose will go up on the PDK site soon.

Mainly it is used to calibrate touch size information.  This allows applications to fairly accurately determine how large of an area was touched.

Would you like me to send you the current draft documentation?  The calibration process itself is quite straightforward.  We do not have any tools available to assist yet but I've been thinking about writing some.

Jeff.

Retti

unread,
Jan 7, 2011, 8:25:46 AM1/7/11
to android-porting
If there is a documentation about the idc-files, it would be great to
get it.

But Dianne said, thats not the problem.
I think the only way is to modify the code.
So far I could not find a solution yet.

If there is anybody with a fix, please let me know this.

Thanks

G2

unread,
Jan 11, 2011, 8:23:13 PM1/11/11
to android-porting
In my case, it's not a problem of IDC files. It seems that Android
believes the screen is off and then, there is a policy stating to
discard input event like touchscreen if screen is off. I don't have a
clean patch as the problem is more elsewhere, meaning you need to
understand why Android thinks the screen is off on your hardware while
it's on. I remember to have seen "similar" things in Froyo where the
PM was not fully implemented in the kernel, and Android was confused
what was really on or off, and some were not working properly,

Grégoire

Retti

unread,
Jan 12, 2011, 9:03:49 AM1/12/11
to android-porting
I think you`re right.
Android thinks that the screen is off.
This problem I also had in Froyo, but there a simple patch was enough
to say android that the screen is on.
There is a flag in PowerManager, and I modified it to say "the screen
is always on".
This one don`t work for GingerBread.

The problem in my case is, that there is no hardwaresupport for PM.
My kernel comes without any implementation of PM.
The next spezial thing is, that I have no Battery.
So the device is alway plugged and needs no PM.

Is there a way to say to android that the device has no Battery and no
PM?
I think this will fix the Touch problem.

Zdravko Stoychev

unread,
Jan 12, 2011, 7:16:15 AM1/12/11
to android-porting
Hi!

On Jan 5, 12:05 pm, Retti <retti...@googlemail.com> wrote:
> Hi,
> thanks for the fast reply.
>
> Yes, tscalibrate is not part of officially Android Code.
> I`ve build an tscalibrate for my android.
> I can use this and am able to get a pointercal.
> The problem is, that i have no idea how to say Android to use this
> pointercal instead of .idc-file.

See this post:
http://blog.linuxconsulting.ro/2010/04/tslib-ported-to-android-for-touchscreen.html
Message has been deleted
Message has been deleted
Message has been deleted

Chih-Wei

unread,
Feb 9, 2011, 9:06:56 PM2/9/11
to android-porting, jeff...@android.com
Hi,
Any update about this issue?
Has anybody successfully port ts calibartion
to gingerbread?

Jeff, have you publish the document you mentioned?
I can't find it yet...

On 1月6日, 上午6時28分, Jeffrey Brown <jeffbr...@android.com> wrote:
> Documentation about the .idc format and purpose will go up on the PDK site
> soon.
>
> Mainly it is used to calibrate touch size information.  This allows
> applications to fairly accurately determine how large of an area was
> touched.
>
> Would you like me to send you the current draft documentation?  The
> calibration process itself is quite straightforward.  We do not have any
> tools available to assist yet but I've been thinking about writing some.
>
> Jeff.
>

Bharathi Subramanian

unread,
Feb 29, 2012, 4:36:50 AM2/29/12
to android-porting, cwh...@linux.org.tw
> Any update about this issue? Has anybody successfully port ts calibartion
> to gingerbread?

I am also working on similar issue. I hope, the following links may help:
1. http://dev.openaos.org/wiki/AndroidTouchscreenCalibration
2. http://source.android.com/tech/input/touch-devices.html

Another option is doing calibration at the touchscreen driver itself.
But that is not recommended.

Bye :)
--
Bharathi Subramanian

Nilly

unread,
Mar 2, 2012, 2:57:38 AM3/2/12
to android-porting
Bharathi,

Did you get touch screen working in ginger bread?
I am struggling to get it work on ginger bread.

Regards,
Niral

On Feb 29, 2:36 pm, Bharathi Subramanian <bharathi.w...@gmail.com>
wrote:
> > Any update about this issue? Has anybody successfully port ts calibartion
> > to gingerbread?
>
> I am also working on similar issue. I hope, the following links may help:
> 1.http://dev.openaos.org/wiki/AndroidTouchscreenCalibration
> 2.http://source.android.com/tech/input/touch-devices.html

Nilly

unread,
Mar 2, 2012, 2:59:33 AM3/2/12
to android-porting
Bharathi,

Did you get touch screen working in ginger bread?
I am struggling to get it work on ginger bread.

Regards,
Niral

On Feb 29, 2:36 pm, Bharathi Subramanian <bharathi.w...@gmail.com>
wrote:
> > Any update about this issue? Has anybody successfully port ts calibartion
> > to gingerbread?
>
> I am also working on similar issue. I hope, the following links may help:
> 1.http://dev.openaos.org/wiki/AndroidTouchscreenCalibration
> 2.http://source.android.com/tech/input/touch-devices.html
Reply all
Reply to author
Forward
0 new messages