kolsi
Posts: 62
Joined: Wed Jan 23, 2019 10:40 am

Re: Show splash screen ASAP

Tue Mar 03, 2020 8:39 am

DarkElvenAngel wrote:
Mon Mar 02, 2020 10:32 pm
kolsi wrote:
Mon Mar 02, 2020 7:55 pm
b) do not use initramfs to display boot screen on Raspbian. Although you can use it to display an image during the kernel initialization, it will add another a few seconds black screen when initramfs is being initialized before the kernel loads.
This is true however sometimes this is the simplest way at the cost of a few seconds but on a Pi 4 there really isn't much time lost at all
The question is if it's worth it. I haven't tested initramfs on Pi4, but the kernel initialization takes about 1.5 seconds on Pi3B+ and Pi4. If I added initramfs it took another 1.5 seconds to load it. So you replace 1.5 seconds of black screen while kernel is being loaded and add another 1.5 seconds while initramfs is being loaded.
DarkElvenAngel wrote:
Mon Mar 02, 2020 10:32 pm
kolsi wrote:
Mon Mar 02, 2020 7:55 pm
c) the most cleaner way to have boot splash during the whole boot is to build your own kernel and replace the small Raspberry logo with high-resolution (same as your screen resolution) image (max 224 colours, PPM format). This image will be displayed over the whole screen until something clears the screen (e.g. Xorg starts up).
That's something I have played with an it's not for a novice plus you need a way to keep the kernel updated. So that going to require more effort in the long term.
Yes, the problem with kernel updating is the biggest disadvantage. That's why I talked about incorporating it into official Raspberry kernel directly. We use custom kernel modules in our project so we need to build kernel anyway.
DarkElvenAngel wrote:
Mon Mar 02, 2020 10:32 pm
kolsi wrote:
Mon Mar 02, 2020 7:55 pm
d) when vc4-fkms driver is used then the video device is reinitialized and the frame buffer is cleared by systemd-udev service. You can create custom simple systemd service that is wanted by sysinit.target and executes a shell script that paints your logo (same as compiled into the kernel) to the frame buffer in the loop and checks for Xorg process existence. As a bonus, you can use it to create some kind of nice animation (e.g. spinner below the logo)
This is an issue I have also found most guides only use the service to display the image. The problem is that a Pi 4 is so fast it lasts for a fraction of a second and this isn't desirable for some users.
The service cannot display the static image only. It must periodically refresh it in the background. Such service is loaded immediately when systemd is initialized. Also "-background none" switch must be added to Xorg, so the screen is not cleared when Xorg starts. Something like this:

Code: Select all

#!/bin/sh

i=0
while [ -z $(pidof Xorg) ]
do
	# logo
	$(dirname $0)/fb_viewer $(dirname $0)/bootsplash-logo.bmp
	
	# spinner
	$(dirname $0)/fb_viewer $(dirname $0)/bootsplash-spinner-$i.bmp

	sleep 0.1
	
	if [ $i -eq 7 ]; then
		i=0
	else
		i=$(($i + 1))
	fi
done 
boot.PNG
boot.PNG (94.18 KiB) Viewed 2269 times
DarkElvenAngel wrote:
Mon Mar 02, 2020 10:32 pm
I've actually been working on such a thing but it uses the initramfs solution and some custom software. Building that functionality into a kernel is possible, but you have to remember the boot partition isn't mount by the kernel the root partition is. The smaller you can build the initramfs the faster it loads. I think having a slight delay in boot so you can have a picture is fine it's a trade off that more than a few are willing to make.
My bad. I meant root partition, not boot - just something that is accessible during the kernel boot and user can put the image file there directly without the need of kernel recompiling. If I have time, I can work on it and create a patch, but I'm not sure if developers will be interested in incorporating it to the official kernel.

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

Re: Show splash screen ASAP

Tue Mar 03, 2020 11:47 am

rpdom wrote:
Tue Mar 03, 2020 7:15 am
DarkElvenAngel wrote:
Tue Mar 03, 2020 2:16 am
Add this to the end of the /boot/cmdline.txt

