directfb2 / DirectFB2

Core DirectFB library
GNU Lesser General Public License v2.1
136 stars 16 forks source link

Problem with input #149

Closed stefan11111 closed 3 months ago

stefan11111 commented 5 months ago

I have tried this with multiple builds of DirectFB2, with and without linux_input, with and without multi application support, and also a default build. In all of this, the same problem appears.

The graphics are rendered properly, but applications don't register input. I have tried df_input from the examples repo, and it shows no input, and after some time exits. Other examples, like df_andi work, but since input doesn't work, I can't quit them.

This is not a problem when using the original DirectFB project.

stefan11111 commented 5 months ago

Here's some output from df_andi after running pkill df_andi via telnet:

        (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: Multi Application Core. (2024-05-04 14:50)
(*) Fusion/SHM: Using MADV_REMOVE
(*) FBDev/System: Using device /dev/fb0 as specified in DirectFB configuration
(*) FBDev/System: Found 'EFI VGA' (ID 0) with framebuffer at 0xf1000000, 3072k (MMIO 0x00000000, 0k)
(*) DirectFB/Input: Virtual Input 0.1 (DirectFB)
(*) DirectFB/Input: Hot-plug detection enabled with Linux Input
(*) DirectFB/Genefx: MMX enabled
(*) DirectFB/Graphics: Genefx Software Rasterizer 0.7 (DirectFB)
(!) *** ONCE [no mode found for 1024x720] *** [../DirectFB2-9999/systems/fbdev/fbdev_mode.c:650 in fbdev_find_mode()]
(*) FBDev/Screen: Default mode is 1024x768 (1 modes in total)
(*) DirectFB/Core/WM: Default 0.3 (DirectFB)
(*) FBDev/Mode: Setting 1024x768 RGB32
(*) FBDev/Mode: Switched to 1024x768 (virtual 1024x768) at 32 bits (RGB32), pitch 4096
(*) FBDev/Mode: Setting 1024x720 RGB32
(*) FBDev/Mode: Switched to 1024x768 (virtual 1024x768) at 32 bits (RGB32), pitch 4096
(*) Direct/Interface: Loaded 'DGIFF' implementation of 'IDirectFBFont'
(*) Direct/Interface: Loaded 'DFIFF' implementation of 'IDirectFBImageProvider'
(*) FBDev/Mode: Setting 1024x720 RGB32
(*) FBDev/Mode: Switched to 1024x768 (virtual 1024x768) at 32 bits (RGB32), pitch 4096
(=) [SigHandler       11196.285,966] ( 5769) Direct/Signals:             [../DirectFB2-9999/lib/direct/os/linux/signals.c:283 in show_any()]   --> Caught signal 15 (sent by pid 5864, uid 0) <--
(=) [SigHandler       11196.285,990] ( 5769) Direct/Signals:             [../DirectFB2-9999/lib/direct/os/linux/signals.c:319 in call_handlers()]   --> -1
(!) Direct/Thread/Init: Canceling 'Fusion Dispatch' (5770)!

Here's my .directfbrc, some lines are commented out:

system=fbdev
fbdev=/dev/fb0
#mode=1920x1080
#depth=32
depth=32
mode=1024x720
#mode=1024x768
caramelli commented 5 months ago

If the event device interface is supported on your Linux system, the DirectFB input driver module should be built and installed in "lib install directory"/directfb-2.0-0/inputdrivers/libdirectfb_linux_input.so

What is the output of the following command: ls /dev/input

stefan11111 commented 5 months ago

Thanks, after rebuilding my kernel with CONFIG_EVDEV enabled, input started to work.

However, applications running under DirectFB2 seem to run way slower that under DirectFB. When running df_fire, it barely runs, when under the old DirectFB it would work flawlessly. Even leafpad seems to run slow on DirectFB2. df_andi, however, runs in ~500fps both on DirectFB and DirectFB2.

These are the build options I used for DirectFB and DirectFB2. DirectFB:

./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --disable-dependency-tracking --disable-silent-rules --docdir=/usr/share/doc/DirectFB-1.7.7 --htmldir=/usr/share/doc/DirectFB-1.7.7/html --libdir=/usr/lib64 --disable-static --enable-x11 --disable-divine --disable-sawman --disable-fusiondale --disable-fusionsound --enable-fbdev --enable-mmx --enable-sse --disable-egl --disable-idirectfbgl-egl --disable-jpeg --disable-png --disable-mng --disable-gstreamer --disable-gif --disable-tiff --disable-imlib2 --disable-pnm --disable-svg --disable-mpeg2 --disable-libmpeg3 --disable-flash --disable-xine --disable-xine-vdpau --disable-ffmpeg --disable-bmp --disable-jpeg2000 --disable-openquicktime --disable-avifile --disable-freetype --disable-webp --disable-debug --disable-zlib --disable-video4linux --disable-video4linux2 --disable-x11vdpau --disable-multicore --enable-dynload --disable-mesa --disable-drmkms --with-fs-drivers=,alsa --without-timidity --without-wawe --without-vorbis --without-tremor --without-mad --without-cdda --without-playlist --disable-sdl --with-gfxdrivers=nvidia --with-inputdrivers=keyboard,ps2mouse,serialmouse --disable-vnc

DirectFB2:

meson setup -Db_lto=true --libdir lib64 --localstatedir /var/lib --prefix /usr --sysconfdir /etc --wrap-mode nodownload --build.pkg-config-path /usr/share/pkgconfig --pkg-config-path /usr/share/pkgconfig --native-file /var/tmp/portage/dev-libs/DirectFB2-9999/temp/meson.x86_64-pc-linux-gnu.amd64.ini -Db_pch=false -Dwerror=false -Dbuildtype=plain -Dconstructors=true -Ddrmkms=false -Dfbdev=true -Dlinux_input=true -Dmemcpy-probing=false -Dmmx=true -Dneon=false -Dmulti=true -Dmulti-kernel=false -Dnetwork=true -Dpiped-stream=true -Dsentinels=false -Dsmooth-scaling=false -Dtext=true -Dtrace=false /var/tmp/portage/dev-libs/DirectFB2-9999/work/DirectFB2-9999 /var/tmp/portage/dev-libs/DirectFB2-9999/work/DirectFB2-9999-build

Also, is the X11 backend gone from DirectFB2. I couldn't find anything about it in the meson build options.

caramelli commented 5 months ago

Separate repositories are used for additional system modules. Yes, the x11 system module could be restored in a DirectFB2-x11 repository.

Benchmarks (with the FBDev system module and without GFX driver for hardware acceleration) generally give similar or even better results on DirectFB2 (e.g. https://github.com/directfb2/DirectFB2/issues/110). So it's annoying that you're seeing worse performance with DirectFB2, I'd be curious to understand the explanation for this difference.

If you started Leafpad, that means you built GTK+ for the DirectFB GDK target: what version of GTK+ are you using?

stefan11111 commented 5 months ago

Separate repositories are used for additional system modules. Yes, the x11 system module could be restored in a DirectFB2-x11 repository.

So, if I understand correctly, It can be done, but isn't done yet?

Benchmarks (with the FBDev system module and without GFX driver for hardware acceleration) generally give similar or even better results on DirectFB2 (e.g. #110). So it's annoying that you're seeing worse performance with DirectFB2, I'd be curious to understand the explanation for this difference.

Did you notice anything in the build options I listed that could lead to this? Would it be useful to post my kernel config?

If you started Leafpad, that means you built GTK+ for the DirectFB GDK target: what version of GTK+ are you using?

I am using my fork of gtk2: https://github.com/stefan11111/gtk2

caramelli commented 5 months ago

Yes exactly, a x11 system module working with DirectFB2 can be done based on https://github.com/directfb2/DirectFB2/tree/directfb-1.8/systems/x11 (but DirectFB on top of X11 is the kind of hybrid approach which I am not focused on at the moment).

I haven't noticed anything strange in your build options but I would probably test using a very basic setup (you probably already did this): meson setup build/ Finding where time is lost compared to the original DirectFB code might help to understand (but tedious).

Your GTK2 fork is interesting: for info if it helps, I use https://github.com/caramelli/higfxback/blob/master/patches/dfb/gtk%2B-2.12.12.patch

stefan11111 commented 4 months ago

I tried out DirectFB2 on some other hardware, and I think it's a problem with the nvidia hardware. I tested DirectFB2 on a laptop with intel integrated graphics, and it started to run smoothly.