3

I am currently working on a small rpi3 kiosk. I managed to set up a boot splashcreen with fbi started by an initscript. However I can not make a smooth transition between the splashscreen and the openbox background (image loaded into the root window of X)

Even if I use the Esetroot command at the very beginning of the .xinitrc file (or openbox-session file in the case of using lightdm), there will be short period of grey ugliness before it loads.

Are there any way to make X server to load/show its root window already with an image in it?

or as a fallback change the background color to black.

$BG -solid "#000000" is the openbox startup file did not do the trick.

My .xinitrc:

Esetroot -scale "/etc/splash.png" &
if test -n "$1"; then
    echo "Syntax: openbox-session"
    echo
    echo "See the openbox-session(1) manpage for help."
  exit
fi

# Clean up after GDM
xprop -root -remove _NET_NUMBER_OF_DESKTOPS \
      -remove _NET_DESKTOP_NAMES \
      -remove _NET_CURRENT_DESKTOP 2> /dev/null

# Set up the environment
A="/etc/xdg/openbox/environment"
test -r $A && . $A
A="${XDG_CONFIG_HOME:-"$HOME/.config"}/openbox/environment"
test -r $A && . $A

# Run Openbox, and have it run the autostart stuff
exec /usr/bin/openbox --startup "/usr/lib/arm-linux-gnueabihf/openbox-autostart OPENBOX" "$@"

1 Answer 1

3

Are there any way to make X server to load/show its root window already with an image in it?

Probably not completely, but keep reading. Although the 3 is the fastest pi, it is still not something that is on a par with, e.g., current x86-64 processors.

You could compare this to your smartphone. I have a fairly new, fairly fast, Snapdragon "octocore" (8 cores, 4 x 1.5 Ghz + 4 x 1 Ghz) based phone w/ 2 GB RAM that manages to avoid any "periods of of grey ugliness", but it goes through a sequence of irrelevant glitzy screens during its 10-20 second boot cycle.

It's probably doing a fair bit more than a Pi based kiosk during that time, but what's missing with the Pi is, as you notice, something to span the gap between the boot splash screen, which probably ends once init starts X, X takes the display, then starts the program that sets the background. I've used display -window root for this and on a B/B+ it takes perhaps a couple of seconds, on a 2 it is noticeably faster but there is still a blank black screen for a moment. Whereas on a desktop or laptop this is not really noticeable.

[I don't know why you are getting grey here and not black; I would guess that's either because the brightness is set very high or because the software involved does take the display but shows just gray while it is processing the image.]

One of the reasons that display or other software may require some time here is because it may have to adapt the image dimensions slightly (I think it can be dysfunctional this way, such that a 1920x1080 image on a 1920x1080 screen may end up scaled and tiled along one edge...), and for compressed formats (such as .jpg or .png), do the work of uncompressing them.

So, you want to ensure:

  • The image is the exact same dimensions as the screen.

  • You use an uncompressed format such as .bmp or .xpm. I am not positive the former is supported, so you'll have to play around a bit with that. convert is a useful tool for this (see man convert; if you don't have it, sudo apt install imagemagick).

This may or may not help much. If it could be arranged such that the software displaying the image were able to prep it for load before the X server started, i.e., while the boot splash is still visible, that would probably be the most optimal mechanism. But as far as I know it is not, so there is bound to be a least a moment or two of nothing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.