Thank you for your donation!


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


Solved: Waveshare DSI 7.9 Touch display on Moode 9
#1
Hi
just upgraded to latest Moode 9.0 release. Unfortunately my solution for running a local Waveshare DSI 7.9 display on 8.3.9 is not working anymore.

But here is the solution to make it working again:

The necessary LCD drivers are now included in the Bookworm release, no need to install drivers Smile

Just need to enable it in /boot/firmware/config.txt

Code:
$ sudo nano /boot/firmware/config.txt
insert
Code:
dtoverlay=vc4-kms-dsi-waveshare-panel,7_9_inch
and save.
Since this display has portrait orientation one need to change it for boot messages:
Edit /boot/firmware/cmdline.txt
Code:
$ sudo nano /boot/firmware/cmdline.txt
insert this in front of the command line:
Code:
video=HDMI-1:d video=HDMI-2:d video=DSI-1:400x1280e,rotate=270
save it. after a reboot boot messages appears in landscape orientation.

Now one need to tell X11 the same. Edit .xinitrc in the home directory:
Code:
$ cd
$ sudo nano .xinitrc
insert these lines:

Code:
# disable HDMI ports
xrandr --output HDMI-1 --off
xrandr --output HDMI-2 --off

#Force rotation for Waveshare
xrandr --output DSI-1 --rotate right --mode 400x1280

fbset --geometry 1280 400 1280 400 16

# Capture screen size
#SCREENSIZE="$(fbset -s | awk '$1 == "geometry" { print $2","$3 }')"
SCREENSIZE="1280,400"
Now after a reboot the local display will work as expected in landscape orientation.
Last thing to do is change the orientation of the touchscreen. Unfortunately this needs to be done in the xserver configuration.
First install libinput if not already there:
Code:
$ sudo apt-get install xserver-xorg-input-libinput
Then create a local config directory:
Code:
$ sudo mkdir /etc/X11/xorg.conf.d
Now copy over the template and edit the copied file:
Code:
$ sudo cp /usr/share/X11/xorg.conf.d/40-libinput.conf /etc/X11/xorg.conf.d/
$ sudo nano /etc/X11/xorg.conf.d/40-libinput.conf
insert the right option into the touchscreen section select from
#90°Right touch rotation: 
Option "CalibrationMatrix" "0 1 0 -1 0 1 0 0 1"

#180° Inverted touch rotation:
#Option "CalibrationMatrix" "-1 0 1 0 -1 1 0 0 1"
#270° Left rotation:
#Option "CalibrationMatrix" "0 -1 1 1 0 0 0 0 1"


The resulting section should look like:
Code:
Section "InputClass"
       Identifier "libinput touchscreen catchall"
       MatchIsTouchscreen "on"
       Option "CalibrationMatrix" "0 1 0 -1 0 1 0 0 1"
       MatchDevicePath "/dev/input/event*"
       Driver "libinput"
EndSection
Voilà one more reboot and every thing works as expected.

much joy with Waveshare 7.9 DSI Touch display!
Reply
#2
(05-31-2024, 03:36 PM)felix1024 Wrote: Hi
just upgraded to latest Moode 9.0 release. Unfortunately my solution for running a local Waveshare DSI 7.9 display on 8.3.9 is not working anymore.

But here is the solution to make it working again:

The necessary LCD drivers are now included in the Bookworm release, no need to install drivers Smile

Just need to enable it in /boot/firmware/config.txt

Code:
$ sudo nano /boot/firmware/config.txt
insert
Code:
dtoverlay=vc4-kms-dsi-waveshare-panel,7_9_inch
and save.
Since this display has portrait orientation one need to change it for boot messages:
Edit /boot/firmware/cmdline.txt
Code:
$ sudo nano /boot/firmware/cmdline.txt
insert this in front of the command line:
Code:
video=HDMI-1:d video=HDMI-2:d video=DSI-1:400x1280e,rotate=270
save it. after a reboot boot messages appears in landscape orientation
...
Hello Felix, thanks for your post, I have the same display (HDMI in Stealth V3) but cannot even get the console boot messages to work in landscape mode using those settings. Could you please post your complete cmdline.txt and config.txt ? I suspect I have something wrong, despite starting from 9.0.1 image.
Reply
#3
(06-04-2024, 06:27 AM)popeye65 Wrote:
(05-31-2024, 03:36 PM)felix1024 Wrote: Hi
just upgraded to latest Moode 9.0 release. Unfortunately my solution for running a local Waveshare DSI 7.9 display on 8.3.9 is not working anymore.

But here is the solution to make it working again:

The necessary LCD drivers are now included in the Bookworm release, no need to install drivers Smile

Just need to enable it in /boot/firmware/config.txt

Code:
$ sudo nano /boot/firmware/config.txt
insert
Code:
dtoverlay=vc4-kms-dsi-waveshare-panel,7_9_inch
and save.
Since this display has portrait orientation one need to change it for boot messages:
Edit /boot/firmware/cmdline.txt
Code:
$ sudo nano /boot/firmware/cmdline.txt
insert this in front of the command line:
Code:
video=HDMI-1:d video=HDMI-2:d video=DSI-1:400x1280e,rotate=270
save it. after a reboot boot messages appears in landscape orientation
...
Hello Felix, thanks for your post, I have the same display (HDMI in Stealth V3) but cannot even get the console boot messages to work in landscape mode using those settings. Could you please post your complete cmdline.txt and config.txt ? I suspect I have something wrong, despite starting from 9.0.1 image.
sorry my proposal will only work with this display https://www.waveshare.com/7.9inch-dsi-lcd.htm
(DSI interface) for HDMI other options are required. I don‘t have such display to check.
maybe the lcd_rotate parameter in config.txt will help.
I don‘t understand wath you mean with HDMI in Stealth V3?
Reply
#4
A big thank you to felix1024 for figuring this out and posting these instructions.
I did find some steps need a little clarification.

1) When editing .xinitrc file, the below 2 lines already exist, just need to add SCREENSIZE="1280,400" directly under.

# Capture screen size
#SCREENSIZE="$(fbset -s | awk '$1 == "geometry" { print $2","$3 }')"

2) no need to make a copy of the 40-libinput.conf file. I found you can edit it directly where it sits.

sudo nano /usr/share/X11/xorg.conf.d/40-libinput.conf
Reply
#5
Hello felix1024,

I have the HDMI version of your display: you may have seen in the forum's posts that the initialisation time of this HDMI screen takes more than one minute before displaying Moode. Is it also the same with your DSI display ?

Thank you in advance for the information you may give ?
Reply
#6
(08-27-2024, 06:19 AM)pkdick Wrote: Hello felix1024,

I have the HDMI version of your display: you may have seen in the forum's posts that the initialisation time of this HDMI screen takes more than one minute before displaying Moode. Is it also the same with your DSI display ?

Thank you in advance for the information you may give ?

Well With DSI in my setup, boot messages from Rasbian are immediately visible. 20 sec. later the login prompt appears, following a 10 sec. delay until Moode is starting.
Approximately 55 sec. from Power On Moode is ready.

This could be reduced by omit the login delay somehow. But also enable/connecting Wifi takes time and is needed to start web services. (even in local mode)

Usually I do not completely turn off Moode, just turn off display to standby.
Reply
#7
Look in the startup log and examine the time stamps to see whether a process is taking a long time to start.

ETA: 
My Pi-4 with 10" HDMI display takes 1 minute to get from power on to WebUI displayed on the screen.
With LocalUI OFF on that same system it takes 30 secs to get to WebUI displayed in Browser.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#8
Hi everyone,

Thanks @felix1024 for the wonderful hints on display configuration Smile


just used a slightly altered version of these settings to successfully configure and use a Waveshare 4inch 480 x 800 HMDI display in landscape mode (the display is by standard in portrait mode!). I use Moode on a Raspberry Pi 5, the display is attached via the HDMI port right beside of the USB C port.

I used in cmdline.txt the following code at the end of the line to shape the boot messages/ command line:

Code:
video=HDMI-A-1:480x800@60,rotate=90


And in .xinitrc I added the following lines:

Code:
#somewhere in the beginning before the browser commands are executed and before screensize is set
DISPLAY=:0 xrandr --output HDMI-1 --rotate left
fbset --geometry 800 480 800 480 16

#after the already present SCREENSIZE line
SCREENSIZE="800,480"


Remark:
  • all other attempts to set/rotate the screen via config.txt did not work (apparently this cannot be done in bookworm anymore)
  • I did not setup the touchscreen so far since I do not have the GPIO connections made yet
Cheers
Reply
#9
Hello felix1024
Glad to have found you
I have previously purchased the display Waveshare DSI 7.9
also I've try (see Thread" Problem: Waveshare 7.9" DSI - 400x1280@60Hz")
but without success
now  I tried to install the DSI display on MoOde 9.1.3 with your instruction , ..now with the integration over MoOde for drivers is more easy...
...and it all works I've see the output over dsi display after the first reboot before  X11 without mod over .xinitrc
the touchscreen work in coherence with the visualization ....

BUT all is rotated in reverse counter clockwise as can see by picture  (the same prob that I've see in past)

I've try to rotate 90 in clockwise but without success
rotate=0
rotate=90
rotate=180
rotate=270 
... any setting of the rotate parameter always leaves the display oriented to the left

what is the wrong..
Glad if anyone has any ideas about this


Attached Files Thumbnail(s)
   
Reply
#10
The rotate=xx command in /boot/firmware/cmdline.txt will only affect the system output while booting. Not the graphical output of X!

For rotating X the changes in .xinitrc are important! Following exactly the instructions in post #1 should configure X correctly.

The addition of libinput and configuration in 40-libinput.conf will adjust touchscreen accordingly.
Reply


Forum Jump: