RenWal
Posts: 9
Joined: Thu Apr 11, 2013 2:00 pm

Touch is missing the lower part of the screen

Thu Feb 15, 2018 7:48 pm

Hi!
I've just received the official touchscreen and spent some hours today getting the touch function to work properly - but to no avail.
Here's the issue: The lower 100 pixels cannot be reached by the mouse pointer because the calibration seems off. When I touch the upper part of the screen, the mouse pointer matches my finger position quite well, but the lower I touch the display the worse the alignment becomes. The mouse pointer is progressively more above my finger position, so I can't reach the bottom of the screen with the mouse pointer even I touch it there.

Using xdotool getmouselocation i found the maximum coordinates I can reach to be 800x380.
Overscan is disabled in raspi-config and tvservice -s shows 800x480 as the current resolution.
Disconnecting all other hardware does not solve the issue.
The image is raspbian stretch 2017-11-29 and apt shows all packages up to date. I am on the latest stable firmware.

Any ideas as to what I am missing here?

Regards,
René

User avatar
Imperf3kt
Posts: 1017
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: Touch is missing the lower part of the screen

Thu Feb 15, 2018 9:11 pm

As you suspected: you need to calibrate the screen.

Install xinput_calibrator
User experiencing technical difficulties.

RenWal
Posts: 9
Joined: Thu Apr 11, 2013 2:00 pm

Re: Touch is missing the lower part of the screen

Thu Feb 15, 2018 10:03 pm

Thanks!

Simply calibrating solved the issue. I didn't do that because the raspberrypi.org troubleshooting page didn't mention it and I've read many times that "there is no calibration function because the touchscreen is calibrated at the factory". Also, I found the mismatch of exactly 100 pixels confusing, thinking I must have made a configuration mistake somewhere.

Anyway, it works now so thanks a lot! (I also had to install xsserver-xorg-input-evdev because with libinput the calibration did not take effect.)

dustinshah
Posts: 1
Joined: Thu Feb 22, 2018 3:35 pm

Re: Touch is missing the lower part of the screen

Thu Feb 22, 2018 7:26 pm

After doing an rpi-update, my original 7 inch touch screen misses the lower part of the screen. After hours of searching and trying to fix, finally touch screen came back to normal after I revert rpi-update.

here is what i did:
sudo apt-get install --reinstall raspberrypi-kernel

basically it gets back to the latest stable version of rpi-update

User avatar
ab1jx
Posts: 636
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Re: Touch is missing the lower part of the screen

Sat Feb 24, 2018 1:43 am

Imperf3kt wrote:
Thu Feb 15, 2018 9:11 pm
As you suspected: you need to calibrate the screen.

Install xinput_calibrator
Dumb question probably but and then what? I created the xorg.conf section /usr/shar/X11/xorg.conf.f/99-tcal.conf
which looks like

Code: Select all

Section "InputClass"
        Identifier      "calibration"
        MatchProduct    "FT5406 memory based driver"
        Option  "MinX"  "335"
        Option  "MaxX"  "65487"
        Option  "MinY"  "1445"
        Option  "MaxY"  "52690"
        Option  "SwapXY"        "0" # unless it was already set to 1
        Option  "InvertX"       "0"  # unless it was already set
        Option  "InvertY"       "0"  # unless it was already set
EndSection
and rebooted, no difference. Are we supposed to use a different method of utilizing the calibration data?

For newbies and because it's difficult to work on the thing without being able to actually type on it yet, I created this script in /usr/local/bin/ did a chmod +x on it, then ran it from an ssh session from another machine:

Code: Select all

#!/bin/bash
DISPLAY=:0.0 xinput_calibrator -v --geometry 800x480 --no-timeout
Oh, and you should see something like this
tscreencal.png
tscreencal.png (3.55 KiB) Viewed 1852 times
It comes up with 1 cross in the upper left corner, you click on that and another appears. Do 4 of them and the program exits.

Gotta find a stylus, I tried a pen and it didn't work.

I can't reach about the bottom 3/4 inch of the screen, including the taskbar. I got rxvt open only because I have an icon on the desktop.
ss_2018-02-23_19-58.png
ss_2018-02-23_19-58.png (77.14 KiB) Viewed 1850 times
Oh, is that an overscan problem around the sides? I see it on other machines too. It goes away locally once that area has been repainted. I have a normal taskbar on the Pi I'm typing on because I've clicked on stuff there. Can't reach it on the machine with the 7" display. The top and sides on this machine look the same.

Oh, but a VNC session looks like that too, that doesn't sound like overscan, never mind.

I see in a VNC session that there's a GUI calibrate touchscreen option, I'd only launched it from a script. I can't access my menu. Maybe that puts the calibration data in the right place. Maybe I should switch window managers temporarily to get my menu up top.

User avatar
Imperf3kt
Posts: 1017
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: Touch is missing the lower part of the screen

Sat Feb 24, 2018 9:10 am

ab1jx wrote:
Sat Feb 24, 2018 1:43 am
Imperf3kt wrote:
Thu Feb 15, 2018 9:11 pm
As you suspected: you need to calibrate the screen.

Install xinput_calibrator
Dumb question probably but and then what?
And then you read the readme on how to use xinput calibrator?
User experiencing technical difficulties.

User avatar
ab1jx
Posts: 636
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Re: Touch is missing the lower part of the screen

Sat Feb 24, 2018 3:54 pm

Imperf3kt wrote:
Sat Feb 24, 2018 9:10 am
And then you read the readme on how to use xinput calibrator?
Oh? There's a readme somewhere? No, I've only read the xinput_calibrator man page. This seems to be a case of terrible documentation. My display came from Element14 with a cumbersome multipage multilanguage "safety guide" at the end of which, in the English section, are 2 lines saying go to www.element14.com/PiDisplay for instructions on how to assemble it. I did that, registered so I could read them, and at the end is this:
PiDisplay_stp9.jpg
PiDisplay_stp9.jpg (161.77 KiB) Viewed 1816 times
and there's nothing obvious at https://www.raspberrypi.org/downloads/ about the display at all.

For shame, for a display that costs almost twice as much as a Pi I would expect better documentation. Maybe I'm spoiled by having bought a small Adafruit display a few years ago, for much less money, for which there's this very complete PDF on how to get it working. https://learn.adafruit.com/downloads/pd ... rry-pi.pdf They went to the trouble of setting up multiple images you could download or directly downloading the device-specific files to get it working. I spend $60 and buy the official display from the educational RPI Foundation and I'm left googling how to get it set up. There's no mention of a readme anywhere.

OK, rant over. It seems to be a question of getting X to recognize my calibration data, giving it the right name, having the sequence number right, the right identifier. In /usr/share/X11/xorg.conf.d I have this as 01-input.conf:

Code: Select all

Section "InputClass"
#        Identifier      "calibration"
Identifier "libinput touchscreen catchall"
        MatchProduct    "FT5406 memory based driver"
        Option  "MinX"  "335"
        Option  "MaxX"  "65487"
        Option  "MinY"  "1445"
        Option  "MaxY"  "52690"
        Option  "SwapXY"        "0" # unless it was already set to 1
        Option  "InvertX"       "0"  # unless it was already set
        Option  "InvertY"       "0"  # unless it was already set
EndSection
I don't know if the sequence number is important, I also have a 10-evdev.conf in the same directory. Maybe the calibration data has to be after that in the sequence. The last time I did much with xorg.conf files they were all 1 file.

My Xorg.log.0 looks like this:

Code: Select all

[    16.919] 
X.Org X Server 1.18.4
Release Date: 2016-07-19
[    16.919] X Protocol Version 11, Revision 0
[    16.919] Build Operating System: Linux 4.4.26-v7+ armv7l Raspbian
[    16.919] Current Operating System: Linux pi2 4.14.20-v7+ #1094 SMP Mon Feb 19 15:14:31 GMT 2018 armv7l
[    16.919] Kernel command line: 8250.nr_uarts=0 bcm2708_fb.fbwidth=800 bcm2708_fb.fbheight=480 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
[    16.919] Build Date: 11 November 2016  11:59:59AM
[    16.919] xorg-server 2:1.18.4-2+rpi1 (https://www.debian.org/support) 
[    16.919] Current version of pixman: 0.33.3
[    16.919] 	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
[    16.919] Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[    16.919] (==) Log file: "/var/log/Xorg.0.log", Time: Sat Feb 24 08:40:32 2018
[    16.973] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[    16.991] (==) No Layout section.  Using the first Screen section.
[    16.991] (==) No screen section available. Using defaults.
[    16.991] (**) |-->Screen "Default Screen Section" (0)
[    16.991] (**) |   |-->Monitor "<default monitor>"
[    16.998] (==) No device specified for screen "Default Screen Section".
	Using the first device section listed.
[    16.998] (**) |   |-->Device "Allwinner A10/A13 FBDEV"
[    16.998] (==) No monitor specified for screen "Default Screen Section".
	Using a default monitor configuration.
[    16.998] (==) Automatically adding devices
[    16.998] (==) Automatically enabling devices
[    16.998] (==) Automatically adding GPU devices
[    16.998] (==) Max clients allowed: 256, resource mask: 0x1fffff
[    17.037] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
[    17.037] 	Entry deleted from font path.
[    17.064] (==) FontPath set to:
	/usr/share/fonts/X11/misc,
	/usr/share/fonts/X11/100dpi/:unscaled,
	/usr/share/fonts/X11/75dpi/:unscaled,
	/usr/share/fonts/X11/Type1,
	/usr/share/fonts/X11/100dpi,
	/usr/share/fonts/X11/75dpi,
	built-ins
[    17.064] (==) ModulePath set to "/usr/lib/xorg/modules"
[    17.064] (II) The server relies on udev to provide the list of input devices.
	If no devices become available, reconfigure udev or disable AutoAddDevices.
[    17.064] (II) Loader magic: 0x68ef20
[    17.064] (II) Module ABI versions:
[    17.064] 	X.Org ANSI C Emulation: 0.4
[    17.064] 	X.Org Video Driver: 20.0
[    17.064] 	X.Org XInput driver : 22.1
[    17.064] 	X.Org Server Extension : 9.0
[    17.067] (++) using VT number 7

[    17.067] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[    17.067] (II) no primary bus or device found
[    17.070] (II) LoadModule: "glx"
[    17.078] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[    17.160] (II) Module glx: vendor="X.Org Foundation"
[    17.160] 	compiled for 1.18.4, module version = 1.0.0
[    17.160] 	ABI class: X.Org Server Extension, version 9.0
[    17.160] (==) AIGLX enabled
[    17.160] (II) LoadModule: "fbturbo"
[    17.160] (II) Loading /usr/lib/xorg/modules/drivers/fbturbo_drv.so
[    17.166] (II) Module fbturbo: vendor="X.Org Foundation"
[    17.166] 	compiled for 1.18.4, module version = 0.5.1
[    17.166] 	Module class: X.Org Video Driver
[    17.166] 	ABI class: X.Org Video Driver, version 20.0
[    17.166] (II) FBTURBO: driver for framebuffer: fbturbo
[    17.172] (WW) Falling back to old probe method for fbturbo
[    17.172] (II) Loading sub module "fbdevhw"
[    17.172] (II) LoadModule: "fbdevhw"
[    17.172] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so
[    17.183] (II) Module fbdevhw: vendor="X.Org Foundation"
[    17.183] 	compiled for 1.18.4, module version = 0.0.2
[    17.183] 	ABI class: X.Org Video Driver, version 20.0
[    17.183] (II) FBTURBO(0): using /dev/fb0
[    17.183] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[    17.183] (II) FBTURBO(0): Creating default Display subsection in Screen section
	"Default Screen Section" for depth/fbbpp 24/32
[    17.183] (==) FBTURBO(0): Depth 24, (==) framebuffer bpp 32
[    17.184] (==) FBTURBO(0): RGB weight 888
[    17.184] (==) FBTURBO(0): Default visual is TrueColor
[    17.184] (==) FBTURBO(0): Using gamma correction (1.0, 1.0, 1.0)
[    17.184] (II) FBTURBO(0): hardware: BCM2708 FB (video memory: 1500kB)
[    17.184] (**) FBTURBO(0): Option "fbdev" "/dev/fb0"
[    17.184] (**) FBTURBO(0): Option "SwapbuffersWait" "true"
[    17.184] (II) FBTURBO(0): processor: Unknown
[    17.184] (II) FBTURBO(0): checking modes against framebuffer device...
[    17.184] (II) FBTURBO(0): checking modes against monitor...
[    17.184] (--) FBTURBO(0): Virtual size is 800x480 (pitch 800)
[    17.184] (**) FBTURBO(0):  Built-in mode "current"
[    17.184] (==) FBTURBO(0): DPI set to (96, 96)
[    17.184] (II) Loading sub module "fb"
[    17.184] (II) LoadModule: "fb"
[    17.185] (II) Loading /usr/lib/xorg/modules/libfb.so
[    17.195] (II) Module fb: vendor="X.Org Foundation"
[    17.195] 	compiled for 1.18.4, module version = 1.0.0
[    17.195] 	ABI class: X.Org ANSI C Emulation, version 0.4
[    17.195] (==) Depth 24 pixmap format is 32 bpp
[    17.219] (II) FBTURBO(0): using backing store heuristics
[    17.225] (II) FBTURBO(0): can't load 'g2d_23' kernel module
[    17.225] (II) FBTURBO(0): failed to enable the use of sunxi display controller
[    17.225] (II) FBTURBO(0): No sunxi-g2d hardware detected (check /dev/disp and /dev/g2d)
[    17.225] (II) FBTURBO(0): G2D hardware acceleration can't be enabled
[    17.225] (II) FBTURBO(0): enabled fbdev copyarea acceleration
[    17.225] (==) FBTURBO(0): Backing store enabled
[    17.254] (==) FBTURBO(0): DPMS enabled
[    17.255] (II) FBTURBO(0): failed to enable hardware cursor
[    17.255] (II) FBTURBO(0): no 3D acceleration because the driver has been compiled without libUMP
[    17.255] (II) FBTURBO(0): if this is wrong and needs to be fixed, please check ./configure log
[    17.268] (==) RandR enabled
[    17.314] (II) SELinux: Disabled on system
[    17.326] (II) AIGLX: Screen 0 is not DRI2 capable
[    17.326] (EE) AIGLX: reverting to software rendering
[    20.381] (II) AIGLX: enabled GLX_MESA_copy_sub_buffer
[    20.384] (II) AIGLX: Loaded and initialized swrast
[    20.384] (II) GLX: Initialized DRISWRAST GL provider for screen 0
[    20.901] (II) config/udev: Adding input device FT5406 memory based driver (/dev/input/event0)
[    20.901] (**) FT5406 memory based driver: Applying InputClass "calibration"
[    20.901] (**) FT5406 memory based driver: Applying InputClass "evdev touchscreen catchall"
[    20.901] (**) FT5406 memory based driver: Applying InputClass "libinput touchscreen catchall"
[    20.901] (**) FT5406 memory based driver: Applying InputClass "calibration"
[    20.901] (II) LoadModule: "libinput"
[    20.903] (II) Loading /usr/lib/xorg/modules/input/libinput_drv.so
[    20.934] (II) Module libinput: vendor="X.Org Foundation"
[    20.934] 	compiled for 1.18.4, module version = 0.20.0
[    20.934] 	Module class: X.Org XInput Driver
[    20.934] 	ABI class: X.Org XInput driver, version 22.1
[    20.934] (II) Using input driver 'libinput' for 'FT5406 memory based driver'
[    20.934] (**) FT5406 memory based driver: always reports core events
[    20.934] (**) Option "Device" "/dev/input/event0"
[    20.935] (**) Option "_source" "server/udev"
[    20.935] (II) input device 'FT5406 memory based driver', /dev/input/event0 is tagged by udev as: Touchscreen
[    20.936] (II) input device 'FT5406 memory based driver', /dev/input/event0 is a touch device
[    20.970] (**) Option "config_info" "udev:/sys/devices/virtual/input/input0/event0"
[    20.970] (II) XINPUT: Adding extended input device "FT5406 memory based driver" (type: TOUCHSCREEN, id 6)
[    20.971] (**) Option "AccelerationScheme" "none"
[    20.971] (**) FT5406 memory based driver: (accel) selected scheme none/0
[    20.971] (**) FT5406 memory based driver: (accel) acceleration factor: 2.000
[    20.971] (**) FT5406 memory based driver: (accel) acceleration threshold: 4
[    20.972] (II) input device 'FT5406 memory based driver', /dev/input/event0 is tagged by udev as: Touchscreen
[    20.972] (II) input device 'FT5406 memory based driver', /dev/input/event0 is a touch device
[    20.972] (II) config/udev: Adding input device FT5406 memory based driver (/dev/input/mouse0)
[    20.972] (**) FT5406 memory based driver: Applying InputClass "calibration"
[    20.972] (**) FT5406 memory based driver: Applying InputClass "calibration"
[    20.972] (II) No input driver specified, ignoring this device.
[    20.972] (II) This device may have been added with another device file.
[   134.349] (II) config/udev: Adding input device bluetooth iPazzport (/dev/input/event1)
[   134.349] (**) bluetooth iPazzport: Applying InputClass "evdev pointer catchall"
[   134.349] (**) bluetooth iPazzport: Applying InputClass "evdev keyboard catchall"
[   134.349] (**) bluetooth iPazzport: Applying InputClass "libinput pointer catchall"
[   134.349] (**) bluetooth iPazzport: Applying InputClass "libinput keyboard catchall"
[   134.350] (II) Using input driver 'libinput' for 'bluetooth iPazzport'
[   134.350] (**) bluetooth iPazzport: always reports core events
[   134.350] (**) Option "Device" "/dev/input/event1"
[   134.350] (**) Option "_source" "server/udev"
[   134.351] (II) input device 'bluetooth iPazzport', /dev/input/event1 is tagged by udev as: Keyboard Mouse
[   134.351] (II) input device 'bluetooth iPazzport', /dev/input/event1 is a pointer caps
[   134.351] (II) input device 'bluetooth iPazzport', /dev/input/event1 is a keyboard
[   134.390] (II) libinput: bluetooth iPazzport: needs a virtual subdevice
[   134.390] (**) Option "config_info" "udev:/sys/devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:11/0005:0A5C:8502.0001/input/input1/event1"
[   134.390] (II) XINPUT: Adding extended input device "bluetooth iPazzport" (type: MOUSE, id 7)
[   134.391] (**) Option "AccelerationScheme" "none"
[   134.391] (**) bluetooth iPazzport: (accel) selected scheme none/0
[   134.391] (**) bluetooth iPazzport: (accel) acceleration factor: 2.000
[   134.391] (**) bluetooth iPazzport: (accel) acceleration threshold: 4
[   134.392] (II) input device 'bluetooth iPazzport', /dev/input/event1 is tagged by udev as: Keyboard Mouse
[   134.392] (II) input device 'bluetooth iPazzport', /dev/input/event1 is a pointer caps
[   134.392] (II) input device 'bluetooth iPazzport', /dev/input/event1 is a keyboard
[   134.392] (**) bluetooth iPazzport: Applying InputClass "evdev pointer catchall"
[   134.393] (**) bluetooth iPazzport: Applying InputClass "evdev keyboard catchall"
[   134.393] (**) bluetooth iPazzport: Applying InputClass "libinput pointer catchall"
[   134.393] (**) bluetooth iPazzport: Applying InputClass "libinput keyboard catchall"
[   134.393] (II) Using input driver 'libinput' for 'bluetooth iPazzport'
[   134.393] (**) bluetooth iPazzport: always reports core events
[   134.393] (**) Option "Device" "/dev/input/event1"
[   134.393] (**) Option "_source" "_driver/libinput"
[   134.393] (II) libinput: bluetooth iPazzport: is a virtual subdevice
[   134.393] (**) Option "config_info" "udev:/sys/devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/hci0:11/0005:0A5C:8502.0001/input/input1/event1"
[   134.393] (II) XINPUT: Adding extended input device "bluetooth iPazzport" (type: KEYBOARD, id 8)
[   134.393] (**) Option "xkb_model" "pc101"
[   134.393] (**) Option "xkb_layout" "us"
[   134.393] (**) Option "xkb_options" "terminate:ctrl_alt_bksp"
[   134.478] (II) config/udev: Adding input device bluetooth iPazzport (/dev/input/mouse1)
[   134.478] (II) No input driver specified, ignoring this device.
[   134.478] (II) This device may have been added with another device file.
[   251.703] (II) config/udev: removing device bluetooth iPazzport
[   251.707] (II) UnloadModule: "libinput"
[   251.707] (II) config/udev: removing device bluetooth iPazzport
[   251.745] (II) UnloadModule: "libinput"
I had my iPazzport in my pocket and it made a quick substitute keyboard and mouse since it was all paired with this Pi.

X seems to be picking up the "FT5406 memory based driver" but then there's "No input driver specified, ignoring this device.". It doesn't ignore the device, it ignores the calibration. After saying 'FT5406 memory based driver: Applying InputClass "calibration"'. Does an identifer in my calibration file have to match my evdev identifiers? That's why I changed it. I also have a 99-calibration.conf symlink pointing to my 01-input.conf file, which is probably why it's in the log twice. I still can't get my pointer within 3/4 inch of the bottom of the touchscreen. Horizontal seems mostly OK, I'm only off about 1/8 inch there. The calibration made no difference at all, which tells me something isn't connecting the data with the device.

User avatar
DougieLawson
Posts: 33053
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Touch is missing the lower part of the screen

Sat Feb 24, 2018 5:58 pm

ab1jx wrote:
Sat Feb 24, 2018 3:54 pm
Imperf3kt wrote:
Sat Feb 24, 2018 9:10 am
And then you read the readme on how to use xinput calibrator?

I don't know if the sequence number is important, I also have a 10-evdev.conf in the same directory. Maybe the calibration data has to be after that in the sequence. The last time I did much with xorg.conf files they were all 1 file.
... I also have a 99-calibration.conf symlink pointing to my 01-input.conf file, which is probably why it's in the log twice. I still can't get my pointer within 3/4 inch of the bottom of the touchscreen. Horizontal seems mostly OK, I'm only off about 1/8 inch there. The calibration made no difference at all, which tells me something isn't connecting the data with the device.
You can't do it that way. The calibration file must be the last configuration file read by X11.

Delete the symlink and your 01-* file and save the output from xinput_calibrator as /usr/share/X11/xorg.conf.d/99-xinput.conf
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

User avatar
ab1jx
Posts: 636
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Re: Touch is missing the lower part of the screen

Sun Feb 25, 2018 4:58 am

Hmm, no matter what I do the calibration file doesn't get read. My MaxY value was 52621 and I changed it to 62621 as a test, couldn't see a difference. Where the pointer stops when I drag it down the screen should have changed by 15%, that should be a noticeable change. Nothing happened.

Looking around I've seen in some places the calibration is given on one line like Option "Calibration" "119 3736 3850 174" (and there it's an option) and in others the identifier is calibration and there are separate lines for MinX, MinY, etc. I don't know if all those possibilities could still work or if I'm hitting old documentation.

Yes, I had a 99-fbturbo.conf and I didn't know if having two 99 somethings was legit but I moved that to 98. Put the calibration as 99-calibration.conf, got rid of the 01-input.conf. It could just be an ASCII sort but evidently order matters.

The Adafruit display had 2 calibration programs, a command line one you ran first, then xinput_calibrator. But I think their display is usable at a command line too, that's why. It's too small to be of much actual use so it mostly stays unplugged. The command line calibration was evidently something they wrote, I didn't try it on this.

I ran xinput_calibrator again, no significant difference. But at the top of the screen it shows the values that are currently in effect, they aren't working. Adafruit warns you to delete the old conf file before you run it gain, here the values are 0 and 65535 anyway. Like it's not reading the file.
ss_2018-02-24_20-57.png
ss_2018-02-24_20-57.png (84.66 KiB) Viewed 1782 times
Played around with evemu-record a little and put this in my notes:

Code: Select all

The screen should be 480 high.  If I tap about in the middle vertically of
the task bar (aka something else: system tray?) I can see a Y reading of 479
or 480, below that it doesn't read a Y value at all.  But that area is only
about 1/8 inch high.

Trying to drag the cursor down the screen it stops at at least 3 times this
height.  So there's maybe more than 1 thing involved here.  Being able to
read a touch and being able to put the cursor there.
My 99-calibration.conf looks reasonably textbook other than the comments;

Code: Select all

# from a fresh run 2/24/2018, still no stylus
Section "InputClass"
        Identifier "calibration"
        MatchProduct    "FT5406 memory based driver"
#       Option "Calibration" "335 65487 1445 52690"
        Option  "MinX"  "826"
        Option  "MaxX"  "64996"
        Option  "MinY"  "831"
#        Option  "MaxY"  "52621"
# experiment:
        Option  "MaxY"  "62621"
        Option  "SwapXY"        "0" # unless it was already set to 1
        Option  "InvertX"       "0"  # unless it was already set
        Option  "InvertY"       "0"  # unless it was already set
EndSection
But, hmm, will these permissions work? I'm not sure how they got set this way although I do normally log in as root.

Code: Select all

-rw-r--r-- 1 root root 1099 Sep 24  2016 10-evdev.conf
-rw-r--r-- 1 root root 1350 Nov 11  2016 10-quirks.conf
-rw-r--r-- 1 root root  788 Sep 30  2016 40-libinput.conf
-rw-r--r-- 1 root root 1753 Jun  1  2016 70-synaptics.conf
-rw-r--r-- 1 root root  607 Dec  7  2016 98-fbturbo.conf
-rw-r--r-- 1 root root  742 Feb 24 22:01 99-calibration.conf
Anything/anybody can read them but only root can change them. Nobody can execute.

Latest xlog

Code: Select all

[    20.456] (II) config/udev: Adding input device FT5406 memory based driver (/dev/input/event0)
[    20.456] (**) FT5406 memory based driver: Applying InputClass "evdev touchscreen catchall"
[    20.456] (**) FT5406 memory based driver: Applying InputClass "libinput touchscreen catchall"
[    20.456] (**) FT5406 memory based driver: Applying InputClass "calibration"
[    20.456] (**) FT5406 memory based driver: Applying InputClass "calibration"
[    20.456] (II) LoadModule: "libinput"
[    20.461] (II) Loading /usr/lib/xorg/modules/input/libinput_drv.so
[    20.488] (II) Module libinput: vendor="X.Org Foundation"
[    20.488] 	compiled for 1.18.4, module version = 0.20.0
[    20.488] 	Module class: X.Org XInput Driver
[    20.488] 	ABI class: X.Org XInput driver, version 22.1
[    20.488] (II) Using input driver 'libinput' for 'FT5406 memory based driver'
[    20.488] (**) FT5406 memory based driver: always reports core events
[    20.488] (**) Option "Device" "/dev/input/event0"
[    20.488] (**) Option "_source" "server/udev"
[    20.489] (II) input device 'FT5406 memory based driver', /dev/input/event0 is tagged by udev as: Touchscreen
[    20.489] (II) input device 'FT5406 memory based driver', /dev/input/event0 is a touch device
[    20.530] (**) Option "config_info" "udev:/sys/devices/virtual/input/input0/event0"
[    20.530] (II) XINPUT: Adding extended input device "FT5406 memory based driver" (type: TOUCHSCREEN, id 6)
[    20.530] (**) Option "AccelerationScheme" "none"
[    20.531] (**) FT5406 memory based driver: (accel) selected scheme none/0
[    20.531] (**) FT5406 memory based driver: (accel) acceleration factor: 2.000
[    20.531] (**) FT5406 memory based driver: (accel) acceleration threshold: 4
[    20.531] (II) input device 'FT5406 memory based driver', /dev/input/event0 is tagged by udev as: Touchscreen
[    20.531] (II) input device 'FT5406 memory based driver', /dev/input/event0 is a touch device
[    20.532] (II) config/udev: Adding input device FT5406 memory based driver (/dev/input/mouse0)
[    20.532] (**) FT5406 memory based driver: Applying InputClass "calibration"
[    20.532] (**) FT5406 memory based driver: Applying InputClass "calibration"
[    20.532] (II) No input driver specified, ignoring this device.
[    20.532] (II) This device may have been added with another device file.
What's with those last 2 lines???

User avatar
Imperf3kt
Posts: 1017
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: Touch is missing the lower part of the screen

Sun Feb 25, 2018 8:02 am

Yes, there is a readme, it is here:
http://github.com/tias/xinput_calibrato ... 7.5/README
Usage:
------
Simply run:
xinput_calibrator
You can find this information on the github for xinput calibrator:
https://github.com/tias/xinput_calibrator

From there, all I did when calibrating my touchscreen, was touch all four points and then save the file it gave me.

Here is a guide:
https://www.thingsconnected.io/raspberr ... libration/
Note: I didn't do the

Code: Select all

sudo apt-get install libx11-dev libxext-dev libxi-dev x11proto-input-dev 
as it was already installed apparently.
User experiencing technical difficulties.

User avatar
ab1jx
Posts: 636
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Re: Touch is missing the lower part of the screen

Sun Feb 25, 2018 3:35 pm

I'm talking about a readme for the display, it seems like the seller has some obligation to provide instructions. I'd used xinput_calibrator before, downloaded the whole source tarball (master.zip) yesterday to look through. I have an Adafruit 2.8 inch display I bought for my Raspberry Pi model B a few years ago.
pitft_working.jpg
pitft_working.jpg (74.02 KiB) Viewed 1733 times
Their instructions are a lot better. The display is too small to be very useful though.

Their instructions have you use xinput_calbrator, and evtest, but also some software that they wrote: tslib, ts_test, ts_calibrate. xinput_calibrator is the last step.

I'm having trouble with the calibration file not being read. If you go to /usr/share/X11/xorg.conf.d and do an ls -la do the permissions on the files look like this?

Code: Select all

-rw-r--r-- 1 root root 1099 Sep 24  2016 10-evdev.conf
-rw-r--r-- 1 root root 1350 Nov 11  2016 10-quirks.conf
-rw-r--r-- 1 root root  788 Sep 30  2016 40-libinput.conf
-rw-r--r-- 1 root root 1753 Jun  1  2016 70-synaptics.conf
-rw-r--r-- 1 root root  607 Dec  7  2016 98-fbturbo.conf
-rw-r--r-- 1 root root  742 Feb 24 22:01 99-calibration.conf
They should be readable but if something tries to open them read/write or maybe tries to stat() them it could conceivably fail.

I just tried moving my 99-calibration.conf completely out of that directory and rebooted, it made no difference. The file isn't being read. Like this: https://raspberrypi.stackexchange.com/q ... -pi-zero-w

They also make use of stmpe_ts in the kernel modules. But their display is SPI, it doesn't connect to the DSI connector. I'm not sure what stmpe_ts is for. There seem to be a number of calibration posts, I'll look through some. Like this viewtopic.php?f=41&t=74896 Well, the stmpe_ts seems to be for a particular ST Microelectronics controller chip looking at this: https://elixir.bootlin.com/linux/latest ... stmpe-ts.c Probably not applicable to this situation.

User avatar
ab1jx
Posts: 636
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Re: Touch is missing the lower part of the screen

Mon Feb 26, 2018 12:17 am

I finally fixed it using a calibration matrix. Apparently libinput breaks the older xinput_calibrator method. If evtest shows that your screen looks right by that, but you still can't reach part of your screen then you're in the same boat I was.

First of all make sure overscan isn't turned on in raspi-config (under advanced). There's kernel level scaling (evdev, evtest & ts_calibrate) and scaling in X (libinput) at a higher level.

I ran evtest or anything that showed raw events and by slowly dragging my finger onto the screen at all 4 edges then stopping and looking at the X or Y coordinate of that edge they were right. The official Pi display is 800 x 480 pixels, you should see those numbers (actually 799 and 479). If those numbers are wrong and you just need to scale them try ts_calibrate. To make those corrections permanent see the evdev man page under Option "Calibration".

My numbers were right but my pointer still wouldn't reach the bottom 1/4 of my screen. It could have to do with pixel shape or something but it was just wrong. See the libinput man page. A calibration matrix wasn't making sense to me until you consider that they apply to all 3 dimensions even though you're probably only worried about 2. It's a 3x3 matrix so there are 9 numbers. I found an article that made sense at https://wiki.archlinux.org/index.php/Ta ... ouchscreen and used the spreadsheet linked from it. I could download it in Libre Office format and while I was playing with it my matrix got generated.

I could just run this:

Code: Select all

#!/bin/bash
xinput set-prop "FT5406 memory based driver" --type=float 'Coordinate Transformation Matrix' 1 0 0 0 1.28803856583308 0 0 0 1
and see the change immediately. I had dug out my digital calipers and measured in mm so in my case this is accurate to at least 3 significant figures. To make the matrix permanent (from the libinput man page) edit /usr/share/X11/xorg.conf.d/40-libinput.conf and in the section under "libinput touchscreen catchall" add (with your real matrix instead)

Code: Select all

Option "CalibrationMatrix" "1 0 0 0 1.28803856583308 0 0 0 1"
save and reboot. The change takes effect before the login screen so it helps even that.

Return to “Official Foundation Display”

Who is online

Users browsing this forum: No registered users and 3 guests