Framebuffer Animations is an open-source project designed to play GIF animations on a raw framebuffer device, primarily intended for use in embedded devices. It provides a lightweight and efficient solution for rendering animated content on displays connected to embedded systems.
- Plays GIF animations on raw framebuffer devices,
- Lightweight and suitable for resource-constrained environments,
- The binary has no dependencies,
- Designed for use in embedded systems,
- Customizable for different display configurations,
- Written in Rust for performance and reliability.
Cross-compiling Framebuffer Animations for your target embedded system is straightforward. Here's an example of cross-compilation for The NXP i.MX28 processor with support for the ARMv5TE instruction set.
-
Install the cross-compiler toolchain for your target.
-
Setup a target for Rust:
rustup target add armv5te-unknown-linux-gnueabi
- Clone the repository:
git clone https://github.com/pawelkn/framebuffer-animations.git
- Create a .cargo subfolder in the project directory.
cd framebuffer-animations
mkdir .cargo
- Edit .cargo/config file. Set the valid gcc cross-compiler for your target. Set additional compiler flags, if needed. Example file content:
[target.armv5te-unknown-linux-gnueabi]
linker = "/home/pawel/buildroot/output/host/usr/bin/arm-buildroot-linux-gnueabi-gcc"
- Build the project:
cargo build --target=armv5te-unknown-linux-gnueabi --release
Deployment of Framebuffer Animations depends on your specific embedded system and framebuffer device. However, here are some general steps to follow:
- Transfer the built binary to your embedded device:
scp target/armv5te-unknown-linux-gnueabi/release/fba [email protected]:/usr/bin/
- Transfer example images:
scp -r images [email protected]:/root/
- Log in to your device via SSH.
- Ensure that your framebuffer device exists and is accessible:
ls -l /dev/fb*
crw-rw---- 1 root root 29, 0 Jan 1 1970 /dev/fb0
- Run the example on your embedded device:
fba --device /dev/fb0 --interval 5 --once /root/images/spaceship-640x480.gif
Enjoy your GIF animations on your embedded display!
The Framebuffer Animations accepts the following command line arguments:
-
--device
,-d
: Specifies the framebuffer device file. Default is/dev/fb0
. -
--interval
,-i
: Sets the interval step for displaying GIF frames in milliseconds. Default is 5 milliseconds. -
--once
,-o
: When provided, the GIF animation will play only one time. By default, it loops indefinitely. -
gif_file
: The path to the GIF file that you want to play.
If you encounter any issues while using Framebuffer Animations, first check, if the framebuffer is in sleep mode. To leave Framebuffer sleep power mode:
echo 0 > /sys/class/graphics/fb0/blank
The example images used in this project are sourced from:
- Spaceship - Kövesházi Dániel - https://dribbble.com/shots/3121924-Spaceship
If you find the project beneficial and would like to support me, please consider showing your appreciation by buying me a coffee on Buy Me A Coffee