Menu

#155 gp_camera_wait_for_event() hangups

open
nobody
None
5
2022-01-29
2022-01-29
Mario Trams
No

Hello!

I'm observing severe hangup conditions for gp_camera_wait_for_event() in junction with gp_camera_trigger_capture(). I'm using the recent libgphoto2 version 2.5.28 (but also older ones), I'm seeing these issues under both an regular Intel-PC as well as on a RaspberryPi and with both a Sony A7S as well as an A6300.

There is this example "sample-trigger-capture" in the libgphoto2 source. This is not working for me. It is receiving two pictures (I'm having the camera to store both Jpeg and RAW) and then hangs up.

One thing that seems to add to the hangup problem is a rather small timeout parameter for gp_camera_wait_for_event(). 200-300ms seems to be an absolute minimum according to my observations. Though, I don't know whether this is somehow coupled to my setup.

Then I'm having some general difficulties to understand the "officially correct" method of using gp_camera_trigger_capture() and gp_camera_wait_for_event(). I did attach a somewhat simple C program that is somewhat resembling the sample-trigger-capture. It is just taking a picture set (Jpeg+RAW) one after each other while overwriting the last set. The basic procedure is as follows:
1. Call gp_camera_trigger_capture()
2. Wait for two FILE_ADDED events (Jpeg and RAW) and two CAPTURE_COMPLETE events.
3. Retrieve both Jpeg and RAW files from the camera and store them away.
4. Call gp_camera_wait_for_event() until there is a timeout in order to "drain" remaining events in the queue (whatever purpose these events serve - mostly these are three unknown events, but sometimes there are also more than three unknown events).

This procedure is working so far as long as I set the timeout to at least 300ms for step 4. Using 200ms here is causing hangups sometimes. Interestingly, I can use a rather small timeout of even 0ms in step 2.

Of course, this method is not that good as it is wasting at least one timeout waiting period. However, at least it should leave libgphoto2 in some some sort of a clean state I believe. But as I said, I'm not sure whether this is the proper way of doing what I want to do there and whether there is some fundamental mistake that is causing gp_camera_wait_for_event() to hang.

Many thanks in advance for any hints!
Mario

1 Attachments

Discussion


Log in to post a comment.