-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gp_camera_wait_for_event ignores timeout, blocks for a long time #29
Comments
Do you get the same behaviour with a C program? I'm not aware of anything in the Python interface that would add a delay, so your problem may be with libgphoto2 itself. I don't think the image is being downloaded during your 1.2 second delay, I think the camera is busy saving it to its SD card (and so not responding to USB). If you don't need to store the image on the SD card you could try capturing to memory instead. (It might also be worth trying a faster SD card.) PS. Rather than using a loop with a short timeout I'd prefer to use a separate thread to wait for the camera to have an image. I do this with any sort of blocking operation in an interactive program. |
I'm also using a Canon EOS 600D and seeing unexpected behaviour trying to use gp_camera_wait_for_event. It seems to just return right away. i.e. it never waits!
Any pointers? |
How soon is "right away"? You're specifying a timeout of only 1 second. |
much less than 1sec. fwiw specifying much longer makes no difference.
subsequent calls return much quicker - assume the first call has to do a bit more work initiinlaising the "connection"
|
I don't know then. The return value of 0 is |
ok thanks, I remember finding that 0 meant gp.GP_EVENT_UNKNOWN come to think of it and wondered similar.. |
:) |
I've just added code to handle any string when
I suspect I might run out of such events eventually. |
With the Canon EOS 600D, I'm polling gp_camera_wait_for_event in an endless loop with a timeout of 1 (ms). After physically triggering a shot on the camera, the function produces a GP_EVENT_FILE_ADDED event, but not before blocking for about 1.2 seconds. The duration is reduced when taking smaller pictures, so this might be the time it takes to download the image.
My goal is to download images in small chunks while keeping the loop interactive. Seems like this should be doable.
The text was updated successfully, but these errors were encountered: