Bug 243760 - Import *listing* from "Canon PowerShot G5 (normal mode)" takes very long
Summary: Import *listing* from "Canon PowerShot G5 (normal mode)" takes very long
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Import-Gphoto2 (show other bugs)
Version: 1.3.0
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-06 14:39 UTC by Axel Thimm
Modified: 2017-08-16 05:50 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 2.1.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Axel Thimm 2010-07-06 14:39:49 UTC
Version:           1.2.0 (using KDE 4.4.4) 
OS:                Linux

When a Canon PowerShot G5 with a few pictures (20-30) - most of them in raw format - is inserted the initial listing takes very long, in the order of 5-10 minutes. If the link hasn't timed out the thumbnails are downloaded properly. For a successful import I reduced the number of pictures to 15:

The actual contents were:
  121    0 dr-x------   1 thimm    thimm           0 Jan  1  1970 .
   122    0 dr-x------   1 thimm    thimm           0 Jan  1  1970 ./DCIM
   123    0 dr-x------   1 thimm    thimm           0 Jan  1  1970 ./DCIM/148CANON
   124 4481 -rw-------   1 thimm    thimm     4587934 Jul  6 13:18 ./DCIM/148CANON/CRW_4891.CRW
   125 4375 -rw-------   1 thimm    thimm     4479816 Jul  6 13:18 ./DCIM/148CANON/CRW_4892.CRW
   126 4391 -rw-------   1 thimm    thimm     4495932 Jul  6 13:18 ./DCIM/148CANON/CRW_4893.CRW
   127 4399 -rw-------   1 thimm    thimm     4503980 Jul  6 13:18 ./DCIM/148CANON/CRW_4894.CRW
   128 4402 -rw-------   1 thimm    thimm     4506944 Jul  6 13:18 ./DCIM/148CANON/CRW_4895.CRW
   129 4409 -rw-------   1 thimm    thimm     4514670 Jul  6 13:18 ./DCIM/148CANON/CRW_4896.CRW
   130 4405 -rw-------   1 thimm    thimm     4510460 Jul  6 13:18 ./DCIM/148CANON/CRW_4897.CRW
   131 4396 -rw-------   1 thimm    thimm     4500732 Jul  6 13:18 ./DCIM/148CANON/CRW_4898.CRW
   132 4405 -rw-------   1 thimm    thimm     4509920 Jul  6 13:18 ./DCIM/148CANON/CRW_4899.CRW
   133 4584 -rw-------   1 thimm    thimm     4693036 Jul  6 13:19 ./DCIM/148CANON/CRW_4900.CRW
   134 1826 -rw-------   1 thimm    thimm     1869597 Jul  6 13:12 ./DCIM/148CANON/IMG_4890.JPG
   135    0 dr-x------   1 thimm    thimm           0 Jan  1  1970 ./DCIM/149CANON
   136 4543 -rw-------   1 thimm    thimm     4651402 Jul  6 13:19 ./DCIM/149CANON/CRW_4901.CRW
   137 4510 -rw-------   1 thimm    thimm     4617360 Jul  6 13:19 ./DCIM/149CANON/CRW_4902.CRW
   138 4525 -rw-------   1 thimm    thimm     4632582 Jul  6 13:19 ./DCIM/149CANON/CRW_4903.CRW
   139 4683 -rw-------   1 thimm    thimm     4794442 Jul  6 13:19 ./DCIM/149CANON/CRW_4904.CRW
   140    0 dr-x------   1 thimm    thimm           0 Jan  1  1970 ./DCIM/CANONMSC
   141    0 dr-x------   1 thimm    thimm           0 Jan  1  1970 ./MISC

gphoto2 detected the camera as follows:
$ gphoto2 --auto-detect
Model                          Port                                            
----------------------------------------------------------
Canon PowerShot G5 (normal mode) usb:            
Canon PowerShot G5 (normal mode) usb:005,006     

