All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Paulo Assis <pj.assis@gmail.com>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: uvcvideo fails on 3.16 and 3.17 kernels
Date: Wed, 01 Oct 2014 01:31:11 +0300	[thread overview]
Message-ID: <3332528.UXGlNqFTSJ@avalon> (raw)
In-Reply-To: <CAPueXH73_yHoBhHKn+zroC6WViBmU1XH-B-FPVE2Q-V56bcBFQ@mail.gmail.com>

Hi Paulo,

Thank you for investigation this.

On Tuesday 30 September 2014 13:56:15 Paulo Assis wrote:
> Ok,
> so I've set a workaround in guvcview, it now uses the length filed if
> bytesused is set to zero.
> Anyway I think this violates the v4l2 api:
> http://linuxtv.org/downloads/v4l-dvb-apis/buffer.html
> 
> bytesused - ..., Drivers must set this field when type refers to an
> input stream, ...
> 
> without this value we have no way of knowing the exact frame size for
> compressed formats.
> 
> And this was working in uvcvideo up until 3.16, I don't know how many
> userspace apps rely on this value, but at least guvcview does, and
> it's currently broken for uvcvideo devices in the latest kernels.

It took me some time to debug the problem, and I think the problem is actually 
on guvcview's side. When dequeuing a video buffer, the application requeues it 
immediately before processing the buffer's contents. The VIDIOC_QBUF ioctl 
will reset the bytesused field to 0.

While you could work around the problem by using a different struct 
v4l2_buffer instance for the VIDIOC_QBUF call, the V4L2 doesn't allow 
userspace application to access a queued buffer. You must process the buffer 
before requeuing it.

> 2014-09-30 9:50 GMT+01:00 Paulo Assis <pj.assis@gmail.com>:
> > I referring to the following bug:
> > 
> > https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1362358
> > 
> > I've run some tests and after increasing verbosity for uvcvideo, I get:
> > EOF on empty payload
> > 
> > this seems consistent with the zero size frames returned by the driver.
> > After VIDIOC_DQBUF | VIDIOC_QBUF, I get buf.bytesused=0
> > 
> > Testing with an eye toy 2 (gspca), everything works fine, so this is
> > definitly related to uvcvideo.
> > This happens on all available formats (YUYV and MJPEG)

-- 
Regards,

Laurent Pinchart


  reply	other threads:[~2014-09-30 22:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-30  8:50 uvcvideo fails on 3.16 and 3.17 kernels Paulo Assis
2014-09-30 12:56 ` Paulo Assis
2014-09-30 22:31   ` Laurent Pinchart [this message]
2014-10-01 10:48     ` Paulo Assis
2014-10-01 11:05       ` Laurent Pinchart
2014-10-01 11:53         ` Paulo Assis
2014-10-01 12:07           ` Hans Verkuil
2014-09-30 13:12 ` Nicolas Dufresne
2014-09-30 13:29   ` Paulo Assis

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=3332528.UXGlNqFTSJ@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=pj.assis@gmail.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.