directfb2 / DirectFB2

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

DirectFB2 Runs on Ubuntu? #74

Closed Greijus closed 1 year ago

Greijus commented 1 year ago

Hi,

I was able to compile the DirectFB2 library and examples on my desktop PC running on Ubuntu 20.04. However, when running the examples from the terminal I see the following:

stresstech@tech:~$ df_neo

   ~~~~~~~~~~~~~~~~~~~~~~~~~~| DirectFB 2.0.0  |~~~~~~~~~~~~~~~~~~~~~~~~~~
        (c) 2017-2022  DirectFB2 Open Source Project (fork of DirectFB)
        (c) 2012-2016  DirectFB integrated media GmbH
        (c) 2001-2016  The world wide DirectFB Open Source Community
        (c) 2000-2004  Convergence (integrated media) GmbH
      ----------------------------------------------------------------

(*) DirectFB/Core: Single Application Core. (2022-11-23 14:56) 
(*) DRMKMS/System: Using device /dev/dri/card0 (default)
(*) DRMKMS/System: Found 2 connectors, 2 encoders, 3 planes
(!) DRMKMS/VT: Error opening '/dev/tty0'!
    --> Permission denied
(!) Core/Parts: Could not initialize 'system_core' core!
    --> A general initialization error occurred
Segmentation fault (core dumped)

These are mi questions:

  1. It is possible to run these examples at all in host machines?
  2. Can I run the DFBTerm on my host? If so, how?

Thank you, and my apologies for such elementary questions.

caramelli commented 1 year ago

Switch to a virtual console, on the first for example by pressing Ctrl + Alt + F1 Then you can try running examples with sudo

DFBTerm depends on the LiTE library. So you need to install LiTE first (same way as DirectFB2) and then install DFBTerm Switch to a virtual console and run dfbterm using sudo

Greijus commented 1 year ago

I tryed to run df_andi from tty3 totty6 using Ctrl + Alt + F3 to Ctrl + Alt + F6, but I get the same error log posted in the first comment. Ctrl + Alt + F1 is GUI login screen, Ctrl + Alt + F2 is GUI desktop (see https://askubuntu.com/questions/66195/what-is-a-tty-and-how-do-i-access-a-tty)

Looks like tty0 is not available somehow in Ubuntu 20.04 (Error opening '/dev/tty0'!).

Do you have any other suggestion? Is worth to mention that I was able to run the FusionSound2 examples fs_buffer and fs_stream from the virtual consoles as well as from the normal linux terminal.

caramelli commented 1 year ago

What is the output of the following command: stat /dev/tty0

Have you tried running examples using sudo?

Greijus commented 1 year ago

logs when executing $ df_andi and $ sudo df_andi from tty3: MicrosoftTeams-image

Also, this are the logs from normal terminal:

stresstech@tech:~$ df_andi

   ~~~~~~~~~~~~~~~~~~~~~~~~~~| DirectFB 2.0.0  |~~~~~~~~~~~~~~~~~~~~~~~~~~
        (c) 2017-2023  DirectFB2 Open Source Project (fork of DirectFB)
        (c) 2012-2016  DirectFB integrated media GmbH
        (c) 2001-2016  The world wide DirectFB Open Source Community
        (c) 2000-2004  Convergence (integrated media) GmbH
      ----------------------------------------------------------------

(*) DirectFB/Core: Single Application Core. (2023-01-03 07:25) 
(*) DRMKMS/System: Using device /dev/dri/card0 (default)
(*) DRMKMS/System: Found 2 connectors, 2 encoders, 3 planes
(!) DRMKMS/VT: Error opening '/dev/tty0'!
    --> Permission denied
(!) Core/Parts: Could not initialize 'system_core' core!
    --> A general initialization error occurred
Segmentation fault (core dumped)
stresstech@tech:~$ 
stresstech@tech:~$ 
stresstech@tech:~$ 
stresstech@tech:~$ sudo df_andi

   ~~~~~~~~~~~~~~~~~~~~~~~~~~| DirectFB 2.0.0  |~~~~~~~~~~~~~~~~~~~~~~~~~~
        (c) 2017-2023  DirectFB2 Open Source Project (fork of DirectFB)
        (c) 2012-2016  DirectFB integrated media GmbH
        (c) 2001-2016  The world wide DirectFB Open Source Community
        (c) 2000-2004  Convergence (integrated media) GmbH
      ----------------------------------------------------------------

(*) DirectFB/Core: Single Application Core. (2023-01-03 07:25) 
(*) DRMKMS/System: Using device /dev/dri/card0 (default)
(*) DRMKMS/System: Found 2 connectors, 2 encoders, 3 planes
(*) DirectFB/Input: Logitech USB Receiver (1) 0.1 (DirectFB)
(*) DirectFB/Input: Logitech USB Receiver Mouse (2) 0.1 (DirectFB)
(*) DirectFB/Input: Logitech USB Receiver Consumer  (3) 0.1 (DirectFB)
(*) DirectFB/Input: Jabra Link 370 (4) 0.1 (DirectFB)
(*) DirectFB/Input: Eee PC WMI hotkeys (5) 0.1 (DirectFB)
(*) DirectFB/Input: Hot-plug detection enabled with Linux Input
(*) DirectFB/Genefx: MMX enabled
(*) DirectFB/Graphics: MMX Software Rasterizer 0.7 (DirectFB)
(*) DRMKMS/Screen: Default mode is 1920x1200 (10 modes in total)
(*) DRMKMS/Layer: Supported properties for layer id 39
(*)      alpha
(*)      zpos
(!) DRMKMS/Layer: drmModeObjectSetProperty() failed setting zpos!
    --> Permission denied
(!) Core/Layers: Failed to initialize layer 1!
    --> Access to the resource is denied
(!) Core/Parts: Could not initialize 'layer_core' core!
    --> Access to the resource is denied
../src/df_andi.c <494>:
    (!) DirectFBError [DirectFBCreate( &dfb )]: Access to the resource is denied
caramelli commented 1 year ago

OK, can you try: sudo df_andi --dfb:system=fbdev

I never had the failure of drmModeObjectSetProperty(), I don't have an explanation for the moment, it's to be investigated...

Greijus commented 1 year ago

ok! it worked with the command sudo df_andi --dfb:system=fbdev. Thanks!

caramelli commented 1 year ago

Regarding the drmModeObjectSetProperty() failure, I'm curious what happens if you just remove the error check that follows the call to drmModeObjectSetProperty() in the drmkmsPlaneInitLayer() function:

if (err) {
     ret = errno2result( errno );
     D_PERROR( "DRMKMS/Layer: drmModeObjectSetProperty() failed setting zpos!\n" );
     return ret;
}

Rebuild, install, then run: sudo df_andi (or sudo df_andi --dfb:system=drmkms)

Greijus commented 1 year ago

I followed your instructions and it worked! I commented the error check in the drmkms_layer.c, then when runnning sudo df-andi works just fine, I see the pinguins...

caramelli commented 1 year ago

Great, thanks for this test! So the drmkms system module will be updated accordingly.

Since you are running DirectFB2 on your desktop, you probably have a graphics card with OpenGL support. Although there are still some issues to be fixed, note that the DirectFB2-eglgbm system module combined with the DirectFB2-gles2 GFX driver provides hardware acceleration support.

To get an idea of ​​the performance:

df_andi --dfb:system=eglgbm
df_dok --dfb:system=eglgbm