GNOME Bugzilla – Bug 623809
Ubuntu 9.10:connect a device via PTP/MTP mode failed with 'Could not lock the device' error
Last modified: 2018-09-21 17:04:48 UTC
Created attachment 165457 [details] error dialog when connect device i have a device which support PTP/MTP and can be mounted by gvfsd-gphoto2 backend everytime, when i connect my device with Ubuntu 9.10, there will be a dialog popup, saying'Unable to mount ...,error initializing camera:-60:could not lock device' (for details, see attached picture).after seeing this error, the device still can be used normally, i mean, you can browse its contents in file browser, send some files from PC to the device via PTP/MTP. tested another device which only report one drive when connect via PTP/MTP mode, no such problem. My concern is: could gvfs only launch one 'gvfsd-gphoto2' process for a device with multi drives, since the device will only be mount once. also, i want to know who is responsible to launch the 'gvfsd-gphto2' backend when a PTP/MTP device is conneced with PC, thanks. i did some investigation about this, below is my analysis: when plug in device, 'gvfsd-gphto2' process will be invoked, if there are multi drives on the device, there will be more than one 'gvfsd-gphoto2' running, one copprespond to one drive. each of this process will do the mount job, which include open the usb port. When open the usb port, it will check currently 'usbfs' driver has been bound to the device or not, if not, then claim the interface and the mount can be successful. The problem is that, after the first 'gvfsd-gphoto2' process successfully mount the device, the other 'gvfsd-gphto2' processes can not mount it, because the device already mounted. thus it returns the error 'GP_ERROR_IO_LOCK' and show the attached error dialog.
after showing the 'Could not lock device' dialog, in fact, all the drives on the device can be used. so i wonder could gvfs do not popup this error dialog since this might mislead user. or for a better solution, one device just show one icon on the desktop,by click the device icon, user can see all available drives on the device, this is what Windows platform behaves.
I can confirm this problem. And I believe it affects many others and needs some urgent attention. As caihuanut points out it occurs with cameras that have two drives. This is very common with many cameras having a small internal drive as well as an additional memory card that is much larger. Here are some reports: http://ubuntuforums.org/showthread.php?t=1163070 http://www.google.com/search?sclient=psy&hl=en&safe=off&rls=ig&site=webhp&q=%22Error+initializing+camera:+-60%3A+Could+not+lock+the+device%22&aq=f&aqi=&aql=&oq=&gs_rfai=&pbx=1&cad=h
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gvfs/issues/151.