Coder Social home page Coder Social logo

Comments (11)

embeddedt avatar embeddedt commented on May 24, 2024

My educated guess would be that you are running out of heap space.

from lv_lib_png.

matinrn avatar matinrn commented on May 24, 2024

My educated guess would be that you are running out of heap space.

I don't think that's the case here, because esp32 has 294k free heap before trying to show the image while the image size is only 20k.

from lv_lib_png.

kisvegabor avatar kisvegabor commented on May 24, 2024

What is the resolution of the image?

It needs minimum hor. res. x ver. res. x 4 bytes

from lv_lib_png.

matinrn avatar matinrn commented on May 24, 2024

What is the resolution of the image?

It needs minimum hor. res. x ver. res. x 4 bytes

I'm using the image that came with the library (png_decoder_test.c) which is 200 x 150 and it needs 200 x 150 x 4=120kB which is about 1/3 of esp's free heap (294kB) in this project.

from lv_lib_png.

kisvegabor avatar kisvegabor commented on May 24, 2024

Do you see anything suspicious if you enable logging in lv_conf.h?

from lv_lib_png.

matinrn avatar matinrn commented on May 24, 2024

Do you see anything suspicious if you enable logging in lv_conf.h?

I can't figure out the problem from the logs so I just post them here.

there's no log on LV_LOG_LEVEL_ERROR.
here's the log on LV_LOG_LEVEL_WARN:
.pio\libdeps\esp32dev\lvgl\src\lv_draw\lv_img_cache.c@135->fnn: _lv_img_cache_open ->Image draw cannot open the image resource .pio\libdeps\esp32dev\lvgl\src\lv_draw\lv_draw_img.c@88->fnn: lv_draw_img ->Image draw error .pio\libdeps\esp32dev\lvgl\src\lv_draw\lv_img_cache.c@135->fnn: _lv_img_cache_open ->Image draw cannot open the image resource .pio\libdeps\esp32dev\lvgl\src\lv_draw\lv_draw_img.c@88->fnn: lv_draw_img ->Image draw error .pio\libdeps\esp32dev\lvgl\src\lv_draw\lv_img_cache.c@135->fnn: _lv_img_cache_open ->Image draw cannot open the image resource .pio\libdeps\esp32dev\lvgl\src\lv_draw\lv_draw_img.c@88->fnn: lv_draw_img ->Image draw error .pio\libdeps\esp32dev\lvgl\src\lv_draw\lv_img_cache.c@135->fnn: _lv_img_cache_open ->Image draw cannot open the image resource .pio\libdeps\esp32dev\lvgl\src\lv_draw\lv_draw_img.c@88->fnn: lv_draw_img ->Image draw error

and here's the pastebin link for the log on LV_LOG_LEVEL_INFO.

from lv_lib_png.

kisvegabor avatar kisvegabor commented on May 24, 2024

Have you called lv_png_init()?

from lv_lib_png.

matinrn avatar matinrn commented on May 24, 2024

Have you called lv_png_init()?

Yes, I've called it right after calling lv_init().

from lv_lib_png.

kisvegabor avatar kisvegabor commented on May 24, 2024

I've tested it on PC and worked well for me.

I suggest debugging the devoder_open() function to see why it can't open the imaga.

from lv_lib_png.

matinrn avatar matinrn commented on May 24, 2024

I suggest debugging the devoder_open() function to see why it can't open the imaga.

I did it and function lodepng_decode32() which is called inside decoder_open() returns error 83 which means "memory allocation failed".
I used smaller pictures and it worked fine with a 150x100 png c array, but fails with a 200x100 one.
It's still confusing since esp32 has about 300kB free ram available and a 200x100 png c array needs only ~80kB of ram.

from lv_lib_png.

kisvegabor avatar kisvegabor commented on May 24, 2024

It's more than 80kB because the one decoder uses some internal working buffers too, but it shouldn't be an extra 220 kB.

Maybe it's somehow specific to ESP32 memory manager.

You can try to change lodepng's malloc/free to lv_mem_alloc/realloc/free and give areally large LV_MEM_SIZE to LVGL.

from lv_lib_png.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.