GNOME Bugzilla – Bug 728205
Camera not mounting in ptp with recent distributions
Last modified: 2014-06-29 15:26:19 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
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?
:~$ 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
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.
OK, scratch that last bit. After reading http://sourceforge.net/p/gphoto/bugs/974/ this could be a gvfs bug in the way that gvfs uses the results from udev.
Ross, that issue doesn't seem specific to one distribution, I've updated the title, let me know if that's uncorrect
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.
Summary from comparing a camera that works (Canon PowerShot SX200) with a camera that does not (a Fuji one):
- 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
- 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).
It seems like the gphoto developers suggest (1) to be the "proper" solution:
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.
Marcus committed an udev rule for this case now: https://sourceforge.net/p/gphoto/code/15004
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?
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.
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
Created attachment 279538 [details] [review]
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.