Bug 423392

Summary: Import from android mobile phone does not work
Product: [Applications] digikam Reporter: Marcel <maeseee>
Component: Import-MainViewAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles, maeseee, metzpinguin
Priority: NOR    
Version: 7.0.0   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In: 8.1.0
Attachments: Error msg on import dialog
Output on the terminal

Description Marcel 2020-06-23 13:10:14 UTC
Created attachment 129602 [details]
Error msg on import dialog

SUMMARY
Pressing Import/Cameras/<PHONE_NAME> opens a dialog to upload from that phone. By the way the phone has been recognized as it is automatically listed there. Unfortunately, no pictures can be imported although file transfer is allowed on the phone and can be transferred by a file manager. Probably it has to do with the mtp protocol used by android. 

STEPS TO REPRODUCE
1. Import/Cameras/<PHONE_NAME>
2. See dialog


OBSERVED RESULT
Error message "Failed to connect to the camera" on the import dialog

EXPECTED RESULT
Working import or ignoring android phones on the Import/Cameras/ list

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Ubuntu 20.04

ADDITIONAL INFORMATION
See attached screenshot
Comment 1 Maik Qualmann 2020-06-23 13:17:58 UTC
Works here without problems. However, no other program may have previously blocked the gPhoto2 device. The gPhoto2 drivers do not allow simultaneous access. Presumably some service on Ubuntu already uses the device. We have a bug entry for this and cannot really change it.

Maik
Comment 2 Maik Qualmann 2020-06-23 13:20:26 UTC
Please post the message from the therminal. Otherwise bug 412255.

Maik
Comment 3 Marcel 2020-06-23 13:31:20 UTC
Unfortunately there is no error on the terminal and this happens even if I never accessed my phone by some other application. Just Plugin and try. Adding the phone manually does not list my phone. It is an oppo reno 2.
Comment 4 Maik Qualmann 2020-06-23 15:27:02 UTC
Debug messages from gPhoto2 must be available if an error occurs within digiKam. Activate the debug output of digiKam with:

export QT_LOGGING_RULES="digikam*=true"

Maik
Comment 5 Marcel 2020-06-23 17:23:24 UTC
Created attachment 129608 [details]
Output on the terminal

Here is the terminal output. Additionally I added the steps I did.
Comment 6 Maik Qualmann 2020-06-23 17:55:18 UTC
Exactly the error message I expected, the device is already blocked by another service. With gPhoto2, the USB device should only be opened as long as required. A desktop service from Ubuntu has already opened the gPhoto2 device.


Digikam::GPCamera::printGphotoErrorDescription: Libgphoto2 error:  Could not claim the USB device  ( -53 )

Kill the service and digiKam will be able to access the Android device. The phone does not have to appear in the list of cameras, it is addressed as the standard MTP / PTP device.

Maik

*** This bug has been marked as a duplicate of bug 412255 ***
Comment 7 Marcel 2020-06-23 19:21:30 UTC
The solution of Maik did work. Thank you for your help. In my case (Ubuntu 20.04) it was the task /usr/libexec/gvfsd-mtp.
Comment 8 caulier.gilles 2023-05-01 19:41:35 UTC
Fixed with #412255