Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Touch input needs rotation with xinput command. Unable to get command to auto-start on boot

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
hellomrmeseeks
Posts: 10
Joined: 2022-05-20 19:07
Has thanked: 2 times

Touch input needs rotation with xinput command. Unable to get command to auto-start on boot

#1 Post by hellomrmeseeks »

As the title suggests, I need to rotate the touch input on a DSI display.

I am successful in rotating the input with

Code: Select all

xinput set-prop 'seeed-tp' 'Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 1
Entered into the terminal.

I have tried:

Code: Select all

sudo crontab -e
and adding

Code: Select all

@reboot /bin/sleep 120; /usr/bin/xinput set-prop 'seeed-tp' 'Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 1
to the end and this does not work. I have to open terminal and type it in.

I have tried:

Code: Select all

sudo nano /etc/rc.local
and making the end look iike this:

Code: Select all

fi
/usr/bin/xinput set-prop 'seeed-tp' ''Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 1
exit 0
this does not work.

I have tried:

Code: Select all

sudo nano /home/pi/.bashrc
and adding

Code: Select all

  fi
fi

sudo xinput set-prop 'seeed-tp' 'Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 1 >
to the end of that file. This does not work.

I have also tried CREATING AN .xsessionrc and placing it in my /home/pi

The only thing in that file is:

Code: Select all

xinput set-prop 'seeed-tp' 'Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 1
This aldo does not work.

I am using LXDE-PI and I saw somewhere that I am also using Llightdm.
This image: https://downloads.raspberrypi.org/raspi ... ull.img.xz

I don't know what to do. Any help would be appreciated.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Touch input needs rotation with xinput command. Unable to get command to auto-start on boot

#2 Post by Head_on_a_Stick »

hellomrmeseeks wrote: 2022-05-20 19:27I have also tried CREATING AN .xsessionrc and placing it in my /home/pi

The only thing in that file is:

Code: Select all

xinput set-prop 'seeed-tp' 'Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 1
This aldo does not work.
That method works in Debian but...
hellomrmeseeks wrote: 2022-05-20 19:27I am using LXDE-PI
You're not using Debian. Are you lost? :mrgreen:

An X.Org configuration file should work with anything running X so try that.
deadbang

hellomrmeseeks
Posts: 10
Joined: 2022-05-20 19:07
Has thanked: 2 times

Re: Touch input needs rotation with xinput command. Unable to get command to auto-start on boot

#3 Post by hellomrmeseeks »

Raspberry Pi OS with desktop
Release date: April 4th 2022
System: 64-bit
Kernel version: 5.15
Debian version: 11 (bullseye)
Anyway...

I am not sure where to place this x.org file. And do I just put in that file:

Code: Select all

xinput set-prop 'seeed-tp' 'Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 1
?

edit. I created a file called x.org and placed it in /home/pi/ and put the above line in there. It did not work. So if that was correct, that too didn't work.
Last edited by hellomrmeseeks on 2022-05-20 21:26, edited 1 time in total.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Touch input needs rotation with xinput command. Unable to get command to auto-start on boot

#4 Post by Head_on_a_Stick »

Read xorg.conf(5).

And I don't care what your quoted text says but Raspberry Pi OS is not the same as Debian. You're not even running a bullseye kernel version FFS... :roll:
deadbang

hellomrmeseeks
Posts: 10
Joined: 2022-05-20 19:07
Has thanked: 2 times

Re: Touch input needs rotation with xinput command. Unable to get command to auto-start on boot

#5 Post by hellomrmeseeks »

After a bit of reading and more googling, apparantly I need to create that xorg.conf file.

My limited knowledge and smooth brain figured that I need to reboot to CLI and then:

Code: Select all

