Re: FILE_ADDED events getting lost

Dave Taylor <[email protected]> Mon, 5 Oct 2020 19:06:17 -0700
Newsgroups gmane.comp.multimedia.gphoto.user
Message-ID <CAL2tZycz=9_1RM+fXVsm+v2A_=_EZ22Cwnh6DT2px2bqf=cycA@mail.gmail.com>
FYI, I just tried linking against a build from the master branch on
the libgphoto2 git repo today (as of commit 72c0ff69e1), and I'm
seeing the same GP_EVENT_UNKNOWN behaviour.

        =-ddt->



On Mon, Oct 5, 2020 at 2:48 PM Dave Taylor <[email protected]> wrote:
>
> I'm using a mix of Nikon D5300s and D5600s, and we're triggering the
> focus and shutter externally using hardware (through the MC-DC2 port),
> and then I'm using gp_camera_wait_for_event() to spot a
> GP_EVENT_FILE_ADDED event, so I can know when to grab it.
>
> I was using the timeout support in that call, but I wasn't seeing a
> correlation between real time and the stated milliseconds I was
> passing to gp_camera_wait_for_event(), so I tried passing 0ms, 1ms,
> and 10ms timeouts, and then I just polled that for 10 real seconds by
> checking clock_gettime(CLOCK_REALTIME) until I got 10 real seconds
> passed since the start of the loop.
>
> I'm not sure if it was that change or something else, but I am
> definitely no longer getting reliable GP_EVENT_FILE_ADDED events, even
> when I confirm that the file did show up on the internal SD card.
>
> For some reason, instead, I'll get three GP_EVENT_UNKNOWN's, and
> sometimes, oddly, the next time I restart my code using
> gp_camera_init() and friends, when I go through and discard any events
> that might have been queued up by initialization, I'll sometimes see a
> GP_EVENT_FILE_ADDED, but even more maddeningly, not always.
>
> Resetting the camera power will usually allow it to work for one shot
> with the GP_EVENT_FILE_ADDED event showing up properly, and then on
> subsequent shots, it'll get back in that state where it gives me those
> GP_EVENT_UNKNOWN's, never to return until the camera is power-cycled.
> Note that restarting my process using libgphoto2 has no bearing on
> recovering from this state.
>
> Also, does the fact that the timeouts don't seem to track real-time
> sound familiar to you?  Or am I a weirdo for seeing that?
>
> What I'm really hoping is that these symptoms sound familiar to you,
> and you suggest what I might next try to further isolate what's
> happening.
>
> I'm on the Debian package libgphoto2-dev 2.5.22-3 on a Raspberry Pi 3
> running Raspbian Buster.
>
> I'm kind of at my wit's end how to further isolate this.  If you could
> suggest any strategies to help track this down, I'd love suggestions!
> Thank you!
>
>        =-ddt->