GNOME Bugzilla – Bug 591009
Don't use gphoto when AFC is present on iPhones
Last modified: 2010-03-24 14:04:29 UTC
When AFC is present, don't use gphoto, as we can already get the same data through other means (a DCIM directory will appear under the mount).
Sounds good to me... about implementing it... seems like we need to teach the gphoto2 volume monitor about detecting devices capable of being driven by the AFC driver code - is this complicated (e.g. sending commands to the device) or is it just a VPD check? Should probably also make the AFC and GPhoto2 monitors share code for this...
*** Bug 597803 has been marked as a duplicate of this bug. ***
@David: It is a matter of the gphoto2 rules flagging the device as a "camera" afaik.
(In reply to comment #3) > @David: It is a matter of the gphoto2 rules flagging the device as a "camera" > afaik. Yeah, and that's still correct since the camera still can be driven by a PTP driver. The thing here is that we have two different drivers (gphoto2 and afc) that can be used - we need logic to only use one of them (afc in this case).
Is there an easy (in terms of udev rules) way to check which devices are handled by the afc backend? A particular usb interface/protocol and the like? Then we could add this check to the gvfs gphoto backend to ignore devices which have ID_GPHOTO2, but also match this interface/protocol, and enclose this check in #ifdef HAVE_AFC. I don't see another elegant and race free variant here, unless there's a way to predict/force the probing order of gvfs backends?
(In reply to comment #5) > Is there an easy (in terms of udev rules) way to check which devices are > handled by the afc backend? A particular usb interface/protocol and the like? Ah, it seems there might be. libimobiledevice ships a hal fdi with <match key="info.subsystem" string="usb"> <match key="usb.vendor_id" int="0x05ac"> <match key="usb.product_id" compare_ge="0x1290"> <match key="usb.product_id" compare_le="0x1294"> <match key="usb.interface.number" int="0x1"> <append key="info.capabilities" type="strlist">afc</append> but this seems very limited. Do all the Apple-type devices really look that much alike?
(In reply to comment #5) > Is there an easy (in terms of udev rules) way to check which devices are > handled by the afc backend? A particular usb interface/protocol and the like? A patch to usbmuxd's udev rule would be enough to add a tag. > Then we could add this check to the gvfs gphoto backend to ignore devices which > have ID_GPHOTO2, but also match this interface/protocol, and enclose this check > in #ifdef HAVE_AFC. > > I don't see another elegant and race free variant here, unless there's a way to > predict/force the probing order of gvfs backends? I think that just ignoring all gphoto mounts from AFC-capable devices is good enough.
(In reply to comment #7) > I think that just ignoring all gphoto mounts from AFC-capable devices is good > enough. Ah, this way around? I assumed that the afc backend would be preferred, since it's more specialized for Apple hardware.
(In reply to comment #8) > (In reply to comment #7) > > > I think that just ignoring all gphoto mounts from AFC-capable devices is good > > enough. > > Ah, this way around? I assumed that the afc backend would be preferred, since > it's more specialized for Apple hardware. I think you might have confused what I said. You'd put the code in the gphoto volume monitor to ignore all devices that are tagged as being AFC capable. This would need to depend on the AFC backend being compiled.
I think Bastien got it right, either one can check for the 0x05ac:0x1290-0x1299 USB id range but due to the fact that this range is already maintained by usbmuxd's udev rules it makes more sense to just add a flag in the udev rules. Please mind that this only should apply to the GVFS backend, since the PTP interface is still exposed access using libgphoto should still work.
Created attachment 156755 [details] [review] Mark AFC devices as such in the usbmuxd udev rules Would allow user-space to know that the device is AFC capable. Helps with GNOME Bugzilla:
Created attachment 156756 [details] [review] Ignore gphoto2 mounts on AFC capable devices Requires a small usbmuxd udev rules change, to mark devices with the USBMUXD_AFC_DEVICE property.
Patches for usbmuxd's udev rules, as well as the gphoto2 backend changes attached. Works nicely for me, I now get 2 pop-ups instead of 4 :)
Created attachment 156758 [details] [review] Ignore gphoto2 mounts on AFC capable devices Requires a small usbmuxd udev rules change, to mark devices with the USBMUXD_AFC_DEVICE property.
Comment on attachment 156755 [details] [review] Mark AFC devices as such in the usbmuxd udev rules Obsoleted by upstream patch
Attachment 156758 [details] pushed as b6202b8 - Ignore gphoto2 mounts on AFC capable devices