All of lore.kernel.org
 help / color / mirror / Atom feed
From: dean <dean@sensoray.com>
To: video4linux-list@redhat.com,
	Mauro Carvalho Chehab <mchehab@infradead.org>
Subject: VIVI driver issue with xawtv resize in low resolution mode
Date: Fri, 27 Mar 2009 14:57:22 -0700	[thread overview]
Message-ID: <49CD4BC2.9010702@sensoray.com> (raw)

xawtv and/or libv4l2 is unmapping the V4L2 buffers before stopping the 
stream.  This causes xawtv and/or libv4l2 to retry VIDIOC_STREAMOFF 
multiple times before failing and the stream does not get restarted.

Tested on Ubuntu 8.10 with kernel upgraded to 2.6.29 and with 
v4l-dvb-b1596c6517c9.


To reproduce (does not fail if running with XV extensions):

1) load vivi driver
2) xawtv -noxv -nodga -noxv-image -c /dev/video0  (where video0 is vivi 
device, xawtv-3.95)
3) Resize the xawtv window.
4) Video output will stop and will not restart.

Should VIDIOC_STREAMOFF return -EINVAL if the stream is already off?  Is 
it ok to return 0 if the stream was turned off by an user application 
unmapping the buffers before stopping the stream?  In this example, 
videobuf_vm_close in videobuf-vmalloc.c is called before 
vidioc_streamoff in vivi.c.  videobuf_vm_close stops streaming in 
videobuf-vmalloc.c such that -EINVAL is returned on any subsequent 
VIDIOC_STREAMOFF ioctls. xawtv will not resume streaming in this case. 
This also affects other drivers using videobuf-vmalloc.  A possible 
workaround is the following(not an official patch) code below:

static int vidioc_streamoff(struct file *file, void *priv, enum 
v4l2_buf_type i)
{
	struct vivi_fh  *fh = priv;

	if (fh->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
		return -EINVAL;
	if (i != fh->type)
		return -EINVAL;
	return videobuf_streamoff(&fh->vb_vidq);
}

to:

static int vidioc_streamoff(struct file *file, void *priv, enum 
v4l2_buf_type i)
{
	struct vivi_fh  *fh = priv;

	if (fh->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
		return -EINVAL;
	if (i != fh->type)
		return -EINVAL;
	(void) videobuf_streamoff(&fh->vb_vidq);
	return 0;
}




--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

                 reply	other threads:[~2009-03-27 21:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49CD4BC2.9010702@sensoray.com \
    --to=dean@sensoray.com \
    --cc=mchehab@infradead.org \
    --cc=video4linux-list@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.