Xorg :1 -configure
That didn't work and it popped out an Xorg.1.log
[ 87.287]
X.Org X Server 1.20.11
X Protocol Version 11, Revision 0
[ 87.295] Build Operating System: linux Debian
[ 87.301] Current Operating System: Linux raspberrypi 5.15.32-v8+ #1538 SMP PREEMPT Thu Mar 31 19:40:39 BST 2022 aarch64
[ 87.301] Kernel command line: coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 smsc95xx.macaddr=E4:5F:01:3E:98:F5 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 console=ttyS0,115200 console=tty1 root=PARTUUID=37a83bab-02 rootfstype=ext4 fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles logo.nologo vt.global_cursor_default=0 console=tty3 loglevel=0
[ 87.319] Build Date: 04 January 2022 10:24:42AM
[ 87.322] xorg-server 2:1.20.11-1+rpt1+deb11u1 (https://www.debian.org/support)
[ 87.323] Current version of pixman: 0.40.0
[ 87.325] Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
[ 87.325] Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[ 87.330] (==) Log file: "/var/log/Xorg.1.log", Time: Fri May 20 16:20:31 2022
[ 87.330] (II) Loader magic: 0x555a8e1e28
[ 87.330] (II) Module ABI versions:
[ 87.330] X.Org ANSI C Emulation: 0.4
[ 87.330] X.Org Video Driver: 24.1
[ 87.330] X.Org XInput driver : 24.1
[ 87.330] X.Org Server Extension : 10.0
[ 87.332] (--) using VT number 2

[ 87.332] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[ 87.335] (II) xfree86: Adding drm device (/dev/dri/card1)
[ 87.351] (II) xfree86: Adding drm device (/dev/dri/card0)
[ 87.351] (II) no primary bus or device found
[ 87.351] falling back to /sys/devices/platform/gpu/drm/card1
[ 87.353] List of video drivers:
[ 87.355] amdgpu
[ 87.356] ati
[ 87.357] fbturbo
[ 87.358] nouveau
[ 87.359] radeon
[ 87.360] modesetting
[ 87.362] fbdev
[ 87.363] vesa
[ 87.363] (II) LoadModule: "amdgpu"
[ 87.363] (II) Loading /usr/lib/xorg/modules/drivers/amdgpu_drv.so
[ 87.372] (II) Module amdgpu: vendor="X.Org Foundation"
[ 87.372] compiled for 1.20.9, module version = 19.1.0
[ 87.372] Module class: X.Org Video Driver
[ 87.372] ABI class: X.Org Video Driver, version 24.1
[ 87.372] (II) LoadModule: "ati"
[ 87.372] (II) Loading /usr/lib/xorg/modules/drivers/ati_drv.so
[ 87.373] (II) Module ati: vendor="X.Org Foundation"
[ 87.373] compiled for 1.20.9, module version = 19.1.0
[ 87.373] Module class: X.Org Video Driver
[ 87.373] ABI class: X.Org Video Driver, version 24.1
[ 87.373] (II) LoadModule: "fbturbo"
[ 87.373] (II) Loading /usr/lib/xorg/modules/drivers/fbturbo_drv.so
[ 87.374] (II) Module fbturbo: vendor="X.Org Foundation"
[ 87.374] compiled for 1.20.11, module version = 0.5.1
[ 87.374] Module class: X.Org Video Driver
[ 87.375] ABI class: X.Org Video Driver, version 24.1
[ 87.375] (II) LoadModule: "nouveau"
[ 87.375] (II) Loading /usr/lib/xorg/modules/drivers/nouveau_drv.so
[ 87.378] (II) Module nouveau: vendor="X.Org Foundation"
[ 87.378] compiled for 1.20.10, module version = 1.0.17
[ 87.378] Module class: X.Org Video Driver
[ 87.378] ABI class: X.Org Video Driver, version 24.1
[ 87.379] (II) LoadModule: "radeon"
[ 87.379] (II) Loading /usr/lib/xorg/modules/drivers/radeon_drv.so
[ 87.387] (II) Module radeon: vendor="X.Org Foundation"
[ 87.387] compiled for 1.20.9, module version = 19.1.0
[ 87.387] Module class: X.Org Video Driver
[ 87.387] ABI class: X.Org Video Driver, version 24.1
[ 87.387] (II) LoadModule: "modesetting"
[ 87.387] (II) Loading /usr/lib/xorg/modules/drivers/modesetting_drv.so
[ 87.389] (II) Module modesetting: vendor="X.Org Foundation"
[ 87.389] compiled for 1.20.11, module version = 1.20.11
[ 87.389] Module class: X.Org Video Driver
[ 87.389] ABI class: X.Org Video Driver, version 24.1
[ 87.389] (II) LoadModule: "fbdev"
[ 87.389] (II) Loading /usr/lib/xorg/modules/drivers/fbdev_drv.so
[ 87.390] (II) Module fbdev: vendor="X.Org Foundation"
[ 87.390] compiled for 1.20.0, module version = 0.5.0
[ 87.390] Module class: X.Org Video Driver
[ 87.390] ABI class: X.Org Video Driver, version 24.0
[ 87.390] (II) LoadModule: "vesa"
[ 87.390] (II) Loading /usr/lib/xorg/modules/drivers/vesa_drv.so
[ 87.391] (II) Module vesa: vendor="X.Org Foundation"
[ 87.391] compiled for 1.20.9, module version = 2.5.0
[ 87.391] Module class: X.Org Video Driver
[ 87.391] ABI class: X.Org Video Driver, version 24.1
[ 87.391] (WW) Falling back to old probe method for fbturbo
[ 87.391] (WW) Falling back to old probe method for modesetting
[ 87.391] (WW) Falling back to old probe method for fbturbo
[ 87.393] No devices to configure. Configuration failed.
[ 87.393] (EE) Server terminated with error (2). Closing log file.
Additionally I tried to manually create an xorg.conf file and place it in my /etc/X11 file, and I put that xinput command in there, and I could no longer boot. That seems like a very picky file.

Any further suggestions or perhaps you could hold this noobs hand and show me an example of what this xorg.conf file should look like to perform the task that I am trying to perform?

User avatar
NorthEast
Posts: 349
Joined: 2018-11-18 04:35
Has thanked: 12 times
Been thanked: 30 times

Re: Touch input needs rotation with xinput command. Unable to get command to auto-start on boot

#6 Post by NorthEast »

Perhaps try placing your file in: /usr/share/X11/xorg.conf.d/50-your_file.conf. Check the other files there and the xorg.conf manpage for format. Adjust the number to your preference.

hellomrmeseeks
Posts: 10
Joined: 2022-05-20 19:07
Has thanked: 2 times

Re: Touch input needs rotation with xinput command. Unable to get command to auto-start on boot

#7 Post by hellomrmeseeks »

Thank you for your suggestion.

I navigated to /usr/share/X11/xorg.conf.d/ and created a 50-rotate.conf

In that file i placed:

Code: Select all

Section "InputClass"
	Identifier	"calibration"
	MatchProduct	"seeed-tp"
	Option "TransformationMatrix" "1 0 0 0 1 0 0 0 1"
EndSection
This does not work.

In that folder I noticed a file called "40-libinput.conf"

I saw a section that looked like this:

Code: Select all

Section "InputClass"
        Identifier "libinput touchscreen catchall"
        MatchIsTouchscreen "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
	Option "TransformationMatrix" "0 -1 1 1 0 0 0 0 1"
EndSection
I changed the "TransformationMatrix" "0 -1 1 1 0 0 0 0 1" to "TransformationMatrix" "1 0 0 0 1 0 0 0 1"

This also did not work.

I found an application called "xinput_calibrator.desktop"

After running that program it popped out this:

Code: Select all

Calibrating standard Xorg driver "seeed-tp"
	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	"seeed-tp"
	Option	"MinX"	"657"
	Option	"MaxX"	"65646"
	Option	"MinY"	"-1085"
	Option	"MaxY"	"66938"
	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 did that, and even THAT didn't work.

Is there some other way to make xinput set-prop 'seeed-tp' 'Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 1 type itself into the terminal and execute?

hellomrmeseeks
Posts: 10
Joined: 2022-05-20 19:07
Has thanked: 2 times

Re: Touch input needs rotation with xinput command. Unable to get command to auto-start on boot

#8 Post by hellomrmeseeks »

UPDATE:

The transformation matrix is automatically applying... however it only applies the moment I open the terminal and ONLY when the terminal opens. I tried starting from scratch and doing

Code: Select all

xinput list-props 'seeed-tp' 
and I noticed that the matrix was correct. I tried the touch screen and it was OK.

I rebooted and it was not applied, but the moment I clicked on the terminal, the touch was calibrated.

WHAT THE HELL!!!?!?!

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Touch input needs rotation with xinput command. Unable to get command to auto-start on boot

#9 Post by Head_on_a_Stick »

hellomrmeseeks wrote: 2022-05-23 19:59the moment I clicked on the terminal, the touch was calibrated.

WHAT THE HELL!!!?!?!
That's because the xinput line in ~/.bashrc is run every time the terminal is opened.

What have the folks on the Raspberry Pi OS forums said about this? They probably have a better idea of how their operating system works than we do.
deadbang

hellomrmeseeks
Posts: 10
Joined: 2022-05-20 19:07
Has thanked: 2 times

Re: Touch input needs rotation with xinput command. Unable to get command to auto-start on boot

#10 Post by hellomrmeseeks »

Thats why I am here TBH, no answer over there.

I re-flashed with a fresh image and tried the same tricks and they don't work, the input does not change when the terminal is opened any longer.
2022-04-04-raspios-bullseye-arm64.img
I'm not using your typical Raspberry Pi. I am using a CM4 with a custom board with a DSI display.

https://wiki.seeedstudio.com/reTerminal ... r-other-os

I am using this thing. TBH major disappointment. I have tried Kali linux - Cant get the DSI to work, I have tried Ubuntu, cant get the DSI to work.

There is a "custom" raspberry pi OS image that they "suggest" you install, but when I install that image, I get no audio out from Pithos and VLC, but I DO get audio from Firefox.
2021-06-02-Raspbian-reTerminalx64.img
Every image I try has SOME thing that does not work. Either the Display doesn't work or the touch doesn't work or the audio doesn't work.

FFS and the Seeed forums are growing spiderwebs

olTechie
Posts: 1
Joined: 2022-05-26 15:54
Been thanked: 1 time

Re: Touch input needs rotation with xinput command. Unable to get command to auto-start on boot

#11 Post by olTechie »

Not sure about the audio issues, but you can restore your reTerminal to the factory state (Buster) using the files here https://wiki.seeedstudio.com/reTerminal ... reterminal

There does not currently seem to be any way to use the reTerminal with Bullseye. Even if you get the touchscreen rotated correctly, it has strange behavior including changing to portrait when you tilt the unit, odd issues with external screens, other oddities. Looks like a major update will be needed.

hellomrmeseeks
Posts: 10
Joined: 2022-05-20 19:07
Has thanked: 2 times

Re: Touch input needs rotation with xinput command. Unable to get command to auto-start on boot

#12 Post by hellomrmeseeks »

I wouldn't call turning to portrait on rotation "strange" behavior... as an "android" like device, I would want It to auto-rotate.

I do get what you are saying though. I think it's odd that the device is advertised that you can use other linux distros, but you actually can't.

Post Reply