Skip to contentSkip to conversation

GTK+ for framebuffer?

Buildroot Woody Wu 2 participants 11 messages Sep 3, 2013 – Sep 9, 2013

lore
Share & tools
lore

Woody Wu

author
#0 lore raw

Hi,

It seems buildroot already has GTK. Does it can build GTK+ for running on framebuffer (a.k.a, gtkfb)?

Thanks.

Signature · 1 line
I can't go back to yesterday - because I was a different person then
#1 lore raw

Dear Woody Wu,

Quoted 2 lines · Woody Wu

It seems buildroot already has GTK. Does it can build GTK+ for running on framebuffer (a.k.a, gtkfb)?

There used to be a DirectFB backend in Gtk, but it was always broken, because nobody was maintaining it (in Gtk upstream). It was causing too many problems in Buildroot to keep the support for such a broken feature, so we removed it. People interested in running Gtk on DirectFB should work with upstream to fix the issues and get the corresponding patches merged.

These days, if you want to run Gtk, you should run X.org (which can run on top of the framebuffer), or maybe you can explore Wayland (but I guess it'll require Gtk 3.x, while we only have Gtk 2.x in Buildroot for the moment).

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
author
#2 lore raw
Quoted 14 lines · Thomas Petazzoni

Dear Woody Wu,

Quoted 2 lines · Woody Wu

It seems buildroot already has GTK. Does it can build GTK+ for running on framebuffer (a.k.a, gtkfb)?

There used to be a DirectFB backend in Gtk, but it was always broken, because nobody was maintaining it (in Gtk upstream). It was causing too many problems in Buildroot to keep the support for such a broken feature, so we removed it. People interested in running Gtk on DirectFB should work with upstream to fix the issues and get the corresponding patches merged.

Quoted 8 lines

These days, if you want to run Gtk, you should run X.org (which can run on top of the framebuffer), or maybe you can explore Wayland (but I guess it'll require Gtk 3.x, while we only have Gtk 2.x in Buildroot for the moment).

Best regards,

Thomas

Hi, Thomas

Even I cannot find libgtk (neither 2.x or 3.x) in buildroot. I enabled a lot of options which looks like related to gtk, then I got libraries like glib, pango, atk, etc., but just no gtk. Where is the option to enable it? I think I looked through all the options :(

BTW: in your opinion, GtkFB and gtk on TinyX, which one is faster?

Signature · 1 line
I can't go back to yesterday - because I was a different person then
#3 lore raw

Dear Woody Wu,

Quoted 4 lines · Woody Wu

Even I cannot find libgtk (neither 2.x or 3.x) in buildroot. I enabled a lot of options which looks like related to gtk, then I got libraries like glib, pango, atk, etc., but just no gtk. Where is the option to enable it? I think I looked through all the options :(

Hint: in menuconfig, hit '/', and then search for LIBGTK2. This will show you where the option for Gtk is located, what are its dependencies, and which of its dependencies are not satisfied at the moment.

Here is what I have here:

Symbol: BR2_PACKAGE_LIBGTK2 [=n]
Type : boolean
Prompt: libgtk2
Defined at package/libgtk2/Config.in:1
Depends on: BR2_PACKAGE_XORG7 [=n] && BR2_USE_WCHAR [=y] && BR2_TOOLCHAIN_HAS_THREADS [=y] && BR2_INSTALL_LIBSTDCPP [=y] Location:

    -> Target packages
       -> Libraries

(2) -> Graphics

This tells you that libgtk2 package is currently not selected ([=n] on the first line). This tells you the libgtk2 package is located in Target packages -> Libraries -> Graphics. And more importantly, the line "Depends on:" gives you the list of dependencies. In the example above, there are four dependencies: the last three dependencies (wchar, threads and C++) are satisfied. However, the first dependency, BR2_PACKAGE_XORG7 is not satisfied (see the [=n]).

So to be able to enable Gtk, you need to enable X.org.

Quoted 1 line

BTW: in your opinion, GtkFB and gtk on TinyX, which one is faster?

I have no idea as I haven't benchmarked. However, I'm not sure why you keep talking about GtkFB: the DirectFB for Gtk is no longer maintained, so it cannot be used. Your only reasonable option today for Gtk 2.x is with X.org.

A while ago, I remember switching a project from Gtk/DirectFB (at the time it was more or less working) to Gtk/X.org because it ended up working better. I don't quite remember if it was a font rendering problem, or a performance problem, but clearly, Gtk/X.org fixed the problem.

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
author
#4 lore raw
Quoted 43 lines · Thomas Petazzoni

Dear Woody Wu,

Quoted 4 lines · Woody Wu

Even I cannot find libgtk (neither 2.x or 3.x) in buildroot. I enabled a lot of options which looks like related to gtk, then I got libraries like glib, pango, atk, etc., but just no gtk. Where is the option to enable it? I think I looked through all the options :(

Hint: in menuconfig, hit '/', and then search for LIBGTK2. This will show you where the option for Gtk is located, what are its dependencies, and which of its dependencies are not satisfied at the moment.

Here is what I have here:

Symbol: BR2_PACKAGE_LIBGTK2 [=n]
Type : boolean
Prompt: libgtk2
Defined at package/libgtk2/Config.in:1
Depends on: BR2_PACKAGE_XORG7 [=n] && BR2_USE_WCHAR [=y] && BR2_TOOLCHAIN_HAS_THREADS [=y] && BR2_INSTALL_LIBSTDCPP [=y] Location:

    -> Target packages
       -> Libraries

(2) -> Graphics

This tells you that libgtk2 package is currently not selected ([=n] on the first line). This tells you the libgtk2 package is located in Target packages -> Libraries -> Graphics. And more importantly, the line "Depends on:" gives you the list of dependencies. In the example above, there are four dependencies: the last three dependencies (wchar, threads and C++) are satisfied. However, the first dependency, BR2_PACKAGE_XORG7 is not satisfied (see the [=n]).

So to be able to enable Gtk, you need to enable X.org.

Quoted 1 line

BTW: in your opinion, GtkFB and gtk on TinyX, which one is faster?

I have no idea as I haven't benchmarked. However, I'm not sure why you keep talking about GtkFB: the DirectFB for Gtk is no longer maintained, so it cannot be used. Your only reasonable option today for Gtk 2.x is with X.org.

Quoted 6 lines

A while ago, I remember switching a project from Gtk/DirectFB (at the time it was more or less working) to Gtk/X.org because it ended up working better. I don't quite remember if it was a font rendering problem, or a performance problem, but clearly, Gtk/X.org fixed the problem.

Thoams,

Many thanks for your information. Now I feel more clear that I should go Gtk/X.org. On the other side, I have no experience on running x.org on an embeded system. What things in buildroot I should enable to build a minimal system that can at lest run the gtk demons on TinyX? My display is just framebuffer. I understand, the question may sounds a little stupid. Looking forward for your help.

Signature · 1 line
I can't go back to yesterday - because I was a different person then
#5 lore raw

Dear Woody Wu,

Quoted 6 lines · Woody Wu

Many thanks for your information. Now I feel more clear that I should go Gtk/X.org. On the other side, I have no experience on running x.org on an embeded system. What things in buildroot I should enable to build a minimal system that can at lest run the gtk demons on TinyX? My display is just framebuffer. I understand, the question may sounds a little stupid. Looking forward for your help.

I believe to get things started enable BR2_PACKAGE_XORG7, enable BR2_PACKAGE_XSERVER_XORG_SERVER, keep the KDrive/Tiny-X server type, and enable BR2_PACKAGE_XSERVER_XORG_SERVER_KDRIVE_EVDEV.

Then, you will have Xfbdev on your target, which is the X server. It has a bunch of options that allows you to specify which evdev device to use as a mouse and as a keyboard, if you have such input devices on your system.

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
author
#6 lore raw
Quoted 11 lines · Thomas Petazzoni

Dear Woody Wu,

Quoted 6 lines · Woody Wu

Many thanks for your information. Now I feel more clear that I should go Gtk/X.org. On the other side, I have no experience on running x.org on an embeded system. What things in buildroot I should enable to build a minimal system that can at lest run the gtk demons on TinyX? My display is just framebuffer. I understand, the question may sounds a little stupid. Looking forward for your help.

Quoted 9 lines

I believe to get things started enable BR2_PACKAGE_XORG7, enable BR2_PACKAGE_XSERVER_XORG_SERVER, keep the KDrive/Tiny-X server type, and enable BR2_PACKAGE_XSERVER_XORG_SERVER_KDRIVE_EVDEV.

Then, you will have Xfbdev on your target, which is the X server. It has a bunch of options that allows you to specify which evdev device to use as a mouse and as a keyboard, if you have such input devices on your system.

Okay! I will try :-)

Quoted 5 lines
Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
Signature · 1 line
I can't go back to yesterday - because I was a different person then
author
#7 lore raw
In reply to Thomas Petazzoni
Quoted 11 lines · Thomas Petazzoni

Dear Woody Wu,

Quoted 6 lines · Woody Wu

Many thanks for your information. Now I feel more clear that I should go Gtk/X.org. On the other side, I have no experience on running x.org on an embeded system. What things in buildroot I should enable to build a minimal system that can at lest run the gtk demons on TinyX? My display is just framebuffer. I understand, the question may sounds a little stupid. Looking forward for your help.

Quoted 9 lines

I believe to get things started enable BR2_PACKAGE_XORG7, enable BR2_PACKAGE_XSERVER_XORG_SERVER, keep the KDrive/Tiny-X server type, and enable BR2_PACKAGE_XSERVER_XORG_SERVER_KDRIVE_EVDEV.

Then, you will have Xfbdev on your target, which is the X server. It has a bunch of options that allows you to specify which evdev device to use as a mouse and as a keyboard, if you have such input devices on your system.

Hi, Thomas

I've already have Xfbdev started. Thanks for your help. But I have not yet figured out a right way to pass my touchscreen device (/dev/input/event0) to Xfbdev. I tried something like "-mouse evdev,,..." and "-mouse tslib,,..." but always got strange warning messages. Maybe you have experience on this.

Signature · 1 line
I can't go back to yesterday - because I was a different person then
#8 lore raw

Dear Woody Wu,

Quoted 5 lines · Woody Wu

I've already have Xfbdev started. Thanks for your help. But I have not yet figured out a right way to pass my touchscreen device (/dev/input/event0) to Xfbdev. I tried something like "-mouse evdev,,..." and "-mouse tslib,,..." but always got strange warning messages. Maybe you have experience on this.

Here is known-working command line I was using to run Xfbdev under Qemu:

Xfbdev -keybd evdev,,device=/dev/input/event0 -mouse evdev,,device=/dev/input/event1 &

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
author
#9 lore raw
Quoted 10 lines · Thomas Petazzoni

Dear Woody Wu,

Quoted 5 lines · Woody Wu

I've already have Xfbdev started. Thanks for your help. But I have not yet figured out a right way to pass my touchscreen device (/dev/input/event0) to Xfbdev. I tried something like "-mouse evdev,,..." and "-mouse tslib,,..." but always got strange warning messages. Maybe you have experience on this.

Quoted 4 lines

Here is known-working command line I was using to run Xfbdev under Qemu:

Xfbdev -keybd evdev,,device=/dev/input/event0 -mouse evdev,,device=/dev/input/event1 &

Thanks for the example. Finally I found my command line was correct (I used tslib and has not yet tried evdev with success), the problem actually came from a xorg server bug in version 1.12.4 (which is used by buildroot 2013.08). I just fixed the bug in xorg and posted a patch on this list. The bug make the the xserver option such as "device=xxxx" is parsed as (key=device=, value=xxxx), but it should be (key=device, value=xxxx).

Because of this bug, whatever way I tried, I always cannot get Xfbdev started correctly.

BTW: before I am going to try 'evdev', would you tell me what's the major difference between using 'evdev' and 'tslib' for my touchscreen? Which way is better? Thanks.

Cheers,
woody

Quoted 8 lines

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
Signature · 1 line
I can't go back to yesterday - because I was a different person then
#10 lore raw

Dear Woody Wu,

Quoted 7 lines · Woody Wu

Thanks for the example. Finally I found my command line was correct (I used tslib and has not yet tried evdev with success), the problem actually came from a xorg server bug in version 1.12.4 (which is used by buildroot 2013.08). I just fixed the bug in xorg and posted a patch on this list. The bug make the the xserver option such as "device=xxxx" is parsed as (key=device=, value=xxxx), but it should be (key=device, value=xxxx).

Ok.

Quoted 3 lines

BTW: before I am going to try 'evdev', would you tell me what's the major difference between using 'evdev' and 'tslib' for my touchscreen? Which way is better? Thanks.

tslib is a userspace library that you can add between the evdev input device and X.org to apply some additional filtering and other algorithms on the touchscreen events. See the tslib documentation for details.

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com