Waveshare DSI LCD displays

@Mark_Bastard, did @Wheaten s’ fix work for display rotation?
I am also highly interested in those drivers. :slight_smile:

Hi @Lyzards , no it didn’t work unfortunately.

@Wheaten the script doesn’t work, I think maybe it’s running too early so we need to hook it to wait for a different event rather than network being up.

If I run the script manually after everything is booted and the screen is already showing, it works.

./scripts/startup.sh

I’m thinking it’s best to dive deeper into how the plugin launches chromium and ensure that command runs at the correct time. It may even be that it has to run after chromium launches, like maybe it only works once a GUI process has launched and wouldn’t work for the CLI, so it’s running before the GUI has started. There’s no point in the bootup process where the CLI login prompt rotates.

By the way I received approval to share the drivers from Waveshare!
5.10.92-32.zip (33.3 KB)

Mods, if you want proof of approval I can send a screenshot of the email or forward you the email. Just let me know.

2 Likes

Okay, it’s a hack but I got something working. I modified /opt/volumiokiosk.sh as follows. I added the line starting with xrandr below

#!/bin/bash
while true; do timeout 3 bash -c "</dev/tcp/127.0.0.1/3000" >/dev/null 2>&1 && break; done
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' /data/volumiokiosk/Default/Preferences
sed -i 's/"exit_type":"Crashed"/"exit_type":"None"/' /data/volumiokiosk/Default/Preferences
if [ -L /data/volumiokiosk/SingletonCookie ]; then
  rm -rf /data/volumiokiosk/Singleton*
fi
openbox-session &
xrandr --output DSI-1 --rotate left &
while true; do
  /usr/bin/chromium-browser \
    --simulate-outdated-no-au='Tue, 31 Dec 2099 23:59:59 GMT' \
    --force-device-scale-factor=1 \
    --disable-pinch \
    --kiosk \
    --no-first-run \
    --noerrdialogs \
    --disable-3d-apis \
    --disable-breakpad \
    --disable-crash-reporter \
    --disable-infobars \
    --disable-session-crashed-bubble \
    --disable-translate \
    --user-data-dir='/data/volumiokiosk'     http://localhost:4004
done

I then changed this to make it happen before the openbox-session line and it still worked. Therefore I believe if I can get it to run immediately before this script it’ll probably work.
I didn’t need to export DISPLAY=:0 as that is only needed in an SSH session.

I’m assuming there’s a way to run things in certain orders in services.


EDIT:

Alright, I’ve finally nailed it.

You don’t need the service at all. Volumio seems to use something called openbox for its GUI, and it allows you to make a user specific autostart script.

mkdir /home/volumio/.config/openbox
nano /home/volumio/.config/openbox/autostart
#add in the following line and save
xrandr --output DSI-1 --rotate left
# rotate right if you want the screen orientated the other way for some reason
#

So the high level steps are:

  • Install volumio and the touch_display plugin normally
  • Install the custom driver I attached above as per the wiki instructions
  • Follow my guide to create the openbox autostart file above
  • Reboot and it should be working and horizontal

Thanks to everyone for their help, this ended up being a pretty clean way to get it working so I won’t need to return the screen. I’m otherwise very happy with the screen so that’s a win! In particular compared to the HDMI one I don’t need to worry about cables going out in such a way it’d ruin having a very slim profile. The case I’m going to make will have its entire front be just this screen.

Please let me know if it’s worth making another thread as a ‘guide’ or a wiki page or something else, so that in future people can follow a simple guide rather than trawling through the thread.

Cheers

1 Like

Here is my final guide on how to get Waveshare DSI monitors to work on Volumio.

My Gear (for reference)

  • Raspberry Pi 4B
  • Waveshare 7.9 inch DSI screen (not HDMI).

Base Installation
Install Volumio and Touch Display plugin. Optionally install Now Playing plugin (allows more customisation to make the screen nicer).
Go to volumio web interface and change the URL to have /dev at the top, and enable SSH.
Reboot volumio. You’ll note that the screen is still permanently turned off. If yours is somehow working, don’t bother with the further instructions as you have a different screen to mine.

Driver Installation
Download these drivers 5.10.92-32.zip (33.3 KB) which are not currently available publically.
Unzip the files as volumio doesn’t seem to have unzip installed.
SCP these to your volumio instance with the following command

