ponty / framebuffer-vncserver

VNC server for Linux framebuffer devices
GNU General Public License v2.0
169 stars 69 forks source link

tslib device support #21

Open JesseGuoX opened 1 year ago

JesseGuoX commented 1 year ago

Hi there, is there anyway to add support for tslib devices, I know tslib devices do not write functions in the kernel, is there another way to support it?

ponty commented 1 year ago

tslib should work. You should set the correct event file.

example for tslib:

TSLIB_TSDEVICE=/dev/input/event2

then

./framebuffer-vncserver -t /dev/input/event2 -v

https://manpages.ubuntu.com/manpages/trusty/man5/ts.conf.5.html

The tslib calibration file is not supported.

JesseGuoX commented 1 year ago

my touch device is /dev/input/ts2 , export TSLIB_TSDEVICE=/dev/input/ts2; framebuffer-vncserver -t /dev/input/ts2 -F 60 -v won't work.

ponty commented 1 year ago

Your comments have no details. If you think that something is not working properly then show it in your log or in the program code.

I tested framebuffer-vncserver with QT application using tslib and there was no problem.

framebuffer-vncserver writes into /dev/input/eventX. tslib is an application library which reads /dev/input/eventX They are independent.

dataflow:

framebuffer-vncserver -> /dev/input/eventX

/dev/input/eventX -> tslib -> application

JesseGuoX commented 1 year ago

I'm sorry for my last comment. I have two different devices with touch screen. One of the touchscreen node is /dev/input/event5, it is works fine with framebuffer-vncserver. The other device's touchscreen node is /dev/input/ts2 and it won't work properly. The framebuffer-vncserver could not get the right range of the xy :

$ framebuffer-vncserver -F 60 -t /dev/input/ts2
Initializing framebuffer device /dev/fb0...
  xres=1280, yres=800, xresv=1280, yresv=1600, xoffs=0, yoffs=0, bpp=32
  offset:length red=16:8 green=8:8 blue=0:8
No keyboard device
Initializing touch device /dev/input/ts2 ...
  x:(0 0)  y:(0 0)
Initializing VNC serv

The info about ts2 is below:

# ls -lah /dev/input/ts2
lrwxrwxrwx    1 root     root           6 Feb  8 22:51 /dev/input/ts2 -> event5
# cat /proc/bus/input/
devices   handlers
# cat /proc/bus/input/handlers
N: Number=0 Name=kbd
N: Number=1 Name=sysrq (filter)
N: Number=2 Name=mousedev Minor=32
N: Number=3 Name=evdev Minor=64
# cat /proc/bus/input/devices
I: Bus=0019 Vendor=0001 Product=0001 Version=0100
N: Name="sunxi-ths"
P: Phys=sunxiths/input0
S: Sysfs=/devices/virtual/input/input0
U: Uniq=
H: Handlers=event0
B: PROP=0
B: EV=9
B: ABS=100 0

I: Bus=0019 Vendor=0001 Product=0001 Version=0100
N: Name="sunxi-keyboard"
P: Phys=sunxikbd/input0
S: Sysfs=/devices/virtual/input/input1
U: Uniq=
H: Handlers=kbd event1
B: PROP=0
B: EV=3
B: KEY=40040 0 0 10000000

I: Bus=0019 Vendor=0001 Product=0001 Version=0100
N: Name="sunxi-keypad"
P: Phys=Keypad/input2
S: Sysfs=/devices/virtual/input/kp0
U: Uniq=
H: Handlers=sysrq kbd event2
B: PROP=0
B: EV=3
B: KEY=ffffffff fffffffe

I: Bus=0019 Vendor=0001 Product=0001 Version=0100
N: Name="all_key"
P: Phys=sunxi_ts/input0
S: Sysfs=/devices/platform/sunxi-ts/input/input3
U: Uniq=
H: Handlers=event3
B: PROP=0
B: EV=b
B: KEY=400 0 0 0 0 0 0 0 0 0 0
B: ABS=610000 0

I: Bus=0019 Vendor=0001 Product=0001 Version=0100
N: Name="axp22-powerkey"
P: Phys=m1kbd/input2
S: Sysfs=/devices/soc.0/1c2ac00.twi/i2c-0/0-0034/axp22-powerkey/input/input4
U: Uniq=
H: Handlers=kbd event4
B: PROP=0
B: EV=7
B: KEY=100000 0 0 0
B: REL=0

I: Bus=0018 Vendor=dead Product=beef Version=28bb
N: Name="gt9xxnew_ts"
P: Phys=
S: Sysfs=/devices/virtual/input/input5
U: Uniq=
H: Handlers=kbd event5
B: PROP=2
B: EV=b
B: KEY=400 0 0 7f8 0 0 0 0 0 0 0
B: ABS=2650000 0