How to develop a DirectFB app without leaving X.11 environment
Asked Answered
R

6

13

I'm trying to develop a GUI application for an embedded platform, without any windowing whatsoever and I'm doing that with DirectFB, and it suits my needs very fine.

Since the embedded I develop for is not that powerful, I would really like to try to develop on my own Ubuntu desktop. The problem is Framebuffer is conflicting with X.org causing me to leave the whole desktop, and shutdown X.org just to see the result of my changes.

Is there a good framebuffer simulator that suits my needs? Qt has one, called QVFb, but it only works for developing Qt apps, and the VNC back-end of DirectFB always crash.

So, any ideas?

Rosena answered 6/2, 2009 at 20:3 Comment(0)
F
17

DirectFB has a X11 backend.

$ sudo apt-get install libdirectfb-extra  # for Debian and Ubuntu, anyhow
$ cat ~/.directfbrc
system=x11
force-windowed

Also, DirectFB has a SDL backend, and SDL has a X11 backend. Also, SDL has a GGI backend, and GGI has an X backend. That's a bit circuitous, but it should work :)

I tested it with

$ SDL_VIDEODRIVER=directfb ffplay some_movie.avi

and got a nice 640x480 window with media playing and DirectFB handling layering and input, so I'm sure this works.

Fourpenny answered 7/2, 2009 at 2:29 Comment(0)
M
1

The three previous answers are all good suggestions. I'd suggest trying ephemient's answer because it's the simplest. For more details on setting up your .directfbrc file, check out "man directfbrc".

One other possibility would be to switch from X to another virtual terminal (using CTRL+ALT+F1), run your directfb program, and then switch back X (using CTRL+ALT+F7).

Moneyed answered 31/12, 2009 at 23:1 Comment(1)
Does DirectFB play nice with recent KMS based X stuff?Abie
R
1

I came to use ephemient's solution to run DirectFB applications inside a chroot environment (target filesystem as a courtesy of buildroot) in addition to Xnest, a separate X environment which runs in a window of the current X.

$ Xnest -ac :1 &
$ cd $TARGET_DIR # into the target file system root
$ DISPLAY=:1 sudo chroot . usr/bin/df_neo

This way you can assure not only your directfb installation is correct, but also all the required dependencies are installed inside the chroot'ed file system.

Recur answered 26/4, 2010 at 3:25 Comment(0)
C
0

You could use Moblin Image Creator to create a disk image of Moblin, which you can then run inside a VM like QEMU. You can then test your DirectFB application inside the virtual machine.

Carbonization answered 6/2, 2009 at 21:30 Comment(0)
W
0

You could develop (i.e. edit and compile) your application on your Ubuntu desktop, and test your application on the embedded platform that it is intended to run on.

If the embedded platform supports networking, you might be able to reduce the length of your edit-compile-test loop by running the application directly from an NFS share.

Willms answered 7/2, 2009 at 4:7 Comment(1)
That's what I'm doing right now, but the process takes too much time.Rosena
D
0

Here is a nice example with qemu and directFB:

Despumate answered 17/6, 2010 at 14:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.