MTP, libgphoto2 & KFM
Mark Gaiser
markg85 at gmail.com
Sat Dec 5 18:16:48 GMT 2015
Ok, lets try one more thing. I have an idea where something might be going
wrong. My hunch is that for back/forward purposes the devices is kept open.
Could you:
1. open dolphin
2. open a new tab (you now have 2 tabs open). Be sure that neither tab went
to the MTP device yet!
3. pick a tab, doesn't matter which one, and navigate to the MTP device.
4. close the tab where you navigated to the MTP device, but keep dolphin
open!
5. Try opening the MTP device in your application.
If my hunch is correct you're able to open the MTP device in your app as
you would when dolphin is closed.
On Sat, Dec 5, 2015 at 5:26 PM, Damon Lynch <damonlynch at gmail.com> wrote:
> I didn't yet report it as a bug just yet because my understanding of
> kframeworks is poor.
>
> kioclient5 ls 'mtp:/Nexus 4/Internal storage/' works, and frees the
> device. In other words you can access the device with gphoto2 after running
> this command.
>
> Note: Dolphin uses the URI mtp:/device, which looks to me like a bug (it's
> missing the second forward slash).
>
> Interestingly, these steps cause Dolphin to fail:
> 1. Open Dolphin and browse to see the contents of directory "Internal
> storage" in the MTP device
> 2. run this command (for example): kioclient5 ls 'mtp:/Nexus 4/Internal
> storage/DCIM'
> It works as expected, displaying the contents.
> 3. Dolphin now fails to browse the MTP device subfolders. Sometimes it
> incorrectly displays nothing in the subfolder, whereas at other times it
> displays an error "Could not enter folder xyz".
>
> On Sat, Dec 5, 2015 at 7:32 PM, Mark Gaiser <markg85 at gmail.com> wrote:
>
>> 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.
>>
>
>
>
> --
> http://www.damonlynch.net
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20151205/49c09907/attachment.htm>
More information about the kfm-devel
mailing list