MTP, libgphoto2 & KFM
Damon Lynch
damonlynch at gmail.com
Sat Dec 5 11:21:51 GMT 2015
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
More information about the kfm-devel
mailing list