Re: [PATCH 13/13] media: bttv: convert to vb2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Deb,

I did some testing and found two issues. When streaming video, then
starting and stopping streaming from vbi, there are dropped frames in
the video stream. This happens both for vb1 and for vb2, although it seems
to happen in slightly different places (I think in one case the dropped
frame is when you start the second stream, and in the other case it is
when you stop the second stream. I have to retest this to confirm this
difference).

In any case, I don't think it should cause frames to drop at all. I will
investigate this when I have more time.

The second issue is a bug in the sequence counter, see below.

On 25/04/2023 02:10, Deborah Brouwer wrote:
> Convert this driver from the old videobuf framework to videobuf2.
> 
> Signed-off-by: Deborah Brouwer <deborah.brouwer@xxxxxxxxxxxxx>
> ---
>  drivers/media/pci/bt8xx/Kconfig       |   2 +-
>  drivers/media/pci/bt8xx/bttv-driver.c | 805 ++++++++------------------
>  drivers/media/pci/bt8xx/bttv-risc.c   | 265 +++++----
>  drivers/media/pci/bt8xx/bttv-vbi.c    | 239 +++-----
>  drivers/media/pci/bt8xx/bttvp.h       |  60 +-
>  5 files changed, 491 insertions(+), 880 deletions(-)
> 

<snip>

>  static void
>  bttv_irq_wakeup_vbi(struct bttv *btv, struct bttv_buffer *wakeup,
> -		    unsigned int state)
> +				unsigned int state)
>  {
>  	if (NULL == wakeup)
>  		return;
> -
> -	wakeup->vb.ts = ktime_get_ns();
> -	wakeup->vb.field_count = btv->field_count;
> -	wakeup->vb.state = state;
> -	wake_up(&wakeup->vb.done);
> +	wakeup->vbuf.vb2_buf.timestamp = ktime_get_ns();
> +	wakeup->vbuf.sequence = btv->seqnr++;

If both video and vbi are streaming, then the seqnr is increased
too often: once for video, once for vbi.

Change this to:

      wakeup->vbuf.sequence = btv->seqnr;
      if (!vb2_start_streaming_called(&btv->capq))
              btv->seqnr++;

This avoids incrementing the sequence counter twice.

> +	vb2_buffer_done(&wakeup->vbuf.vb2_buf, state);
>  }
>  
>  static void bttv_irq_timeout(struct timer_list *t)

Regards,

	Hans




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux