On Friday 03 November 2006 18:19, Duncan Webb wrote:
> Hans Verkuil wrote:
> > On Thursday 02 November 2006 19:50, Duncan Webb wrote:
> >> Duncan Webb wrote:
> >>> Hans Verkuil wrote:
> >>>> On Tuesday 31 October 2006 07:09, Duncan Webb wrote:
> >>>>>>> Aha, need to use VIDIOC_STREAMOFF. I'll try this out in the
> >>>>>>> next few days and let you know.
> >>>>>>
> >>>>>> Thanks, this works quite nicely.
> >>>>>>
> >>>>>> There are a couple of things that I've noticed:
> >>>>
> >>>> Oops, I missed the following questions in your original email.
> >>>>
> >>>>>> 1) If the video device is read again after VIDIOC_STREAMOFF
> >>>>>> and reading 0 bytes, it does continue streaming. This means
> >>>>>> that it's not possible to use VIDIOC_STREAMOFF and
> >>>>>> VIDIOC_STREAMON to pause the recording. AFAICS Not a problem
> >>>>>> for what I'm doing but could be a problem if anybody wants to
> >>>>>> pause the video recording.
> >>>>
> >>>> STREAMOFF is not meant for pausing (there are ivtv ioctls for
> >>>> that). STREAMON is not implemented at all currently.
> >>>>
> >>>>>> 2) The end of program marker is written by VIDIOC_STREAMOFF
> >>>>>> instead of during the close.
> >>>>
> >>>> That's correct. You should interpret STREAMOFF as a close() that
> >>>> waits for the end of the GOP. You should not try to do anything
> >>>> after the STREAMOFF.
> >>
> >> I've done some more testing on this, attached is a tiny program to
> >> turn off the stream.
> >>
> >> Am I correct that to pause the stream the IVTV_IOC_PAUSE_ENCODE
> >> and IVTV_IOC_RESUME_ENCODE should be used?
> >>
> >> Two thing that I've noticed both cause an "Interrupted System
> >> Call" error.
> >>
> >> 1) If IVTV_IOC_S_GOP_END is not called
> >> 2) If the PAUSE and RESUME calls are made.
> >>
> >> After the interrupted system call a reboot is required, or at
> >> least I've not found a way to reset the driver.
> >>
> >> I'm wondering if the calls have been made incorrectly?
> >
> > Hi Duncan,
> >
> > You are clearly going into uncharted territories here :-)
> >
> > The good news is that your code is correct, the bad news is that
> > the driver code is really broken. I've attached a patch for
> > ivtv-0.8 that fixes the bugs. The pause bug was really bad: pause
> > and resume were swapped internally! And after stopping with END_GOP
> > on an important flag wasn't cleared, so the next time the read()
> > would stop working.
> >
> > Let me know how it goes. If this is working fine for you, then I'll
> > commit the changes.
>
> The IVTV_IOC_S_GOP_END has worked like a dream, thanks.
>
> The IVTV_IOC_PAUSE_ENCODE and IVTV_IOC_RESUME_ENCODE still seem to be
> broken.
>
> It reads two blocks after the resume and then blocks.
>
> I've done a bit more tweaking on the program, so I've attached it.

Works fine for me. Can you run ivtvctl -D95 to enable debugging? And 
mail me what the kernel log says around the time the resume blocks?

Thanks,

        Hans

_______________________________________________
ivtv-devel mailing list
[email protected]
http://ivtvdriver.org/mailman/listinfo/ivtv-devel

Reply via email to