Only small image are displayed !?

Description

from Flash memory or SDcard, i can display only small images size.
all is working as expected, but only for small images (like 150x150 pixels)

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

ESP32-S3 8MB flash / 2MB PSRAM
ESP32-S3-HMI-DevKit 800x480 display
https://github.com/W00ng/ESP32-S3-HMI-DevKit/

What LVGL version are you using?

8.3.4

What do you want to achieve?

display images on full screen (800x480), eventually using PSRAM if required
the final goal is to make a sort of screen saver, displaying all images (jpg, bmp or png) from an directory on the SDcard.

What have you tried so far?

read all forums ! :frowning:
i found a lot of thread, but nothing help me

What happens when you display a large image? Do you get a “No Data” placeholder? It might be that you are running out of memory when displaying the image. Try turning on logging. If you’re running out of memory it should print something there.

To increase the memory you might want to adjust LV_MEM_SIZE in lv_conf.h but without the logs this is just a guess.

hi Jake thanks for your reply,

for file from flash memory (C source include in the program), nothing, black screen
but for JPG files from SDcard, yes a white rectangle with “No data”.
a small JPG file from SDcard works as expected.

from log :
[Warn] (75.220, +75220) _lv_img_cache_open: Image draw cannot open the image resource (in lv_img_cache.c line #125)
[Warn] (75.221, +1) lv_draw_img: Image draw error (in lv_draw_img.c line #81)
[Warn] (75.268, +47) _lv_img_cache_open: Image draw cannot open the image resource (in lv_img_cache.c line #125)
[Warn] (75.269, +1) lv_draw_img: Image draw error (in lv_draw_img.c line #81)
[Warn] (75.316, +47) _lv_img_cache_open: Image draw cannot open the image resource (in lv_img_cache.c line #125)
[Warn] (75.316, +0) lv_draw_img: Image draw error (in lv_draw_img.c line #81)
[Warn] (75.363, +47) _lv_img_cache_open: Image draw cannot open the image resource (in lv_img_cache.c line #125)
[Warn] (75.363, +0) lv_draw_img: Image draw error (in lv_draw_img.c line #81)
[Warn] (75.410, +47) _lv_img_cache_open: Image draw cannot open the image resource (in lv_img_cache.c line #125)
[Warn] (75.410, +0) lv_draw_img: Image draw error (in lv_draw_img.c line #81)
[Warn] (75.457, +47) _lv_img_cache_open: Image draw cannot open the image resource (in lv_img_cache.c line #125)
[Warn] (75.457, +0) lv_draw_img: Image draw error (in lv_draw_img.c line #81)
[Warn] (75.504, +47) _lv_img_cache_open: Image draw cannot open the image resource (in lv_img_cache.c line #125)
[Warn] (75.504, +0) lv_draw_img: Image draw error (in lv_draw_img.c line #81)
[Warn] (75.551, +47) _lv_img_cache_open: Image draw cannot open the image resource (in lv_img_cache.c line #125)
[Warn] (75.552, +1) lv_draw_img: Image draw error (in lv_draw_img.c line #81)
[Warn] (75.598, +46) _lv_img_cache_open: Image draw cannot open the image resource (in lv_img_cache.c line #125)
[Warn] (75.599, +1) lv_draw_img: Image draw error (in lv_draw_img.c line #81)
[Warn] (75.645, +46) _lv_img_cache_open: Image draw cannot open the image resource (in lv_img_cache.c line #125)
[Warn] (75.646, +1) lv_draw_img: Image draw error (in lv_draw_img.c line #81)
[Warn] (75.692, +46) _lv_img_cache_open: Image draw cannot open the image resource (in lv_img_cache.c line #125)
[Warn] (75.693, +1) lv_draw_img: Image draw error (in lv_draw_img.c line #81)
[Warn] (75.740, +47) _lv_img_cache_open: Image draw cannot open the image resource (in lv_img_cache.c line #125)
[Warn] (75.740, +0) lv_draw_img: Image draw error (in lv_draw_img.c line #81)
[Warn] (75.787, +47) _lv_img_cache_open: Image draw cannot open the image resource (in lv_img_cache.c line #125)
[Warn] (75.787, +0) lv_draw_img: Image draw error (in lv_draw_img.c line #81)
[Warn] (75.834, +47) _lv_img_cache_open: Image draw cannot open the image resource (in lv_img_cache.c line #125)
[Warn] (75.834, +0) lv_draw_img: Image draw error (in lv_draw_img.c line #81)
[Warn] (75.881, +47) _lv_img_cache_open: Image draw cannot open the image resource (in lv_img_cache.c line #125)
[Warn] (75.881, +0) lv_draw_img: Image draw error (in lv_draw_img.c line #81)
[Warn] (75.928, +47) _lv_img_cache_open: Image draw cannot open the image resource (in lv_img_cache.c line #125)
[Warn] (75.928, +0) lv_draw_img: Image draw error (in lv_draw_img.c line #81)
[Warn] (75.976, +48) _lv_img_cache_open: Image draw cannot open the image resource (in lv_img_cache.c line #125)
[Warn] (75.976, +0) lv_draw_img: Image draw error (in lv_draw_img.c line #81)
[Warn] (76.023, +47) _lv_img_cache_open: Image draw cannot open the image resource (in lv_img_cache.c line #125)
[Warn] (76.023, +0) lv_draw_img: Image draw error (in lv_draw_img.c line #81)
[Warn] (76.070, +47) _lv_img_cache_open: Image draw cannot open the image resource (in lv_img_cache.c line #125)
[Warn] (76.071, +1) lv_draw_img: Image draw error (in lv_draw_img.c line #81)
[Warn] (76.117, +46) _lv_img_cache_open: Image draw cannot open the image resource (in lv_img_cache.c line #125)
[Warn] (76.118, +1) lv_draw_img: Image draw error (in lv_draw_img.c line #81)
[Warn] (76.165, +47) _lv_img_cache_open: Image draw cannot open the image resource (in lv_img_cache.c line #125)
[Warn] (76.165, +0) lv_draw_img: Image draw error (in lv_draw_img.c line #81)
[Warn] (76.212, +47) _lv_img_cache_open: Image draw cannot open the image resource (in lv_img_cache.c line #125)
[Warn] (76.212, +0) lv_draw_img: Image draw error (in lv_draw_img.c line #81)

i already increase :
#define LV_MEM_SIZE (128U * 1024U) /*[bytes] initial (48U * 1024U) */
i can’t more. that is why i ask to use eventualy the PSRAM too, but i can’t find a simple example to do it.

regards

oh my god …

just switching
#define LV_MEM_CUSTOM 1

and now the image from the SDcard is working …
slowly, but my image appear :slight_smile:
I thought I had to write my own functions (malloc, free and realloc) … but no, it works like this :o)

Is there anything I can do to speed up the display of the image?
and it take a lot of CPU ressource !

but the big image (800x480) from the flash memory is NOT working : black screen and nothing from the log

thanks
phil

well, the jpg decoder is really too slow :frowning:
it take up to 10 secondes to draw a full image !
and take a lot a CPU ressource, that hang too much the webserver

the only way i found is to convert all images to bmp format.
but there is another problem now ! :
decoder_open: LV_COLOR_DEPTH == 16 but bpp is 24 (should be 16) (in lv_bmp.c line #162)

with paint.net i can’t convert the bmp to 16 bits !.. there is only 8 or 24bits option available !
is there a way to automaticaly adjust the color depth ?
something like a lookup table or ?
that will allow to save on SDcard any bmp depth color !

thanks

That’s good that you figured out what was taking up the CPU time.

I’m not sure of a good way to do this at runtime in LVGL but if you’re using BMP files you can use the free GNU Image Manipulation Program to convert them to 16 bits per pixel. When exporting you can choose the bit depth in the advanced options.

Hi Jake,

I’m not saying that I solved the CPU consumption problem. I say that using BMP files will be faster than JPGs.
the new constraint is to have all the BMP files in 16 bits (for my screen configuration). which is not very practical.
I would like to know if there is a solution to avoid having to convert all the files. JPG files obviously do not require a specific format related to the configuration of the screen.

or if there is a solution combining the JPG decoder and the PSRAM memory to speed up the display?
this thread https://forum.lvgl.io/t/how-to-preload-image-resources-from-fatfs-to-psram/10427 seems like a way?

thanks, regards