scp /path/to/unzipped/files/* volumio@your.volumio.ip.address:~

This should copy them into your home holder on volumio, so now you can login:

ssh volumio@your.volumio.ip.address

Run the driver installation files

sudo bash ./WS_xinchDSI_Main.sh 7_9inch I2C0

Note you can change those last two parameters if you have a different screen or have changed the touch screen jumpers for some reason. Valid options are:

SCREEN_TYPE: 2_8inch, 4inch, 7inch, 9inch, 10_1inch, 7_9inch, 11_9inch
I2C_TYPE: I2C0, I2C1

Now reboot either through the volumio interface or because you’re already SSH’d into a terminal type reboot now

Now when it boots you should see first a terminal with some white text asking to login, but after a while you should see volumio appear on the screen, but it will be rotated the wrong way. This is because by default the screen is in portrait not landscape.

Correcting the screen orientation
I found that the settings in the Touch_Screen plugin did not work, so ignore them. Volumio seems to use a package called openbox to create its GUI, and it allows a simple per-user startup script, so let’s create one.

First make the folder in question
mkdir /home/volumio/.config/openbox

Now let’s make the startup file.
nano /home/volumio/.config/openbox/autostart

Type in the following line. Change ‘left’ to ‘right’ if you want it orientated the other way.
xrandr --output DSI-1 --rotate left

Reboot once more, and now when it starts it should work just right!

Bonus: Now Playing plugin settings
If you like the way I’ve got mine setup I’ll share how I made it this way by changing some settings in the Now Playing plugin. Note that I’m deliberately not using touch controls, I plan to make a HiFi style streamer and I don’t want people touching the screen. I have the android app for managing what’s playing and only want my screen to show what song is currently playing.

Text Styles:
  Font Sizes: Custom
  Title: 40px
  Artist: 36px
  Album: 30px
  Sample Rate: 20px
  Alignment (Horizontal): Center
  Alignment (Vertical): Spread

Widget Styles
  Widget Visibility: Custom
  Playback Buttons: Off
  Seek Bar: Off

Album Art
  Show Album Art: On
  Album Art Size: Custom
  Width: 400px
  Height: 400px
  Album Art Fit: Contain

Background
  Background Type: Volumio Background
  Image: myvinyl.jpg
  Image Fit: Fill
  Image Position: Center
  Background Overlay: Custom (Gradient)
  Gradient CSS: linear-gradient(to right, rgba(0,0,0,1), rgba(0,0,0,0.5))

Dock Component Menu
  Enabled: Off

Dock Component - Action Panel Trigger
  Enabled: Off

Volumio Kiosk (Local Display)
  Enable this. It makes this external screen show 'Now Playing' instead of the default 'Touch Screen' UI

Please if anyone follows this guide please let me know it works. I am doing it from memory after a lot of trial and error!

3 Likes

great to see it working, Make a note for yourself to add this line again when updating “Touch Display”

1 Like

@Mark_Bastard great work and write-up!
Everything is working!
Thanks a lot!

P.s. For those interested in correct touch screen orientation (270 deg in @Mark_Bastard case) don’t forget to add following line in userconfig.txt

dtoverlay=WS_xinchDSI_Touch,invertedx,swappedxy

3 Likes

@Wheaten
/home/volumio/.config/openbox/autostart should persist through updates I think?

No I don’t think so.
Openbox is part of the Touch Display (host the chromium kiosk)

Hi, Guys!

I made a small mod to drivers installation files/folders to better streamline installation process for 7.9" display without necessity of second reboot and adding configs/overlays to userconfig.txt rather than config.txt

5.10.92-32-mod.zip (35.0 KB)

Rotation of the screen is in “right” direction, which for me is more comfortable, and corresponds to pictures of my setup above.

More details in README_MOD.txt

I hope it will be useful for other members and I didn’t make too much of a mess. ;p

All credits to Waveshare, @Mark_Bastard and Volumio community.

3 Likes

well done guys! this is how a community should work!

2 Likes

It is works!!! Folks, have no words… You did so great work!
Looks like will have spare 7.9" HDMI display which is on shipment to me. :slight_smile:

1 Like

So your son doesn’t get it anymore :crazy_face:

He will get it. Will make for additional screen with hardware parameters etc. :wink:
But I get that much cheaper. :sunglasses:

It’s good to see what the community can accomplish when working together.
And credits for Waveshare, delivering the needed drivers for an older kernel.

2 Likes

Hi Mark
After installing as in your description I got to this stage… But nothing happened on the screen. With the Webbrowser I have access to the Volumio.
Any tips from you how the see volumio on the screen?

Seems you didn’t install the touch display plugin.

1 Like

Thanks, Touch Display Plugin 3.3.5 is installed and enabled, System booted several times
System is RP3

try re-installing the touch plugin.
otherwise take a older version of the plugin.

1 Like

Heartfelt thanks to Mark. I have followed your guide step by step and got a big success. I could not find any other post or blog or website with such clear guidelines to help me set up this 7.9 inch widescreen with Volumio3. Many thanks again.

1 Like

Hi!
I also had problems installing the 11.9inch DSI LCD 320 x 1480: https://www.waveshare.com/wiki/11.9inch_DSI_LCD
in Volumio and here I found a solution. Now the display works fine with Volumio, thanks.

However, there is a problem with the Peppymeter plugin: despite many attempts, the plugin does not work.

Do you also have this problem on DSI displays?