fix: Camera USB stack crash after second capture#122
Open
fzorbach wants to merge 1 commit into
Open
Conversation
7612089 to
2414df7
Compare
Fixes the bug by calling gp_camera_wait_for_event until timeout.
2414df7 to
87c1027
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I am using the Sony Alpha 7s.
I experienced an issue when taking a picture.
gp_camera_capturereturnedGP_ERROR_IOwhen taking the second picture (after start of the app). Retrying will then returnGP_ERROR_IO_USB_FIND. The photobox app now hangs in a loop right here.In the mean time, the camera will disappear from the USB devices. I guess the USB stack in the camera errored out.
The camera does not recover unless restarted.
After fiddling around, i noticed that nothing calls
gp_camera_wait_for_event. So I had a feeling that the camera had some pending events it wanted to process before taking another picture. Callinggp_camera_wait_for_eventuntilGP_EVENT_TIMEOUToccurs does fix it.The way I implemented it should wait for the event while the captured image is shown. So no preview frames are lost and no further delay should occur. Right now, 6 events occur before timeout (1x file added, 2x capture complete, 3x unknown).
Due to not having more cameras, I can only test it with the Alpha 7s, which works fine.
Open for discussion on how to integrate that properly. I've never worked with stdexec before.