Closed MGlolenstine closed 4 years ago
For me it worked with Xorg properly (I initially implemented it to test Xorg apps without having a real touchscreen).
What are Linux kernel and Xorg versions? Have you tried running it for Xorg alone, without also attaching other clients like libinput record
or evtest
?
Thanks for your swift reply!
I'm currently running X.Org X Server 1.20.4
on a Raspberry Pi Compute Module 3+.
This is my uname
: Linux raspberrypi 5.4.45-v7+ #1321 SMP Wed Jun 10 17:33:27 BST 2020 armv7l GNU/Linux
.
The reason for testing it out with evtest
and libinput record
was the touchscreen not working in OpenBox and i3.
Have just tried it my X.Org X Server 1.20.4
Linux 4.19.128-64+
and it works.
What have you used to provide input to /dev/virtual_touchscreen
? The supplied GUI app or something else? Naive x 0\ny 0\nS 0\n
won't typically lead to any visible changes.
I've actually created a Rust application that reads data from a real touchscreen via I2c and then forwards data to the /dev/virtual_touchscreen
.
Maybe you need to issue more commands?
Here is example output of the GUI app: https://github.com/vi/virtual_touchscreen/blob/master/example_commands.txt
Feeding this file to the device makes mouse move and click in Xorg:
pv -L100 example_commands.txt > /dev/virtual_touchscreen
This indeed is interesting. Your example data does move the mouse.
Would you be able to elaborate more on T
and :
commands I saw in the example_commands?
T
tells you what the tracking ID is. Is this RO and what does it tell you? Currently selected multitouch slot?:
would stand for.I don't remember much myself. Need to dig the source code.
When I was implementing it, I mostly used trial and error until it worked.
Oh, I see... Then I guess I'll just have to do the same.
Thanks for your help and showing me that the dmesg
error is nothing to worry about.
Maybe if I remember the command set and properly document it, a Rust crate for a proper API for driving the virtual_touchscreen can be published. Are you interested in doing or reviewing it?
To be fair, I'm quite new to Rust myself, but I'd surely be up to doing that.
I just figured what the problem is.
I was using x
and y
, but those two don't execute events, that's why the mouse wasn't moving.
Now that I changed it to X
and Y
, the mouse cursor moves.
Note: issuing cat /dev/virtual_touchscreen
shows a help message about commands.
Looks empty. Also *-rs
is not the recommended name for Rust crates (no need to change it just because of that, as you have already reserved it). Also crate reservations are sometimes frowned upon in the Rust community.
If you want me to review the crate, you can write a comment here when you publish the real version.
I did not know about the *-rs
naming scheme, but good to know for the future crates.
It currently still is empty, as I just finished with work and am on my way home. I'll write it when I get home.
I've only reserved the crate so I wouldn't forget to do it later 😅. I hope crate reservations for few hours aren't being frowned upon too hard.
After the
insmod
ormodprobe
, the device appears and I can uselibinput record
orevtest
for testing it and it works great, but it doesn't work in X. The X log shows this errorWhich I think is connected to the TVD not working in the X.
What would have to be changed in the code to make the module work within X?