directfb2 / DirectFB2

Core DirectFB library
GNU Lesser General Public License v2.1
132 stars 15 forks source link

DirectFB2 for NuttX failing to compile because fluxcomp not found #117

Closed acassis closed 1 year ago

acassis commented 1 year ago

@caramelli I'm trying to compiled DirectFB2 on NuttX RTOS but it is failing:

$ make -j
Create version.h
LN: platform/board to /home/alan/nuttxspace/apps/platform/dummy
/usr/bin/bash: line 1: fluxcomp: command not found
/usr/bin/bash: line 1: fluxcomp: command not found
make[3]: *** [Makefile:229: src/core/CoreDFB.c] Error 127
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [Makefile:229: src/core/CoreGraphicsState.c] Error 127
/usr/bin/bash: line 1: fluxcomp: command not found
/usr/bin/bash: line 1: fluxcomp: command not found
make[3]: *** [Makefile:229: src/core/CoreInputDevice.c] Error 127
make[3]: *** [Makefile:229: src/core/CoreLayer.c] Error 127
/usr/bin/bash: line 1: fluxcomp: command not found
/usr/bin/bash: line 1: fluxcomp: command not found
make[3]: *** [Makefile:229: src/core/CoreLayerContext.c] Error 127
make[3]: *** [Makefile:229: src/core/CoreLayerRegion.c] Error 127
Downloading: v8.3.3.zipmake[2]: *** [Makefile:58: /home/alan/nuttxspace/apps/graphics/DirectFB2_context] Error 2
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:175: context] Error 2
make: *** [tools/Unix.mk:436: /home/alan/nuttxspace/apps/.context] Error 2

The INSTALL file only say: "fluxcomp for converting .flux interface description files to .c files" but no clue where and how to get it.

I searched in the Debian/Ubuntu repositories and didn't find it. Searching in the google also didn't help much. Even https://pypi.org/search/ was not able to find it :-)

Since fluxcomp is not part of Linux distros yet, maybe we should include a target in the Makefile to compile and use it.

What do you think?

Update: I used the fluxcomp from here: https://github.com/kevleyski/fluxcomp but the compilation didn't work. It returned:

Flux Compiler Tool (version 1.4.4)

Usage: fluxcomp [options] <filename>
...
make[3]: *** [Makefile:229: src/core/CoreSurface.c] Error 255
make[3]: *** [Makefile:229: src/core/CoreLayerRegion.c] Error 255
make[2]: *** [Makefile:58: /home/alan/nuttxspace/apps/graphics/DirectFB2_context] Error 2
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:175: context] Error 2
caramelli commented 1 year ago

Some discussions on fluxcomp: https://github.com/directfb2/DirectFB2/issues/9

You can get the source from https://github.com/deniskropp/flux

fluxcomp is a small tool required on the host: since most distributions do not provide an updated version of the flux package, this prerequisite tool can be installed manually (like kconfig-frontends on Ubuntu 18.04 and earlier)

acassis commented 1 year ago

Thank you very much Nicolas! The DirectFB2 compilation was successful, but I got some warnings, please take a look: https://gist.github.com/acassis/6921765cba0f8c69c046e1f3c26c94c8

I wrote a blog post showing all the steps here: https://acassis.wordpress.com/2023/05/13/how-to-compile-directfb2-on-nuttx/

caramelli commented 1 year ago

OK, DirectFB2 has been updated to NuttX-12.1.0 (this should fix warnings): https://github.com/directfb2/DirectFB2/commit/72698b25fef7de684374b50761c675eaaf1d5355

For my part, I currently use the sim:fb configuration on which I add:

RTOS Features  --->
    Pthread Options  ---> 
        [*] Enable mutex types
        [*] pthread cleanup stack

and :

System Type  --->
    Simulated Graphics/Input  --->
        [*] X11 graphics/input

Note that the current build is done with the dummy system module (this corresponds to offscreen rendering). The next step will be to run some DirectFB-examples with a nuttxfb system module...

acassis commented 1 year ago

Thank you very much @caramelli I'll update the tutorial!

I'm thinking about some RTSP client demo using DirectFB on ESP32 board with 8MB PSRAM or other board with enough external memory. I friend of mine here at Espressif already ported rtptools to NuttX (he will submit) to mainline soon. But it is focused on Audio.

For video I think we need to use this: https://github.com/ireader/media-server

caramelli commented 1 year ago

Interesting, using a DirectFB video provider would be fine.

For example, you can test it with the fbdev system module and FFmpeg video provider https://github.com/directfb2/DirectFB2-media/blob/master/interfaces/IDirectFBVideoProvider/idirectfbvideoprovider_ffmpeg.c

df_video_sample_rtsp

What are you planning to use for video decoding on ESP32?

acassis commented 1 year ago

WOW! Very nice demo @caramelli !!!

Yes, the idea is similar to that, but ffmpeg and gstreamer should be difficult to port to NuttX, just guessing maybe it could be easier than I'm supposing.

Yes, my idea is to have some video demo running on ESP32/ESP32S3. Currently only Sony Spresense board (and a SAMV7 with OV2640) has some support to video on NuttX.

acassis commented 1 year ago

May I clone this issue now? Do you have some Discord channel where we can discuss these ideas?

caramelli commented 1 year ago

Just open dedicated issues for any ideas you want to discuss about DirectFB: this makes it easy to share information with anyone who follows the DirectFB2 project.