Calibration of touch screen not working? cant load `sudo DISPLAY=:0.0 xinput_calibrator`

Hi All

I’m trying to calibrate my touchscreen but i cant seem to get any further than this: at the moment the cursor pointer on my screen is mixed up, if i go left it goes down, if i go right it goes up. Also it does not point to where i touch!

Volumio Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
volumio@dark-horse-audio:~$ sudo apt-get install xserver-xorg-input-evdev
Reading package lists… Done
Building dependency tree
Reading state information… Done
xserver-xorg-input-evdev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 23 not upgraded.
volumio@dark-horse-audio:~$ sudo apt-get install -y xinput-calibrator
Reading package lists… Done
Building dependency tree
Reading state information… Done
xinput-calibrator is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 23 not upgraded.
volumio@dark-horse-audio:~$ sudo display
[sudo] password for volumio:
sudo: display: command not found
volumio@dark-horse-audio:~$ sudo diplay=:0.0 xinput_calibrator
Unable to connect to X server
volumio@dark-horse-audio:~$ sudo su display=:0.0 xinput_calibrator
No passwd entry for user ‘display=:0.0’
volumio@dark-horse-audio:~$

i either get unable to connect to x server or no passwd entry for user.

i am following this advice:

Calibration of the touch function of displays is beyond the scope of the plugin IMHO. But according to the Waveshare wiki you should be able to calibrate your display with the following steps:

Install xserver-xorg-input-evdev and xinput-calibrator:
sudo apt-get install xserver-xorg-input-evdev
sudo apt-get install -y xinput-calibrator

Then run
sudo DISPLAY=:0.0 xinput_calibrator

After following the calibration procedure the generated calibration data will be displayed in the terminal. Copy or write down these values and open /etc/X11/xorg.conf.d/99-calibration.conf:
sudo nano /etc/X11/xorg.conf.d/99-calibration.conf

Look for the line beginning with Option "Calibration" and subsitute the calibration data with the new values you copied before.

Press the Ctrl+X then Y to save 99-calibration.conf.

Then reboot.

im using the newest version of volumio on my raspberry pi 4 and a 1920x480 touch screen.

Typo “diplay”.

Also Linux is case sensitive. Should ‘display’ be ‘DISPLAY’?

I tried all variations and corrected the spelling mistake i still get the same thing.

Why post the incorrectly spelled version then; it doesn’t make it any easier to problem solve :weary:

Can you confirm that you actually typed:

sudo DISPLAY=:0.0 xinput_calibrator

and got the error you showed above?

1 Like

Try to run the command without “sudo”:

DISPLAY=:0 xinput_calibrator

1 Like

Beat me to it :wink:

volumio@dark-horse-audio:~$ DISPLAY=:0 xinput_calibrator
Calibrating standard Xorg driver “wch.cn USB2IIC_CTP_CONTROL”
current calibration values: min_x=0, max_x=65535 and min_y=0, max_y=6553 5
If these values are estimated wrong, either supply it manually with the --precalib option, or run the ‘get_precalib.sh’ script to automatically get it ( through HAL).
volumio@dark-horse-audio:~$

ok that worked but does not allow me to calibrate on the screen?

sorry about that! Yes typed it all correctly

now i’ve never done this before an only started this project a few weeks ago! Just learning as i go along and reading forums.

I thought my screen would come up with something like a calibration screen which i tap 4 times and it gives me codes to use?

Do you have the Touch Screen plugin installed? I have very little experience with adding screens to Volumio, but it seems to me that you will need some sort of display manager running to calibrate anything graphically.

Edit: I think I might bow out and let the more experienced offer advice here :).

1 Like

Yes its all installed and plugged in working, the touch screen works just cant use it as the pointer is all over the place, needs calibrating so it knows where its pointing to when i touch the screen

Actually it was your advice from github im following!

Seems to be wrong then (regarding the use of “sudo”) :wink:

When you run xinput_calibrator do you see the calibration screen at all?

I decided to reset everything and start again! We finally got there, the calibration screen came up. Now i just need to figure out the next part.

Volumio Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
volumio@dark-horse-audio:~$ sudo apt-get install xinput
Reading package lists… Done
Building dependency tree
Reading state information… Done
xinput is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 23 not upgraded.
volumio@dark-horse-audio:~$ DISPLAY=:0 xinput_calibrator
Calibrating standard Xorg driver “wch.cn USB2IIC_CTP_CONTROL”
current calibration values: min_x=0, max_x=65535 and min_y=0, max_y=65535
If these values are estimated wrong, either supply it manually with the --precalib option, or run the ‘get_precalib.sh’ script to automatically get it (through HAL).
→ 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 “wch.cn USB2IIC_CTP_CONTROL”
Option “MinX” “8172”
Option “MaxX” “8195”
Option “MinY” “131161”
Option “MaxY” “131525”
Option “SwapXY” “1” # unless it was already set to 1
Option “InvertX” “0” # unless it was already set
Option “InvertY” “0” # unless it was already set
EndSection
volumio@dark-horse-audio:~$

after a reset and starting again it finally worked. Now i get the results what does one do now?

Highlight the results in the terminal your are working on. Then

sudo nano /etc/X11/xorg.conf.d/99-calibration.conf

The nano editor opens. Now paste the copied results into the nano.

Hit Ctrl+x, y and Enter. Reboot.

Which part do i highlight?

This one:

Section “InputClass”
Identifier “calibration”
MatchProduct “[wch.cn](http://wch.cn) USB2IIC_CTP_CONTROL”
Option “MinX” “8172”
Option “MaxX” “8195”
Option “MinY” “131161”
Option “MaxY” “131525”
Option “SwapXY” “1” # unless it was already set to 1
Option “InvertX” “0” # unless it was already set
Option “InvertY” “0” # unless it was already set
EndSection

You could copy it also from here of course :wink:

1 Like

ok done, now it wont move from the login screen :roll_eyes: even when i log into from the app on my phone,

So, the UI isn’t shown on the screen?

Please post the results of

ls -al /usr/share/X11/xorg.conf.d

ls -al /etc/X11/xorg.conf.d

cat /etc/X11/xorg.conf.d/99-calibration.conf

1 Like