Git Product home page Git Product logo

Comments (20)

Plippo avatar Plippo commented on August 18, 2024 1

You can try to calibrate the screen before starting twofing. As you see in the output, the axes are by default calibrated to a range of 0..65535. You can try to reduce these numbers until they fit. To e.g. change them to 20000, you can call:

xinput set-int-prop 6 "Evdev Axis Calibration" 32 0 20000 0 20000

6 is your device id (as seen in the output above), 32 is a fixed value (size of an integer) and after that come the calibration values (MinX MaxX MinY MaxY). I hope it works!

from twofing.

Plippo avatar Plippo commented on August 18, 2024 1

Don't worry, there's no need to hurry. I was just wondering.

from twofing.

Plippo avatar Plippo commented on August 18, 2024

@Patronics Did it work for you, can I mark the bug as closed?

from twofing.

Patronics avatar Patronics commented on August 18, 2024

Sorry, I actually haven't had a chance to test it yet, I've been busy with other projects. I can try to spare some time to test it tomorrow, see if this solution works for me

from twofing.

dschugha avatar dschugha commented on August 18, 2024

My cursor is jumping to the top left corner too. I am using:

Raspberry Pi 4B
https://www.conrad.de/de/p/raspberry-pi-rb-lcd-7-display-modul-17-8-cm-7-zoll-800-x-480-pixel-passend-fuer-raspberry-pi-1388955.html
uname -a
Linux raspberrypi 5.10.17-v7l+ #1403 SMP Mon Feb 22 11:33:35 GMT 2021 armv7l GNU/Linux

calibration with
xinput set-int-prop 6 "Evdev Axis Calibration" 32 0 20000 0 20000
doesn´t help.

For me it seems that the configuration

Section "InputClass"
Identifier "calibration"
...

is not in place and not used. When starting in debug mode with
twofing --debug /dev/input/event0
twofing uses "default values".

Whereever I put the configuration I cannot see that anything is used. I do have following X11 configuration files

ls -ln /usr/share/X11/xorg.conf.d/
insgesamt 12
-rw-r--r-- 1 0 0 1099 Aug 23 2018 10-evdev.conf
-rw-r--r-- 1 0 0 1350 Jan 15 15:03 10-quirks.conf
-rw-r--r-- 1 0 0 1429 Mär 31 2019 40-libinput.conf

Think it would help finding the correct configuration file for calibration.

from twofing.

Plippo avatar Plippo commented on August 18, 2024

Can you post the complete output of twofing --debug /dev/input/event0?
Maybe 6 is not the correct xinput id for your devide.

from twofing.

dschugha avatar dschugha commented on August 18, 2024

pi@raspberrypi:~/twofing $ xinput list
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ raspberrypi-ts id=6 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
--------------------------------------------------------------------

pi@raspberrypi:~/twofing $ twofing --debug /dev/input/event0
twofing, the two-fingered daemon
Version 0.1.5.20200913

Input device name: "raspberrypi-ts"
XInput device id is 6.
XInput device id for calibration is 6.
Start calibration
No calibration data found, use default values.
No valid axis inversion data found, assuming no inversion.
No valid axes swap data found, assuming no swap.
Calibration: MinX: 0; MaxX: 65535; MinY: 0; MaxY: 65535
Invert X Axis: No
Invert Y Axis: No
Swap Axes: No
Calibration Matrix: 1.000000 0.000000 0.000000
0.000000 1.000000 0.000000
Grab Result: 0
Reading input from device ... (interrupt to exit)

from twofing.

Plippo avatar Plippo commented on August 18, 2024

ID seems right. Strange that xinput set-int-prop 6 "Evdev Axis Calibration" 32 0 20000 0 20000 does not work. It should at least change the twofing output so that the Calibration line would read "Calibration: MinX: 0; MaxX: 20000; MinY: 0; MaxY: 20000"

from twofing.

dschugha avatar dschugha commented on August 18, 2024

Sorry, didn´t realize that I have to execute xinput set-int-pro before, so this is complete output

pi@raspberrypi:~ $ xinput set-int-prop 6 "Evdev Axis Calibration" 32 0 20000 0 20000
pi@raspberrypi:~ $ twofing --debug /dev/input/event0
twofing, the two-fingered daemon
Version 0.1.5.20200913

Input device name: "raspberrypi-ts"
XInput device id is 6.
XInput device id for calibration is 6.
Start calibration
No valid axis inversion data found, assuming no inversion.
No valid axes swap data found, assuming no swap.
Calibration: MinX: 0; MaxX: 20000; MinY: 0; MaxY: 20000
Invert X Axis: No
Invert Y Axis: No
Swap Axes: No
Calibration Matrix: 1.000000 0.000000 0.000000
0.000000 1.000000 0.000000
Grab Result: 0
Reading input from device ... (interrupt to exit)

from twofing.

dschugha avatar dschugha commented on August 18, 2024

I made an other test

pi@raspberrypi:~ $ sudo su
root@raspberrypi:/home/pi# DISPLAY=:0.0 xinput_calibrator
Calibrating EVDEV driver for "raspberrypi-ts" id=6
current calibration values (from XInput): min_x=0, max_x=20000 and min_y=0, max_y=20000

