GNOME Bugzilla – Bug 570888
gvfs-gphoto2 mount 4 devices when pluging one camera
Last modified: 2009-03-12 12:28:50 UTC
Please describe the problem: In Ubuntu Jaunty alpha4, when I plug my Canon PowerShot A700 Camera (a PTP camera mounted by gphoto2 gvfs backend), the camera appear 3 times (and sometime even 4 times) in nautilus left panel like if I had 3 cameras at the same time. Each of these 3 devices in nautilus bring to a different folder inside the camera as described here : Camera 1 : gphoto2://[usb:002,015]/ Camera 2 : gphoto2://[usb:002,015]/store_80000001 Camera 3 : gphoto2://[usb:002,015]/store_00010001 When I unplug the camera, two of the cameras in nautilus does not disappears until I reboot the computer. If I don't insert a SD card in the camera, gphoto2://[usb:002,015]/store_80000001 still appears and give a error message when trying to access it (normal since the card isn't even available). "gphoto2 --auto-detect" output : Canon PowerShot A700 (PTP mode) usb: Canon PowerShot A700 (PTP mode) usb:002,006 lsusb output : Bus 002 Device 006: ID 04a9:3117 Canon, Inc. PowerShot A700 Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x04a9 Canon, Inc. idProduct 0x3117 PowerShot A700 bcdDevice 0.02 iManufacturer 1 Canon Inc. iProduct 2 Canon Digital Camera iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 39 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xc0 Self Powered MaxPower 2mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 3 bInterfaceClass 6 Imaging bInterfaceSubClass 1 Still Image Capture bInterfaceProtocol 1 Picture Transfer Protocol (PIMA 15470) iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x02 EP 2 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x83 EP 3 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0008 1x 8 bytes bInterval 10 Device Qualifier (for other device speed): bLength 10 bDescriptorType 6 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 bNumConfigurations 1 Device Status: 0x0001 Self Powered Steps to reproduce: 1. Plug a PTP camera such as the Canon PowerShot A700 Actual results: The Camera mount 3 times in nautilus. Expected results: I would expect to see only one camera mounted in nautilus. Does this happen every time? Yes Other information:
Created attachment 128180 [details] gvfs-mount -li output
Created attachment 128181 [details] Screenshot
As a general sentiment please state upstream versions, things like "Ubuntu Jaunty alpha4" is not really helpful. According to gvfs-mount -li output, the camera apparently reports two storage heads so you should expect two camera volume/mounts e.g. gphoto2://[usb:002,005]/store_80000001 gphoto2://[usb:002,005]/store_00010001 The third mount (gphoto2://[usb:002,005]/) is shadowed and shouldn't be displayed in Nautilus. This patch was committed to Nautilus on 2/9 (part of 2.25.91) so either the patch is not working or you are using an old Nautilus. What version of Nautilus are you using?
using GNOME 2.25.92 gvfs 1.1.7 the situation changed slightly: * gcfs-mount log: Volume(0): Canon, Inc. PowerShot A95 Type: GProxyVolume (GProxyVolumeMonitorGPhoto2) ids: hal-udi: '/org/freedesktop/Hal/devices/usb_device_4a9_30bb_noserial_if0' unix-device: '/dev/bus/usb/006/006' activation_root=gphoto2://[usb:006,006]/store_00010001 themed icons: [camera-photo] can_mount=1 can_eject=0 Mount(0): Canon, Inc. PowerShot A95 -> gphoto2://[usb:006,006]/store_00010001 Type: GProxyShadowMount (GProxyVolumeMonitorGPhoto2) themed icons: [camera-photo] x_content_types: x-content/image-dcf can_unmount=1 can_eject=0 is_shadowed=0 Volume(1): Canon, Inc. PowerShot A95 Type: GProxyVolume (GProxyVolumeMonitorGPhoto2) ids: hal-udi: '/org/freedesktop/Hal/devices/usb_device_4a9_30bb_noserial_if0' unix-device: '/dev/bus/usb/006/006' activation_root=gphoto2://[usb:006,006]/store_80000001 themed icons: [camera-photo] can_mount=1 can_eject=0 Mount(0): Canon, Inc. PowerShot A95 -> gphoto2://[usb:006,006]/store_80000001 Type: GProxyShadowMount (GProxyVolumeMonitorGPhoto2) themed icons: [camera-photo] x_content_types: x-content/image-dcf can_unmount=1 can_eject=0 is_shadowed=0 Mount(0): Canon, Inc. PowerShot A95 -> gphoto2://[usb:006,006]/ Type: GDaemonMount themed icons: [camera-photo] [camera] x_content_types: x-content/image-dcf can_unmount=1 can_eject=0 is_shadowed=1 * 2 icons are displayed and the dialog is opened twice the situation seems to happen with lot of canon cameras
$ gphoto2 --auto-detect Modèle Port ---------------------------------------------------------- Canon PowerShot A95 (PTP mode) usb: Canon PowerShot A95 (PTP mode) usb:006,008
gphoto2 --summary Storage Devices Summary: store_00010001: StorageDescription: None VolumeLabel: D Storage Type: Removable RAM (memory card) Filesystemtype: Digital Camera Layout (DCIM) Access Capability: Read-Write Maximum Capability: 260018176 (247 MB) Free Space (Bytes): 233070592 (222 MB) Free Space (Images): -1 store_80000001: StorageDescription: None VolumeLabel: V Storage Type: Builtin RAM Filesystemtype: Unknown: 0x8001 Access Capability: Read-Write Maximum Capability: 0 (0 MB) Free Space (Bytes): 0 (0 MB) Free Space (Images): -1
gvfs: 1.1.7-0ubuntu1 nautilus: 1:2.25.92-0ubuntu1 I probably confirm Sebastian Bacher comment, my camera now show 2 times in nautilus, however one of these two camera does not disappear when I unplug the camera. When I plug the camera again, I finally get 3 cameras in nautilus. Don't hesitate to ask if I can provide more information.
(In reply to comment #6) > gphoto2 --summary > > Storage Devices Summary: > store_00010001: > StorageDescription: None > VolumeLabel: D > Storage Type: Removable RAM (memory card) > Filesystemtype: Digital Camera Layout (DCIM) > Access Capability: Read-Write > Maximum Capability: 260018176 (247 MB) > Free Space (Bytes): 233070592 (222 MB) > Free Space (Images): -1 > store_80000001: > StorageDescription: None > VolumeLabel: V > Storage Type: Builtin RAM > Filesystemtype: Unknown: 0x8001 > > Access Capability: Read-Write > Maximum Capability: 0 (0 MB) > Free Space (Bytes): 0 (0 MB) > Free Space (Images): -1 Interesting. We should probably ignore storage heads with very low capacity (say, less than 1MB).
2009-03-09 Alexander Larsson <alexl@redhat.com> Bug 570888 – gvfs-gphoto2 mount 4 devices when pluging one camera * monitor/gphoto2/ggphoto2volumemonitor.c: (get_stores_for_camera): Ignore stores that have 0 byte capability.
Even better, ignore "Storage Type == Builtin RAM", no?
Yeah, we should probably ignore ram, as well as capacity 0.
(In reply to comment #9) > 2009-03-09 Alexander Larsson <alexl@redhat.com> > > Bug 570888 – gvfs-gphoto2 mount 4 devices when pluging one camera > > * monitor/gphoto2/ggphoto2volumemonitor.c: > (get_stores_for_camera): > Ignore stores that have 0 byte capability. Alex, thanks for looking at this. But I think you also need to fix up ensure_ignore_prefix() in daemon/gvfsbackendgphot2.c... (am currently traveling, back on Monday March 16th)
Created attachment 130451 [details] [review] Update ensure_ignore_prefix to also ignore broken storages
david: Yeah, you're right. Attached patch (untested) should handle this. I'd like someone with this hardware to verify that it works. Make sure that after installing the fix both the gphoto mount and monitor are restarted. Easiest is to log out first.
Please ignore the daemon/gvfsbackendcomputer.c part of the patch.
I've tested the new patch and does what is expected, the camera lists the photo directory again directly
commited.