Plymouth bootanimation not showing up

i am trying to customize the bootanimation through plymouth i use a tool called plymouth-creator (git repo) which convert an mp4 into frames and generate a .script and a .plymouth :
this is the .script

Window.SetBackgroundTopColor (0, 0, 0);
Window.SetBackgroundBottomColor (0, 0, 0);
for(i = 1; i <= 241; i++)
{
  image[i].image = Image("images/image-" + i + ".png");
  image[i].sprite = Sprite(image[i].image);
  image[i].sprite.SetOpacity(0);
  image[i].x = Window.GetX() + Window.GetWidth() / 2 - image[i].image.GetWidth() / 2;
  image[i].y = Window.GetY() + Window.GetHeight() / 2 - image[i].image.GetHeight() / 2;
  image[i].sprite.SetPosition(image[i].x, image[i].y, 0);
}

index = 1;
fun boot_callback()
{
  if(index >= 241 + 1)
  {
    image[241].sprite.SetOpacity(1);
  }
  else
  {
    for(i = 1; i <= 241; i++)
    {
      if(index != i)
      {
        image[i].sprite.SetOpacity(0);
      }
      else
      {
        image[i].sprite.SetOpacity(1);
      }
    }
    index++;
  }
}

Plymouth.SetRefreshFunction(boot_callback);
Plymouth.SetQuitFunction(boot_callback);

this is the .plymouth:

[Plymouth Theme]
Name=pixii
Description=pixii boot animation
ModuleName=script

[script]
ImageDir=/usr/share/plymouth/themes/pixii
ScriptFile=/usr/share/plymouth/themes/pixii/pixii.script

and this is the recipe :

FILESEXTRAPATHS:prepend := "${THISDIR}/files:"

SRC_URI += " \
    file://pixii.plymouth \
    file://pixii.script \
    file://images/ \  
"

PREFERRED_THEME = "pixii"

PACKAGECONFIG = "pango drm"

EXTRA_OECONF += "--with-udev --with-runtimedir=/run"

