qaz
Posts: 27
Joined: Fri Feb 22, 2019 6:09 pm

Show splash screen ASAP

Sun Sep 15, 2019 10:02 am

Hello,

I'd like to show splash screen as soon as possible at boot time (I'm using Raspbian Stretch Lite).
At the moment I'm using default Plymouth splash screen (using this guide: https://www.thedigitalpictureframe.com/ ... 9-version/)
And it takes around 14sec from power on to show up.
Compared to RetroPie splash screen that only takes 4sec to show.
Can anyone teach me how to do it?

Thanks in advance

qaz
Posts: 27
Joined: Fri Feb 22, 2019 6:09 pm

Re: Show splash screen ASAP

Sun Sep 15, 2019 3:38 pm

Shoud I have posted to a specific forum? :?

W. H. Heydt
Posts: 13309
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Show splash screen ASAP

Sun Sep 15, 2019 3:50 pm

qaz wrote:
Sun Sep 15, 2019 3:38 pm
Shoud I have posted to a specific forum? :?
No... But you should have waited a lot more than 5 hours before bumping your post.

User avatar
B.Goode
Posts: 10561
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Show splash screen ASAP

Sun Sep 15, 2019 3:59 pm

qaz wrote:
Sun Sep 15, 2019 3:38 pm
Shoud I have posted to a specific forum? :?


Everything you post goes in a specific forum of your choice.

In this case, Community -> General discussion.


If you feel it is more appropriate elsewhere, such as Operating Systems -> Raspbian, then use the Report This Post facility to ask a Moderator to relocate it. Don't duplicate it.

If your underlying concern is that you have not had a reply after 5 hours of waiting then be aware that most advice here comes from volunteer helpers donating their free time - maybe the person with the skill and inclination to help has not logged in yet. It is a weekend where I live.

(Pretty much what @whh said more pithily as I was writing this... )

qaz
Posts: 27
Joined: Fri Feb 22, 2019 6:09 pm

Re: Show splash screen ASAP

Sun Sep 15, 2019 4:24 pm

Thanks :)

dkeruza
Posts: 4
Joined: Thu Sep 19, 2019 3:02 pm

Re: Show splash screen ASAP

Thu Sep 19, 2019 3:03 pm

qaz wrote:
Sun Sep 15, 2019 10:02 am
Hello,

I'd like to show splash screen as soon as possible at boot time (I'm using Raspbian Stretch Lite).
At the moment I'm using default Plymouth splash screen (using this guide: https://www.thedigitalpictureframe.com/ ... 9-version/)
And it takes around 14sec from power on to show up.
Compared to RetroPie splash screen that only takes 4sec to show.
Can anyone teach me how to do it?

Thanks in advance
Hi,
I have the same issue in a Raspberry pi Zero w, were you able to solve it?

Thanks

DarkElvenAngel
Posts: 979
Joined: Tue Mar 20, 2018 9:53 pm

Re: Show splash screen ASAP

Fri Sep 20, 2019 2:04 am

You can use an initramfs to display an image within 1-2 seconds after boot. Depending on your setup and needs you can do away with Plymouth.

I have an older guild to achieve this here https://www.raspberrypi.org/forums/view ... 7#p1335189

User avatar
pi-tastic
Posts: 173
Joined: Mon Jul 29, 2019 6:34 pm

Re: Show splash screen ASAP

Fri Sep 20, 2019 3:37 pm

do you mean this option?
Screenshot from 2019-09-20 11-01-48.png
Screenshot from 2019-09-20 11-01-48.png (34.96 KiB) Viewed 5173 times
maccaps.com - bringing life to dead electronics.

dkeruza
Posts: 4
Joined: Thu Sep 19, 2019 3:02 pm

Re: Show splash screen ASAP

Sat Sep 21, 2019 2:51 am

DarkElvenAngel wrote:
Fri Sep 20, 2019 2:04 am
You can use an initramfs to display an image within 1-2 seconds after boot. Depending on your setup and needs you can do away with Plymouth.

I have an older guild to achieve this here https://www.raspberrypi.org/forums/view ... 7#p1335189
This is a great guide. Thanks

One more question, I did install plymouth to have an animation as soon as the system boots, but I have the same problem, takes like 14 seconds to show up.
I did use initramfs for plymouth but seems like is still running from the main root volume.
Any suggestion to make the plymouth animation from the initramfs?

Thanks again

DarkElvenAngel
Posts: 979
Joined: Tue Mar 20, 2018 9:53 pm

Re: Show splash screen ASAP

Sat Sep 21, 2019 11:59 am

dkeruza wrote:
DarkElvenAngel wrote:
Fri Sep 20, 2019 2:04 am
You can use an initramfs to display an image within 1-2 seconds after boot. Depending on your setup and needs you can do away with Plymouth.

I have an older guild to achieve this here https://www.raspberrypi.org/forums/view ... 7#p1335189
This is a great guide. Thanks

One more question, I did install plymouth to have an animation as soon as the system boots, but I have the same problem, takes like 14 seconds to show up.
I did use initramfs for plymouth but seems like is still running from the main root volume.
Any suggestion to make the plymouth animation from the initramfs?

Thanks again
Yes you can make Plymouth or anything really run from the initramfs. The problem is that programs have dependencies and they need to go in too or at least be available... Then there's the handover from initramfs to rootfs that might cause an issues. I'm working on a newer guide that better suits what you want to try.

I'm wondering what your project is meant to do does it boot into a custom ui or program? And what hardware are you using (Pi 0 is my guess) SD card speed.

These things will be helpful to get you from power on to application faster. In the meantime I'll look into testing if Plymouth will play will in initramfs.

dkeruza
Posts: 4
Joined: Thu Sep 19, 2019 3:02 pm

Re: Show splash screen ASAP

Tue Sep 24, 2019 10:04 pm

DarkElvenAngel wrote:
Sat Sep 21, 2019 11:59 am
dkeruza wrote:
DarkElvenAngel wrote:
Fri Sep 20, 2019 2:04 am
You can use an initramfs to display an image within 1-2 seconds after boot. Depending on your setup and needs you can do away with Plymouth.

I have an older guild to achieve this here https://www.raspberrypi.org/forums/view ... 7#p1335189
This is a great guide. Thanks

One more question, I did install plymouth to have an animation as soon as the system boots, but I have the same problem, takes like 14 seconds to show up.
I did use initramfs for plymouth but seems like is still running from the main root volume.
Any suggestion to make the plymouth animation from the initramfs?

Thanks again
Yes you can make Plymouth or anything really run from the initramfs. The problem is that programs have dependencies and they need to go in too or at least be available... Then there's the handover from initramfs to rootfs that might cause an issues. I'm working on a newer guide that better suits what you want to try.

I'm wondering what your project is meant to do does it boot into a custom ui or program? And what hardware are you using (Pi 0 is my guess) SD card speed.

These things will be helpful to get you from power on to application faster. In the meantime I'll look into testing if Plymouth will play will in initramfs.
I believe that I am missing a dependency in my initramfs, that is why the plymouth animation starts when the rootfs is handed.

I am using a Pi zero W and is a project that boots and plays videos in a loop, which I was also thinking of just boot to initramfs which is extremely quick and play the videos from there, no need for a full system boot.

My goal would be to boot to a splash screen, then plymouth animation from initramfs. then either keep booting the complete os an start playing the videos or play the videos from the initramfs itself. Videos will be stored in an external USB drive.


Is there any way I can see which plymouth dependencies are missing?

Thanks and I wish I could make it work.

DarkElvenAngel
Posts: 979
Joined: Tue Mar 20, 2018 9:53 pm

Re: Show splash screen ASAP

Thu Sep 26, 2019 9:23 pm

dkeruza wrote:
Tue Sep 24, 2019 10:04 pm

I believe that I am missing a dependency in my initramfs, that is why the plymouth animation starts when the rootfs is handed.

I am using a Pi zero W and is a project that boots and plays videos in a loop, which I was also thinking of just boot to initramfs which is extremely quick and play the videos from there, no need for a full system boot.

My goal would be to boot to a splash screen, then plymouth animation from initramfs. then either keep booting the complete os an start playing the videos or play the videos from the initramfs itself. Videos will be stored in an external USB drive.


Is there any way I can see which plymouth dependencies are missing?

Thanks and I wish I could make it work.
Very similar to what I've worked on. You can use Buildroot to build a full rootfs in the initramfs. I would advise against putting to much in there since memory resources are limited on a Pi Zero W.

As for Plymouth from what I read it should be able to run from the initramfs, you can find dependencies with the

Code: Select all

ldd
command as far as binaries go. Maybe this Debian wiki page is useful https://wiki.debian.org/plymouth

Realistically you should be able to play a local video long before the system completes booting. have you disabled unneeded services from your boot? Networks are the slowest to start and you don't need to wait for it to start unless you need it.