digikam's history log said:
13:17:49 :: Connecting to camera...
13:17:49 :: Connection established.
13:17:50 :: Listing folders...
13:17:50 :: The folders have been listed.
13:17:50 :: Listing files in /home/thimm/.gvfs/gphoto2 mount on usb%3A005,006...
13:17:50 :: The files in /home/thimm/.gvfs/gphoto2 mount on usb%3A005,006 have been listed.
13:17:50 :: Listing files in /home/thimm/.gvfs/gphoto2 mount on usb%3A005,006/DCIM...
13:17:50 :: The files in /home/thimm/.gvfs/gphoto2 mount on usb%3A005,006/DCIM have been listed.
13:17:50 :: Listing files in /home/thimm/.gvfs/gphoto2 mount on usb%3A005,006/DCIM/148CANON...
13:22:29 :: The files in /home/thimm/.gvfs/gphoto2 mount on usb%3A005,006/DCIM/148CANON have been listed.
13:22:29 :: Listing files in /home/thimm/.gvfs/gphoto2 mount on usb%3A005,006/DCIM/149CANON...
13:24:19 :: The files in /home/thimm/.gvfs/gphoto2 mount on usb%3A005,006/DCIM/149CANON have been listed.
13:24:19 :: Listing files in /home/thimm/.gvfs/gphoto2 mount on usb%3A005,006/DCIM/CANONMSC...
13:24:19 :: The files in /home/thimm/.gvfs/gphoto2 mount on usb%3A005,006/DCIM/CANONMSC have been listed.
13:24:19 :: Listing files in /home/thimm/.gvfs/gphoto2 mount on usb%3A005,006/MISC...
13:24:19 :: The files in /home/thimm/.gvfs/gphoto2 mount on usb%3A005,006/MISC have been listed.
13:24:19 :: Getting thumbnails for CRW_4904.CRW...
13:24:48 :: Getting thumbnails for CRW_4903.CRW...
13:25:15 :: Getting thumbnails for CRW_4902.CRW...
13:25:42 :: Getting thumbnails for CRW_4901.CRW...
13:26:10 :: Getting thumbnails for CRW_4900.CRW...
13:26:37 :: Getting thumbnails for CRW_4899.CRW...
13:27:04 :: Getting thumbnails for CRW_4898.CRW...
13:27:31 :: Getting thumbnails for CRW_4897.CRW...
13:27:57 :: Getting thumbnails for CRW_4896.CRW...
13:28:24 :: Getting thumbnails for CRW_4895.CRW...
13:28:51 :: Getting thumbnails for CRW_4894.CRW...
13:29:17 :: Getting thumbnails for CRW_4893.CRW...
13:29:44 :: Getting thumbnails for CRW_4892.CRW...
13:30:10 :: Getting thumbnails for CRW_4891.CRW...
13:30:37 :: Getting thumbnails for IMG_4890.JPG...

Opening the camera in another application (gthumb, shotwell, f-spot) takes only 10-15 seconds for displaying the thumbnails.


Reproducible: Always

Steps to Reproduce:
1. Connect camera to usb port
2. Pick digikam for importing the contents


Actual Results:  
See above. The listing/thumbnail download is painfully slow to the point that the link will disconnect.
Comment 1 caulier.gilles 2010-07-06 14:57:49 UTC
Can you try with digiKam 1.3.0 ?

Gilles Caulier
Comment 2 Axel Thimm 2010-07-06 17:35:51 UTC
I tried building 1.3.0 on F13 (kde 4.4.4), but it looks like digikam 1.3.0 needs libkdcraw >= 1.1.0 and libkexiv2 >= 1.1.0 while kdegraphics-4.4.4 only provides 1.0.0 and 0.6.0 respectively.
Comment 3 Axel Thimm 2010-07-07 08:09:38 UTC
I upgraded to 1.3.0. For this I built and installed the following packages
digikam-1.3.0-1.fc13.x86_64.rpm
digikam-libs-1.3.0-1.fc13.x86_64.rpm
kdegraphics-4.4.90-2.fc13.x86_64.rpm
kdegraphics-libs-4.4.90-2.fc13.x86_64.rpm
kdelibs-4.4.90-1.fc13.x86_64.rpm
kdelibs-common-4.4.90-1.fc13.x86_64.rpm
kio_msits-4.4.90-2.fc13.x86_64.rpm
soprano-2.4.63-3.fc13.x86_64.rpm
(I actually built more, but these were needed for runtime)

The behaviour didn't change the long time execution, the same set of pictures in the same camera now create the following log:

