MTP, libgphoto2 & KFM

Mark Gaiser markg85 at gmail.com
Sat Dec 5 14:32:30 GMT 2015


On Sat, Dec 5, 2015 at 12:21 PM, Damon Lynch <damonlynch at gmail.com> wrote:

> Hello,
>
> I'm developing a FOSS application [1] (Qt 5, python 3.4) that uses
> libgphoto2 to access cameras and camera-like devices, including smart
> phones / tablets that connect via MTP.
>
> I have noticed that when Dolphin has accessed the contents of an MTP
> device, libgphoto2 is unable to access the device, even if Dolphin browsing
> another location e.g. the user's home directory. The device becomes free
> when Dolphin is closed.
>
> To test this, do these steps:
>
> 1. To confirm the MTP device is accessible by libgphoto2, plug in an
> unlocked android 4.0 + phone (for example), and from a terminal execute
> gphoto2 --list-folders
>     That should work.
> 2. Open Dolphin and browse some folders on the phone.
> 3. Repeat step 1 while Dolphin is open. It fails.
>
> I am unaware of a way for the user to do the equivalent of a virtual
> "unmount" to ask Dolphin/Kdeinit5 via the GUI to relinquish exclusive
> control of the device. Is there a way, either through the GUI or the
> command line? GVFS supplies such a feature. I tried solid-hardware unmount
> udi (supplying the correct UDI), but solid-hardware reported the MTP device
> 'does not have the interface StorageAccess".
>
> Is there a way request kdeinit5 to relinquish exclusive control of the
> device from python code? It would be great if my application could
> automatically do a virtual "unmount" of the device so it can access it,
> without user intervention.
>
> Is there a case to be made for KDE applications to provide a virtual
> "unmount" of MTP and perhaps also PTP devices in its GUI?
>
> Thanks.
>
> Damon
>
> [1] https://code.launchpad.net/~dlynch3/rapid/zeromq_pyqt
>
> --
>
> http://www.damonlynch.net
>
>
This smells like it should be reported in https://bugs.kde.org/

Anyhow, can you try if the same happens when just using KIO on the command
line. It would be a command like:
kioclient5 ls mtp://...

You can get the mtp:// line from dolphin when you where browsing the mtp
device (press F6 or click in the location bar)

I'm just curious if using the kio command line tool will give you the same
result.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20151205/ccdc52ac/attachment.htm>


More information about the kfm-devel mailing list