You are not logged in.

#1 2019-01-02 19:08:01

watcher208
Member
Registered: 2019-01-01
Posts: 1

Setting up SDL2 on DirectFB (Without X)

I want to have an Arch box that can run programs using SDL2, but I really do not want to install xorg.

SDL2 appears to support the DirectFB video driver according to : https://wiki.libsdl.org/FAQUsingSDL .

I've compiled SDL2 and DirectFB with ...

# SDL2 
./configure --prefix=/usr \
    --disable-video-x11 \
    --disable-video-opengl \
    --enable-video-kmsdrm \
    --disable-directfb-shared \
    --enable-video-directfb \
    --disable-pulseaudio \
    --disable-input-tslib
# directFB
./configure --prefix=/usr --sysconfdir=/etc \
    --enable-static \
    --enable-zlib \
    --disable-x11 \
    --enable-sdl \
    --disable-vnc \
    --disable-osx \
    --enable-mesa \
    --enable-drmkms

Because of https://github.com/spurious/SDL-mirror/ … irectfb.md my /ect/directfbrc file looks like

disable-module=joystick 
disable-module=cle266 
disable-module=cyber5k 
export SDL_DIRECTFB_X11_CHECK=0
export SDL_DIRECTFB_YUV_DIRECT=1
export SDL_DIRECTFB_WM=1

When I run a program that uses SDL2 (tested to work with SDL2 on X11, it has no calls to any opengl functions in the source) all I see is

commandline read: a.out
(*) Direct/Thread: Started 'SigHandler' (10507) [CRITICAL - OTHER/0] <8388608>...

   ~~~~~~~~~~~~~~~~~~~~~~~~~| DirectFB 1.7.7 |~~~~~~~~~~~~~~~~~~~~~~~~~~
        (c) 2012-2015  DirectFB integrated media GmbH
        (c) 2001-2015  The world wide DirectFB Open Source Community
        (c) 2000-2004  Convergence (integrated media) GmbH
      ----------------------------------------------------------------

(*) DirectFB/Core: Single Application Core. (2019-01-02 16:28) 
(*) Direct/Memcpy: Using Generic 64bit memcpy()
(*) Direct/Thread: Started 'Fusion Dispatch' (10508) [MESSAGING - OTHER/0] <8388608>...
(*) Direct/Modules: suppress module 'joystick'
(*) DirectFB/Input: Hot-plug detection enabled with Input Hub Driver 
(*) DirectFB/Genefx: MMX detected and enabled
(*) DirectFB/Graphics: MMX Software Rasterizer 0.7 (directfb.org)
(*) Direct/Thread: Started 'Dummy Display' (10509) [OUTPUT - OTHER/0] <8388608>...
(*) DirectFB/Core/WM: Default 0.3 (directfb.org)
(*) Direct/Thread: Started 'Genefx' (10510) [DEFAULT - OTHER/0] <8388608>...
 (!!!)  *** UNIMPLEMENTED [fusion_get_fusionee_pid] *** [fusion.c:4147]

Then the program hangs, closing it with control c gives more errors, the total output is

commandline read: a.out
(*) Direct/Thread: Started 'SigHandler' (10536) [CRITICAL - OTHER/0] <8388608>...

   ~~~~~~~~~~~~~~~~~~~~~~~~~| DirectFB 1.7.7 |~~~~~~~~~~~~~~~~~~~~~~~~~~
        (c) 2012-2015  DirectFB integrated media GmbH
        (c) 2001-2015  The world wide DirectFB Open Source Community
        (c) 2000-2004  Convergence (integrated media) GmbH
      ----------------------------------------------------------------

(*) DirectFB/Core: Single Application Core. (2019-01-02 16:28) 
(*) Direct/Memcpy: Using Generic 64bit memcpy()
(*) Direct/Thread: Started 'Fusion Dispatch' (10537) [MESSAGING - OTHER/0] <8388608>...
(*) Direct/Modules: suppress module 'joystick'
(*) DirectFB/Input: Hot-plug detection enabled with Input Hub Driver 
(*) DirectFB/Genefx: MMX detected and enabled
(*) DirectFB/Graphics: MMX Software Rasterizer 0.7 (directfb.org)
(*) Direct/Thread: Started 'Dummy Display' (10538) [OUTPUT - OTHER/0] <8388608>...
(*) DirectFB/Core/WM: Default 0.3 (directfb.org)
(*) Direct/Thread: Started 'Genefx' (10539) [DEFAULT - OTHER/0] <8388608>...
 (!!!)  *** UNIMPLEMENTED [fusion_get_fusionee_pid] *** [fusion.c:4147]
^C(!) [SigHandler       4260.979,066] (10536) Direct/Signals:                --> Caught signal 2 (sent by the kernel) <--
(!) [SigHandler       4260.980,128] (10536) Direct/Signals:                --> -1
 (!!!)  *** UNIMPLEMENTED [fusion_dispatch] *** [fusion.c:3937]
(!) [SigHandler       4261.185,777] (10536) Direct/Signals:                --> -2
Segmentation fault (core dumped)

The version of SDL is 2.0.9, according to https://github.com/postmarketOS/osk-sdl/issues/80 SDL 2.0.8 has a bug breaking support for directFB. I tried SDL version 2.0.7, and the behavior was the same.

Versions and Information
    SDL 2.0.9
    DirectFB 1.7.7
    I am testing this so this is all in a virtual box. I temporarily installed xorg to confirm the virtual box could draw to the screen, everything was successful using SDL2 with X.

Any insight?

Offline

#2 2020-01-15 02:21:24

whitelynx
Member
From: Boston, MA
Registered: 2010-09-17
Posts: 3
Website

Re: Setting up SDL2 on DirectFB (Without X)

watcher208 wrote:

Because of https://github.com/spurious/SDL-mirror/ … irectfb.md my /ect/directfbrc file looks like

disable-module=joystick 
disable-module=cle266 
disable-module=cyber5k 
export SDL_DIRECTFB_X11_CHECK=0
export SDL_DIRECTFB_YUV_DIRECT=1
export SDL_DIRECTFB_WM=1

The "export" lines are supposed to be executed in the shell before running the app, not included in your /etc/directfbrc. (or, equivalently, ~/.directfbrc)

That being said, I'm having a similar issue running a very basic SDL/DirectFB/OpenGL example on a Raspberry Pi 4, except mine segfaults on its own directly after the

(!!!)  *** UNIMPLEMENTED [fusion_dispatch] *** [fusion.c:3937]

line.

Try running your app in `catchsegv` or `gdb`, and post the stack trace - it might help narrow down whether this is an SDL or DirectFB issue. (also, you might want to recompile SDL2 and/or DirectFB with --enable-debug so you can see debug info from them in the stack trace)

Offline

Board footer

Powered by FluxBB