GNOME Bugzilla – Bug 725886
v4l2/gst_v4l2_object_poll handle POLLERR
Last modified: 2014-07-04 11:36:10 UTC
If there is no buffer if kernel, v4l2 api can report it with POLLERR. Catch it instead of waiting forever on VIDIOC_DQBUF.
Would it be possible to give more details, e.g. some steps to reproduce, HW you are running on etc. Or maybe you are going to provide a patch ?
Created attachment 271233 [details] [review] patch for the issue
@Nicolas oops the patch wasn't attached. It should be better now.
Review of attachment 271233 [details] [review]: ::: sys/v4l2/gstv4l2bufferpool.c @@ +658,3 @@ + ret = gst_poll_fd_has_error(v4l2object->poll, &pollfd); + if (ret) + goto stopped; I'm not sure returning GST_FLOW_FLUSNING is right here, can you explain your decision ?
I agree GST_FLOW_ERROR seems better. But I don't understand why GST_FLOW_FLUSHING is called in case of EBUSY. According to http://v4l-test.sourceforge.net/spec/r14169.htm EBUSY is returned in case of multiple read/write.
Created attachment 271404 [details] [review] patch v2
(In reply to comment #5) > I agree GST_FLOW_ERROR seems better. > > But I don't understand why GST_FLOW_FLUSHING is called in case of EBUSY. > According to http://v4l-test.sourceforge.net/spec/r14169.htm EBUSY is returned > in case of multiple read/write. From documentation from gst_poll_set_flushing(): "When flushing is TRUE, this function ensures that current and future calls to gst_poll_wait() will return -1, with errno set to EBUSY."
Review of attachment 271404 [details] [review]: ::: sys/v4l2/gstv4l2bufferpool.c @@ +679,3 @@ + GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, READ, (NULL), + ("poll return pollerr")); + return GST_FLOW_ERROR; Does errno has something meaningful in this case ?
(In reply to comment #8) > Review of attachment 271404 [details] [review]: > > ::: sys/v4l2/gstv4l2bufferpool.c > @@ +679,3 @@ > + GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, READ, (NULL), > + ("poll return pollerr")); > + return GST_FLOW_ERROR; > > Does errno has something meaningful in this case ? No in this case gst_poll_wait return with ret == 1 and errno is not set.
Marking as a dup. Next time please report the problem you are seeing, would help. *** This bug has been marked as a duplicate of bug 731015 ***
Thanks for reporting.
Thanks for taking care of this bug after some much time. The setup was complex, that why I only reported the problem in gst_v4l2.