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 728205 - Camera not mounting in ptp with recent distributions
Camera not mounting in ptp with recent distributions
Product: gvfs
Classification: Core
Component: gphoto backend
Other Linux
: Normal major
: ---
Assigned To: gvfs-maint
Depends on:
Reported: 2014-04-14 19:35 UTC by Nick Rhodes
Modified: 2014-06-29 15:26 UTC
See Also:
GNOME target: ---
GNOME version: ---

libgphoto2 patch (5.18 KB, patch)
2014-06-29 15:24 UTC, Ross Lagerwall
reviewed Details | Review

Description Nick Rhodes 2014-04-14 19:35:01 UTC
Plug in a PTP Camera (various) - Nautilus does not show a mounted camera, nor any dialog.

Photos can be downloaded successfully from the terminal using gphoto2
Comment 1 Cristian Aravena Romero 2014-04-15 00:03:10 UTC
Comment 2 Ross Lagerwall 2014-04-15 06:39:30 UTC
Thanks for the report.  Is the gphoto volume monitor running when this occurs?
What is the output of "ps aux | grep gvfs" when this occurs?
Comment 3 Nick Rhodes 2014-04-15 19:22:29 UTC
:~$ ps aux | grep gvfs
nirh      1967  0.0  0.0 196680  3208 ?        Sl   18:40   0:00 /usr/lib/gvfs/gvfsd
nirh      1981  0.0  0.0 345660  3136 ?        Sl   18:40   0:00 /usr/lib/gvfs/gvfsd-fuse /run/user/1000/gvfs -f -o big_writes
nirh      2242  0.0  0.0 124480  2812 ?        Sl   18:40   0:00 /usr/lib/gvfs/gvfsd-metadata
nirh      2272  0.0  0.1 298884  5272 ?        Sl   18:40   0:00 /usr/lib/gvfs/gvfs-udisks2-volume-monitor
nirh      2295  0.0  0.0 212448  3388 ?        Sl   18:40   0:00 /usr/lib/gvfs/gvfs-gphoto2-volume-monitor
nirh      2301  0.0  0.1 200284  4860 ?        Sl   18:40   0:00 /usr/lib/gvfs/gvfs-mtp-volume-monitor
nirh      2305  0.0  0.0 286000  3368 ?        Sl   18:40   0:00 /usr/lib/gvfs/gvfs-afc-volume-monitor
nirh      2329  0.0  0.1 433304  5856 ?        Sl   18:40   0:00 /usr/lib/gvfs/gvfsd-trash --spawner :1.5 /org/gtk/gvfs/exec_spaw/0
nirh      2360  0.0  0.0 270412  3064 ?        Sl   18:40   0:00 /usr/lib/gvfs/gvfsd-burn --spawner :1.5 /org/gtk/gvfs/exec_spaw/1
nirh      5158  0.0  0.0  15948   916 pts/0    R+   20:21   0:00 grep --color=auto gvfs
Comment 4 Ross Lagerwall 2014-04-16 17:27:40 UTC
Previously, libgphoto generated udev rules, one of which was to label devices with a usb interface of *:060101:* as PTP devices.  This allowed gvfs to detect them.

Now, recent distros are generating a hwdb file which only includes explicit rules for certain cameras does not seem to include this catch-all rule.  Consequently, the device is not getting labelled by udev as a PTP device and gvfs is unable to detect it.

This is not a gvfs bug; however I shall ask on the gphoto mailing list for a solution and leave this bug open in the meantime.
Comment 5 Ross Lagerwall 2014-04-16 18:36:19 UTC
OK, scratch that last bit.  After reading this could be a gvfs bug in the way that gvfs uses the results from udev.
Comment 6 Sebastien Bacher 2014-05-13 10:11:16 UTC
Comment 7 Sebastien Bacher 2014-05-13 10:11:43 UTC
Ross, that issue doesn't seem specific to one distribution, I've updated the title, let me know if that's uncorrect
Comment 8 Ross Lagerwall 2014-05-13 11:50:15 UTC
Yeah, that is correct.  It would be nice if someone who knows a little more about the gphoto monitor and udev could look at this.
Comment 9 Martin Pitt 2014-06-10 15:25:06 UTC
Summary from comparing a camera that works (Canon PowerShot SX200) with a camera that does not (a Fuji one):

Working model:
 - This has a specific vendor/model match in 20-libgphoto2-6.hwdb
 - The ID_GPHOTO2 tag is on both the usb_device (i. e. /dev/bus/usb/002/011) and its "usb_interface" (INTERFACE=6/1/1, in other words, "PTP") child in udev

Non-working model:
 - This uses the "usb:v*ic06isc01ip01*" hwdb match which is only true on the usb_interface, but not its parent usb_device
 - Thus the ID_GPHOTO2 tag is only on the interface

So there are two obvious alternatives:
 (1) Make gvfs look for PTP USB interfaces instead of USB devices


 (2) Make the ID_GPHOTO2 tag for "generic PTP cam" appear on the parent usb_device, too. AFAICS this isn't possible directly with hwdb, but it's possible with a generic udev rule (we already had that in the past, before moving to hwdb).
Comment 10 Ross Lagerwall 2014-06-10 17:52:39 UTC
It seems like the gphoto developers suggest (1) to be the "proper" solution:

Marcus Meissner:
Well, we have to match what actually needs to be matched...

If the upstream code cannot handle that we just match the interface class, it is buggy and should be fixed.

I can do different hwdb rules, but I do think the problem lies in other layers.

Comment 11 Martin Pitt 2014-06-11 08:04:10 UTC
Marcus committed an udev rule for this case now:

For the record, I did something similar in the Ubuntu package as that's the least intrusive fix for a stable distro release. But it seems the general direction is to fix this with an udev rule, so we might close this as NOTGNOME after all?
Comment 12 Ross Lagerwall 2014-06-11 16:51:27 UTC
Nice spot.  Although perhaps the gvfs code is not ideal, there seems little point in changing it if it works with the latest gphoto fix.

I shall test the latest gphoto code and close as NOTGNOME if it works OK.
Comment 13 Ross Lagerwall 2014-06-29 15:22:55 UTC
Tested and it works fine.

To get it to work, build libgphoto2 from svn or libgphoto2 2.5.4 with the attached patch and then generate the required rules file and hwdb. E.g.
/usr/lib/libgphoto2/print-camera-list udev-rules version 201 > /usr/lib/udev/rules.d/40-gphoto.rules
/usr/lib/libgphoto2/print-camera-list hwdb > /usr/lib/udeb/hwdb.db/20-gphoto.hwdb

Comment 14 Ross Lagerwall 2014-06-29 15:24:08 UTC
Created attachment 279538 [details] [review]
libgphoto2 patch
Comment 15 Ross Lagerwall 2014-06-29 15:26:19 UTC
If you're on a stable distro release, you may need to ask your distro maintainer nicely to backport this or what Martin did to get some cameras mounting.