Code: Select all

logo.nologo vt.global_cursor_default=0 quite loglevel=0 splash
That should be quiet not quite in that line.
Thanks I have made that correction !

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

Re: Show splash screen ASAP

Tue Mar 03, 2020 12:06 pm

kolsi wrote:
Tue Mar 03, 2020 8:39 am
My bad. I meant root partition, not boot - just something that is accessible during the kernel boot and user can put the image file there directly without the need of kernel recompiling. If I have time, I can work on it and create a patch, but I'm not sure if developers will be interested in incorporating it to the official kernel.
That would be ideal, it saves all this extra work. However I see problems that could come of it and the would be why we have the system we have now. What might be better is a way to have the kernel update build on system in a Gentoo fashion this is very slow on the pi and might not be worth it and introduce more problems. I don't see anything like this changing any time soon.

As for xorg -background none where would that be placed to help out l3odybag?

kolsi
Posts: 62
Joined: Wed Jan 23, 2019 10:40 am

Re: Show splash screen ASAP

Tue Mar 03, 2020 6:49 pm

"- background none" should be added as argument in a command that executes Xorg server.
For example, I start Xorg via .bash_profile, so my file contains:

Code: Select all

startx -- -quiet -background none > /dev/null 2>&1
I just have to note that this argument works with KMS graphics driver only (e.g. vc4-fkms). In opposite case, Xorg always creates root window with solid black color (or white when -wr argument is passed).

When KMS driver is not used, so Xorg uses default fbdev/fbturbo driver, I recommend to disable Xorg's GLX module because it is not needed and brings additional (black screen) delay during Xorg startup. (https://unix.stackexchange.com/question ... n-in-linux)

I3odybag
Posts: 30
Joined: Fri Feb 21, 2020 4:08 pm

Re: Show splash screen ASAP

Tue Mar 03, 2020 9:56 pm

DarkElvenAngel wrote:
Mon Mar 02, 2020 6:06 pm

Then rebuild the initramfs

Code: Select all

update-initramfs -c -k $(uname -r)
Make sure you point to the correct images and have add the initramfs line to config.txt
DarkElvenAngel,
I added the part to the end of my command line which eliminated the text before the splash screen displays.

There is still a pretty good delay between the time the Pi is powered on till I see the Splash screen the first time and then after the splash screen comes up for about 12 seconds it goes away for 10 before the web browser is shown. You mentioned in a earlier post to add initramfs line to the config.txt on the pi. From what I can tell I do not see that in the config.txt file at all currently. Could that be causing part of the delay?

It still seems to also to show the login text on top of my splash screen before it goes to black screen then loads the browser.

I also have listed my cmdline.txt file as requested.

Code: Select all

console=serial0,115200 console=tty3 root=PARTUUID=738a4d67-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait logo.nologo vt.global_cursor_default=0 quiet loglevel=0 splash

User avatar
TheMindVirus
Posts: 180
Joined: Mon Jul 29, 2019 12:38 am
Location: Cornwall, UK

Re: Show splash screen ASAP

Tue Mar 03, 2020 11:50 pm

Has anyone considered using an FPGA?: https://www.fpga4fun.com/HDMI.html
You could make your own device that displays a custom splash screen as the first thing it does on power-on.
https://alchitry.com/blogs/tutorials/hdmi-shield-basics
Then you could program it to switch back to the Pi when it has finished booting by sending a Ready signal by GPIO.

...What?...The post is called "Show splash screen ASAP"...
Alastair Cota
Embedded Firmware Developer
[ERR]: Sense of Humour Failure

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

Re: Show splash screen ASAP

Wed Mar 04, 2020 12:21 am

l3odybag,

You need to put the following in your config.txt

Code: Select all

initramfs initrd.img-4.19.97-v7l+
Put that in after [pi4] normally near the bottom.

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

Re: Show splash screen ASAP

Wed Mar 04, 2020 12:23 am

