AndroidInputInverter

From TAMI
Revision as of 15:09, 10 November 2013 by Jacob Eichbaum (talk | contribs)
Jump to navigationJump to search

@Yaki @Alon

Target: invert input from secondary usb tablet on an Akai AK8455 tablet.

TODO

  • The touchpanel only produces clicks when using two fingers. See logs below. Also see android-porting group.
  • Orientation is wrong for a given gravity - need to either change the output of the acceleration sensor via kernel change, or perhaps a configuration change
    • getevent is very useful to debug this, it parses /dev/input/*
  • We are not sure why the orientation locked with the panel, i.e. if the idc file addition fixed it. To figure out, do:
    • dumpsys window input *without* the idc file
    • dumpsys window input *with* the idc file
    • compare.
  • How to force rereading of the idc file without reset?

DONE

  • using the idc file rotation of the tablet is enabled and it produces clicks that are always aligned with the screen rotation, see it's contents below.
    • not sure all of the settings there are required.

Howto connect via adb to Akai from windows 8

Install PdaNet package, it includes drivers. Follow it's instructions (disconnect device before or during installation, connect it when it asks).

Afterwards "adb devices" should show up for instance:

List of devices attached
20080411413fc082        device

Turning on tcp/ip debugging via adb

http://stackoverflow.com/questions/2604727/how-can-i-connect-to-android-with-adb-over-tcp

su
setprop service.adb.tcp.port 5555
stop adbd
start adbd

Android input devices

How does android process a usb input device?

Android consults input device configuration files.

/system/usr/idc/

Vendor_2087_Product_0702.idc

# Copyright (C) 2010 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Emulator keyboard configuration file #1.
#
device.internal = 1
# Basic Parameters
touch.deviceType = touchScreen
touch.orientationAware = 2
# Size
touch.size.calibration = diameter
touch.size.scale = 1
touch.size.bias = 0
touch.size.isSummed = 0
# Pressure
# Driver reports signal strength as pressure.
#
# A normal thumb touch typically registers about 200 signal strength
# units although we don't expect these values to be accurate.
touch.pressure.calibration = amplitude
touch.pressure.scale = 0.005
# Orientation
touch.orientation.calibration = none

Resources

getevent traces

Single tap, doesn't produce the higher 'click' event

root@android:/ # getevent -lt /dev/input/event2                                
2658-945331: EV_KEY       BTN_TOOL_PEN         DOWN                
2658-945354: EV_ABS       ABS_MISC             00000002            
2658-945362: EV_ABS       ABS_X                00000282            
2658-945369: EV_ABS       ABS_Y                00000b15            
2658-945405: EV_SYN       SYN_REPORT           00000000            
2658-955340: EV_MSC       MSC_SCAN             000d0042            
2658-955358: EV_KEY       BTN_TOUCH            DOWN                
2658-955393: EV_MSC       MSC_SCAN             000d0042            
2658-955397: EV_KEY       BTN_TOUCH            UP                  
2658-955429: EV_SYN       SYN_REPORT           00000000            
2658-965327: EV_MSC       MSC_SCAN             000d0042            
2658-965342: EV_KEY       BTN_TOUCH            DOWN                
2658-965364: EV_ABS       ABS_X                00000288            
2658-965371: EV_ABS       ABS_Y                00000b11            
2658-965379: EV_MSC       MSC_SCAN             000d0042            
2658-965382: EV_KEY       BTN_TOUCH            UP                  
2658-965413: EV_SYN       SYN_REPORT           00000000            
2658-975333: EV_MSC       MSC_SCAN             000d0042            
2658-975348: EV_KEY       BTN_TOUCH            DOWN                
2658-975384: EV_MSC       MSC_SCAN             000d0042            
2658-975388: EV_KEY       BTN_TOUCH            UP                  
2658-975417: EV_SYN       SYN_REPORT           00000000            
2658-985363: EV_MSC       MSC_SCAN             000d0042            
2658-985378: EV_KEY       BTN_TOUCH            DOWN                
2658-985413: EV_MSC       MSC_SCAN             000d0042            
2658-985417: EV_KEY       BTN_TOUCH            UP                  
2658-985447: EV_SYN       SYN_REPORT           00000000            
2658-995485: EV_KEY       BTN_TOOL_PEN         UP                  
2658-995608: EV_SYN       SYN_REPORT           00000000            

External tablet, double tap, produces click

# getevent -lt /dev/input/event2                            
2777-567013: EV_KEY       BTN_TOOL_PEN         DOWN                
2777-567201: EV_ABS       ABS_MISC             00000001            
2777-567308: EV_ABS       ABS_X                000002bf            
2777-567407: EV_ABS       ABS_Y                000009f7            
2777-567919: EV_SYN       SYN_REPORT           00000000            
2777-576720: EV_MSC       MSC_SCAN             000d0042            
2777-576801: EV_KEY       BTN_TOUCH            DOWN                
2777-577208: EV_MSC       MSC_SCAN             000d0042            
2777-577254: EV_KEY       BTN_TOUCH            UP                  
2777-577665: EV_SYN       SYN_REPORT           00000000            
2777-616766: EV_MSC       MSC_SCAN             000d0042            
2777-616858: EV_KEY       BTN_TOUCH            DOWN                
2777-617137: EV_ABS       ABS_X                000002cd            
2777-617231: EV_ABS       ABS_Y                000009d2            
2777-617343: EV_MSC       MSC_SCAN             000d0042            
2777-617386: EV_KEY       BTN_TOUCH            UP                  
2777-617498: EV_KEY       BTN_TOOL_RUBBER      DOWN                
2777-617671: EV_ABS       ABS_Z                000001a9            
2777-617760: EV_ABS       ABS_RX               0000077c            
2777-617872: EV_ABS       002a                 00000002            
2777-617918: EV_SYN       SYN_REPORT           00000000            
2777-626715: EV_MSC       MSC_SCAN             000d0042            
2777-626797: EV_KEY       BTN_TOUCH            DOWN                
2777-627571: EV_SYN       SYN_REPORT           00000000            
2777-686340: EV_ABS       ABS_X                000002b4            
2777-686371: EV_ABS       ABS_Y                000009c4            
2777-686447: EV_SYN       SYN_REPORT           00000000            
2777-706393: EV_MSC       MSC_SCAN             000d0042            
2777-706427: EV_KEY       BTN_TOUCH            UP                  
2777-706442: EV_KEY       BTN_TOOL_PEN         UP                  
2777-706447: EV_KEY       BTN_TOOL_RUBBER      UP                  
2777-706526: EV_SYN       SYN_REPORT           00000000     

Builtin tablet, single tap, produces click

# getevent -lt /dev/input/event3                            
2737-190833: EV_ABS       ABS_MT_TOUCH_MAJOR   00000001            
2737-190935: EV_ABS       ABS_MT_POSITION_X    00000069            
2737-190986: EV_ABS       ABS_MT_POSITION_Y    000000a2            
2737-191030: EV_SYN       SYN_MT_REPORT        00000000            
2737-191067: EV_SYN       SYN_REPORT           00000000            
2737-249546: EV_ABS       ABS_MT_TOUCH_MAJOR   00000001            
2737-251284: EV_ABS       ABS_MT_POSITION_X    00000069            
2737-253841: EV_ABS       ABS_MT_POSITION_Y    000000a2            
2737-254038: EV_SYN       SYN_MT_REPORT        00000000            
2737-254195: EV_SYN       SYN_REPORT           00000000            
2737-283836: EV_ABS       ABS_MT_TOUCH_MAJOR   00000001            
2737-283869: EV_ABS       ABS_MT_POSITION_X    00000069            
2737-283880: EV_ABS       ABS_MT_POSITION_Y    000000a2            
2737-283891: EV_SYN       SYN_MT_REPORT        00000000            
2737-283902: EV_SYN       SYN_REPORT           00000000            
2737-321578: EV_ABS       ABS_MT_TOUCH_MAJOR   00000000            
2737-321709: EV_SYN       SYN_MT_REPORT        00000000            
2737-321736: EV_SYN       SYN_REPORT           00000000

Both devices compared

# getevent -li /dev/input/event2                              
add device 1: /dev/input/event2
  bus:      0003
  vendor    2087
  product   0702
  version   0111
  name:     "Multi Touch Panel with Controller"
  location: "usb-sw_hcd_host0-1/input0"
  id:       ""
  version:  1.0.1
  events:
    KEY (0001): BTN_TOOL_PEN          BTN_TOOL_RUBBER       BTN_TOUCH            
    ABS (0003): ABS_X                 : value 692, min 0, max 4095, fuzz 0, flat 0, resolution 0
                ABS_Y                 : value 2500, min 0, max 4095, fuzz 0, flat 0, resolution 0
                ABS_Z                 : value 425, min 0, max 4095, fuzz 0, flat 0, resolution 0
                ABS_RX                : value 1916, min 0, max 4095, fuzz 0, flat 0, resolution 0
                ABS_MISC              : value 1, min 0, max 1, fuzz 0, flat 0, resolution 0
                0029                  : value 3, min 0, max 1, fuzz 0, flat 0, resolution 0
                002a                  : value 2, min 0, max 2, fuzz 0, flat 0, resolution 0
    MSC (0004): MSC_SCAN             
  input props:
    <none>
root@android:/ # getevent -li /dev/input/event3                                
add device 1: /dev/input/event3
  bus:      0019
  vendor    0001
  product   0002
  version   0100
  name:     "zet6221_ts"
  location: "zet6221_touch/input0"
  id:       ""
  version:  1.0.1
  events:
    KEY (0001): KEY_HOME              KEY_MENU              KEY_BACK              KEY_SEARCH           
    ABS (0003): ABS_MT_TOUCH_MAJOR    : value 0, min 0, max 1, fuzz 0, flat 0, resolution 0
                ABS_MT_WIDTH_MAJOR    : value 0, min 0, max 0, fuzz 0, flat 0, resolution 0
                ABS_MT_POSITION_X     : value 0, min 0, max 960, fuzz 0, flat 0, resolution 0
                ABS_MT_POSITION_Y     : value 0, min 0, max 640, fuzz 0, flat 0, resolution 0
  input props:
    <none>

here is a link to table of linux supported moulti-touch panel - http://lii-enac.fr/en/architecture/linux-input/multitouch-devices.html here is the condo driver, used in our transparent tablet - https://android.googlesource.com/kernel/tegra/+/457287905f43f5be9789214e1a25b514cd1d3e5a/drivers/hid/hid-cando.c