再次求教:台电P76上安装Ubuntu用不了触摸屏的问题

笔记本/便携移动设备,手机平板等软硬件
回复
头像
jingxt
帖子: 31
注册时间: 2013-06-21 10:09
系统: Kubuntu 13.04

再次求教:台电P76上安装Ubuntu用不了触摸屏的问题

#1

帖子 jingxt » 2013-06-28 23:14

(上一篇主题:viewtopic.php?f=126&t=444342

上一篇主题问得不是很清楚,补充一下。。提前谢谢各位大神~~

台电P76平板。全志A10方案。(sun4i)
触摸屏比较奇葩,是电阻屏,却是两点触控。

这里的“两点触控”仅限于在安卓系统下用来放大缩小网页。切水果的时候根本不起效果。

使用chroot方式可以运行Ubuntu。(ARM架构)

这是uname -a的返回结果:

代码: 全选

root@Jingtian-Pad:~# uname -a
Linux Jingtian-Pad 2.6.36-android+ #4 PREEMPT Mon Apr 23 14:58:21 CST 2012 armv7l GNU/Linux
触摸屏设备名为:

代码: 全选

/dev/input/event1
但是一运行Xorg,就会黑屏并且重启(reboot)。
命令行:

代码: 全选

Xorg :0 vt1
而且这里有一个很诡异的问题:直接运行Xorg没有反应,什么东西都不输出。必须要加上vt1选项。
据此推断,我觉得是tty的问题。于是我测试了一下。果然从chvt 2到chvt 12通通都没有反应。屏幕上也没有任何反应。我运行getty也没用。
只有chvt 1能运行成功。


(这个问题有解决的办法吗?)

所以我放弃Xorg了,打算用Xfbdev。

今天新编译了一个,确保加上了所有的库。Xorg的官方文档也说了evdev支持触摸屏。

tslib除外,因为使用ts_calibrate校准失败。
这是返回的结果:

代码: 全选

root@Jingtian-Pad:~# ts_calibrate 
xres = 800, yres = 480
tslib: Selected device uses a different version of the event protocol than tslib was compiled for
Took 5 samples...
Top left : X =    5 Y =    0
Took 5 samples...
Top right : X =    5 Y =    0
Took 5 samples...
Bot right : X =    5 Y =    0
Took 5 samples...
Bot left : X =    5 Y =    0
Took 5 samples...
Center : X =    5 Y =    0
ts_calibrate: determinant is too small -- 0.000000
Calibration failed.
然后我把编译好的Xfbdev传到平板上,先通过ssh把安卓的进程杀了,然后运行:

代码: 全选

Xfbdev tty1 vt1 -retro -mouse evdev
(我不知道如何通过命令行指定设备,而evdev的默认设备是event0,所以我干脆把event0删了,做了一个event1的符号链接。)

屏幕上出现了熟悉的这个:
Camera_20130628_215537_s.jpg
然后,我按平板上的触摸屏。上面的鼠标指针不动。但是在电脑上可以看到一些像是坐标值的东西:

代码: 全选

root@Jingtian-Pad:~# Xfbdev tty1 vt1 -retro -mouse evdev
[dix] Could not init font path element /usr/share/fonts/X11/TTF/, removing from list!
[dix] Could not init font path element /usr/share/fonts/X11/OTF/, removing from list!
[dix] Could not init font path element /usr/share/fonts/X11/Type1/, removing from list!
[dix] Could not init font path element /usr/share/fonts/X11/100dpi/, removing from list!
[dix] Could not init font path element /usr/share/fonts/X11/75dpi/, removing from list!
[b]abs 48=800 53=0 54=0
abs 48=800 53=2241 54=0
abs 48=800 53=2242 54=1121
abs 48=800 53=2243 54=1129
abs 48=800 53=2242 54=1132
abs 48=800 53=2243 54=1144
abs 48=800 53=2242 54=1150
abs 48=800 53=2244 54=1151
abs 48=800 53=2243 54=1148
abs 48=800 53=2246 54=1152
abs 48=800 53=2249 54=1139
abs 48=0 53=2249 54=1131[/b]
snapshot8.png
而且53=和54=后面的两个数字会随着我手指头在屏幕上的位置而改变。

据我观察,53=后面的数字,根据我手指头在屏幕上的位置从左到右,由大到小。
54=后面的数字,根据我手指头在屏幕上的位置从上到下,由大到小。

48=后面的数字,在我手指按着触摸屏的时候一直是800,但是在松开的一瞬间会变成0。

对于此,我觉着么,这个触摸屏,evdev还是认的。应该只是没有设置好。

接着,我通过ssh运行startlxde,可以正常启动LXDE桌面。mplayer看视频也无压力。。
Camera_20130628_222715_s.jpg
Camera_20130628_222823_s.jpg
这是总体效果:
Camera_20130628_222904_s.jpg
(啥都可以干,但是触摸屏用不了,这难道不让人口水流干吗?!)
………………

后来我在网上找了一堆资料,说是没有校准的问题,于是按照网上说的对照了xinput,并且装了网上说的xinput_calibrator,但是也无济于事。

代码: 全选

root@Jingtian-Pad:~# xinput list
⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ Evdev mouse                               id=6    [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]


root@Jingtian-Pad:~# xinput list-props "Evdev mouse"
Device 'Evdev mouse':
        Device Enabled (113):   1
        Coordinate Transformation Matrix (114): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
        Device Accel Profile (230):     0
        Device Accel Constant Deceleration (231):       1.000000
        Device Accel Adaptive Deceleration (232):       1.000000
        Device Accel Velocity Scaling (233):    10.000000


root@Jingtian-Pad:~# xinput_calibrator --device "Evdev mouse"
Error: Device "Evdev mouse" not found; use --list to list the calibratable input devices.

root@Jingtian-Pad:~# xinput_calibrator --list
No calibratable devices found.
然后我就没有办法了……

求各位大神指教~!
Just a little child who loves strange things.

My Launchpad page: https://launchpad.net/~oppop007
My Qzone: http://1158739473.qzone.qq.com
felonwan
帖子: 262
注册时间: 2008-09-12 12:32

Re: 再次求教:台电P76上安装Ubuntu用不了触摸屏的问题

#2

帖子 felonwan » 2013-10-09 23:20

支持。 :em11

请问你的触摸屏能用了么?
楼主要是能共享一下你的过程就好了!

我也想直接在Android内核的基础上直接上Linux。
玩过Chroot,用vnc真的太慢,也试过用别人的Xserver直接实现,发现没有Xserver能稳定运行还支持触摸的。
现在抽空折腾了下TF上装Linux系统,能用。编译了内核,和网上下的编译好的不同的rootfs配合起来,要么触摸屏不能用,要么lcd没显示。
felonwan
帖子: 262
注册时间: 2008-09-12 12:32

Re: 再次求教:台电P76上安装Ubuntu用不了触摸屏的问题

#3

帖子 felonwan » 2013-10-14 12:33

不知道楼主有没有试过这个帖子,用ubuntu镜像:

http://www.thefanclub.co.za/how-to/how- ... alibration
felonwan
帖子: 262
注册时间: 2008-09-12 12:32

Re: 再次求教:台电P76上安装Ubuntu用不了触摸屏的问题

#4

帖子 felonwan » 2013-10-16 14:45

tslib只支持单点,lz的evdev似乎是可以用的。

如果用Xorg,屏幕驱动用fbdev,触摸屏作为输入驱动用evdev,在xorg.conf里面自己写,可能就能用了。

我的测试中,evdev驱动加载正常,但是告诉我有bug,一触摸就会触发某个没有解决的bug:

代码: 全选

evdev-ts: Attempted to start touch without x/y (driver bug)   #不触摸的时候只这一个提示,触摸就会有下面的提示。
BUG: triggered 'if (!b || !v)'
BUG: ../../Xi/exevents.c:1004 in UpdateDeviceState()
准备自己编译evdev,结果发现需要libevdev,这个源里没有,9月才新出来开发的一个库,编译又出错:

代码: 全选

……
In file included from libevdev-uinput.c:36:0:
libevdev-int.h:96:30: error: 'ABS_MT_TOOL_Y' undeclared here (not in a function)
libevdev-uinput.c: In function 'fetch_device_node':
libevdev-uinput.c:175:11: warning: ignoring return value of 'asprintf', declared with attribute warn_unused_result [-Wunused-result]
make[3]: *** [libevdev-uinput.lo] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
felonwan
帖子: 262
注册时间: 2008-09-12 12:32

Re: 再次求教:台电P76上安装Ubuntu用不了触摸屏的问题

#5

帖子 felonwan » 2013-10-17 0:58

:em05

编译evdev搞定,现在是触摸没反应了。。。也没办法校正……

代码: 全选

root@localhost:/root# xinput list
⎡ Virtual core pointer                      id=2  [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4  [slave  pointer  (2)]
⎜   ↳ evdev-ts                                  id=6  [slave  pointer  (2)]
⎣ Virtual core keyboard                     id=3  [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5  [slave  keyboard (3)]
    
root@localhost:/root# xinput list-props 6 
Device 'evdev-ts':
  Device Enabled (114): 1
  Coordinate Transformation Matrix (115): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
  Device Accel Profile (242): 0
  Device Accel Constant Deceleration (243): 1.000000
  Device Accel Adaptive Deceleration (244): 1.000000
  Device Accel Velocity Scaling (245):  10.000000
  Device Product ID (246):  57005, 48879
  Device Node (247):  "/dev/input/event2"
  Evdev Axis Inversion (248): 0, 0
  Evdev Axis Calibration (249): <no items>
  Evdev Axes Swap (250):  0
  Axis Labels (251):  "Abs X" (231), "Abs Y" (232), "Abs Hat 0 X" (233), "Abs Hat 1 X" (234), "Abs Hat 2 Y" (235), "Abs Hat 3 X" (236), "Abs Distance" (237), "Abs MT Touch Major" (238), "Abs MT Width Major" (239), "Abs MT Position X" (240), "Abs MT Position Y" (241), "None" (0)
  
root@localhost:/root# xinput_calibrator --device "evdev-ts" 
Calibrating EVDEV driver for "evdev-ts" id=6
  current calibration values (from XInput): min_x=0, max_x=1000 and min_y=0, max_y=1000
回复