All of lore.kernel.org
 help / color / mirror / Atom feed
* uvcvideo USERPTR mode busted?
@ 2013-03-03  9:37 Rémi Denis-Courmont
  2013-03-03 14:57 ` Devin Heitmueller
  0 siblings, 1 reply; 4+ messages in thread
From: Rémi Denis-Courmont @ 2013-03-03  9:37 UTC (permalink / raw)
  To: linux-media

	Hello,

Trying to use USERPTR buffers with UVC, user space gets stuck either in 
poll(POLLIN) or in ioctl(VIDIOC_DQBUF). It seems the UVC driver never ever 
returns a frame in USERPTR mode. The symptoms are identical with kernel 
versions 3.6, 3.7 and 3.8. I also tested 3.2, but it did not support USERPTR.

Tested hardware was Logitech HD Pro Webcam C920 with YUY2 pixel format. The 
same hardware and the same driver work fine with MMAP buffers.
The same USERPTR userspace code works fine with the vivi test device...

Did any have any better luck?

-- 
Rémi Denis-Courmont
http://www.remlab.net/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: uvcvideo USERPTR mode busted?
  2013-03-03  9:37 uvcvideo USERPTR mode busted? Rémi Denis-Courmont
@ 2013-03-03 14:57 ` Devin Heitmueller
  2013-03-21 12:41   ` Laurent Pinchart
  0 siblings, 1 reply; 4+ messages in thread
From: Devin Heitmueller @ 2013-03-03 14:57 UTC (permalink / raw)
  To: Rémi Denis-Courmont; +Cc: linux-media

On Sun, Mar 3, 2013 at 4:37 AM, Rémi Denis-Courmont <remi@remlab.net> wrote:
>         Hello,
>
> Trying to use USERPTR buffers with UVC, user space gets stuck either in
> poll(POLLIN) or in ioctl(VIDIOC_DQBUF). It seems the UVC driver never ever
> returns a frame in USERPTR mode. The symptoms are identical with kernel
> versions 3.6, 3.7 and 3.8. I also tested 3.2, but it did not support USERPTR.
>
> Tested hardware was Logitech HD Pro Webcam C920 with YUY2 pixel format. The
> same hardware and the same driver work fine with MMAP buffers.
> The same USERPTR userspace code works fine with the vivi test device...
>
> Did any have any better luck?

Hi Remi,

I've used userptr mode with the C920 on an ARM platform (with YUYV
mode and not MPEG).  It's worth noting that there is actually a bug I
hit where if the memory you pass is not aligned on a page boundary
then you will get garbage video.  I have a fix or this but haven't
submitted it upstream yet.

So it should work, aside from the bug I found.

Have you tried testing with v42l-ctl's streaming command?  That would
help identify whether it's something special about your code or
whether it's the driver.  Don't get me wrong, it's almost certainly a
driver issue in either case, but it would help narrow down the issue
if you're using v4l2-ctl as that app is really simple and readily
available to the driver developers.

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: uvcvideo USERPTR mode busted?
  2013-03-03 14:57 ` Devin Heitmueller
@ 2013-03-21 12:41   ` Laurent Pinchart
  2013-03-21 13:28     ` Devin Heitmueller
  0 siblings, 1 reply; 4+ messages in thread
From: Laurent Pinchart @ 2013-03-21 12:41 UTC (permalink / raw)
  To: Devin Heitmueller; +Cc: Rémi Denis-Courmont, linux-media

On Sunday 03 March 2013 09:57:14 Devin Heitmueller wrote:
> On Sun, Mar 3, 2013 at 4:37 AM, Rémi Denis-Courmont <remi@remlab.net> wrote:
> >         Hello,
> > 
> > Trying to use USERPTR buffers with UVC, user space gets stuck either in
> > poll(POLLIN) or in ioctl(VIDIOC_DQBUF). It seems the UVC driver never ever
> > returns a frame in USERPTR mode. The symptoms are identical with kernel
> > versions 3.6, 3.7 and 3.8. I also tested 3.2, but it did not support
> > USERPTR.
> > 
> > Tested hardware was Logitech HD Pro Webcam C920 with YUY2 pixel format.
> > The same hardware and the same driver work fine with MMAP buffers.
> > The same USERPTR userspace code works fine with the vivi test device...
> > 
> > Did any have any better luck?

I've just tested USERPTR with a Logitech C905 on a 3.7.10 kernel using yavta 
without any issue.

> Hi Remi,
> 
> I've used userptr mode with the C920 on an ARM platform (with YUYV mode and
> not MPEG).  It's worth noting that there is actually a bug I hit where if
> the memory you pass is not aligned on a page boundary then you will get
> garbage video.  I have a fix or this but haven't submitted it upstream yet.

Please submit it at some point :-)

Is it a uvcvideo issue or a videobuf2 issue ?

> So it should work, aside from the bug I found.
> 
> Have you tried testing with v42l-ctl's streaming command?  That would help
> identify whether it's something special about your code or whether it's the
> driver.  Don't get me wrong, it's almost certainly a driver issue in either
> case, but it would help narrow down the issue if you're using v4l2-ctl as
> that app is really simple and readily available to the driver developers.

-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: uvcvideo USERPTR mode busted?
  2013-03-21 12:41   ` Laurent Pinchart
@ 2013-03-21 13:28     ` Devin Heitmueller
  0 siblings, 0 replies; 4+ messages in thread
From: Devin Heitmueller @ 2013-03-21 13:28 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: Rémi Denis-Courmont, linux-media

On Thu, Mar 21, 2013 at 8:41 AM, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> Please submit it at some point :-)
>
> Is it a uvcvideo issue or a videobuf2 issue ?

Yeah, it's definitely on my list.  Basically if you hand
videobuf2-vmalloc a piece of memory that is not page aligned, it gets
treated as if paged aligned, which causes the first N bytes of every
video frame to be garbage and the video is shifted right by N bytes.
I saw the issue with both uvcvideo as well as em28xx.

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-03-21 13:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-03  9:37 uvcvideo USERPTR mode busted? Rémi Denis-Courmont
2013-03-03 14:57 ` Devin Heitmueller
2013-03-21 12:41   ` Laurent Pinchart
2013-03-21 13:28     ` Devin Heitmueller

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.