TheMindVirus wrote:
Tue Mar 03, 2020 11:50 pm
Has anyone considered using an FPGA?: https://www.fpga4fun.com/HDMI.html
You could make your own device that displays a custom splash screen as the first thing it does on power-on.
https://alchitry.com/blogs/tutorials/hdmi-shield-basics
Then you could program it to switch back to the Pi when it has finished booting by sending a Ready signal by GPIO.

...What?...The post is called "Show splash screen ASAP"...
I think that's an interesting idea however outside the reach of most users

User avatar
TheMindVirus
Posts: 180
Joined: Mon Jul 29, 2019 12:38 am
Location: Cornwall, UK

Re: Show splash screen ASAP

Wed Mar 04, 2020 1:19 am

DarkElvenAngel wrote:I think that's an interesting idea however outside the reach of most users
I agree and wish FPGA's would become cheaper and easier to use.
They are very powerful chips with precise timing, but they usually
need to be teamed with something like a Pi or AVR to do anything meaningful.
Maybe Xilinx or Altera/Intel will make it possible soon.
Alastair Cota
Embedded Firmware Developer
[ERR]: Sense of Humour Failure

I3odybag
Posts: 30
Joined: Fri Feb 21, 2020 4:08 pm

Re: Show splash screen ASAP

Wed Mar 04, 2020 3:08 pm

DarkElvenAngel wrote:
Wed Mar 04, 2020 12:21 am
l3odybag,

You need to put the following in your config.txt

Code: Select all

initramfs initrd.img-4.19.97-v7l+
Put that in after [pi4] normally near the bottom.
DarkElvenAngel,

I have added the information to the config.txt file now. It didn't seem to change the boot up process any from what I can tell. The system still has a blank screen for about 10 seconds, shows the splash screen for about 10 seconds, then goes back blank for a bit till the chromium browser opens.

If I need to change the splash screen for any reason what would be the process for that? Would I have to start all over? I tried yesterday by changing the splash.png file that I had saved on the pi but that didn't seem to work. So I wasn't sure if the file got moved and saved somewhere else for the system to reference now or not. I would like to know for using this same system other places in the plant. That way I don't have to recreate everything. Just clone the device and change the splash screen. Thank you once again for all the help with the system.

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

Re: Show splash screen ASAP

Wed Mar 04, 2020 3:50 pm

I3odybag wrote:
Wed Mar 04, 2020 3:08 pm
DarkElvenAngel wrote:
Wed Mar 04, 2020 12:21 am
l3odybag,

You need to put the following in your config.txt

Code: Select all

initramfs initrd.img-4.19.97-v7l+
Put that in after [pi4] normally near the bottom.
DarkElvenAngel,

I have added the information to the config.txt file now. It didn't seem to change the boot up process any from what I can tell. The system still has a blank screen for about 10 seconds, shows the splash screen for about 10 seconds, then goes back blank for a bit till the chromium browser opens.

If I need to change the splash screen for any reason what would be the process for that? Would I have to start all over? I tried yesterday by changing the splash.png file that I had saved on the pi but that didn't seem to work. So I wasn't sure if the file got moved and saved somewhere else for the system to reference now or not. I would like to know for using this same system other places in the plant. That way I don't have to recreate everything. Just clone the device and change the splash screen. Thank you once again for all the help with the system.
I'll upload a initramfs to GitHub tonight or tomorrow morning that should work better for you. There is a long list of things we can check but I'd like to try something that is known good. I use it myself and know it works. All you have to do is put the splash image into the boot folder and tell config.txt to load it.

If you post your config.txt I'll check it make sure you have that I the correct place.

I3odybag
Posts: 30
Joined: Fri Feb 21, 2020 4:08 pm

Re: Show splash screen ASAP

Wed Mar 04, 2020 5:05 pm

DarkElvenAngel below is the content of the /boot/config.txt file as you requested. I added the part to the bottom of it as you stated earlier.

Code: Select all

# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
framebuffer_width=1680
framebuffer_height=1050

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

# Uncomment this to enable infrared communication.
#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18

# Disable Wifi
dtoverlay=pi3-disable-wifi
dtoverlay=disable-wifi

