[Utopia] Fix gnome-volume-manager PTP camera detection

Pozsár Balázs pozsy at uhulinux.hu
Sat Jul 30 07:31:15 PDT 2005


On Sat, Jul 30, 2005 at 09:26:27AM +0200, Martin Pitt wrote:
> Hi Jeffrey!
> 
> (crossposting to the hal list to get some better coordination).
> 
> Jeffrey Stedfast [2005-07-29 15:39 -0400]:
> > e.g. is camera.access_method only reported as "ptp" if it's unsupported
> > by libgphoto2 (or at least no fdi file for the camera)? or is the access
> > method only "libgphoto2" for USB Mass-Storage?
> 
> I think it's even more complicated: There are basically three ways to
> talk to a camera:
> 
>   * usb mass-storage
>   * standardized PTP protocol (supported by gphoto)
>   * proprietary model specific protocols (most of them supported by
>     gphoto)
> 
> Some cameras (like my Canon PowerShot A70) speak both PTP and the
> Canon-specific protocol, so earlier hal versions (which used gphoto's
> UBS hotplug map) actually reported *two* "camera" interfaces which
> caused g-v-m to ask for photo import twice. Nowadays (hal 0.5.3) seems
> to only check for PTP interfaces, and it almost seems that support for
> non-PTP cameras, which gphoto supports with a custom protocol has been
> dropped. David, can you confirm this?

A while back I was the one who sent David the .fdi files for the 
cameras.
To clarify things:
- Yes, there are basically three methods as you describe, and there are 
  cameras which support more than one, for example the SONY DSC-P10 
  which I own. (mass storage+PTP)
- At any given time, one camera only supports _one_ access method.
  For example, if I set it to PTP mode, it will report itself as an usb 
  device with a PTP interface (6/1/1), and it will _not_ be accessable 
  as an usb mass storage device, only as a ptp device.
  The other way around, it will only accessible as a mass storage device 
  (eg be mounted), and not as a ptp device.

I really think, that HAL should only report _actual_ information about 
any given device. This means that imho if a camera in PTP mode is 
connected, HAL should report an usb camera with "ptp" mode and nothing 
more.


The .fdi files I contributed provided exactly this idea:
- If an usb device has interface id PTP, then:
  - it is a camera
  - it supports camera.access_method "ptp"
  [hal-0.5.3/fdi/information/10freedesktop/10-camera-ptp.fdi]
- If an usb device has a vendor/device id which is known by gphoto
  (and thus having a proprietary model specific protocol) then it is 
  tagged as camera, which can be accessed via gphoto, more precisely,
  "libgphoto2" is added to camera.access_method.
  [hal-0.5.3/tools/gen-libgphoto-hal-fdi]


> So access method "libgphoto2" is not USB mass storage

That is correct.


> > If the latter, I might have to change some logic again... because we get
> > the "device added" event from HAL for the physical camera device before
> > the volume is added, but we don't actually want to do anything until we
> > get the volume added event for USB MAss-Storage camera devices (so that
> > we can both mount the camera volume and also pass the mount point to
> > f-spot or whatever)
> 
> Uh, indeed, that makes it even more complicated. There might actually
> be cameras around which support both mass storage and PTP, especially
> since the latter is very popular with directly connecting your camera
> to a printer.

Well, as I explained above, one device can only be either a PTP or 
either usb mass storage device at any given time, that is, so it should 
be always be exactly clear in which way you can access it.



ps: I'm not on the utopia list, please cc: me.

-- 
pozsy
_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list