Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • 在线文档
    • 社区主页

    tslib 电阻触摸屏调试!!!

    Linux
    3
    12
    4183
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • W
      wyljkl LV 7 last edited by

      请问一下,电阻触摸屏,使用tslib校准后,查阅到可以通过ts_uinput 命令虚拟出一个event设备,应用层就直接可以通过这个设备来获取坐标了,不知道是否可行?使用后出现下面log:
      root@TinaLinux:/# ts_uinput -n /dev/input/event1
      tslib: WARNING: no multitouch using VARIANCE filter
      open /dev/uinput: No such file or directory
      Illegal instruction

      是不行?还是我应该在系统层面去生成一个/dev/uinput 设备,这需要打开哪项配置?

      whycan 1 Reply Last reply Reply Quote Share 0
      • whycan
        whycan晕哥 LV 9 @wyljkl last edited by whycan

        @wyljkl

        可以参考这个帖子: D1S芒果派MQ-R在tina-sdk2.0下无法识别电阻触摸屏

        ① 用这个先生成校准文件:

        TSLIB_TSDEVICE=/dev/input/event0 ts_calibrate

        ② 后台运行 uinput(会产生新的event设备):

        TSLIB_TSDEVICE=/dev/input/event0 ts_uinput

        ③ 前台执行 测试:

        TSLIB_TSDEVICE=/dev/input/event2 ts_test

        这个坐标应该是正确的。

        注意看环境变量!

        W 1 Reply Last reply Reply Quote Share 0
        • W
          wyljkl LV 7 @whycan last edited by xiaowenge

          @whycan 晕哥,我这边已经校准过了,然后ts_test坐标也对了,现在的问题就是ts_uinput虚拟出来的设备没有报点,这是什么原因?

          root@TinaLinux:/# export TSLIB_CALIBFILE=/etc/pointercal;export TSLIB_CONFFILE=/
          etc/ts.conf;export TSLIB_PLUGINDIR=/usr/lib/ts;export TSLIB_CONSOLEDEVICE=none;e
          xport TSLIB_FBDEVICE=/dev/fb0;export TSLIB_TSDEVICE=/dev/input/event0;
          root@TinaLinux:/# 
          root@TinaLinux:/# 
          root@TinaLinux:/# 
          root@TinaLinux:/# ts_calibrate 
          xres = 480, yres = 272
          Took 15 samples...
          Top left : X = 3495 Y = 3300
          Took 11 samples...
          Top right : X =  557 Y = 3183
          Took 11 samples...
          Bot right : X =  609 Y =  823
          Took 13 samples...
          Bot left : X = 3489 Y =  935
          Took 14 samples...
          Center : X = 2013 Y = 2048
          507.976929 -0.130559 -0.001265
          279.929535 0.002867 -0.072775
          Calibration constants: 33290776 -8556 -82 18345462 187 -4769 65536 
          root@TinaLinux:/# 
          root@TinaLinux:/# 
          root@TinaLinux:/# ts_test
          94.175296:    459    237    255
          94.175296:    459    237    255
          94.185553:    458    237    255
          94.195795:    458    237    255
          94.206035:    457    238    255
          94.216333:    457    239    255
          94.226508:    457    239    255
          94.236740:    457    240    255
          94.246991:    458    240    255
          94.350075:    458    239      0
          94.773312:    440     93    255
          94.773312:    440     93    255
          94.783571:    441     92    255
          94.890074:    439     91      0
          ^Csignal 2 caught
          root@TinaLinux:/# 
          root@TinaLinux:/# TSLIB_TSDEVICE=/dev/input/event0 ts_uinput &
          root@TinaLinux:/# tslib: WARNING: no multitouch using VARIANCE filinput: ts_uinput as /devices/virtual/input/input1
          ter
          tslib: WARNING: no multitouch using VARIANCE filter
          
          root@TinaLinux:/# 
          root@TinaLinux:/# 
          root@TinaLinux:/# TSLIB_TSDEVICE=/dev/input/event1 ts_test
          ^Csignal 2 caught
          root@TinaLinux:/# 
          
          root@TinaLinux:/etc# ./evtest 
          No device specified, trying to scan all of /dev/input/event*
          Available devices:
          /dev/input/event0:      1c24800.sun3i-rtp
          /dev/input/event1:      ts_uinput
          Select the device event number [0-1]: 1
          Input driver version is 1.0.1
          Input device ID: bus 0x6 vendor 0x0 product 0x0 version 0x0
          Input device name: "ts_uinput"
          Supported events:
            Event type 0 (EV_SYN)
            Event type 1 (EV_KEY)
              Event code 330 (BTN_TOUCH)
            Event type 3 (EV_ABS)
              Event code 48 (ABS_MT_TOUCH_MAJOR)
                Value      0
                Min        0
                Max     1000
              Event code 53 (ABS_MT_POSITION_X)
                Value      0
                Min        0
                Max      479
              Event code 54 (ABS_MT_POSITION_Y)
                Value      0
                Min        0
                Max      271
          Properties:
          Testing ... (interrupt to exit)
          ^Croot@TinaLinux:/etc#
          
          whycan 2 Replies Last reply Reply Quote Share 0
          • whycan
            whycan晕哥 LV 9 @wyljkl last edited by

            @wyljkl 在 tslib 电阻触摸屏调试!!! 中说:

            /dev/input/event0
            ls /dev/input/event* -l

            看下有没有生成新设备

            W 1 Reply Last reply Reply Quote Share 0
            • W
              wyljkl LV 7 @whycan last edited by

              @whycan 有的,生成了一个新设备event1
              root@TinaLinux:/# ls /dev/input/event* -l
              crw-rw---- 1 root root 13, 64 Jan 1 00:00 /dev/input/event0
              crw-rw---- 1 root root 13, 65 Jan 1 00:03 /dev/input/event1
              root@TinaLinux:/#

              1 Reply Last reply Reply Quote Share 0
              • whycan
                whycan晕哥 LV 9 @wyljkl last edited by

                @wyljkl 在 tslib 电阻触摸屏调试!!! 中说:

                root@TinaLinux:/etc# ./evtest
                No device specified, trying to scan all of /dev/input/event*
                Available devices:
                /dev/input/event0: 1c24800.sun3i-rtp
                /dev/input/event1: ts_uinput
                Select the device event number [0-1]: 1
                Input driver version is 1.0.1
                Input device ID: bus 0x6 vendor 0x0 product 0x0 version 0x0
                Input device name: "ts_uinput"
                Supported events:
                Event type 0 (EV_SYN)
                Event type 1 (EV_KEY)
                Event code 330 (BTN_TOUCH)
                Event type 3 (EV_ABS)
                Event code 48 (ABS_MT_TOUCH_MAJOR)
                Value 0
                Min 0
                Max 1000
                Event code 53 (ABS_MT_POSITION_X)
                Value 0
                Min 0
                Max 479
                Event code 54 (ABS_MT_POSITION_Y)
                Value 0
                Min 0
                Max 271
                Properties:
                Testing ... (interrupt to exit)
                ^Croot@TinaLinux:/etc#

                这个正常吗?

                W 2 Replies Last reply Reply Quote Share 0
                • W
                  wyljkl LV 7 @whycan last edited by

                  @whycan evtest也没有数据

                  1 Reply Last reply Reply Quote Share 0
                  • W
                    wyljkl LV 7 @whycan last edited by

                    @whycan 会不会是这个地方还需要打开什么配置?
                    6ec31d02-676d-4fdd-8ec4-efe512cf5add-image.png

                    whycan 1 Reply Last reply Reply Quote Share 0
                    • whycan
                      whycan晕哥 LV 9 @wyljkl last edited by

                      @wyljkl
                      没遇到过。

                      W 1 Reply Last reply Reply Quote Share 0
                      • W
                        wyljkl LV 7 @whycan last edited by

                        @whycan 晕哥,我使用tslib源码包里面的ts_uinput启动脚本他会提示这个问题:
                        root@TinaLinux:/# ./ts_uinput_start.sh
                        input: ts_uinput as /devices/virtual/input/input1
                        ts_uinput: See the kernel log for the device number
                        ls: tslib: WARNING: no multitouch using VARIANCE filter: No such file or directory
                        ts_uinput: Error creating event device
                        这上面提示说没有生成设备,但是单独运行,他是生成了event1的,好奇怪

                        脚本
                        ts_uinput_start.sh :
                        !/bin/sh

                        This starts ts_uinput as a daemon and creates /dev/input/ts_uinput to use

                        as an evdev input device

                        TS_UINPUT_DEV_FILE=$(ts_uinput -d -v)
                        TS_UINPUT_DEV_FILE_CHECKED=$(ls "$TS_UINPUT_DEV_FILE" | grep 'event')

                        if [ ! -z "$TS_UINPUT_DEV_FILE_CHECKED" ]
                        then
                        rm -f /dev/input/ts_uinput
                        ln -s $TS_UINPUT_DEV_FILE_CHECKED /dev/input/ts_uinput
                        else
                        echo "ts_uinput: Error creating event device"
                        exit 1
                        fi

                        exit 0

                        1 Reply Last reply Reply Quote Share 0
                        • W
                          wyljkl LV 7 last edited by

                          问题解决了,tslib的源码有问题,我把tslib的版本更新了一下就OK了。

                          1 Reply Last reply Reply Quote Share 0
                          • G
                            张三 LV 6 last edited by

                            This post is deleted!
                            1 Reply Last reply Reply Quote Share 0
                            • 1 / 1
                            • First post
                              Last post

                            Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

                            行为准则 | 用户协议 | 隐私权政策