bioe007
Posts: 16
Joined: Tue Apr 04, 2017 11:39 pm

Plymouth background disappears shortly into boot

Sun Oct 15, 2017 10:52 pm

Using a compute module (CM3)
Raspbian stretch lite
Plymouth

I'm using Plymouth to create a splash screen with progress bar.

Basically this with a little different background and colors - http://brej.org/blog/?p=174

PROBLEM:
After a couple of seconds, the background disappears.The progress bar continues to show, but all the other sprites disappear.

As a temporary workaround I can redraw the background at every progress callback, but that seems horribly stupid, and it 'flickers' which looks bad too. (See the commented line `# bg_sprite = Sprite(resized_bg_image);` in progress_callback)

Here is my theme's script:

Code: Select all

screen_width = Window.GetWidth();
screen_height = Window.GetHeight();

bg_image = Image("background.png");
resized_bg_image = bg_image.Scale(screen_width, screen_height);

bg_sprite = Sprite(resized_bg_image);
bg_sprite.SetZ(-10000);

#----------------------------------------- Progress Bar --------------------------------

prog_width = 0.75 * screen_width;
prog_height = 0.04 * screen_width;
ptmp = Image("progress_box_gr.png");

progress_box.image = ptmp.Scale(prog_width, prog_height);
progress_box.sprite = Sprite(progress_box.image);

progress_box.x = screen_width / 2 - prog_width / 2;
progress_box.y = screen_height * 0.90 - prog_height / 2;
progress_box.sprite.SetPosition(progress_box.x, progress_box.y, 0);

progress_bar.original_image = Image("progress_bar_yl.png");
progress_bar.sprite = Sprite();

progress_bar.x = screen_width / 2 - prog_width / 2;
progress_bar.y = screen_height * 0.90 - prog_height / 2;
progress_bar.sprite.SetPosition(progress_bar.x, progress_bar.y, 1);

fun progress_callback (duration, progress)
  {
    if (progress_bar.image.GetWidth () != Math.Int (prog_width * progress))
      {
        progress_bar.image = progress_bar.original_image.Scale(prog_width * progress, prog_height);
        progress_bar.sprite.SetImage (progress_bar.image);
      }
    # bg_sprite = Sprite(resized_bg_image);
  }

Plymouth.SetBootProgressFunction(progress_callback);

Full cmdline

Code: Select all

# cat /proc/cmdline
bcm2708_fb.fbwidth=1904 bcm2708_fb.fbheight=1064 bcm2708_fb.fbswap=1 smsc95xx.macaddr=B8:27:EB:19:13:74 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  splash quiet plymouth.ignore-serial-consoles vt.global_cursor_default=0 logo.nologo fbcon=map:10 dwc_otg.lpm_enable=0 loglevel=5 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait initrd=initrd.gz
My cmdline.txt

Code: Select all

splash quiet plymouth.ignore-serial-consoles vt.global_cursor_default=0 logo.nologo fbcon=map:10 dwc_otg.lpm_enable=0 loglevel=5 console=serial0,115200 kgdboc=serial0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait initrd=initrd.gz
I set `loglevel=8` in cmdline.txt and watched for the background to disappear while watching the kernel messages over serial console. This is the last entry before the background disappears:

Code: Select all

[7.360063] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
*As an aside, it doesn't seem like I get much boot messages over serial0, and none from the system services starting up.

1 ) Has anyone else noticed this problem in stretch?

2) Does anyone know if there is a kernel fb 'change' event that affects Plymouth's early background painting?

3) Is there any fix people know of? (better than my hack above)

Thanks


*NOTE*
The problem can be reproduced using the vanilla 'script' theme:

Code: Select all

plymouth-set-default-theme script
mkinitramfs -o /boot/initrd.gz
reboot
and after a few seconds, the blue background goes away, the progress box is lost and only the debian script logo flashes for a while.

bioe007
Posts: 16
Joined: Tue Apr 04, 2017 11:39 pm

Re: Plymouth background disappears shortly into boot

Sun Oct 15, 2017 11:59 pm

(talking to myself)

Code: Select all

fun refresh_callback ()
  {
    # (Normally)Currently we do nothing here
    bg_sprite = Sprite(resized_bg_image);
    bg_sprite.SetZ(-10000);
  }

Plymouth.SetRefreshFunction (refresh_callback);
Using this refresh_callback is another workaround. I think it's even a little better because somehow it doesn't clobber the 'progress box' in the background either.

Return to “Raspbian”