https://bugs.kde.org/show_bug.cgi?id=412255

            Bug ID: 412255
           Summary: Unable to Import photos from camera
           Product: digikam
           Version: 6.3.0
          Platform: Archlinux Packages
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Import-Gphoto2
          Assignee: digikam-bugs-n...@kde.org
          Reporter: ham...@laposte.net
  Target Milestone: ---

STEPS TO REPRODUCE
1. Connect my smartphone via usb
2. Launch digikam
3. select Import


OBSERVED RESULT

The GUI shows this error :

Failed to connect to the camera. Please make sure it is connected properly and
turned on.

In the console, digikam displays theses errors :

digikam.general: Found camera from ids  8888   11894  camera is:  "Motorola
Moto G (ID1)"  at  "usb:001,024"
digikam.geoiface: "setting backend marble"
digikam.general: Audio output backends: ("OpenAL", "Pulse", "null")
digikam.general: Number of supported audio codecs: 186
digikam.general: Number of supported video codecs: 259
digikam.geoiface: "ROADMAP"
digikam.geoiface: "setting backend marble"
QLayout: Attempting to add QLayout "" to Digikam::DNGConvertSettings "", which
already has a layout
digikam.geoiface: "ROADMAP"
QFSFileEngine::open: No file name specified
digikam.import: Log ( ""   "" :  "Connecting to camera..."
digikam.import: Failed to initialize camera!
digikam.import: Libgphoto2 error:  Could not claim the USB device  ( -53 )
digikam.import: Log ( ""   "" :  "Connection failed."
digikam.geoiface: ----

EXPECTED RESULT
Digikam shows all the photos stored in my smartphone and allows me to import
them.

SOFTWARE/OS VERSIONS
Digikam 6.3.0
KDE Frameworks 5.62.0
Qt 5.13.1 (built against 5.13.1)
The xcb windowing system

ADDITIONAL INFORMATION
I got the same error when using directly gphoto2 :

$ gphoto2 -L

*** Error ***              
An error occurred in the io-library ('Could not claim the USB device'): Could
not claim interface 0 (Device or resource busy). Make sure no other program
(gvfs-gphoto2-volume-monitor) or kernel module (such as sdc2xx, stv680,
spca50x) is using the device and you have read/write access to the device.
*** Error (-53: 'Could not claim the USB device') ***  


When tracing gphoto2, I see it fails when it is trying to open the device file
:
strace -e file gphoto2 --list-files
openat(AT_FDCWD, "/dev/bus/usb/001/024", O_RDWR|O_CLOEXEC) = 9

In fact, this file is already in use by kiod5 :

$ lsof /dev/bus/usb/001/024
COMMAND   PID   USER   FD   TYPE DEVICE SIZE/OFF   NODE NAME
kiod5   99742 azertx   19u   CHR 189,23      0t0 499545 /dev/bus/usb/001/024

Systemd is launching this process as soon as I plug my phone via usb.

● dbus.service - D-Bus User Message Bus
   Loaded: loaded (/usr/lib/systemd/user/dbus.service; static; vendor preset:
enabled)
   Active: active (running) since Mon 2019-09-23 19:35:54 CEST; 55min ago
     Docs: man:dbus-daemon(1)
 Main PID: 33057 (dbus-daemon)
   CGroup: /user.slice/user-2230.slice/user@2230.service/dbus.service
           ├─33057 /usr/bin/dbus-daemon --session --address=systemd: --nofork
--nopidfile --syst>
           ├─33117 /usr/bin/kglobalaccel5
           ├─33130 /usr/lib/dconf-service
           ├─33249 /usr/lib/kactivitymanagerd
           ├─33395 /usr/lib/kf5/kscreen_backend_launcher
           └─99742 /usr/lib/kf5/kiod5

The workaround is to kill kiod5 to free the device. After that, I can import
photo from digikam/gphoto2.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to