# Disable Bluetooth
dtoverlay=disable-bt

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

[pi4]

# Enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-fkms-v3d
max_framebuffers=2

[all]
#dtoverlay=vc4-fkms-v3d
gpu_mem=256

# Disable rainbow splash screen
disable_splash=1

# Adding initramfs
initramfs initrd.img-4.19.97-v7l+


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

Re: Show splash screen ASAP

Wed Mar 04, 2020 7:44 pm

I3odybag,

That all looks right, there might possibly be an error one of the steps during building the initramfs. But I will upload you one I know works and see if you get any faster.

That will be later today as I'm not with my setup right now.

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

Re: Show splash screen ASAP

Thu Mar 05, 2020 8:39 pm

Apologies for the delay,

This is the GitLab link for the project as it sits now.

https://gitlab.com/DarkElvenAngel/initramfs-splash

It's very simple to use just copy the initramfs.img for the project's boot folder to your boot folder and copy the image you want as the splash name it splash.png

Change the entry in the config.txt to

Code: Select all

initramfs initramfs.img
Reboot

This image hasn't been optimized for size but it's going to be about as fast as you can get.

I should also note that the image viewer is in early alpha stage and can't resize image in that version used and it will not work if you give a image that is too big to fit on the screen.


For the most up-to-date information visit the link.

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

Re: Show splash screen ASAP

Tue Mar 10, 2020 2:57 pm

@I3odybag,

How did you make out is everything working for you?

I3odybag
Posts: 30
Joined: Fri Feb 21, 2020 4:08 pm

Re: Show splash screen ASAP

Tue Mar 10, 2020 4:02 pm

DarkElvenAngel wrote:
Tue Mar 10, 2020 2:57 pm
@I3odybag,

How did you make out is everything working for you?
DarkElvenAngel,

I performed the steps that you mentioned. The new method does seem to be a little faster. I used a different splash.png file that way it would let me know that everything was working. It seems like right now that I have two different things showing the image cause when I boot it up right now it shows the new splash.png file which your system was pointing to and using then the screen goes blank and then it shows a different splash image that I was originally using. Then the screen goes blank for about 10 seconds then it loads the chromium web browser. Just seems like the Initramfs shows the splash screen for about 4 seconds, then it goes black screen, then something else shows a splash screen for about 10 seconds then black screen for 10 seconds till the chromium web browser starts up.

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

Re: Show splash screen ASAP

Tue Mar 10, 2020 6:21 pm

I3odybag wrote:
Tue Mar 10, 2020 4:02 pm
DarkElvenAngel wrote:
Tue Mar 10, 2020 2:57 pm
@I3odybag,

How did you make out is everything working for you?
DarkElvenAngel,

I performed the steps that you mentioned. The new method does seem to be a little faster. I used a different splash.png file that way it would let me know that everything was working. It seems like right now that I have two different things showing the image cause when I boot it up right now it shows the new splash.png file which your system was pointing to and using then the screen goes blank and then it shows a different splash image that I was originally using. Then the screen goes blank for about 10 seconds then it loads the chromium web browser. Just seems like the Initramfs shows the splash screen for about 4 seconds, then it goes black screen, then something else shows a splash screen for about 10 seconds then black screen for 10 seconds till the chromium web browser starts up.

Okay that sounds about right, the second image you see is from your systemd splash service if you change that image to point to the /boot/splash.png it will show the same image. You can get rid of that blank between the initramfs and the service by disabling

Code: Select all

dtoverlay=vc4-fkms-v3d
in your config.txt I'm not sure the effect that will have on your kiosk.

As for the last 10 seconds did you try as kolsi suggests a few posts up?

I3odybag
Posts: 30
Joined: Fri Feb 21, 2020 4:08 pm

Re: Show splash screen ASAP

Tue Mar 10, 2020 6:49 pm

kolsi wrote:
Tue Mar 03, 2020 6:49 pm
"- background none" should be added as argument in a command that executes Xorg server.
For example, I start Xorg via .bash_profile, so my file contains:

Code: Select all

startx -- -quiet -background none > /dev/null 2>&1
I just have to note that this argument works with KMS graphics driver only (e.g. vc4-fkms). In opposite case, Xorg always creates root window with solid black color (or white when -wr argument is passed).

When KMS driver is not used, so Xorg uses default fbdev/fbturbo driver, I recommend to disable Xorg's GLX module because it is not needed and brings additional (black screen) delay during Xorg startup. (https://unix.stackexchange.com/question ... n-in-linux)
DarkElvenAngel,

Kolsi suggests adding "-background none" to the command that executes Xorg server. I am not sure where to put this command. I tried to find something that mentioned Xorg Server in the instructions that I followed and not really seeing anything.

kolsi
Posts: 62
Joined: Wed Jan 23, 2019 10:40 am

Re: Show splash screen ASAP

Tue Mar 10, 2020 8:06 pm

It depends how you start your Xserver.

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

Re: Show splash screen ASAP

Tue Mar 10, 2020 8:07 pm

I3odybag wrote: DarkElvenAngel,

Kolsi suggests adding "-background none" to the command that executes Xorg server. I am not sure where to put this command. I tried to find something that mentioned Xorg Server in the instructions that I followed and not really seeing anything.
I'm looking for it maybe here

Code: Select all

 /etc/systemd/system/display-manager.service

I3odybag
Posts: 30
Joined: Fri Feb 21, 2020 4:08 pm

Re: Show splash screen ASAP

Tue Mar 10, 2020 8:14 pm

kolsi wrote:
Tue Mar 10, 2020 8:06 pm
It depends how you start your Xserver.
Kolsi,

That is what I am saying. I do not recall ever typing anything in to start the Xserver. So I am not sure where to type the command that you mentioned.

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

Re: Show splash screen ASAP

Wed Mar 11, 2020 1:58 am

I3odybag wrote:
Tue Mar 10, 2020 8:14 pm
kolsi wrote:
Tue Mar 10, 2020 8:06 pm
It depends how you start your Xserver.
Kolsi,

That is what I am saying. I do not recall ever typing anything in to start the Xserver. So I am not sure where to type the command that you mentioned.
Kolsi,

I see how this is set up if l3odybag has followed the steps exactly in the guide. We have the raspi-config automatically logging into a desktop and a modified /etc/xdg/openbox/autostart

Is that correct l3odybag? I think you followed this guide https://wiredzero.com/kiosk you posted earlier on.

I3odybag
Posts: 30
Joined: Fri Feb 21, 2020 4:08 pm

Re: Show splash screen ASAP

Wed Mar 11, 2020 2:11 am

DarkElvenAngel,

Yes that was where I started. I know at one point I believe we removed Plymouth cause I no longer needed it anymore.

kolsi
Posts: 62
Joined: Wed Jan 23, 2019 10:40 am

Re: Show splash screen ASAP

Wed Mar 11, 2020 9:43 am

My method works when Xserver is start in .bash_profile.
If display manager (e.g. lightdm is used), there may be different approach. Some display managers add "-background none" automatically, but the problem is they start Xserver on different console and Xserver automatically switches to this console upon its startup. And this will erase the screen including the bootsplash logo.

i would check /etc/lightdm.conf for configuration.

Code: Select all

# xserver-command = X server command to run (can also contain arguments e.g. X -special-option)

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

Re: Show splash screen ASAP

Wed Mar 11, 2020 12:00 pm

kolsi wrote:
Wed Mar 11, 2020 9:43 am
My method works when Xserver is start in .bash_profile.
If display manager (e.g. lightdm is used), there may be different approach. Some display managers add "-background none" automatically, but the problem is they start Xserver on different console and Xserver automatically switches to this console upon its startup. And this will erase the screen including the bootsplash logo.

i would check /etc/lightdm.conf for configuration.

Code: Select all

# xserver-command = X server command to run (can also contain arguments e.g. X -special-option)
On my pi this file was here

Code: Select all

/etc/lightdm/lightdm.conf

Return to “General discussion”