Re: Handling cameras with no auto-mount on Fedora 31



Hi Ondrej,

The output is 'true', but that contradicts the behavior I'm seeing
with cameras on Fedora 31 specifically. Something appears to be wrong.

But as I say, from a pragmatic perspective I think not automounting
libgphoto2 devices is better behavior. Cameras should never be
automounted unless a process specifically needs to access the camera.
While that process is accessing the camera, every other process is
blocked from it. When a process no longer needs access, it should free
it up for other processes. This is not how GVFS has done it
historically, which generates much confusion for users of applications
that directly use libgphoto2. Unless the user already knows that they
must instruct GVFS to unmount the camera, their application is blocked
from the camera. Most users do not know this, assume the application
is broken, and give up. It is possible for the application to monitor
mounts and take appropriate action in code to instruct GFVS to unmount
the camera, but the only application that I know that does that is my
own (Rapid Photo Downloader).

Best,
Damon

On Thu, Apr 16, 2020 at 3:48 AM Ondrej Holy <oholy redhat com> wrote:

Hi Damon,

automount behavior is driven by gsettings property. Please check the
output from "gsettings get org.gnome.desktop.media-handling
automount".

Regards

Ondrej

st 15. 4. 2020 v 21:42 odesílatel Damon Lynch via gvfs-list
<gvfs-list gnome org> napsal:

Hello,

On Fedora 31 I have noticed that at some point the mounting behavior
of cameras changed, as far as I can tell.

Previously, GIO would attempt to mount a camera (for all practical
purposes) as soon as it was inserted.

Now, GIO notifies Gio.VolumeMonitor that the camera volume has been
added, but the camera remains unmounted. I have no idea if this is by
accident or design.

(Perhaps I changed a setting while testing that affected this
behavior, but I don't recall that. And in any case, changing the
Removable Media setting in Gnome to "Open Folder" has no effect.)

In my opinion it's a welcome change. Only one libgphoto2 process at a
time can access the camera. If GIO automounts a camera (and the user
or another program does not subsequently manually unmount it), any
other process using libghoto2 cannot access it until GIO unmounts it.

My question is: how is an application supposed to query GIO to
ascertain if GIO will auto-mount the camera volume or not?
Unfortunately, when the volume is added, Gio.Volume.should_automount()
is always true, regardless of whether the volume will subsequently be
auto-mounted or not.

My application had previously assumed that when GIO is active, all
cameras would be auto-mounted, and then it would automatically unmount
them so it could access the camera directly using libgphoto2. The way
my applications handles this new behavior as seen in Fedora 31 is to
wait 3 seconds and check if the camera had been auto-mounted or not.
If not, it access the camera. I'm curious if there is a better
approach.

Thanks.

Best,
Damon

--
http://www.damonlynch.net
_______________________________________________
gvfs-list mailing list
gvfs-list gnome org
https://mail.gnome.org/mailman/listinfo/gvfs-list




-- 
http://www.damonlynch.net


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]