digikam fail to import pictures via MTP: Failed to connect to the camera

Bug #2036244 reported by Benjamin Drung
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
digikam (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

I am trying to reproduce bug #2035406.

preparation
-----------

1. Install Ubuntu 20.04 (using ubuntu-22.04.2-desktop-amd64.iso) and reboot
2. Install all updates: sudo apt update && sudo apt dist-upgrade
3. Install digikam: sudo apt install digikam
4. Open digikam and accept all defaults and close digikam again

reproduce
---------

5. Connect a camera (in my case a Sony Alpha 9) via USB to the computer and configure the camera to use MTP
6. Open digikam
7. Select Import -> Cameras -> Sony ILCE-9 (auto-detected)

A new window will open and show a red bar at the bottom with:

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

```
~$ LANG=C digikam
digikam.facedb: Cannot found faces engine model "shapepredictor.dat"
digikam.facedb: Faces recognition feature cannot be used!
digikam.facedb: cv::Exception: OpenCV(4.5.4) ./modules/dnn/src/torch/THDiskFile.cpp:496: error: (-2:Unspecified error) cannot open </home/bdrung/.local/share/digikam/facesengine/openface_nn4.small2.v1.t7> in mode r in function 'THDiskFile_new'

QtAV 1.13.0(Mar 17 2022, 15:37:53)
Multimedia framework base on Qt and FFmpeg.
Distributed under the terms of LGPLv2.1 or later.
Shanghai, China Copyright (C) 2012-2019 Wang Bin (aka. Lucas Wang) <email address hidden>
Donate: http://qtav.org/donate.html
Source: https://github.com/wang-bin/QtAV
Home page: http://qtav.org
Icon theme "breeze" not found.
kf.xmlgui: Unhandled container to remove : Digikam::DigikamApp
QLayout: Attempting to add QLayout "" to Digikam::DNGConvertSettings "", which already has a layout
QWidget::insertAction: Attempt to insert null action
QWidget::insertAction: Attempt to insert null action
QWidget::insertAction: Attempt to insert null action
```

Clicking on the ILCE-9 icon on the side bar lets you navigate and show the pictures on the camera.

Following strace output appears when opening the camera import:

```
$ LANG=C strace -efile digikam 2>&1
[...]
newfstatat(AT_FDCWD, "/etc/localtime", {st_mode=S_IFREG|0644, st_size=2298, ...}, 0) = 0
newfstatat(AT_FDCWD, "/etc/localtime", {st_mode=S_IFREG|0644, st_size=2298, ...}, 0) = 0
newfstatat(AT_FDCWD, "/etc/localtime", {st_mode=S_IFREG|0644, st_size=2298, ...}, 0) = 0
QWidget::insertAction: Attempt to insert null action
newfstatat(AT_FDCWD, "/etc/localtime", {st_mode=S_IFREG|0644, st_size=2298, ...}, 0) = 0
newfstatat(AT_FDCWD, "/etc/localtime", {st_mode=S_IFREG|0644, st_size=2298, ...}, 0) = 0
newfstatat(AT_FDCWD, "/etc/localtime", {st_mode=S_IFREG|0644, st_size=2298, ...}, 0) = 0
readlink("/home", 0x7ffe555527d0, 1023) = -1 EINVAL (Invalid argument)
readlink("/home/bdrung", 0x7ffe555527d0, 1023) = -1 EINVAL (Invalid argument)
readlink("/home/bdrung/Bilder", 0x7ffe555527d0, 1023) = -1 EINVAL (Invalid argument)
openat(AT_FDCWD, "/proc/self/mountinfo", O_RDONLY|O_CLOEXEC) = 134
newfstatat(134, "", {st_mode=S_IFREG|0444, st_size=0, ...}, AT_EMPTY_PATH) = 0
access("/dev/nvme0n1p2", F_OK) = 0
statfs("/", {f_type=EXT2_SUPER_MAGIC, f_bsize=4096, f_blocks=239946508, f_bfree=237101089, f_bavail=224894037, f_files=61022208, f_ffree=60785937, f_fsid={val=[0x28359e61, 0xeb905d3d]}, f_namelen=255, f_frsize=4096, f_flags=ST_VALID|ST_RELATIME}) = 0
readlink("/dev", 0x7ffe555528f0, 1023) = -1 EINVAL (Invalid argument)
readlink("/dev/nvme0n1p2", 0x7ffe555528f0, 1023) = -1 EINVAL (Invalid argument)
openat(AT_FDCWD, "/dev/disk/by-label", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/proc/meminfo", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = 134
[...]
```

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: digikam 4:7.5.0-3fakesync1
ProcVersionSignature: Ubuntu 6.2.0-32.32~22.04.1-generic 6.2.16
Uname: Linux 6.2.0-32-generic x86_64
ApportVersion: 2.20.11-0ubuntu82.5
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Fri Sep 15 15:45:13 2023
InstallationDate: Installed on 2023-09-15 (0 days ago)
InstallationMedia: Ubuntu 22.04.2 LTS "Jammy Jellyfish" - Release amd64 (20230223)
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=de_DE.UTF-8
 SHELL=/bin/bash
SourcePackage: digikam
UpgradeStatus: No upgrade log present (probably fresh install)
modified.conffile..etc.apport.crashdb.conf: [modified]
mtime.conffile..etc.apport.crashdb.conf: 2023-09-15T15:44:59.021725

Revision history for this message
Benjamin Drung (bdrung) wrote :
Benjamin Drung (bdrung)
summary: - digikam fail to import pictures via MTP: Failed to connect to the
- camera.
+ digikam fail to import pictures via MTP: Failed to connect to the camera
Revision history for this message
Steve Langasek (vorlon) wrote :

how about 'LANG=C strace -efile digikam 2>&1 | grep '/dev.*EPERM'?

Changed in digikam (Ubuntu):
status: New → Incomplete
Revision history for this message
Benjamin Drung (bdrung) wrote :

That command gives zero output.

Revision history for this message
Benjamin Drung (bdrung) wrote :

I found a way to reliable get digikam working:

1. Close digikam
2. Mount the camera via MTP in Nautilus (click on the camera icon in the side bar)
3. Unmout the camera in Nautilus (eject button)
4. Open digikam
5. Select Import -> Cameras -> Sony ILCE-9 (auto-detected) -> pictures are shown

That looks like GNOME and digikam fighting for MTP.

Revision history for this message
smu (smu) wrote :

thanks, that helped me to get the digikam camera report working in debian + cinnamon.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for digikam (Ubuntu) because there has been no activity for 60 days.]

Changed in digikam (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.