tegav2におけるタッチスクリーンサポートの改善
tegav2は、Tegatechの出しているタッチパネルタブレット。
他にもViewpad10という同じデバイスを使った製品もある。
OEM元は中国のCZCで、ベースモデルはP10Tという名前。
こいつのサンプル機を1つx86の開発検証用に無償提供してもらったので、手元でtegav2の開発ができる。
厳密には内部パラメータなどが微妙に違うのだけど、簡単なパッチで同等の動作にできる。
ターゲットはHoneycomb。
ICSは、いまのところ画面の右側と下側がうまくタッチに反応しないので様子見。
HoneycombもICSも、ポインタアイコンが、コロナ状になって、反応もおかしい。
対策は、solaさんのこれが使えそう。
http://blog.sola-dolphin-1.net/archives/4040909.html
タッチ関係の認識には、新規に設定ファイルが必要になっているというリポート。
たぶん、Honeycombからの変更だろうということで、これに沿って対応する。
認識時に探す設定ファイルの命名規則は以下の3種類。
- vendor product versionを使うもの
- vendor productを使うもの
- device nameを使うもの。
solaさんと同じにデバイス名を使うものを選択する。
タッチデバイスは、/sys/class/input/input*のどれか。
実機では、0-10まである。
それぞれのnameの中身を調べる。
input0 Power Botton
input1 Power Botton
input2 Video Bus
input3 PC Speaker
input4 AT Translated Set 2 keyboard
input5 Gotek
input6 BTC USB Keyboard and Mouse
input7 BTC USB Keyboard and Mouse
input8 Android Power Botton
input9 ILITEK ILITEK Multi-Touch
input10 Tega V2 Button
というわけで、ファイル名は、ILITEK_ILITEK_Multi-Touch.idcに決まった。
動作時の置き場所は、/system/usr/idc/ILITEK_ILITEK_Multi-Touch.idc になる。
内容はこの2行でいいらしい。
touch.deviceType = touchScreen touch.orientationAware = 1
他にはどんな設定があるのか、ICSのソースを探してみる。
見つかったのは、/device/samsung/tuna/Melfas_MMSxxx_Touchscreen.idc だけ。
http://tools.oesf.biz/android-4.0.1_r1.0/xref/device/samsung/tuna/Melfas_MMSxxx_Touchscreen.idc
# Basic Parameters touch.deviceType = touchScreen touch.orientationAware = 1 # Size touch.size.calibration = diameter touch.size.scale = 10 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
サイズと圧力と回転を設定できる。
とりあえず、これらはデフォルトでいいので、設定の必要はなさそうだ。
touch.touchSize.calibration = pressure
とか、
touch.pressure.source = default
とか、
# Tool Size
# Driver reports tool size as an area measurement.
#
# Based on empirical measurements, we estimate the size of the tool
# using size = sqrt(22 * rawToolArea + 0) * 9.2 + 0.
touch.toolSize.calibration = area
touch.toolSize.areaScale = 22
touch.toolSize.areaBias = 0
touch.toolSize.linearScale = 9.2
touch.toolSize.linearBias = 0
touch.toolSize.isSummed = 0
とか、気になる設定もググると他で見つかる。
idcファイルは、ビルド時にターゲットにベタ起きしてmake時にコピーさせる感じ。
tunaでは、device.mkで処理されていた。
またファイル名の流儀が変わっているよ... orz
# Input device calibration files PRODUCT_COPY_FILES += \ device/samsung/tuna/Melfas_MMSxxx_Touchscreen.idc:system/usr/idc/Melfas_MMSxxx_Touchscreen.idc
というわけで、x86版のHoneycombに追加修正する。
kinneko@BuildSV:~/Honeycomb-x86$ vi device/tegatech/tegav2/ILITEK_ILITEK_Multi-Touch.idc touch.deviceType = touchScreen touch.orientationAware = 1 kinneko@BuildSV:~/Honeycomb-x86$ vi device/tegatech/tegav2/tegav2.mk PRODUCT_COPY_FILES += \ device/tegatech/tegav2/ILITEK_ILITEK_Multi-Touch.idc:system/usr/idc/ILITEK_ILITEK_Multi-Touch.idc
たったの4行。
USBイメージでビルドしてみたが、コロナは消えて、正常に動作した。
一応パッチ形式も置いておく。
kinneko@BuildSV:~/Honeycomb-x86/device/tegatech/tegav2$ git diff --no-prefix HEAD~ diff --git ILITEK_ILITEK_Multi-Touch.idc ILITEK_ILITEK_Multi-Touch.idc new file mode 100644 index 0000000..97ef515 --- /dev/null +++ ILITEK_ILITEK_Multi-Touch.idc @@ -0,0 +1,2 @@ +touch.deviceType = touchScreen +touch.orientationAware = 1 diff --git tegav2.mk tegav2.mk index babf87f..3e545a9 100644 --- tegav2.mk +++ tegav2.mk @@ -8,6 +8,9 @@ PRODUCT_COPY_FILES := \ $(SRC_TARGET_DIR)/board/generic_x86/GenericTouch.idc:system/usr/idc/Vendor_ $(LOCAL_PATH)/vold.fstab:system/etc/vold.fstab \ +PRODUCT_COPY_FILES += \ + device/tegatech/tegav2/ILITEK_ILITEK_Multi-Touch.idc:system/usr/idc/ILIT + $(call inherit-product,$(SRC_TARGET_DIR)/product/generic_x86.mk) PRODUCT_NAME := tegav2