Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Solved: 5inch HDMI LCD touch is inverted
#1
So after hours of searching i don't know what to try.

I used https://www.waveshare.com/wiki/5inch_HDMI_LCD for a new set-up, due to the lack of room I had to turn the screen 180°.

I added the line: dtoverlay=ads7846,penirq=25,xmin=120,xmax=3960,ymin=300,ymax=3900,speed=50000, to /boot/firmware/config.txt, to make touch work.

And video=HDMI-A-1:800x480M@60,rotate=180 to cmdline.txt, to turn the screen 180*

Now I have the problem that the cursor is on the correct position, but upside down and the position of a click is inverted. If I want to click the m I have to click on in the opposite corner. I tried adding invx and invy which did not work. I also tried inverting xmin xmax values, which just inverted the position of the cursor.

Other setup Rpi 3b+, moode 9.1.4
Reply
#2
Saeniv, take a look at this thread https://moodeaudio.org/forum/showthread.php?tid=7079 and see if it applies. I suggest trying to fix this with only the X11 solution to see if that works for you.
Michael

RPi4 —> HiFiBerry DAC+ —> Rotel RA01 —> Celestion DL8
Reply
#3
Code:
DISPLAY=:0 xrandr --output HDMI-1 --rotate left

Turns the display.

and editing the line in, /usr/share/X11/xorg.conf.d/40-libinput.conf, turns the touch

Code:
Section "InputClass"
       Identifier "libinput touchscreen catchall"
        MatchIsTouchscreen "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
        Option "CalibrationMatrix" "-1 0 1 0 -1 1 0 0 1"
EndSection

According to a lot of threads, editing the ~/.xinitrc should make the screen rotation permanent, but it get ignored. Is there another way to execute
DISPLAY=:0 xrandr --output HDMI-1 --rotate left at every boot
Reply
#4
So i edited the  /home/moode/.xinitrc, xintric is hidden, with ls -a, you can make it visible, with:


Code:
    # Set HDMI/DSI screen orientation
HDMI_SCN_ORIENT=$(moodeutl -q "SELECT value FROM cfg_system WHERE param='hdmi_scn_orient'")
DSI_SCN_TYPE=$(moodeutl -q "SELECT value FROM cfg_system WHERE param='dsi_scn_type'")
DSI_PORT=$(moodeutl -q "SELECT value FROM cfg_system WHERE param='dsi_port'")
DSI_SCN_ROTATE=$(moodeutl -q "SELECT value FROM cfg_system WHERE param='dsi_scn_rotate'")
if [ $DSI_SCN_TYPE = 'none' ]; then
    if [ $HDMI_SCN_ORIENT = "landscape" ]; then
        DISPLAY=:0 xrandr --output HDMI-1 --rotate inverted
    fi


and then inverted the Input Matrix in /usr/share/X11/xorg.conf.d/40-libinput.conf

Last thing missing is the calibration of the x and y touch coordinates.

When i finally read the actual code instead of doing what seems to work for others solved the problem.
Reply


Forum Jump: