New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GTK-3 support ? #14

Open
kyrios123 opened this Issue Jan 29, 2018 · 14 comments

Comments

Projects
None yet
4 participants
@kyrios123
Copy link

kyrios123 commented Jan 29, 2018

Hello,

Is there any plan for supporting gtk-3 ?
We are considering retiring wxWidgets gtk-2 build and eviacam is one of the only blocker.

Thank you !

@cmauri

This comment has been minimized.

Copy link
Owner

cmauri commented Feb 6, 2018

Hi!
Solus distro? Who is the maintainer of the package? Did you try building eViacam against wxWidgets gtk-3 build?

Thanks!

@kyrios123

This comment has been minimized.

Copy link

kyrios123 commented Feb 8, 2018

yes I did, that's why I made this request

@cmauri

This comment has been minimized.

Copy link
Owner

cmauri commented Feb 13, 2018

Added support for gtk+-3 in commit 6cd6ea9

@kyrios123

This comment has been minimized.

Copy link

kyrios123 commented Feb 13, 2018

I confirm it builds successfully with the patch.
I will do some testing during the coming days.

@kyrios123

This comment has been minimized.

Copy link

kyrios123 commented Feb 25, 2018

Hello,

I get the following error when launching the patched version (of course I did replace gtk2 libs with gtk3 libs and I used a gtk3 build of wxwidgets)

(eviacam:3978): Gtk-ERROR **: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported
Trace/breakpoint trap
@cmauri

This comment has been minimized.

Copy link
Owner

cmauri commented Feb 28, 2018

Hello,

I tried the following on a clean chrooted ubuntu artful installation:

$ dpkg -l | grep -E "gtk|opencv|wx"
(no results)

$ sudo apt-get install libopencv-dev
(this command installs around 350 packages)

$ dpkg -l | grep -E "gtk"

ii  gtk-update-icon-cache           3.22.24-0ubuntu1                  amd64       
ii  libgtk-3-0:amd64                3.22.24-0ubuntu1                  amd64 
ii  libgtk-3-bin                    3.22.24-0ubuntu1                  amd64  
ii  libgtk-3-common                 3.22.24-0ubuntu1                  all 

libopencv installs libgtk-3.0 because some modules have dependencies on it. I only had to manually install libgtk-3-dev
$ sudo apt-get install libgtk-3-dev

To install wxWidgets I used the latest stable tarball for linux. I configured it to use gtk-3 and compiled manually:

./configure --with-gtk=3
make
sudo make install
sudo ldconfig

Finally, I managed to build (from commit a598ace) and run eviacam without issues. These are the steps I followed:

./autogen.sh
./configure --prefix=/usr/local
make
sudo make install
eviacam

However, when installing wxWidgets from ubuntu repository, i.e.: $ sudo apt-get install libwxgtk3.0-dev eviacam build fails with:

In file included from /usr/include/gtk-3.0/gdk/gdkapplaunchcontext.h:30:0,
                 from /usr/include/gtk-3.0/gdk/gdk.h:32,
                 from /usr/include/gtk-3.0/gdk/gdkx.h:28,
                 from wxappbar.cpp:46:
/usr/include/gtk-3.0/gdk/gdktypes.h:143:39: error: conflicting declaration 'typedef struct _GdkWindow GdkWindow'
 typedef struct _GdkWindow             GdkWindow;
                                       ^~~~~~~~~
In file included from /usr/include/wx-3.0/wx/wxprec.h:12:0,
                 from wxappbar.cpp:24:
/usr/include/wx-3.0/wx/defs.h:3466:33: note: previous declaration as 'typedef struct _GdkDrawable GdkWindow'
     typedef struct _GdkDrawable GdkWindow;
                                 ^~~~~~~~~

Checking the wxWidgets version shipped with artful:

$ wx-config --selected-config 
gtk2-unicode-3.0

it is clear that has been built against gtk-2. In fact, there is an open bug in ubuntu launchpad about this:
https://bugs.launchpad.net/ubuntu/+source/wxwidgets3.0/+bug/1394031

Furthermore, when running the eviacam version shipped with artful I also get:

Gtk-ERROR **: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported
Trace/breakpoint trap

In summary, @kyrios123 make sure that both libopencv and wxWidgets are build against gtk-3 and that no other libraries add dependencies to gtk-2.

It seems also that recent versions of debian (strech) and ubuntu (artful) provide wxWidgets built against gtk-2 and libopencv against gtk-3 and thus, software that need both libraries will probably crash with the same error.

@kyrios123

This comment has been minimized.

Copy link

kyrios123 commented Mar 1, 2018

Thanks for this very useful feedback! Indeed, I see our opencv currently uses gtk-2 libraries.

@kyrios123

This comment has been minimized.

Copy link

kyrios123 commented Mar 3, 2018

We are currently testing the gtk3 vs gtk2 builds and the following issue has been reported: Takes forever getting the webcam via v4l

@JoshStrobl

This comment has been minimized.

Copy link

JoshStrobl commented Mar 3, 2018

When launching from the Terminal, it starts my webcam, turns it back off, and then provides an index error. It cycles through 9 indexes until it gets to my webcam (the only video device I have), then starts the OpenCL runtime.

VIDEOIO ERROR: V4L: index 1 is not correct!
VIDEOIO ERROR: V4L: index 2 is not correct!
VIDEOIO ERROR: V4L: index 3 is not correct!
VIDEOIO ERROR: V4L: index 4 is not correct!
VIDEOIO ERROR: V4L: index 5 is not correct!
VIDEOIO ERROR: V4L: index 6 is not correct!
VIDEOIO ERROR: V4L: index 7 is not correct!
VIDEOIO ERROR: V4L: index 8 is not correct!
VIDEOIO ERROR: V4L: index 9 is not correct!
[ INFO:1] Initialize OpenCL runtime...
@cmauri

This comment has been minimized.

Copy link
Owner

cmauri commented Mar 8, 2018

Try applying the following patch. It basically disables multiple camera detection:
patch.diff.gz

@JoshStrobl

This comment has been minimized.

Copy link

JoshStrobl commented Mar 8, 2018

@cmauri Applied patch, did a local build, same behavior as my previous comment. Here's an strace if it's any help. Webcam is a Logitech HD Pro Webcam C920.

eviacam_strace.txt (~2.6MB)

@cmauri

This comment has been minimized.

Copy link
Owner

cmauri commented Mar 26, 2018

output.txt
@JoshStrobl also applied the patch and, for me, this only opens the camera once. Here is the output of eviacam when running with the debug flag enabled:

./eviacam --debug

Could you please run also in debug mode and attach the output?

Remember that you should clone the devel branch and apply the patch on top of it.

@Clement-TS

This comment has been minimized.

Copy link

Clement-TS commented Nov 26, 2018

I there, I have this same issue using eviacam on a Ubuntu 18.04 desktop (was working on 16.04):

(eviacam:23589): Gtk-ERROR **: 16:01:44.053: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported
Trace/breakpoint trap

Is this fixed within the devel branch? Are there .deb available with any fix on that?
Thank you

@kyrios123

This comment has been minimized.

Copy link

kyrios123 commented Nov 26, 2018

@Clement-TS yes look at the detailed explanation here. TL;DR make sure that wxWidgets and openCV are built against the same version of GTK+ than eviacam

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment