I'm struggling with calibration of a touchscreen on Android plataform.
It is an USB Single-Touch Touchscreen from vendor 0dfc and product 0001 as checked with dmesg:
<6>[ 4118.091541] input: USB Touchscreen 0dfc:0001 as /devices/platform/usb20_host/usb2/2-1/2-1.3/2-1.3:1.0/input/input23
I'm pushing the Vendor_0dfc_Product_0001.idc file /data/system/devices/idc/ (following the documentation from android source - IDC
I got the touch device with all requirements for single touch events:
root#android:/ # getevent -il /dev/input/event3
add device 1: /dev/input/event3
bus: 0003
vendor 0dfc
product 0001
version 0202
name: "USB Touchscreen 0dfc:0001"
location: "usb-usb20_host-1.3/input0"
id: ""
version: 1.0.1
events:
KEY (0001): BTN_TOUCH
ABS (0003): ABS_X : value 540, min 0, max 32767, fuzz 0, flat 0, resolution 0
ABS_Y : value 289, min 0, max 32767, fuzz 0, flat 0, resolution 0
input props:
<none>
I also enabled the Pointer Location option from Developer options (Android settings) in order to debug this stage of calibration.
Setup 1
touch.deviceType = touchScreen
With this setup (1) all the gestures on the touchscreen take place at the up-left corner - just a few pixels left/right/up/down no matter the gesture (swipe). All the touchscreen get events. All the gestures are reversed - when swipe left the pointer goes right; when swipe up, the pointer goes down.
Setup 2
touch.deviceType = pointer
touch.gestureMode = pointer
With this setup (2), as expected, it shows a pointer, placed at the position from the last pointer device left (mouse). All the gestures on the touchscreen (no matter the swipe size) keep beaving like setup 1 - move only a few pixels with each swipe event, and with reversed axis.
Setup 3
touch.deviceType = pointer
touch.gestureMode = spots
With this setup (3) the result is the same as setup 2. I just did that to prove that the IDC file is being interpreted correctly.
At this stage, as you can check by now, I have a working IDC file (setup 1) requiring calibration for this touch device.
I tried a lot of combinations from other IDC files (internet samples) and from android source - IDC - ANY OTHER PROPERTY TOOK EFFECT (NOT A SINGLE ONE) - raw.*, output.*, touch.size.*
Does anyone knows how to calibrate properly a touch screen in Android that could guide me in this process?
Same here,
but my calibration app did't do anything.
After a while, reading /system/etc/init.sh i found the following:
mkdir -p /data/misc/tscal
touch /data/misc/tscal/pointercal
chown 1000.1000 /data/misc/tscal /data/misc/tscal/*
chmod 775 /data/misc/tscal
chmod 664 /data/misc/tscal/pointercal
Just run those commands manually, reboot, and start the calibration app
Related
I use a touch screen 5 inch(800*480) tft LCD HDMI with raspberry pi 3 ,
I use this driver.
The touch driver works and emits points but shows the mouse cursor in the display. How so I disable the mouse cursor on the touch screen?
below picture show my problem .
OS Version:
1.0.12.5501548
My config.txt in boot files is:
max_usb_current=1
hdmi_group=2
hdmi_mode=1
hdmi_mode=87
hdmi_cvt 800 480 60 6 0 0 0
When I add below config to config.txt mouse cursor disappeared but the driver doesn't work also.
dtoverlay=ads7846,cs=1,penirq=25,penirq_pull=2,speed=50000,keep_vref_on=0,swapxy=0,pmax=255,xohms=150,xmin=200,xmax=3900,ymin=200,ymax=3900
The MonkeyDevice.drag currently can takes only 2 sets of co-ordinates which means I can move from (x1,y1) to (x2,y2). Is there a way I could make the monkey runner simulate a drag from (x1,y1) to (x3,y3) and then to (x2,y2) without breaking the same drag function?
Monkeyrunner is kind of deprecated.
You can use uiautomator instead. More details can be found here:
http://developer.android.com/tools/testing/testing_ui.html
This tool has a method for what you seek, a custom swipe using an array of points (x, y coordinates). More on that here:
http://developer.android.com/tools/help/uiautomator/UiDevice.html#swipe(android.graphics.Point[], int)
I would use Get/Send Event.
Get an event, e.g. touch screen:
issue command: adb shell getevent | grep event2 > CaptureEvent.txt
do the touchscreen activity
stop the recording with CTRL+C
Convert the event:
e.g.: /dev/input/event1 3 47 0
Send an event:
issue commands, e.g.: adb shell sendevent /dev/input/event1 3 47 0
I'm using a touchscreen (atmel maxtouch - atmel 1664s) with android and finding that the further to the right(X gets larger) I go, the larger distance between where my finger is vs touch spot on screen. Would this be a problem with settings in the IDC file, driver, or somewhere else? Using another OS like Ubuntu on the same screen doesn't seem to have this problem.
I've used this IDC file to try and correct the position, but the last line just turns the touchscreen into a trackpad.
touch.deviceType = touchScreen
touch.orientationAware = 1
output.x = (raw.x - raw.x.min) * (output.width / raw.width)
The kernel driver isn't detecting and reporting the possible range of the input X reports correctly.
If you use adb shell and run getevent -il you should get something like
add device 6: /dev/input/event2
bus: 0000
vendor 0000
product 0000
version 0000
name: "touch_dev"
location: ""
id: ""
version: 1.0.1
events:
ABS (0003): ABS_MT_SLOT : value 0, min 0, max 9, fuzz 0, flat 0, resolution 0
ABS_MT_TOUCH_MAJOR : value 0, min 0, max 15, fuzz 0, flat 0, resolution 0
ABS_MT_POSITION_X : value 0, min 0, max 1535, fuzz 0, flat 0, resolution 0
ABS_MT_POSITION_Y : value 0, min 0, max 2559, fuzz 0, flat 0, resolution 0
ABS_MT_TRACKING_ID : value 0, min 0, max 65535, fuzz 0, flat 0, resolution 0
ABS_MT_PRESSURE : value 0, min 0, max 255, fuzz 0, flat 0, resolution 0
input props:
INPUT_PROP_DIRECT
You can see on my device, the X value can range between 0 and 1535.
If you then run getevent -trl /dev/input/event2, move your finger around the screen, and look at the maximum possible X value, it should correspond:
[ 115960.226411] EV_ABS ABS_MT_POSITION_X 000005ee
0x5ee = 1518, so that's about right.
There are some parameters on the touch controller which adjust this scaling, and need to be in sync with what the kernel driver reports. The standard Linux mainline driver doesn't deal very well with those parameters being out of sync with the platform data. There are patches to address this which haven't gone upstream yet: https://github.com/atmel-maxtouch/linux/commit/002438d207
If when you move your finger to the far right, the touch is still on screen, you could probably correct it by doing
output.x = raw.x / scale
Where scale is the ratio of the reported vs desired coordinates. You can't do it the other way round, because the lower input layers will throw away reports outside of the screen.
A proper fix would be to fix the bug in the kernel driver, or adjust the range settings on the touch controller.
You don't say what particular device it is, so it's difficult to help further.
I write simple program to get various information: signal strength, cell info etc... To test I use two phones with the same Android version 2.1 - Sony Ericsson and Samsung Galaxy Spice.
To extract Neighbour Cell Info I use:
telephonyConnectionAdapter.getNeighboringCellInfos()
On SE I am able to get Neighbour Cell info and in adb logcat -b radio I can see:
D/GSM ( 488): [GsmSST] Poll ServiceState done: oldSS=[0 home T-Mobile.pl
T- Mobile.pl 26002 EDGE:2 CSS not supported -1 -1 RoamInd=-1 DefRoamInd=-1
EmergOnly=false] newSS=[0 home T-Mobile.pl T-Mobile.pl 26002 EDGE:2 CSS not
supported -1 -1 RoamInd=-1 DefRoamInd=-1 EmergOnly=false] oldGprs=0 newData=0
oldMaxDataCalls=20 mNewMaxDataCalls=20
oldReasonDataDenied=-1 mNewReasonDataDenied=-1 oldType=EDGE:2 newType=EDGE:2
D/GSM ( 488): [EONS] Reading data from EF_OPL or EF_PNN is not complete.
Suppress operator name display until all EF_OPL/EF_PNN data is read.
D/RILJ ( 488): [8847]> REQUEST_GET_NEIGHBORING_CELL_IDS
D/RILJ ( 488): [8847]< REQUEST_GET_NEIGHBORING_CELL_IDS [b01b59c7#18 [b01b5260#27] [] [b01b63f9#19] [b01b2f4f#17]
but the same application could not extract Neighbour Cell Info on Samsung - the list is empty and adb logcat -b radio looks:
D/GSM ( 1993): Poll ServiceState done: oldSS=[0 home Play Play 26006 (manual)
EDGE CSS not supported -1 -1RoamInd: -1DefRoamInd: -1] newSS=[0 home Play Play
26006 (manual) EDGE CSS not supported -1 -1RoamInd: -1DefRoamInd: -1] oldGprs=0
newGprs=0 oldType=EDGE newType=EDGE D/RILJ ( 1993): [5590]> REQUEST_GET_NEIGHBORING_CELL_IDS
D/RILC ( 1855): [5590]> GET_NEIGHBORING_CELL_IDS
D/RILC ( 1855): [5590]< GET_NEIGHBORING_CELL_IDS fails by E_REQUEST_NOT_SUPPORTED
D/RILJ ( 1993): [5590]< REQUEST_GET_NEIGHBORING_CELL_IDS error: com.android.internal.telephony.CommandException: REQUEST_NOT_SUPPORTED
The is one more important information. When I use magic code *#*#197328640#*#* on Samsung and enter to service menu. There are few visible Neighbour Cells.
Any idea what is going on? Or at least what does this mean?
"com.android.internal.telephony.CommandException: REQUEST_NOT_SUPPORTED"
Each manufacturer implements the low level functionality for their devices as they see fit. In this case, Samsung has decided not to support this feature on this device. This means that you will not be able to get the list of neighboring cells on this device.
I successfuly installed (after 1 week of work) Android on BeagleBoard C4. As display I use Lilliput 669 with an eGalax Usb TouchController. Everything seems ok with exception of touchscreen which have X and Y axes reverse.
I: Bus=0003 Vendor=0eef Product=0001
Version=0210 N: Name="eGalax Inc. USB
TouchController" P:
Phys=usb-ehci-omap.0-2.2/input0 S:
Sysfs=/devices/platform/ehci-omap.0/usb1/1-2/1-2.2/1-2.2:1.0/input/input1
U: Uniq= H: Handlers=event1 B: EV=9
B: ABS=600000 3
I: Bus=0003 Vendor=0eef Product=0001
Version=0210 N: Name="eGalax Inc. USB
TouchController" P:
Phys=usb-ehci-omap.0-2.2/input0 S:
Sysfs=/devices/platform/ehci-omap.0/usb1/1-2/1-2.2/1-2.2:1.0/input/input2
U: Uniq= H: Handlers=mouse0 event2 B:
EV=1b B: KEY=400 0 0 0 0 0 0 0 0 0 0
B: ABS=600000 3 B: MSC=10
Do you know how to reverse X and Y axis for my touchscreen ?
I know that this post is old, but this was a problem I encountered recently while I swapped the broken touchscreen from my Android tablet. The replacement was a poorly manufactured p.o.c.s... Anyway, after I plugged it in, the xy was swapped first, then I turned the connector over and it was just an x-axis problem. I knew that if I flipped the glass over, it would fix it, but that would make the connector too far away from the port on the motherboard. So I just plugged it in, and went to the settings of the tablet, and calibrated the touchscreen from the settings menu. Done.
That's it.
SOLUTION:
Just go to the settings option in the menu and find the "Touchscreen Calibration" option and calibrate it again. This should fix it :) Or just flip connector around and try again :)
The reason I posted this is to help others who might have this problem :)