On Friday 03 November 2006 22:16, Duncan Webb wrote:
> Hans Verkuil wrote:
> > On Friday 03 November 2006 20:00, Duncan Webb wrote:
> >> Hans Verkuil wrote:
> >>> 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?
> >>
> >> Here's the log and a patch I use to determine if the V4L2 calls
> >> are correct.
> >>
> >> Otherwise I'm using 0.8.0.
> >
> > 0.8.0 with my patch from my previous mail, I hope. I can't tell
> > 100% but it looks like the pause/resume commands are still the
> > wrong way around
> >
> > in the driver you are using. An easy check would be to swap the
> > IVTV_IOC_PAUSE_ENCODE and IVTV_IOC_RESUME_ENCODE ioctls in your
> > test program. If it works, then you are still using the unpatched
> > driver.
> >
> > What's the output of streamoff-test when compiled with -DVERBOSE
> > and -DPAUSE?
>
> I thought about not using the patched driver, but since the GOP_END
> worked, I decided that it had patched ok. I checked the driver times
> in the  /lib/modules and they were correct. The patch applied
> cleanly, but with a few shifts:
>
> patch -Np0 -i ~duncan/ivtv-pause.diff
> patching file ivtv-ioctl.c
> Hunk #1 succeeded at 1364 (offset -31 lines).
> patching file ivtv-streams.c
> Hunk #1 succeeded at 925 (offset 21 lines).
> Hunk #3 succeeded at 1359 (offset 21 lines).
> patching file ivtv-fileops.c

Weird, it works perfectly for me. I've committed the changes to the 
ivtv-0.8 branch. Can you check it out from svn yourselves and use that 
particular version? (or just download this: 
http://ivtvdriver.org/viewcvs/ivtv/branches/0.8.tar.gz?view=tar)

That way I'm sure you are using the correct sources.

If that still doesn't work, then please try the trunk version of ivtv 
(http://ivtvdriver.org/viewcvs/ivtv/trunk.tar.gz?view=tar). I've 
committed the same changes in the trunk as well.

Thanks,

        Hans

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

Reply via email to