08:51:59 :: Connecting to camera...
08:51:59 :: Connection established.
08:51:59 :: Listing folders...
08:51:59 :: The folders have been listed.
08:51:59 :: Listing files in /home/thimm/.gvfs/gphoto2 mount on usb%3A005,018...
08:51:59 :: The files in /home/thimm/.gvfs/gphoto2 mount on usb%3A005,018 have been listed.
08:51:59 :: Listing files in /home/thimm/.gvfs/gphoto2 mount on usb%3A005,018/DCIM...
08:51:59 :: The files in /home/thimm/.gvfs/gphoto2 mount on usb%3A005,018/DCIM have been listed.
08:51:59 :: Listing files in /home/thimm/.gvfs/gphoto2 mount on usb%3A005,018/DCIM/148CANON...
08:56:38 :: The files in /home/thimm/.gvfs/gphoto2 mount on usb%3A005,018/DCIM/148CANON have been listed.
08:56:38 :: Listing files in /home/thimm/.gvfs/gphoto2 mount on usb%3A005,018/DCIM/149CANON...
08:58:29 :: The files in /home/thimm/.gvfs/gphoto2 mount on usb%3A005,018/DCIM/149CANON have been listed.
08:58:29 :: Listing files in /home/thimm/.gvfs/gphoto2 mount on usb%3A005,018/DCIM/CANONMSC...
08:58:29 :: The files in /home/thimm/.gvfs/gphoto2 mount on usb%3A005,018/DCIM/CANONMSC have been listed.
08:58:29 :: Listing files in /home/thimm/.gvfs/gphoto2 mount on usb%3A005,018/MISC...
08:58:29 :: The files in /home/thimm/.gvfs/gphoto2 mount on usb%3A005,018/MISC have been listed.
08:58:29 :: Getting thumbnails for CRW_4904.CRW...
08:58:57 :: Getting thumbnails for CRW_4903.CRW...
08:59:25 :: Getting thumbnails for CRW_4902.CRW...
08:59:52 :: Getting thumbnails for CRW_4901.CRW...
09:00:19 :: Getting thumbnails for CRW_4900.CRW...
09:00:47 :: Getting thumbnails for CRW_4899.CRW...
09:01:14 :: Getting thumbnails for CRW_4898.CRW...
09:01:40 :: Getting thumbnails for CRW_4897.CRW...
09:02:07 :: Getting thumbnails for CRW_4896.CRW...
09:02:34 :: Getting thumbnails for CRW_4895.CRW...
09:03:00 :: Getting thumbnails for CRW_4894.CRW...
09:03:27 :: Getting thumbnails for CRW_4893.CRW...
09:03:53 :: Getting thumbnails for CRW_4892.CRW...
09:04:20 :: Getting thumbnails for CRW_4891.CRW...
09:04:47 :: Getting thumbnails for IMG_4890.JPG...
Comment 4 caulier.gilles 2010-07-07 09:35:03 UTC
Time mangling is there :

08:51:59 :: Listing files in /home/thimm/.gvfs/gphoto2 mount on
usb%3A005,018/DCIM/148CANON...
08:56:38 :: The files in /home/thimm/.gvfs/gphoto2 mount on
usb%3A005,018/DCIM/148CANON have been listed.

Your camera is canon mounted through Gphoto2 driver. It's not a USB Mass Storage camera. ALso, look like thumb operation are long : 

09:00:19 :: Getting thumbnails for CRW_4900.CRW...
09:00:47 :: Getting thumbnails for CRW_4899.CRW...
09:01:14 :: Getting thumbnails for CRW_4898.CRW...

Around 20 seconds to get one thumb from RAW... 

Here with my Sony camera, UMS mode, getting thumb take less than 1 seconds by item.

Which libgphoto2 version you use ? Look in Help/Components Info for details.

Also take CF card reader, and try please confirm that it's very fast in this case.

Note : Previous week end, i played with a Canon EOS 500D camera from a friend. Camera have been connected to my laptop, running Mandriva 2010.1 (libgphoto2 2.4.9), and all items have been displayed very quickly (all files have been JPEG, not RAW)

Gilles Caulier
Comment 5 Axel Thimm 2010-07-07 09:55:34 UTC
I'm using libgphoto2 2.4.8.

But note that the same library is being used by the other three apps I mentioned and these do pull in the listing and thumbs within a few seconds.

Maybe the difference is in the way libgphoto2 API is used?
Comment 6 caulier.gilles 2010-07-07 10:04:52 UTC
Perhaps.

If you want to take a look, all libghoto2 code called by digiKam is wrapped into this class :

http://lxr.kde.org/source/extragear/graphics/digikam/utilities/cameragui/gpcamera.h
http://lxr.kde.org/source/extragear/graphics/digikam/utilities/cameragui/gpcamera.cpp

GPCamera class is children class of DKcamera :

http://lxr.kde.org/source/extragear/graphics/digikam/utilities/cameragui/dkcamera.h

Gilles Caulier
Comment 7 caulier.gilles 2010-07-07 10:07:11 UTC
A tools to try with digiKam is cachegrind, to look where time is consumed into GPCamera class :

http://lxr.kde.org/source/extragear/graphics/digikam/HACKING#243

Gilles Caulier
Comment 8 caulier.gilles 2011-08-04 14:37:39 UTC
Same problem than https://bugs.kde.org/show_bug.cgi?id=236394

It's probably fixed in next 2.1.0 (current code from git master)

Can you test with this source code ?

Gilles Caulier
Comment 9 caulier.gilles 2011-08-09 09:25:58 UTC
For me this file is fixed now (future digiKam 2.1.0). Please re-open if
necessary...

Gilles Caulier