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 610261 - do not block camera for whole life time
do not block camera for whole life time
Status: RESOLVED OBSOLETE
Product: gvfs
Classification: Core
Component: gphoto backend
1.4.x
Other Linux
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
: 606058 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-02-17 13:36 UTC by Marcus Meissner
Modified: 2018-09-21 17:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gp-lifetime.patch (590 bytes, patch)
2010-02-17 13:36 UTC, Marcus Meissner
none Details | Review
better patch, checks for Apple (806 bytes, patch)
2010-02-17 15:27 UTC, Marcus Meissner
none Details | Review

Description Marcus Meissner 2010-02-17 13:36:20 UTC
Created attachment 154034 [details] [review]
gp-lifetime.patch

call gp_camera_exit() after the initial setup.

this frees the USB port for access by other programs, like gphoto2 commandline or specialized capture tools (or f-spot, digikam, and other tools not using gvfs yet).

As soon as someone accesses the gvfs tree the camera will be grabbed and reinitialized (and then not freed again).


This is also better for camera attach-lifetime management which is currently not doable with libgphoto2. Inserting / Removing Cards for cameras is not really handled and other events.


The only thing where this is probably bad is for the iPhones which change the master storage prefix on every init. I opened a bug with Apple hgalf a year ago already, but its not closed yet. We could filter iPhones from calling gp_camera_exit() here.
Comment 1 Bastien Nocera 2010-02-17 13:50:20 UTC
Yes, we'd need to have a work-around for the iPhones/iPod Touches.

How does it behave when other applications use the camera?
Comment 2 Marcus Meissner 2010-02-17 15:27:00 UTC
Created attachment 154045 [details] [review]
better patch, checks for Apple

ok, this patch (untested) runs gp_camera_exit() only on non-Apple devices.
Comment 3 Martin Pitt 2010-04-12 13:05:07 UTC
Marcus,

in your second patch, it seems that abilities never gets initialized?
Comment 4 Martin Pitt 2010-04-12 13:05:36 UTC
Argh, sorry, I misread. *brown paperbag*
Comment 5 Martin Pitt 2010-04-12 13:51:09 UTC
Is that patch actually meant to close the USB device? I applied it to 1.6.0 and am running it now. After plugging it in, I can still do "gphoto -l", but as soon as I open nautilus once (and even close it again), the gvfsd-gphoto2 process keeps /dev/bus/usb/NNN/MMM open.
Comment 6 Bastien Nocera 2010-04-12 14:27:31 UTC
FWIW, I haven't tested if the patch works fine or not, but the Apple work-around would only ever apply if the AFC backend wasn't compiled (as we don't mount gphoto mounts on those devices when AFC is available).

(In reply to comment #5)
> Is that patch actually meant to close the USB device? I applied it to 1.6.0 and
> am running it now. After plugging it in, I can still do "gphoto -l", but as
> soon as I open nautilus once (and even close it again), the gvfsd-gphoto2
> process keeps /dev/bus/usb/NNN/MMM open.

Unless it's an iPhone or iPod Touch, it probably shouldn't do that.
Comment 7 Martin Pitt 2010-04-12 14:30:13 UTC
(In reply to comment #6)
> Unless it's an iPhone or iPod Touch, it probably shouldn't do that.

No, it's a Canon PowerShot SX200 (PTP)
Comment 8 Marcus Meissner 2010-04-12 14:55:07 UTC
i am afraid it is a bit hard to test for me.

gp_camera_exit() should close the usb port I thought :(
Comment 9 Paul Crawford 2010-05-24 17:53:05 UTC
I seem to be having this problem with a Nikon D300s camera and F-spot or gphoto2 with various Ubuntu including the recent 10.04 LTS version (camera locked when user space application tries to access it). I would like to try this patch to see if it is a better solution than just killing off gvfs-gphoto2-volume-monitor permanently (e.g. with "chmod a-x ...") that could have other serious implications.
Can anyone tell me where to get the source code and if it is easy enough to build it with this patch in to test?
Comment 10 Paul Crawford 2010-05-24 21:24:07 UTC
Started this thread about my attempts to build and try the patch, as I don't think the bugzilla site is the right one:
http://ubuntuforums.org/showthread.php?p=9354048
Comment 11 Felix Möller 2012-08-02 08:50:51 UTC
Is bug #606058 a duplicate of this one?
Comment 12 Ross Lagerwall 2014-04-05 19:57:20 UTC
*** Bug 606058 has been marked as a duplicate of this bug. ***
Comment 13 GNOME Infrastructure Team 2018-09-21 17:02:16 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gvfs/issues/139.