-
Notifications
You must be signed in to change notification settings - Fork 83
Closed
Labels
bugSomething isn't workingSomething isn't workingquestionFurther information is requestedFurther information is requested
Description
Changing the lv_drv_cmore lv_cronf.h to work with GTK makes that it doesn't compile anymore.
Is this intentional ?
I have libgtk-3.0 dev installed.
My intention is to write and test a GUI dashboard under Ubuntu and then run it on raspberry pi using the framebuffer.
running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-m64" "-I" "/home/lieven/.cargo/registry/src/github.com-1ecc6299db9ec823/lvgl-sys-0.6.2/vendor/lvgl/src" "-I" "/home/lieven/.cargo/registry/src/github.com-1ecc6299db9ec823/lvgl-sys-0.6.2/vendor" "-I" "/home/lieven/workspace/lv_1" "-I" "/home/lieven/.cargo/registry/src/github.com-1ecc6299db9ec823/lvgl-sys-0.6.2/vendor/lv_drivers" "-I" "/usr/include" "-I" "/usr/local/include" "-DLV_CONF_INCLUDE_SIMPLE=1" "-o" "/home/lieven/workspace/lv_1/target/debug/build/lvgl-sys-5f991eed6eeaed4e/out/20eb48ef7c011711-gtkdrv.o" "-c" "/home/lieven/.cargo/registry/src/github.com-1ecc6299db9ec823/lvgl-sys-0.6.2/vendor/lv_drivers/gtkdrv/gtkdrv.c"
cargo:warning=/home/lieven/.cargo/registry/src/github.com-1ecc6299db9ec823/lvgl-sys-0.6.2/vendor/lv_drivers/gtkdrv/gtkdrv.c:12: warning: "_DEFAULT_SOURCE" redefined
cargo:warning= 12 | #define _DEFAULT_SOURCE /* needed for usleep() */
cargo:warning= |
cargo:warning=In file included from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
cargo:warning= from /usr/include/stdint.h:26,
cargo:warning= from /usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h:9,
cargo:warning= from /home/lieven/workspace/lv_1/lv_conf.h:20,
cargo:warning= from /home/lieven/workspace/lv_1/lv_drv_conf.h:16,
cargo:warning= from /home/lieven/.cargo/registry/src/github.com-1ecc6299db9ec823/lvgl-sys-0.6.2/vendor/lv_drivers/gtkdrv/gtkdrv.h:18,
cargo:warning= from /home/lieven/.cargo/registry/src/github.com-1ecc6299db9ec823/lvgl-sys-0.6.2/vendor/lv_drivers/gtkdrv/gtkdrv.c:9:
cargo:warning=/usr/include/features.h:236: note: this is the location of the previous definition
cargo:warning= 236 | # define _DEFAULT_SOURCE 1
cargo:warning= |
cargo:warning=/home/lieven/.cargo/registry/src/github.com-1ecc6299db9ec823/lvgl-sys-0.6.2/vendor/lv_drivers/gtkdrv/gtkdrv.c:15:10: fatal error: gtk/gtk.h: No such file or directory
cargo:warning= 15 | #include <gtk/gtk.h>
cargo:warning= | ^~~~~~~~~~~
cargo:warning=compilation terminated.
exit status: 1
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingquestionFurther information is requestedFurther information is requested
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
nia-e commentedon Apr 30, 2023
Hi!
GTK support is currently untested; only SDL2 is fully confirmed to be working for the drivers and should be considered "ready". However, I'm unsure why this specific issue is occuring; setting the
LVGL_INCLUDE
environment variable manually may remedy this issue though (by default, it will be set to/usr/include,/usr/local/include
). See the docs for details. Also, I had experienced some issues with building the GTK bindings in the past and I suspect there may be issues upstream. Getting this fixed will be added to the roadmap for 0.7 though so thank you for the logs!vortex314 commentedon Apr 30, 2023
Yeah, it looks I am one of the first to try.
Compiling succeeds with
[-]Can this cargo work with gtk ? [/-][+]Can this crate work with gtk ? [/+]cydergoth commentedon Apr 30, 2023
vortex314 commentedon Apr 30, 2023
Now stuck at setting the color_depth correct . In GTK linux this is 32 bit, bu the crate doesnùt adapt when chaning this in lv_conf.h
Compiler error
Additionl challenge, my sample creates the buffer on stack, so I got a LInux stack overflow with this code
nia-e commentedon Apr 30, 2023
Thanks! This should be configured automatically once #82 is merged.
I think I know the issue here. I'll merge a fix tomorrow and give you a ping.
This is a known issue with creating large
DrawBuffer
s, I'm unsure how to approach fixing this. However, you can make the buffer smaller; the LVGL docs claim that it should be identical performance-wise down to the buffer being 1/10th the size of the display.vortex314 commentedon Apr 30, 2023
@nia-e great ! Thanks for the swift feedback. Looking forward to the evolution.
vortex314 commentedon Apr 30, 2023
For what it's worth , got so far

Not clear where the bottom text comes from...
nia-e commentedon Apr 30, 2023
Guessing that's the result of the horribly broken color depth? Still, glad to see GTK (almost) working :D
nia-e commentedon Apr 30, 2023
Ah, forgot to add - the bottom text is configurable in
lv_conf.h
. It's on by default in the example file for debugging purposes.vortex314 commentedon Apr 30, 2023
Concerning the stack overflow, this can be patched by the command under linux :
This increase the stack from 8 MB to 30 MB . And permitted to have a resolution of 1024x768.

A better solution would be to create this buffer on the heap.
Still looking at the ugly colors. :-D
nia-e commentedon Apr 30, 2023
The buffer does live on the heap; the issue is just that on creation, it is (briefly) allocated on the stack. The relevant code is here. Feel free to suggest fixes, but the buffer-related code is probably the most radioactive code in this entire project so be warned
nia-e commentedon May 1, 2023
Hi @vortex314,
A possible fix for the colourspace issue should be on the branch in #104. Can you give this a test and let me know if it runs successfully?
vortex314 commentedon May 1, 2023
Looking much better now.

cargo.toml
and lv_conf.h
nia-e commentedon May 1, 2023
Perfect! The patch should be on master now
vortex314 commentedon May 1, 2023
Thanks for the fast update. Just for future reference I simplified build by using .cargo/config.toml
vortex314 commentedon May 1, 2023
Looks fine now, Thanks for the help.
nia-e commentedon May 8, 2023
Re: the stack overflow mentioned in this issue; it should be fixed as soon as #117 is merged. I think it's ready but I'll wait for tomorrow to merge it just in case anyone spots an issue with it (there have been many)