# Install theme and related files
do_install:append() {
    # Install the Pixii Plymouth theme files
    install -d ${D}${datadir}/plymouth/themes/pixii
    install -m 0644 ${WORKDIR}/pixii.plymouth ${D}${datadir}/plymouth/themes/pixii/pixii.plymouth
    install -m 0755 ${WORKDIR}/pixii.script ${D}${datadir}/plymouth/themes/pixii/pixii.script

    # Install the images for the theme
    install -d ${D}${datadir}/plymouth/themes/pixii/images
    install -m 0644 ${WORKDIR}/images/* ${D}${datadir}/plymouth/themes/pixii/images/
     
}

ROOTFS_POSTPROCESS_COMMAND += "set_plymouth_theme;"

set_plymouth_theme() {
   
    plymouth-set-default-theme pixii --rebuild-initrd
}

i tried to test the plymouth on its own using plymouth --mode=boot /plymouth --show-splash
but it didn’t work

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello!

It seems you’re having trouble with your custom Plymouth boot animation not displaying on your Toradex device. Let’s go through some steps to help you troubleshoot this issue:

  1. Verify Installation Paths: Double-check that the paths in your .plymouth file correctly point to the locations of your images and script on the device.

  2. Set the Default Theme: Ensure your theme is set as the default by running plymouth-set-default-theme pixii --rebuild-initrd. This command sets your theme and rebuilds the initial ramdisk, which is crucial for the changes to take effect.

  3. Manual Testing: Try starting Plymouth manually with plymouthd; plymouth --show-splash. This can help determine if the issue lies with the theme or the boot process.

  4. Review Script Logic: Check your script for any logical errors, especially in the loop and callback functions that handle image sequences and opacity.

  5. DRM Support: Ensure your device supports DRM modesetting drivers, as Plymouth requires these to function properly.

  6. Check Logs: Look at system logs for any Plymouth-related errors. Logs can provide valuable insights into what might be going wrong.

  7. Rebuild and Deploy: After making any changes, rebuild the initramfs and deploy the updated image to your device.

By following these steps, you should be able to identify and resolve the issue with your Plymouth boot animation. If the problem persists, consider simplifying the theme to a static image to verify basic functionality before reintroducing the full animation.

Best regards,
Toradex AI Assistant

Please, also check if these links can help you solve your problem:

Overlap Docker and Plymouth services boot.

Hello @rania,

Thanks for sending all this information. I have never tried to add a custom boot animation but have added custom splash screen with Plymouth. Could you please confirm if that works for you?
Also which BSP version are you working on?
In the meantime, I am trying to build an image to add a boot animation. I will update you of what I find.

no it didn’t work till now it feels like trying to be launched then fails

Hi @rania !

I just quickly tried to change the splash screen on Torizon OS 6.8.0 and I can make it be displayed using plymouthd and plymouth commands.

Here is what I did.
Be aware that the steps below are only meant for testing the splash screen! This won’t permanently change it. To permanently change it on Torizon OS, TorizonCore Builder must be used (and only still images are supported for now): Splash Screen on Torizon OS | Toradex Developer Center
Or Yocto should be used to further customize the splash screen. In this case, you will need to customize both the rootfs and initramfs.

First /usr must be remounted as read-write:

torizon@verdin-imx8mp-15247109:~$ sudo mount -o remount,rw /usr

Then I got the abstract_ring theme from plymouth-themes/pack_1/abstract_ring at master ¡ adi1090x/plymouth-themes ¡ GitHub and copied the abstract_ring folder into /usr/share/plymouth/themes:

torizon@verdin-imx8mp-15247109:~$ ls /usr/share/plymouth/themes
abstract_ring  spinner

To use it I need to configure plymouth to use it by changing the default theme. This is done modifying the /usr/share/plymouth/plymouthd.defaults: I changed from Theme=spinner to Theme=abstract_ring. This is the final content:

torizon@verdin-imx8mp-15247109:~$ cat /usr/share/plymouth/plymouthd.defaults
# Distribution defaults. Changes to this file will get overwritten during
# upgrades.
[Daemon]
Theme=abstract_ring
ShowDelay=0
DeviceTimeout=8

To test it, I need to be sure that no container is making use of the display, so I simply stopped any container that is being executed:

torizon@verdin-imx8mp-15247109:~$ docker stop $(docker ps -a -q)

Then I can try out the new theme using this set of commands:

torizon@verdin-imx8mp-15247109:~$ sudo plymouthd && sudo plymouth show-splash && sleep 5 && sudo pkill plymouthd

Here is a photo of the result (the ring is animated):

So, from our side, animation works, but is not supported on TorizonCore Builder. To make a splash screen animation work, you will need to go to Yocto. If you need help on Yocto, we can recommend you some experienced Toradex Partner to help you with your specific customization.

Best regards,

i tried what u did exactly with my own splash screen and still didn’t work i took same .plymouth and .script adapt them for my splash screen but when i test it nothing appears it seems like trying to launch then fail
NB: i am working with yocto

root@apalis-imx8-15310003:/usr/share/plymouth# cat plymouthd.defaults 
# Distribution defaults. Changes to this file will get overwritten during
# upgrades.
[Daemon]
Theme=my-theme 
ShowDelay=0
DeviceTimeout=8
root@apalis-imx8-15310003:/usr/share/plymouth#
mage-145.png  image-20.png   image-38.png   image-93.png
image-146.png  image-200.png  image-39.png   image-94.png
image-147.png  image-201.png  image-4.png    image-95.png
image-148.png  image-202.png  image-40.png   image-96.png
image-149.png  image-203.png  image-41.png   image-97.png
image-15.png   image-204.png  image-42.png   image-98.png
image-150.png  image-205.png  image-43.png   image-99.png
image-151.png  image-206.png  image-44.png   my-theme.plymouth
image-152.png  image-207.png  image-45.png   my-theme.script
image-153.png  image-208.png  image-46.png
root@apalis-imx8-15310003:/usr/share/plymouth/themes/my-theme# 

Hi @rania !

I would recommend you taking one step back: please try on your side with the exact same Plymouth theme I tried. I am recommending it simply to perform a “sanity check” that something is working on your side.

Also, please share the output of tdx-info (if you are using Torizon OS, you will need sudo).

Best regards,

i tried the abstract-ring it worked for a second then immediately failed

Hi @rania !

If you did just like my steps above, it didn’t fail, but plymouthd was killed after 5 seconds:

sudo plymouthd && sudo plymouth show-splash && sleep 5 && sudo pkill plymouthd

Best regads,

it worked when i reduced the number of my frames to 41 frame but with more it didn’t work but it was so fast i could barely see it i wanted it to show to hide the kernel logs byt that’s not what happened it actually made my boot heavier

it didn’t not work with those steps it only worked whe i did reboot

Hi @rania !

To disable boot logs, please check this Developer article: Serial/UART - Target Device Setup | Toradex Developer Center

Best regards,

i tried with more frame i reached 100 frame and it worked but it fails somehow it feels like struggling to be launched what do u think the problem is ?
NB: i used exactly same .script and .plymouth of the abstract-string just made changes about number of user frames that’s itis problem :
Plymouth works fine on my imx8x. But I can see it starts very late in the boot process. When kernel starts, the screen is blank for around 5,6 seconds, then splash screen shows up in the screen for only 1 second and the boot process finishes. I am using the plymouth-wait-for-animation.service to have a sleep for 10 seconds to see the splash screen for some time. But I think that is not the intention of a splash screen. I would like to see the splash during the entire boot process. Now I have nothing in the first 5,6 seconds and only 1,2 seconds left in the boot process and unnecessary 10 second delay only to see the splash screen. How can we start plymouth earlier than this and make this feature useful for what it is to be?

Hi @rania,

You can check Boot optimization approaches on this resources below:

Best regards,

i tried this solution Overlap Docker and Plymouth services boot - #4 by Pipe

it’s about playing with the After dependencies of plymouth-quit.service.
In my case I added ‘wayland-app-launch.service’ in the After dependencies of plymouth-quit.service to obtain the splash screen onscreen until the wayland/weston block launch my dedicated Qt app and then removed ‘plymouth-quit-wait.service’ from the After dependencies of weston.service to obtain the blanking of the splashscreen before my Qt app launches.
but it didn’t work still the same problem the boot gets killed in a second

Hi @rania!

If you want your splashscreen to remain longer, you can add a sleep to your plymouth-quit.service. For instance:

[Service]
...
ExecStartPre=sleep 3
...

Does it help?

Best regards,

i did that already and it didn’t work when i increase the number of frames the animated splash screen disappear comletely when i decrease it it appears for a second and not all of it only the middle not the beginnning or the ending
i tried adding a wai-for-animation service and tried to edit the quit.service with no result

i doubt that the changing on quit.service are not working and i also doubt the service that launches my qt app that i should add to after dependencies of quit.service isn’t the right one
what do u think ?

Hi Rania,

I start by saying that I worked on Apalis IMX6 Toradex BSP 6.4 and not Torizon, but I think there is no difference regarding the Plymouth utility.

Once Plymouth is installed in the OS (I added it to the Yocto recipe) and deployed to the target,

I edited some files directly in the filesystem connecting via ssh (Bitwise ssh client):

To get rid of the boot log text:

$ fw_setenv tdxargs “quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fbcon=map:1”

To close the splash screen as late as possible:

In /lib/systemd/system/plymouth-quit.service file add ‘wayland-app-launch.service’ into After dependencies

In /lib/systemd/system/getty@service file delete ‘plymouth-quit-wait.service’ from Ater dependencies

In /lib/systemd/system/weston.service delete (or comment #) the row After=plymouth-quit-wait.service

With these tweaks on my system there is no text at boot and splash image stays onscreen up to the launch of the GUI app.

Onestly there is a black screen of about 2 seconds between the splash screen and the GUI app, but this is enough for me.

More, it can be useful for you:

I overwritten the image watermark.png image in /usr/share/plymouth/themes/spinner/ with mine

And to set the position onscreen I edited the file /usr/share/plymouth/themes/spinner/spinner.plymouth

And at [two-step] section I put:

WatermarkVerticalAlignment=.5

to have the image centered.

Hope to help

Happy Christmas

Pipe

1 Like

everything worked fine but still have a problem :
e a blank screen for seconds right before and after the animation screen which get cut as usual it doesn’t finish till the end it shows few frames then get killed the a blank screen for a second

look the splash screnn gets killed in 3 seconds :slight_smile:

root@apalis-imx8-15310003:~# journalctl -u plymouth-quit.service
Dec 27 18:31:07 apalis-imx8-15310003 systemd[1]: Starting Terminate Plymouth Boot Screen...
Dec 27 18:31:10 apalis-imx8-15310003 systemd[1]: Finished Terminate Plymouth Boot Screen.

NB i added a plymouth-wait-for-animation.service as you see

[Unit]
Description=Waits for Plymouth animation to finish
Before=plymouth-quit.service display-manager.service

[Service]
Type=oneshot
ExecStart=/bin/sleep 5

[Install]
WantedBy=plymouth-start.service

don’t get what’s the matter cause thera are no errors showing up

from what i observed sleep command only increase or decrease the blank screen time but the animation still get killed at the same spot it doesn’t show the rest of the frames so sleep isn’t affecting the boot animation at all why do the rest of the frames don’t show