Doing dynamic recalibration:
Setting calibration data: 90, 20971, 455, 19983
--> Making the calibration permanent <--
copy the snippet below into '/etc/X11/xorg.conf.d/99-calibration.conf' (/usr/share/X11/xorg.conf.d/ in some distro's)
Section "InputClass"
Identifier "calibration"
MatchProduct "raspberrypi-ts"
Option "Calibration" "90 20971 455 19983"
Option "SwapAxes" "0"
EndSection

When I do put his in /usr/share/X11/xorg.conf.d/99-calibration.conf Raspberry fails to start "startx"

from twofing.

Plippo avatar Plippo commented on August 18, 2024

So it seems that twofing picks up your calibration, which is good. If it works correctly after you set the calibration values using xinput you can then try to make it permanent using xorg.conf or xorg.conf.d, as you tried. I can't really say why startx doesn't work after you have created the configuration file, maybe there is some error in the file. Maybe you find some information in the output of startx or in the log file /var/log/Xorg.0.log (notice the capital X).

from twofing.

dschugha avatar dschugha commented on August 18, 2024

xorg.conf.d is a directory /usr/share/X11/xorg.conf.d/. Does it matter in which configfile I do put the configuration?

from twofing.

Plippo avatar Plippo commented on August 18, 2024

Yes xorg.conf.d is a directory. Just add any file to that directory. The file name doesn't really matter as long as it ends with ".conf". All ".conf" files in this directory are processed in alphabetical order.

from twofing.

dschugha avatar dschugha commented on August 18, 2024

This is very impotant for me to know! So I made some new tests. After:
sudo apt-get install xserver-xorg-input-evdev
there is a new config file
/usr/share/X11/xorg.conf.d/10-evdev.conf
I did reboot and everything is OK. Now I did create
/usr/share/X11/xorg.conf.d/20-twofing.conf
and startx had not been possible any more after reboot.
Did delete 20-twofing.conf and everything was OK with startx after reboot.
So I don´t understand really what is so dangerous by this calibration entries and what to test next.

from twofing.

Plippo avatar Plippo commented on August 18, 2024

If there is an error in the config file and X cannot parse it, it won't start. I don't know what the error is as I'm no wizard, but I have written you the path to the log file before. When X doesn't start, you can look into the log file or you can try to call startx on the command line to see if there is any output.

from twofing.

dschugha avatar dschugha commented on August 18, 2024

I am new with Raspberry Pi so I am happy about every tip I can get. If X ist started by system there is logfile /var/log/Xorg.0.log. If Raspberry Pi starts and is not able to start X I am in CLI as user pi. If startx then the logfile /home/pi/.local/share/xorg/Xorg.0.log is used. This was confusing for me.

Think I found now a usefull log. There are every time after starting twofing and touch screen entries:
[ 474.640] (EE) BUG: triggered 'if (!iclients)'
[ 474.640] (EE) BUG: ../../../../Xi/exevents.c:1329 in RetrieveTouchDeliveryData()
[ 474.640] (EE)
[ 474.640] (EE) Backtrace:
[ 474.640] (EE)

Please see complete log:
Xorg.0.log

from twofing.

Plippo avatar Plippo commented on August 18, 2024

Well, this looks like a bug in the driver. There's no parsing error to be found but it just crashes.
If the config file makes problems, you can always use xinput to set the calibration. With your values this would be
xinput set-int-prop 6 "Evdev Axis Calibration" 32 90 20971 455 19983
But this has to be performed after every boot. Maybe you can create a script for it that is then executed after every boot.
But to be honest, that is something that has nothing to do with twofing, so maybe you find better help in a Raspberry Pi forum. As I don't own a Raspberry Pi I'm not really an expert in this area.

from twofing.

dschugha avatar dschugha commented on August 18, 2024

Now it twofing works for me. I did make a silly mistake in config file. In your documentation is written
MatchProduct "{{ put your device name here, get it with xinput list }}"
and made
MatchProduct "{{ raspberrypi-ts }}"
Unfortunatly X-Windows didn´t show me a clear error message. After removing the { } twofing is working. At start it reflects the real size of my small display
Input device name: "raspberrypi-ts"
XInput device id is 6.
XInput device id for calibration is 6.
Start calibration
No calibration data found, use default values.
Calibration: MinX: 0; MaxX: 799; MinY: 0; MaxY: 479
...
Thank you very much for your help !!!

from twofing.

mgrouch avatar mgrouch commented on August 18, 2024

I use this script (run as root) to fix the issue (followed by reboot):


if [ -L /dev/twofingtouch ]
then
  MATCH_PRODUCT=$(udevadm info -a -n /dev/twofingtouch | grep "ATTRS{name}" | sed -e 's#.*=="##' -e 's#"$##')
  bash -c 'cat << EOF > /usr/share/X11/xorg.conf.d/90-touchinput.conf
Section "InputClass"
    Identifier "calibration"
    Driver "evdev"
    MatchProduct "'"${MATCH_PRODUCT}"'"
    MatchDevicePath "/dev/input/event*"
    Option "EmulateThirdButton" "1"
    Option "EmulateThirdButtonTimeout" "750"
    Option "EmulateThirdButtonMoveThreshold" "30"
EndSection
EOF'
fi


from twofing.

Plippo avatar Plippo commented on August 18, 2024

I updated the readme file to reduce the confusion. Closing issue.

from twofing.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.