directfb2 / DirectFB2

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

Assistance getting started #70

Closed ghost closed 1 year ago

ghost commented 1 year ago

Hi! I'm just getting started with this project. I've had some difficulties getting set up as there isn't much documentation to go off, but I'm getting there. I'm very new to linux graphics in general and I'm not a linux developer, so please pardon my inexperience. I'm just poking around having fun, learning a lot along the way.

I have some issues and a question, but first here is where I'm currently at:

Issues:

Something is clearly very wrong with my wrapper.

Question:

Many thanks for any guidance.

caramelli commented 1 year ago

1) When calling meson for configuration, fbdev and linuxinput support are automatically enabled if the required headers are available (which is the case on a standard Linux system). Smooth scaling is enabled by default, and I recommend testing without multi application support first. So just run as documented in the INSTALL file: meson build/

2) DirectFB-fbdev is a project which can be used in very specific cases, typically on a platform without fbdev support on which DirectFB can run thanks to a specific system module for this platform. So in these very specific cases, it is possible to run Linux Framebuffer applications thanks to this "DirectFB wrapper". As you have a working Linux Framebuffer, DirectFB-fbdev is not suitable (you can directly run Linux Framebuffer applications like fbi without DirectFB2!)

3) Regarding the error of libdirectfb-2.0.so.0 not found when starting DirectFB examples, you can set LD_LIBRARY_PATH If you are unfamiliar with shared libraries, you still have the option of using static libraries by setting -Ddefault_library=static when calling meson

4) MPlayer has native DirectFB support, this is not present in mpv. But yes, mpv can run on top of DirectFB2 via SDL2!

ghost commented 1 year ago

Thanks a lot for the response! I closed my issue perhaps a bit prematurely, I didn't want to intrude on your time with amateur questions

I actually did try to set my LD_LIBRARY_PATH and the issue persisted, but I may have done that with dfb-fbdev and not with the dfb2 lib, so I will need to check on that when I get back to it. I'll keep hacking away at this and see where I can get with it.

Thanks again! I've become fascinated with the linux framebuffer lately, and having a lot of fun playing around.

My ultimate goal in all of this is a personal experiment to use a spare laptop to see if I can build a functional daily driver machine using only TUI applications (Awesome TUIs is a helpful collection of interesting software) and the framebuffer. No GUI applications, desktops, window managers, or compositors. I want to see how far I can get with it. For no particular reason, I prefer to use direct framebuffer over KMS/DRM. The reason for mpv, instead of mplayer, is to use invidtui for watching Youtube videos from the console.. it relies heavily on mpv. I asked within the mpv community on IRC and was basically berated for trying to use the framebuffer and received no support, so it only fanned the flames for my desire to continue in that direction.

caramelli commented 1 year ago

A distinction should probably be made between terminal user interface applications and applications relying on a graphics driver interface such as the Linux Framebuffer interface or the KMS/DRM interface. But yes, I understand the idea: start applications without complex GUI frameworks, without requiring many dependencies, without desktops or window managers.

I often use my system this way: see HiGFXback with Linux Framebuffer, KMS/DRM or DirectFB graphics backends. In particular, mpv is able to work directly using KMS/DRM: mpv -vo=drm file As said, SDL2 on top of DirectFB2 is also an option for mpv, but I would personally prefer to run something like this: mpv -vo=directfb file It's on my TODO list, and any help making it is welcome!

ghost commented 1 year ago

HiGFXback is how I found you to begin with actually. It was one of the best resources that I stumbled across in my research on Linux graphics, and went on to later find your FOSDEM talks

I would personally prefer to run something like this: mpv -vo=directfb file

That would be ideal.. I don't think I would've have gone on this adventure in the first place had that option existed. I was met with some degree of hostility when I brought up the topic of FB support in the mpv IRC.. the impression I got was that it is inferior to kms/drm and therefore there's no room for discussion. Unfortunate, really.

I tend to be the type who runs away from the popular consensus/latest and greatest, and I'm grateful that there is work being done to breathe life back into this older, but still relevant technology.

caramelli commented 1 year ago

We can probably debate a lot between the "legacy" Linux Framebuffer interface and the "modern" DRM/KMS interface. But regardless of opinions on the subject, the Linux Framebuffer is part of the history of the Linux system, and I still have a few embedded systems that depend on it. As long as you enjoy playing with the Linux Framebuffer on a system and are happy with the performance and rendering, I consider that to be the most important.

DirectFB2 can be used with a system module based on Linux Framebuffer interface or based on DRM/KMS interface (it is also possible to use specific system modules on MCU boards for example, or on embedded platforms like the Raspberry Pi with DirectFB2-eglrpi). This gives the freedom to use any graphics driver interface. Despite this, not sure that adding DirectFB support to the mpv project would be well received...

caramelli commented 1 year ago

mpv/SDL2/DirectFB2/FBDev

mpv-directfb2