Comments (5)
buf 1 flushing to display
as buf 1 is being written to the display copy the invalid areas from the buffer to buf 2
buf 2 gets updated by LVGL
hold program until buf 1 is fully flushed.
write buf 2 to the display
I assume that you are using a display with RGB interface. If so one step is missing from here: when do you switch the frame buffers buffers? With #6120 it will work like this:
buf1
flushing to screen: the flashing is fast as LVGL already rendered everything to the correct place, and we just need to wat for VSYNC. At this point stillbuf2
is shown.- LVGL wants to render to
buf2
, but it need to wait for VSYNC to not draw to the active buffer - Buffers are swapped, now
buf1
is on the screen,buf2
can be used for rendedring - Sync
buf2
frombuf1
- Draw to
buf2
- Flush
buf2
, same as 1)
If you are using an SPI/parallel based display with a display controller PARTIAL mode should be better choice.
from lvgl.
I am testing this using SDL locally but the same thing is being seen wen running an actual MCU with a display that has and RGB connection
I am not able to wrap my head around the order in which things are being done. It looks like the copying of the buffer is being done before the invalidated areas are rendered but the notes in the file say otherwise.
Are the notes incorrect?
I feel like there is a stall in the code that is causing a wait until the buffer gets emptied before doing anything. Even when removing that one wait that is in the code I still end up with a 15 millisecond hang when calling lv_task_handler. That seems like a very large amount of time for rendering 2 sliders. While I know the pixel count is high at 800 x 480 having that kind of a stall seems to be pretty excessive. This is also running on a PC and not a micro controller so the stall would be even longer on a microcontroller.
from lvgl.
This is what a user is running as a test...
scrn = lv.screen_active()
lslider = lv.slider(scrn)
lslider.set_style_size(225, 480, lv.PART.MAIN)
lslider.align(lv.ALIGN.TOP_LEFT, 0, 0)
rslider = lv.slider(scrn)
rslider.set_style_size(225, 480, lv.PART.MAIN)
rslider.align(lv.ALIGN.TOP_RIGHT, 0, 0)
slider_1_inc = 1
slider_2_inc = -1
slider_1_value = 0
slider_2_value = 100
while True:
time.sleep_ms(10)
lslider.set_value(slider_1_value, lv.ANIM.OFF)
slider_1_value += slider_1_inc
if slider_1_value in (0, 100):
slider_1_inc = -slider_1_inc
rslider.set_value(slider_2_value, lv.ANIM.OFF)
slider_2_value += slider_2_inc
if slider_2_value in (0, 100):
slider_2_inc = -slider_2_inc
start_time = time.ticks_ms()
lv.refr_now(lv.display_get_default())
stop_time = time.ticks_ms()
print('refr time:', time.tick_diff(stop_time, start_time))
print()
lv.tick_inc(10)
This test is only testing how long it takes for lv_refr_now to run after updating the 2 slider widgets
This is what I am getting for output
refr time: 185
refr time: 186
refr time: 186
Now change the code so a refresh is done after each widget has it's value changed
scrn = lv.screen_active()
lslider = lv.slider(scrn)
lslider.set_style_size(225, 480, lv.PART.MAIN)
lslider.align(lv.ALIGN.TOP_LEFT, 0, 0)
rslider = lv.slider(scrn)
rslider.set_style_size(225, 480, lv.PART.MAIN)
rslider.align(lv.ALIGN.TOP_RIGHT, 0, 0)
slider_1_inc = 1
slider_2_inc = -1
slider_1_value = 0
slider_2_value = 100
while True:
time.sleep_ms(10)
lslider.set_value(slider_1_value, lv.ANIM.OFF)
lv.refr_now(lv.display_get_default())
slider_1_value += slider_1_inc
if slider_1_value in (0, 100):
slider_1_inc = -slider_1_inc
rslider.set_value(slider_2_value, lv.ANIM.OFF)
slider_2_value += slider_2_inc
if slider_2_value in (0, 100):
slider_2_inc = -slider_2_inc
start_time = time.ticks_ms()
lv.refr_now(lv.display_get_default())
stop_time = time.ticks_ms()
print('refr time:', time.tick_diff(stop_time, start_time))
print()
lv.tick_inc(10)
so now I am only doing a refresh of one of the sliders and this is the output
refr time: 98
refr time: 98
refr time: 98
refr time: 98
The flickering and tearing is also reduced by 95%
98 milliseconds seems like a really long time for the refresh to run for. This is an RGB565 display that is 800 x 480 connected using an RGB bus with double buffering.
from lvgl.
forgot to mention that is running on an ESP32-S3
from lvgl.
Related Issues (20)
- Missing header file lfs.h HOT 3
- Compilation error for FATFS HOT 6
- Unable to change new PNG picture on loop HOT 4
- Core panic'ed lv_slider_set_value 8.4 HOT 4
- lv_label_set_text_fmt formats certain doubles wrong HOT 3
- Unable to load image from SD card - text file loads fine with `lv_fs_read` HOT 2
- LVGL Docs Page Broken For Older Versions HOT 1
- In the master branch, sliding the interface on the edge will cause lvgl to get stuck and cannot be operated anymore HOT 2
- Strange behavior ans crash with use of tabview HOT 5
- Add back CONFIG_LV_COLOR_16_SWAP HOT 10
- Progress bar is rendering incorrectly. HOT 7
- Documentation examples do not load in Chrome OSX when selected branch is master HOT 4
- Cannot rotate image when loaded line by line HOT 1
- https://docs.lvgl.io/8.3/ (and all prior to 9.1) link leads to 404 HOT 13
- snapshot question HOT 3
- Incorrect Relative Path for Including lvgl.h in lv_rnd_unicodes.h HOT 2
- corners of bg_image are not clipped in objects HOT 9
- LV_EVENT_CLICKED not generated when it is supposed to be. HOT 20
- Having 2 different font files as binary HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lvgl.