public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: opencv 3.2.0-1: imshow() very slow
       [not found] <da23ad84-9c7a-d552-09fc-bdbbe9551e6f@free.fr>
@ 2017-05-14  0:07 ` Falk Tannhäuser
  2017-05-14  5:17   ` René Berber
  0 siblings, 1 reply; 5+ messages in thread
From: Falk Tannhäuser @ 2017-05-14  0:07 UTC (permalink / raw)
  To: cygwin

Am 07.05.2017 um 21:16 schrieb René Berber:
> Obviously you are not running dbus-daemon, which accounts for the
> time-out, and the delay, but where does that dependency come from? Is it
> needed? apparently not.
> 
> According to OpenCV's documentation
> (http://docs.opencv.org/2.4/doc/tutorials/introduction/linux_install/linux_install.html)
> there is no such dependency.

Well, I think there were many functionalities added to OpenCV between releases 2.4 and 3.2, so it seems that dbus-daemon is now required. As a 
matter of fact, it is launched in the background the first time I start my 'cvtest' program - here is an extract of a bash session:
___________________________________________________________________________
falkt@FalksAsusDesktop Mo 2017-05-08 01:35:13 ~
$ python cvtest.py
Image shape: (600, 800, 3)

** (Great title:10460): WARNING **: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. 
Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout 
expired, or the network connection was broken.
26.541 s

falkt@FalksAsusDesktop Mo 2017-05-08 01:35:54 ~
$ ps
       PID    PPID    PGID     WINPID   TTY         UID    STIME COMMAND
      6192   10764    2924       4404  ?         197609 01:35:29 /usr/libexec/at-spi-bus-launcher
       396       1   10460        396  pty0      197609 01:35:29 /usr/bin/dbus-launch
      8416    1944    1944       2360  cons0     197609 17:28:14 /usr/bin/xinit
     10744    8416   10744      10244  cons0     197609 17:28:14 /usr/bin/XWin
      1944       1    1944       6284  cons0     197609 17:28:09 /usr/bin/sh
      6492    8416    6492      10288  ?         197609 17:28:16 /usr/bin/sh
      8388    6492    6492       6424  ?         197609 17:28:16 /usr/bin/sleep
      6860    2756    6860       8292  pty0      197609 01:34:52 /usr/bin/bash
     10764    2924    2924      10764  ?         197609 01:35:29 /usr/bin/dbus-daemon
      2756       1    2756       2756  ?         197609 01:34:52 /usr/bin/mintty
      6464    6860    6464       4904  pty0      197609 01:36:01 /usr/bin/ps
      2924       1    2924       2924  ?         197609 01:35:29 /usr/bin/dbus-daemon

falkt@FalksAsusDesktop Mo 2017-05-08 01:36:01 ~
$
___________________________________________________________________________

Strangely enough, even with dbus-daemon launched, the problem persists.

> Check out the libraries linked, and probably one of them has that
> dependency.  Dbus library is linked somehow, the problem is which other
> library was the one that brought it.  Perhaps checking with pkg-config
> to see which one uses it would help.

When I run cygcheck on the executable generated from the cvtest.cxx program I posted, I get the following list:
___________________________________________________________________________
$ cygcheck ./cvtest.exe
C:\Users\falkt\Documents\cvtest.exe
   C:\cygwin64\bin\cygwin1.dll
     C:\WINDOWS\system32\KERNEL32.dll
       C:\WINDOWS\system32\ntdll.dll
       C:\WINDOWS\system32\KERNELBASE.dll
         C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\api-ms-win-eventing-provider-l1-1-0.dll
   C:\cygwin64\bin\cygopencv_core-3.2.dll
     C:\cygwin64\bin\cygz.dll
     C:\cygwin64\bin\cyggcc_s-seh-1.dll
     C:\cygwin64\bin\cygstdc++-6.dll
   C:\cygwin64\bin\cygopencv_highgui-3.2.dll
     C:\cygwin64\bin\cygopencv_imgcodecs-3.2.dll
       C:\cygwin64\bin\cygopencv_imgproc-3.2.dll
       C:\cygwin64\bin\cygHalf-12.dll
       C:\cygwin64\bin\cygIlmImf-22.dll
         C:\cygwin64\bin\cygIex-12.dll
         C:\cygwin64\bin\cygIlmThread-12.dll
       C:\cygwin64\bin\cygjasper-4.dll
         C:\cygwin64\bin\cygjpeg-8.dll
       C:\cygwin64\bin\cygpng16-16.dll
       C:\cygwin64\bin\cygtiff-6.dll
         C:\cygwin64\bin\cygjbig-2.dll
         C:\cygwin64\bin\cyglzma-5.dll
       C:\cygwin64\bin\cygwebp-5.dll
     C:\cygwin64\bin\cygcairo-2.dll
       C:\cygwin64\bin\cygEGL-1.dll
         C:\cygwin64\bin\cygexpat-1.dll
         C:\cygwin64\bin\cygX11-xcb-1.dll
         C:\cygwin64\bin\cygxcb-1.dll
           C:\cygwin64\bin\cygXau-6.dll
           C:\cygwin64\bin\cygXdmcp-6.dll
       C:\cygwin64\bin\cygfontconfig-1.dll
         C:\cygwin64\bin\cygfreetype-6.dll
           C:\cygwin64\bin\cygbz2-1.dll
       C:\cygwin64\bin\cygGL-1.dll
         C:\cygwin64\bin\cygglapi-0.dll
         C:\cygwin64\bin\cygX11-6.dll
         C:\cygwin64\bin\cygxcb-glx-0.dll
         C:\cygwin64\bin\cygXext-6.dll
         C:\WINDOWS\system32\GDI32.dll
         C:\WINDOWS\system32\OPENGL32.dll
           C:\WINDOWS\system32\msvcrt.dll
           C:\WINDOWS\system32\ADVAPI32.dll
             C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\api-ms-win-eventing-controller-l1-1-0.dll
             C:\WINDOWS\system32\SECHOST.dll
               C:\WINDOWS\system32\RPCRT4.dll
           C:\WINDOWS\system32\GLU32.dll
             C:\WINDOWS\system32\USER32.dll
               C:\WINDOWS\system32\win32u.dll
           C:\WINDOWS\system32\DDRAW.dll
             C:\WINDOWS\system32\DCIMAN32.dll
       C:\cygwin64\bin\cygpixman-1-0.dll
       C:\cygwin64\bin\cygxcb-render-0.dll
       C:\cygwin64\bin\cygxcb-shm-0.dll
       C:\cygwin64\bin\cygXrender-1.dll
     C:\cygwin64\bin\cyggdk-3-0.dll
       C:\cygwin64\bin\cygcairo-gobject-2.dll
         C:\cygwin64\bin\cygglib-2.0-0.dll
           C:\cygwin64\bin\cygiconv-2.dll
           C:\cygwin64\bin\cygintl-8.dll
           C:\cygwin64\bin\cygpcre-1.dll
         C:\cygwin64\bin\cyggobject-2.0-0.dll
           C:\cygwin64\bin\cygffi-6.dll
       C:\cygwin64\bin\cygepoxy-0.dll
       C:\cygwin64\bin\cyggdk_pixbuf-2.0-0.dll
         C:\cygwin64\bin\cyggio-2.0-0.dll
           C:\cygwin64\bin\cyggmodule-2.0-0.dll
       C:\cygwin64\bin\cygpango-1.0-0.dll
         C:\cygwin64\bin\cygthai-0.dll
           C:\cygwin64\bin\cygdatrie-1.dll
       C:\cygwin64\bin\cygpangocairo-1.0-0.dll
         C:\cygwin64\bin\cygpangoft2-1.0-0.dll
           C:\cygwin64\bin\cygharfbuzz-0.dll
             C:\cygwin64\bin\cyggraphite2-3.dll
       C:\cygwin64\bin\cygXcomposite-1.dll
       C:\cygwin64\bin\cygXcursor-1.dll
         C:\cygwin64\bin\cygXfixes-3.dll
       C:\cygwin64\bin\cygXdamage-1.dll
       C:\cygwin64\bin\cygXi-6.dll
       C:\cygwin64\bin\cygXinerama-1.dll
       C:\cygwin64\bin\cygXrandr-2.dll
     C:\cygwin64\bin\cyggtk-3-0.dll
       C:\cygwin64\bin\cygatk-1.0-0.dll
       C:\cygwin64\bin\cygatk-bridge-2.0-0.dll
         C:\cygwin64\bin\cygatspi-0.dll
           C:\cygwin64\bin\cygdbus-1-3.dll
___________________________________________________________________________

So effectively cygdbus-1-3.dll appears in the last line.

> Of course there's a better hint on your message: 'org.a11y.Bus'  I have
> no idea what library, or program uses that Dbus ID.  Using Google I
> found
> https://github.com/GNOME/at-spi2-core/blob/master/bus/org.a11y.Bus.service.in
> which is Gnome... so perhaps the OpenCV released only works with Gnome &
> X-Windows running.

Starting the cvtest programs in a Gnome session doesn't change anything: always the same warning message and a 25-seconds delay before 
displaying the picture in a window.
-- Falk

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: opencv 3.2.0-1: imshow() very slow
  2017-05-14  0:07 ` opencv 3.2.0-1: imshow() very slow Falk Tannhäuser
@ 2017-05-14  5:17   ` René Berber
  0 siblings, 0 replies; 5+ messages in thread
From: René Berber @ 2017-05-14  5:17 UTC (permalink / raw)
  To: cygwin

On 5/13/2017 6:50 PM, Falk Tannhäuser wrote:

[snip]
> Starting the cvtest programs in a Gnome session doesn't change anything:
> always the same warning message and a 25-seconds delay before displaying
> the picture in a window.

Then it gets complicated, the problem seems to be Dbus' configuration.

There should be a session.conf under /etc, if not, then the dbus-daemon
is using defaults which, if I remember correctly, changed 2 or 3
versions ago to being restrictive (of course they call it "secure"),
that is: don't allow anything to connect to Dbus, unless specified on
the configuration.

I might be wrong, haven't used Dbus in a while.
-- 
R. Berber


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: opencv 3.2.0-1: imshow() very slow
  2017-05-07 16:37 ` Falk Tannhäuser
  2017-05-07 17:29   ` Brian Inglis
@ 2017-05-07 20:52   ` René Berber
  1 sibling, 0 replies; 5+ messages in thread
From: René Berber @ 2017-05-07 20:52 UTC (permalink / raw)
  To: cygwin

On 5/7/2017 10:31 AM, Falk Tannhäuser wrote:

> I started to test the new OpenCV packages and I noticed that each call
> to the imshow() function delays for usually 25 seconds. Most of the
> time, the following message is displayed:
> 
> ** (Great title:11352): WARNING **: Error retrieving accessibility bus
> address: org.freedesktop.DBus.Error.NoReply: Did not receive a reply.
> Possible causes include: the remote application did not send a reply,
> the message bus security policy blocked the reply, the reply timeout
> expired, or the network connection was broken.
> 
> More rarely, a different message, as for example the following one, is
> shown:
> 
> ** (Great title:9472): WARNING **: Error retrieving accessibility bus
> address: org.freedesktop.DBus.Error.TimedOut: Failed to activate service
> 'org.a11y.Bus': timed out
[snip]

Obviously you are not running dbus-daemon, which accounts for the
time-out, and the delay, but where does that dependency come from? Is it
needed? apparently not.

According to OpenCV's documentation
(http://docs.opencv.org/2.4/doc/tutorials/introduction/linux_install/linux_install.html)
there is no such dependency.

Check out the libraries linked, and probably one of them has that
dependency.  Dbus library is linked somehow, the problem is which other
library was the one that brought it.  Perhaps checking with pkg-config
to see which one uses it would help.

Of course there's a better hint on your message: 'org.a11y.Bus'  I have
no idea what library, or program uses that Dbus ID.  Using Google I
found
https://github.com/GNOME/at-spi2-core/blob/master/bus/org.a11y.Bus.service.in
which is Gnome... so perhaps the OpenCV released only works with Gnome &
X-Windows running.
--
R. Berber


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: opencv 3.2.0-1: imshow() very slow
  2017-05-07 16:37 ` Falk Tannhäuser
@ 2017-05-07 17:29   ` Brian Inglis
  2017-05-07 20:52   ` René Berber
  1 sibling, 0 replies; 5+ messages in thread
From: Brian Inglis @ 2017-05-07 17:29 UTC (permalink / raw)
  To: cygwin

On 2017-05-07 09:31, Falk Tannhäuser wrote:
> Unfortunately I seem to be unable to send this mail to the list while
> attaching my cygcheck output - I tried uncompressed (400 kB) and
> compressed (38 kB).

You're using Tbird - go into Tools/Options/Composition tab/Send Options 
button/When sending.../Convert the message to plain text/Plain Text 
Domains tab/Add/cygwin.com/Add/sourceware.org - only text will then 
be sent to the list and attachments will not be encoded.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* opencv 3.2.0-1: imshow() very slow
       [not found] <2d55cf8f-c69f-77f4-f988-c8916d18f009@free.fr>
@ 2017-05-07 16:37 ` Falk Tannhäuser
  2017-05-07 17:29   ` Brian Inglis
  2017-05-07 20:52   ` René Berber
  0 siblings, 2 replies; 5+ messages in thread
From: Falk Tannhäuser @ 2017-05-07 16:37 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 2245 bytes --]

I started to test the new OpenCV packages and I noticed that each call to the imshow() function delays for usually 25 seconds. Most of the time, 
the following message is displayed:

** (Great title:11352): WARNING **: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. 
Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout 
expired, or the network connection was broken.

More rarely, a different message, as for example the following one, is shown:

** (Great title:9472): WARNING **: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.TimedOut: Failed to activate service 
'org.a11y.Bus': timed out

After the delay, the function displays the image as it is supposed to.
This problem occurs both from within Python and C++. To reproduce it, run one of the following programs (supposing the file picture.jpg is 
available):

########## cvtest.py ##########
# Run using the following command line (works also with python3):
# python cvtest.py
from __future__ import print_function, division
import time
import cv2

img = cv2.imread('picture.jpg')
print('Image shape:', img.shape)
t1 = time.time()
cv2.imshow('Great title', img)
t2 = time.time()
print('%.3f s' % (t2 - t1))
cv2.waitKey()

########## cvtest.cxx ##########
// Compile and run using the following command line (tested with GCC 5.4.0):
// g++ -std=c++11 -Wall -Wextra -O3 -march=native -s cvtest.cxx -lopencv_imgcodecs -lopencv_highgui -lopencv_core -o cvtest && ./cvtest
#include <iostream>
#include <chrono>
#include <opencv2/opencv.hpp>

int main()
{
     auto img = cv::imread("picture.jpg");
     std::cout << "Image size: " << img.size() << '\n';
     auto t1 = std::chrono::high_resolution_clock::now();;
     cv::imshow("Great title", img);
     auto t2 = std::chrono::high_resolution_clock::now();;
     std::cout << std::chrono::duration<double>(t2 - t1).count() << " s\n";
     cv::waitKey();
     return 0;
}

################################

Unfortunately I seem to be unable to send this mail to the list while attaching my cygcheck output - I tried uncompressed (400 kB) and 
compressed (38 kB).
-- Falk



[-- Attachment #2: cygcheck.tar.xz --]
[-- Type: application/octet-stream, Size: 39660 bytes --]

[-- Attachment #3: Type: text/plain, Size: 219 bytes --]


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-05-14  0:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <da23ad84-9c7a-d552-09fc-bdbbe9551e6f@free.fr>
2017-05-14  0:07 ` opencv 3.2.0-1: imshow() very slow Falk Tannhäuser
2017-05-14  5:17   ` René Berber
     [not found] <2d55cf8f-c69f-77f4-f988-c8916d18f009@free.fr>
2017-05-07 16:37 ` Falk Tannhäuser
2017-05-07 17:29   ` Brian Inglis
2017-05-07 20:52   ` René Berber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).