dkeruza
Posts: 4
Joined: Thu Sep 19, 2019 3:02 pm

Re: Show splash screen ASAP

Sun Oct 27, 2019 6:54 pm

I don't know what I'm doing wrong but I can't get it to work. It takes around 15 seconds for the animation to start.
I am not a linux expert but I consider myself not a novice.
I think I am going to not use plymouth and just use a splash screen.

Any idea will be welcomed.

Thanks

DarkElvenAngel
Posts: 979
Joined: Tue Mar 20, 2018 9:53 pm

Re: Show splash screen ASAP

Mon Oct 28, 2019 4:56 pm

Did you try the guide I posted?

That will get a splash image in much faster than Plymouth.
DarkElvenAngel wrote: You can use an initramfs to display an image within 1-2 seconds after boot. Depending on your setup and needs you can do away with Plymouth.

I have an older guild to achieve this here https://www.raspberrypi.org/forums/view ... 7#p1335189

Catch.Rahul
Posts: 33
Joined: Sun Jul 07, 2019 9:37 am

Re: Show splash screen ASAP

Fri Dec 13, 2019 6:22 am

Hello DarkElvenAngel ,
I tried your guide on initramfs to disable boot splash on buster lite (with additional GUI components - xserver-xorg x11-xserver-utils xinit xinput openbox). I could however, could not get splash screen on boot-up.

Steps followed:
apt install busybox
update-initramfs -c -k $(uname -r)
sudo nano /etc/initramfs-tools/scripts/init-top/splash

Code: Select all

#!/bin/sh
lzop /etc/boot.lzo > /dev/fb0 
Note: I was getting an error -> lzopcat : command not found
Installed lzop using sudo apt-get install lzop and edited the above command to lzop from lzopcat. hope this is fine


sudo nano /etc/initramfs-tools/hooks/cpimg.sh

Code: Select all

#!/bin/sh
PREREQ=""
prereqs() {
         echo "$PREREQ"
}
case $1 in 
# get pre-requisites 
prereqs)
         prereqs
         exit 0
         ;; esac
# fbcp 
. /usr/share/initramfs-tools/hook-functions
rm -f ${DESTDIR}/etc/boot.lzo
cp /home/pi/boot.lzo ${DESTDIR}/etc
chmod 666 ${DESTDIR}/etc/image640.raw
exit 0 
apt install libjpeg9-dev
fbv ./splash.png # after installing fbv from the godspeed git hub page

Code: Select all

setup console
fbv - The Framebuffer Viewer
splash.png
1024 x 600
cp /dev/fb0 /home/pi/boot
busybox lzop -5 boot # this created boot.lzo file
update-initramfs -u

Code: Select all

pi@raspberrypi:~$ sudo update-initramfs -u
ln: failed to create hard link '/boot/initrd.img-4.19.75-v7l+.dpkg-bak' => '/boot/initrd.img-4.19.75-v7l+': Operation not permitted
update-initramfs: Generating /boot/initrd.img-4.19.75-v7l+
lzop: /etc/boot.lzo: warning: already has .lzo suffix -- unchanged
added initramfs initrd.img-4.19.75-v7l+ to /boot/config.txt
appended clear > /dev/tty1 before exit 0 in /etc/rc.local
Rebooted, but could not get any splash screen.

Note: Made appropriate changes to disable all the boot text, raspberry logo, default rainbow splash and enabled autologin

Kindly suggest if anything was a miss.

DarkElvenAngel
Posts: 979
Joined: Tue Mar 20, 2018 9:53 pm

Re: Show splash screen ASAP

Fri Dec 13, 2019 7:45 pm

Catch.Rahul,

Some basic troubleshooting:
First try fbv from the console with your image.
Second try to copy raw image to the framebuffer.

Both of these should put your splash image on screen if they don't you have found the problem. Another issue could be file names I'm not sure but it looks like you have an error in one of the scripts. There should be some error messages printed out when you build the initramfs.

Try these things and post any errors you get and that will help solve this.

Catch.Rahul
Posts: 33
Joined: Sun Jul 07, 2019 9:37 am

Re: Show splash screen ASAP

Sat Dec 14, 2019 8:00 am

thanks for replying back!

Was able to display the image from console using fbv command and the raw image showed up upon copy to /dev/fb0

Here is the output from update-initramfs -u

Code: Select all

sudo update-initramfs -u
ln: failed to create hard link '/boot/initrd.img-4.19.75-v7l+.dpkg-bak' => '/boot/initrd.img-4.19.75-v7l+': Operation not permitted
update-initramfs: Generating /boot/initrd.img-4.19.75-v7l+
lzop: /etc/boot.lzo: warning: already has .lzo suffix -- unchanged
kindly suggest next steps

DarkElvenAngel
Posts: 979
Joined: Tue Mar 20, 2018 9:53 pm

Re: Show splash screen ASAP

Sat Dec 14, 2019 1:01 pm

Catch.Rahul,

Your welcome!

Okay everything looks okay there and the images work. I think you have a error in one of your scripts or you missed setting the execution bit on etc/initramfs-tools/scripts/init-top/splash

Just to be sure check the following commands and let's see what they say

ls -lah /etc/initramfs-tools/scripts/init-top/splash

cat /etc/initramfs-tools/scripts/init-top/splash

cat /etc/initramfs-tools/etc/initramfs-tools/hooks/cpimg.sh

And so it's easier to read just wrap the output of each in a code block and then we can see if something jumps out.

/etc/initramfs-tools/scripts/init-top/splash

Code: Select all

#!/bin/sh
lzopcat /etc/boot.lzo > /dev/fb0
This doesn't match what you posted before. This is important as this is the command that puts image to the the framebuffer. The error you see isn't a missing command on your saw was normal.

Let me know how you get on with that and we can go from there if it's still not working.

Catch.Rahul
Posts: 33
Joined: Sun Jul 07, 2019 9:37 am

Re: Show splash screen ASAP

Sun Dec 15, 2019 12:52 pm

Here is the output from comannds that you had suggested:

Code: Select all

$ ls -lah /etc/initramfs-tools/scripts/init-top/splash
-rwxr-xr-x 1 root root 40 Dec 13 05:59 /etc/initramfs-tools/scripts/init-top/splash

$ cat /etc/initramfs-tools/scripts/init-top/splash
#!/bin/sh
lzop /etc/boot.lzo > /dev/fb0

$ cat /etc/initramfs-tools/hooks/cpimg.sh
#!/bin/sh
PREREQ=""
prereqs() {
         echo "$PREREQ"
}
case $1 in
# get pre-requisites
prereqs)
         prereqs
         exit 0
         ;; esac
# fbcp
. /usr/share/initramfs-tools/hook-functions
rm -f ${DESTDIR}/etc/boot.lzo
cp /home/pi/boot.lzo ${DESTDIR}/etc
chmod 666 ${DESTDIR}/etc/image640.raw
exit 0
pi@raspberrypi:~$
Updated the /etc/initramfs-tools/scripts/init-top/splash script as below, still no splash at boot:

Code: Select all

#!/bin/sh
lzopcat /etc/boot.lzo > /dev/fb0

User avatar
rin67630
Posts: 1059
Joined: Fri Mar 04, 2016 10:15 am

Re: Show splash screen ASAP

Sun Dec 15, 2019 11:25 pm

Catch.Rahul wrote:
Sun Dec 15, 2019 12:52 pm
Updated the /etc/initramfs-tools/scripts/init-top/splash script as below, still no splash at boot:
Where do you expect a splash at boot?
On HDMI or on a LCD display connected to the GPIO?

DarkElvenAngel
Posts: 979
Joined: Tue Mar 20, 2018 9:53 pm

Re: Show splash screen ASAP

Mon Dec 16, 2019 1:37 am

rin67630 wrote:
Catch.Rahul wrote:
Sun Dec 15, 2019 12:52 pm
Updated the /etc/initramfs-tools/scripts/init-top/splash script as below, still no splash at boot:
Where do you expect a splash at boot?
On HDMI or on a LCD display connected to the GPIO?
Framebuffer 0 defaults to HMDI or the official touch screen. Good question. However we've already checked that images are shown to /dev/fb0 correctly. Another question I should have thought of is are you using a noobs image as that may not work with this set up.

Rin67630, I have used this method over several models of Pi's and had no issues, have you tried this method at all? I've never tried with a Pi 4 or with Buster. There could be some changes in either that are causing this to fail.

Catch.Rahul,
Okay I see another problem.
I looked at the script /etc/initramfs-tools/hooks/cpimg.sh and I looked at the version I'm using in my own setup.

I have something similar to this.

Code: Select all

#!/bin/sh
echo "Starting $0"
PREREQ=""
prereqs() {
        echo "$PREREQ"
}
case $1 in
# get pre-requisites
prereqs)
        prereqs
        exit 0
        ;; esac
echo "»»»» START $0 ««««"
echo "> Remove old image form initrd"
rm -f ${DESTDIR}/etc/boot.lzo
echo "> Copy new image to initrd"

cp -v /home/pi/boot.lzo ${DESTDIR}/etc/boot.lzo

echo "> Set permissions"
chmod 666 ${DESTDIR}/etc/boot.lzo
echo "»»»» FINISHED $0 ««««"
exit 0
Catch.Rahul wrote:
/etc/initramfs-tools/hooks/cpimg.sh

Code: Select all

#!/bin/sh
PREREQ=""
prereqs() {
         echo "$PREREQ"
}
case $1 in
# get pre-requisites
prereqs)
         prereqs
         exit 0
         ;; esac
# fbcp
. /usr/share/initramfs-tools/hook-functions
rm -f ${DESTDIR}/etc/boot.lzo
cp /home/pi/boot.lzo ${DESTDIR}/etc
chmod 666 ${DESTDIR}/etc/image640.raw
exit 0
I'm thinking there is a typo in the original guide, I am working through the guide on a fresh SD to test it out I will post again with my success or failure.

DarkElvenAngel
Posts: 979
Joined: Tue Mar 20, 2018 9:53 pm

Re: Show splash screen ASAP

Mon Dec 16, 2019 3:22 am

I have traced the issue to the busybox version in Buster it's missing the applet for lzopcat so we have to make some choices.

You can skip compression of the raw image this will make the initram file bigger.

We use a compression method that is supported bzip2 worked (in my test but it's slow)

The simplest solution is to skip compression in that case you have to change all mention of boot.lzo to just boot
And change lzopcat to cat

I don't recommend bzip2 compression it's far to slow .4 seconds to copy the image to screen this has a noticeable screen draw where just using cat will draw in .026s

These were tested on a Pi3B+


I should mention that there's another option it's much more involved and I use this in my new method of doing these splash screens. You could build your own version of busybox. It's a much more complex route hence why I haven't posted the updated guild yet.

User avatar
rin67630
Posts: 1059
Joined: Fri Mar 04, 2016 10:15 am

Re: Show splash screen ASAP

Mon Dec 16, 2019 7:32 am

DarkElvenAngel wrote:
Mon Dec 16, 2019 1:37 am
Framebuffer 0 defaults to HMDI or the official touch screen. Good question. However we've already checked that images are shown to /dev/fb0 correctly.
I have been asking, because the software SPI frame buffer driver for the LCD hats is usually loaded very late in the boot process. So you may update /dev/fbx like crazy, it just will not be shown until 2/3 of the boot process was gone through.
If you can't see the boot steps if splash is disabled in preferences, than you have got that driver problem and will not get an easy solution, but to rewrite a kernel. :o

The KeDei LCD hat brings the raspberry(ies) from the first seconds and will show the boot steps if splash is disabled, but that device works only with a modified kernel.

Catch.Rahul
Posts: 33
Joined: Sun Jul 07, 2019 9:37 am

Re: Show splash screen ASAP

Mon Dec 16, 2019 11:02 am

Updated both the script files as below:

sudo nano /etc/initramfs-tools/scripts/init-top/splash (used cp instead for CAT)

Code: Select all

#!/bin/sh
cp /etc/boot > /dev/fb0
sudo nano /etc/initramfs-tools/hooks/cpimg.sh (used the script you had earlier shared for the modification boot.lzop to boot)
#!/bin/sh

Code: Select all

echo "Starting $0"
PREREQ=""
prereqs() {
        echo "$PREREQ"
}
case $1 in
# get pre-requisites
prereqs)
        prereqs
        exit 0
        ;; esac
echo "»»»» START $0 ««««"
echo "> Remove old image form initrd"
rm -f ${DESTDIR}/etc/boot
echo "> Copy new image to initrd"

cp -v /home/pi/boot.lzo ${DESTDIR}/etc/boot

echo "> Set permissions"
chmod 666 ${DESTDIR}/etc/boot
echo "»»»» FINISHED $0 ««««"
exit 0
Yet, the boot screen doesn't seem to come up. Any further ideas?

User avatar
rin67630
Posts: 1059
Joined: Fri Mar 04, 2016 10:15 am

Re: Show splash screen ASAP

Mon Dec 16, 2019 12:11 pm

Catch.Rahul wrote:
Mon Dec 16, 2019 11:02 am
Yet, the boot screen doesn't seem to come up. Any further ideas?
Do you see the raspberry[ies] at startup?

Return to “General discussion”