Open RReverser opened 3 years ago
@msmeissn I don't know what's the reason for this one or how to actually fix it... does anything in the logs stand out to you by any chance? Or is the only solution really just waiting 1 second before starting any preview, "just in case"?
Sorry missed this ticket earlier ... hmm
Some other newer Sony cameras have a mandatory wait of 2.5 - 3 seconds before they can startup preview and other things ,.. might be needed for the 6600 too.
What I see it times out on the query of the preview picture objectinfo... not sure how to avoid this, except by putting a small wait in front like you said (we have something similar in camera_sony_capture already, we can add similar to preview 6600 capture)
the 20 seconds is the default timeout, it could be reduced temporary during this operation too.
not sure how to avoid this
I wonder if there's any operation or property we can poll to detect what camera has fully "warmed up". Or, I guess, if the initial delay works for capture image, then yeah, we can add it to the preview too. Just need to be careful to make sure it only happens once and not for each preview.
i tried to find this with the Sony ZV1 then, not much luck of any indicators. hmm.
i added a patch that reduces the timeout to 1 second fpr this function, can you check if it helps?
Can't check right now - currently busy with some other stuff at work - but I'll try as soon as I return to this project.
Hm, now just getting transfer error if camera wasn't previously connected (same repro steps as described in the issue above). If it was already connected, then preview succeeds.
Describe the bug
First call to
--capture-preview
or its API variant takes a very long time on Sony a6600 if the camera wasn't connected before.Name the camera
Sony a6600 (USB PTP)
libgphoto2 and gphoto2 version
2.5.27.1 (master)
To Reproduce
time gphoto2 --auto-detect --capture-preview
. Application is stuck for a while, and eventually saves the capture preview in 20 seconds.Log attached: debug.log.
Judging by the log, the underlying
gp_libusb1_read
operation times out after 20 seconds. Is that its actual timeout? if so, it seems like a lot.When experimenting with libgphoto2 API, I found that even waiting 1 second after creating the context & camera and before capturing the actual preview seems to return result successfully and a lot faster, but I'm not sure how reliable that specific number is, plus it introduces unnecessary delay if camera was already connected.