Screen scrolling speed

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

I am using a PIC32MX370F512L using PMP to write to a 40x272 12 bit display, and external SRAM that holds a full framebuffer, and DMA that constantly writes the framebuffer to the display. I am using the PIC32 C32 optimized compiler

What LVGL version are you using?

V7.4

What do you want to achieve?

I want to be able to smoothly display screen scroll animations that involve large portions of the framebuffer without moving slowly or choppily.

What have you tried so far?

I have tried and am still trying to see what can be optimized in my routine where I flush the LVGL buffer to my external SRAM to be handled by DMA, however I wonder what can be done to alert my display driver that a scrolling animation is happening so it can merely move framebuffer data by changing address ranges rather than rewriting it over previous data.

Any ideas? I am thinking this will require some form of modification to the LVGL source.

LVGL 7.x doesn’t have a mechanism for tracking when an object is moved vs. changed, so you would need to add logic to handle that. It might be better to focus your efforts on optimizing your display driver.

Does it help if we use page or tileview for scrolling and apply the functions lv_page_set_anim_time(page, anim_time) or lv_tileview_set_anim_time(tileview, anim_time) to change the animation speed?

I have a similar problem with a slow page-scroll too.

By “slow”, do you mean that the page just moves slowly, or do you mean visible screen tearing as it tries to redraw each frame? If it’s the former, your method would help (although the default speed is typically fine). If it’s the latter, the only solutions are:

  • finding a way of sending pixels to the display faster, or
  • using a smaller page to avoid needing to redraw as much screen area.

Yes, I do. With lv_page_get_anim_time(page) I found the default time is 400msec. So, I change it to 100msec with lv_page_set_anim_time(page, 100) with a significant speed change.

But I think there is a limit to the animation time to the framerate of the display, right? If framerate of the display is 60Hz (17msec), does it mean the lower limit of animation time is 17msec? I tried with real hardware and found setting it like lv_page_set_anim_time(page, 20) did not increase the scrolling speed further.

Just to make sure I understand correctly, when the time is set to 400ms, it takes roughly half a second to your eyes, right? If so, there’s no bug in LVGL, and your customization is exactly what you’re looking for.

Correct. If the display refreshes every 17 ms, you won’t see any animation steps that occur more frequently. The animation will appear to jump between frames.

When it is 400msec it looks like the whole page with full text scrolls pixel-by-pixel without any jump. It was smooth but slow in the sense that, it looks like for my small screen of 128 pixels height, it is going to take 400*128msec to scroll the whole page.

How the animation time is measured? When it is 400msec, does it mean it can scroll one page across in 400msec even for higher resolution e.g. 480*272?

I think the animation should be size-agnostic (i.e. it should take 400ms regardless of screen size, thus it would move faster on a larger display).

I would agree that it is most likely easiest to solve by making the drawing code more efficient. I can tell that the program is taking so long to flush the display that in order to complete the animation in enough time it is performing fewer display flushes per animation.