Is rlottie possible for micopython port?

Greetings!
Thank you for the great lvgl for micropython.

I saw the “Show MicroPython code” button in rlottie example page Lottie player — LVGL documentation
(no files in there)

Is it possible to use it ?

Hi @Sam_Sangkyu_Lee !

rlottie is not yet supported with Micropython.
We are considering supporting it in the future, at least on some platforms.

Supported now on latest lv_micropython, unix port only.
You need to build and install https://github.com/Samsung/rlottie.git before building lv_micropython.

Out of interest, do you think there is likely to be support in the future for rlottie on the ESP32?

Sure, why not?
I currently don’t have time to work on that but I’ll be happy to help anyone who would want to volunteer and spend some time on this.

Dear @amirgon,
Could you give me some tips roughly?
I am not good enough to to that, but I will study it. :slight_smile:

Sure.
The first few steps have nothing to do with Micropython.
First we need to see how rlottie+LVGL C code work on ESP32:

  • Build rlottie for ESP32. It probably should be built as 3rd-party library with the ESP-IDF build system.
  • Run some C examples of LVGL + rlottie on a ESP32 board with some display (ILI9341 for example)
  • Check which color modes rlottie supports. ILI9341 for example uses 16bit color depth and swapped B-R (bgr565)
  • Make sure rlottie runs with decent FPS on ESP32
  • Measure RAM consumption of rlottie running on ESP32
  • Measure rlottie program size

If rlottie consumes a lot of RAM we might be able to modify it to use SPI-RAM on ESP32 board that support that. We use this technique today with lodepng library which consumes lots of RAM, where we configure memory allocation functions to use Micropython’s malloc functions that can take advantage of SPI-RAM.

After all the above is working, if everything looks good, it should be pretty easy to add it to lv_micropython.

I am probably missing something here, but could you point out where / how the unix support has been implimented in lv_micropython as I Can’t see anything obvious?

The Makefile of the unix port uses pkg-config to detect the availability of rlottie library. If rlottie is installed on the system, the Makefile updates the compiler and linker flags to link it in.
The Makefile also defines MICROPY_RLOTTIE to enable rlottie on lv_conf.h

We can’t do that on ESP32, of course, because there is no OS and package managers like we have in Linux. We would need to build rlottie from source and link it statically with our application.