After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 570888 - gvfs-gphoto2 mount 4 devices when pluging one camera
gvfs-gphoto2 mount 4 devices when pluging one camera
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: gphoto backend
1.1.x
Other All
: Normal major
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2009-02-07 18:59 UTC by Oxmosys
Modified: 2009-03-12 12:28 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26


Attachments
gvfs-mount -li output (2.65 KB, text/plain)
2009-02-07 19:00 UTC, Oxmosys
  Details
Screenshot (90.10 KB, image/png)
2009-02-07 19:01 UTC, Oxmosys
  Details
Update ensure_ignore_prefix to also ignore broken storages (1.73 KB, patch)
2009-03-11 10:01 UTC, Alexander Larsson
none Details | Review

Description Oxmosys 2009-02-07 18:59:48 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:
Comment 1 Oxmosys 2009-02-07 19:00:46 UTC
Created attachment 128180 [details]
gvfs-mount -li output
Comment 2 Oxmosys 2009-02-07 19:01:15 UTC
Created attachment 128181 [details]
Screenshot
Comment 3 David Zeuthen (not reading bugmail) 2009-03-04 16:53:09 UTC
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?
Comment 4 Sebastien Bacher 2009-03-04 17:01:23 UTC
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
Comment 5 Sebastien Bacher 2009-03-04 17:02:46 UTC
$ gphoto2 --auto-detect
Modèle                        Port                                             
----------------------------------------------------------
Canon PowerShot A95 (PTP mode) usb:            
Canon PowerShot A95 (PTP mode) usb:006,008  
Comment 6 Sebastien Bacher 2009-03-04 17:06:53 UTC
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
Comment 7 Oxmosys 2009-03-04 17:45:36 UTC
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.
Comment 8 David Zeuthen (not reading bugmail) 2009-03-04 17:55:36 UTC
(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).
Comment 9 Alexander Larsson 2009-03-09 13:35:04 UTC
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.

Comment 10 Bastien Nocera 2009-03-09 14:35:29 UTC
Even better, ignore "Storage Type == Builtin RAM", no?
Comment 11 Alexander Larsson 2009-03-10 14:56:18 UTC
Yeah, we should probably ignore ram, as well as capacity 0.
Comment 12 David Zeuthen (not reading bugmail) 2009-03-10 18:57:45 UTC
(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)
Comment 13 Alexander Larsson 2009-03-11 10:01:07 UTC
Created attachment 130451 [details] [review]
Update ensure_ignore_prefix to also ignore broken storages
Comment 14 Alexander Larsson 2009-03-11 10:02:22 UTC
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.
Comment 15 Alexander Larsson 2009-03-11 10:05:45 UTC
Please ignore the daemon/gvfsbackendcomputer.c part of the patch.

Comment 16 Sebastien Bacher 2009-03-12 09:31:28 UTC
I've tested the new patch and does what is expected, the camera lists the photo directory again directly
Comment 17 Alexander Larsson 2009-03-12 12:28:50 UTC
commited.