How can I optimize my configuration to run the demo faster?

Description

I’m new to LittleVGL and I’m planning to use an ILI9488 for my next project. I’ve seen some videos of people who had smooth animations (more than 15 FPS) in the lvgl default demo with an ESP32, even with this quite big screen.

What MCU/Processor/Board and compiler are you using?

ESP-WROOM-32 with ESP-IDF 4.0

What do you want to achieve?

Better performance in terms of FPS. I think the issue might be in the transmission phase, since as you can see in the slow motion video, the display scan (from top to bottom) is visible.

What have you tried so far?

I tried to set the CPU frequency to 240MHz via menuconfig, tweaked the SPI configuration and set the clock frequency to 60MHz, and enabled the compiler optimization. The first two changes made the display work a little smoother, but the last one didn’t change anything. I checked whether DMA is enabled by default, and it seems to be using the first channel (I’m not expert in ESP-IDF APIs either). I am using the demo from the lv_port_esp32.

Code to reproduce

I did not change anything except for the spi frequency constant, now set to 60*1000*1000.

Note: I’m using the recently created fix_ili9488_orientation branch since I opened an issue on GitHub for that driver (now solved, thanks).

Screenshot and/or video

Videos here.

If needed, I can capture some data with a logic analyzer.

Thanks,
Riccardo

The high speed displays use a driver like this one…

Thank you, I’ll have a look.

Hi @persello,

I’m C47D over github, I’ve been using the ESP32 Wrover Kit v4.1 with an ILI9341 display (320x240), and I’m getting about 25 FPS. I’m not an ESP-IDF expert neither but we also want to improve the FPS.

As i see it we can have some points to consider:

  • Display controller max spi clock, we can’t go faster than this.
  • Max spi clock on the spi master, this can be up to 80MHz on dedicated pins.
  • Improve the transfers via DMA.
  • As far as I know the lvgl tick is slow, we can try to make it faster.

I will also check the loboris library and check how can we improve our reference project.

Regards
Carlos

Hi, I think later I will connect my logic analyzer and check how much of the communication time is actually used, I don’t know how many FPS we can get in SPI mode, this morning I tried 80MHz and it showed lots of artifacts, so I lowered it to 60. Keep in mind that I’m on a breadboard and flying wires, so not optimal at all. Still, at 60MHz I think this is a quite low refresh rate and I’m curious to better understand if there is something we can do. Based on some quick calculations, I don’t think that reaching 30 frames per second at normal frequency (40MHz) would be possible, but there could be space for optimization. A better result than mine can be seen in this video, but there is no source code provided.

Hi,

His SPI is running at 40MHz and he is using DMA also, so I also think we have a lot of improvement room.
I don’t have an logic analyzer that can run that fast so I will have to find an oscilloscope to look how much time is the SPI sending data, how much time is lvgl rendering the screen, etc.
@kisvegabor is helping me to improve the performance here https://github.com/littlevgl/lv_port_esp32/issues/101 if you want to jump in and help us.

Regards

Hello,
I don’t think I will be able to help much in terms of optimization, as I am new to the lvgl library, but I will try for sure. If you need samples of digital signals between an ESP32 or an STM32F767ZI connected with an ILI9488 480x320 or performance tests, I am available to collaborate with you.

A quick look to the first digital capture I made shows that there are on average about 8ms idle between 12ms bursts of SPI data (@60MHz).

Just a little update: I tried @Carlos_Diaz ‘s lv_port_esp32_v7 in benchmark demo and in one of the bouncing gears demo I got 36 FPS @40MHz, 240MHz CPU. Also, many animations in which the FPS counter showed very low rates seemed good and quite smooth.

@persello
I’m very interested to optimize lvgl to run smoothly on ESP32.
Can we continue the discussion on the GitHub issue @Carlos_Diaz mentioned to keep things in one place?

HOW to set lvgl 30 fps
I use esp32 interface with tft9448 spi