diff mbox

[RESEND] uvcvideo: Add FIX_BANDWIDTH quirk to HP Webcam found on HP Mini 5103 netbook

Message ID 20110722144722.GA3717@tugrik.mns.mnsspb.ru (mailing list archive)
State Accepted
Headers show

Commit Message

Kirill Smelkov July 22, 2011, 2:47 p.m. UTC
[ Cc'ing Andrew Morton -- Andrew, could you please pick this patch, in
   case there is no response from maintainers again? Thanks beforehand. ]


Hello up there,

My first posting was 1 month ago, and a reminder ~ 2 weeks ago. All
without a reply. v3.0 is out and they say the merge window will be
shorter this time, so in oder not to miss it, I've decided to resend my
patch on lowering USB periodic bandwidth allocation topic. 


Could this simple patch be please applied?

Thanks,
Kirill


P.S.

Referenced in the description cc62a7eb (USB: EHCI: Allow users to
override 80% max periodic bandwidth) will be entering the mainline via
Greg's usb tree.

---- 8< ----
From: Kirill Smelkov <kirr@mns.spb.ru>
Subject: [PATCH] uvcvideo: Add FIX_BANDWIDTH quirk to HP Webcam found on HP Mini 5103 netbook

The camera there identifies itself as being manufactured by Cheng Uei
Precision Industry Co., Ltd (Foxlink), and product is titled as "HP
Webcam [2 MP Fixed]".

I was trying to get 2 USB video capture devices to work simultaneously,
and noticed that the above mentioned webcam always requires packet size
= 3072 bytes per micro frame (~= 23.4 MB/s isoc bandwidth), which is far
more than enough to get standard NTSC 640x480x2x30 = ~17.6 MB/s isoc
bandwidth.

As there are alt interfaces with smaller MxPS

    T:  Bus=01 Lev=01 Prnt=01 Port=03 Cnt=01 Dev#=  2 Spd=480  MxCh= 0
    D:  Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
    P:  Vendor=05c8 ProdID=0403 Rev= 1.06
    S:  Manufacturer=Foxlink
    S:  Product=HP Webcam [2 MP Fixed]
    S:  SerialNumber=200909240102
    C:* #Ifs= 2 Cfg#= 1 Atr=80 MxPwr=500mA
    A:  FirstIf#= 0 IfCount= 2 Cls=0e(video) Sub=03 Prot=00
    I:* If#= 0 Alt= 0 #EPs= 1 Cls=0e(video) Sub=01 Prot=00 Driver=uvcvideo
    E:  Ad=83(I) Atr=03(Int.) MxPS=  16 Ivl=4ms
    I:* If#= 1 Alt= 0 #EPs= 0 Cls=0e(video) Sub=02 Prot=00 Driver=uvcvideo
    I:  If#= 1 Alt= 1 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=uvcvideo
    E:  Ad=81(I) Atr=05(Isoc) MxPS= 128 Ivl=125us
    I:  If#= 1 Alt= 2 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=uvcvideo
    E:  Ad=81(I) Atr=05(Isoc) MxPS= 512 Ivl=125us
    I:  If#= 1 Alt= 3 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=uvcvideo
    E:  Ad=81(I) Atr=05(Isoc) MxPS=1024 Ivl=125us
    I:  If#= 1 Alt= 4 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=uvcvideo
    E:  Ad=81(I) Atr=05(Isoc) MxPS=1536 Ivl=125us
    I:  If#= 1 Alt= 5 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=uvcvideo
    E:  Ad=81(I) Atr=05(Isoc) MxPS=2048 Ivl=125us
    I:  If#= 1 Alt= 6 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=uvcvideo
    E:  Ad=81(I) Atr=05(Isoc) MxPS=2688 Ivl=125us
    I:  If#= 1 Alt= 7 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=uvcvideo
    E:  Ad=81(I) Atr=05(Isoc) MxPS=3072 Ivl=125us

UVC_QUIRK_FIX_BANDWIDTH helps here and NTSC video can be served with
MxPS=2688 i.e. 20.5 MB/s isoc bandwidth.

In terms of microframe time allocation, before the quirk NTSC video
required 60 usecs / microframe and 53 usecs / microframe after.


P.S.

Now with tweaked ehci-hcd to allow up to 90% isoc bandwidth (cc62a7eb
"USB: EHCI: Allow users to override 80% max periodic bandwidth") I can
capture two video sources -- PAL 720x576 YUV422 @25fps + NTSC 640x480
YUV422 @30fps simultaneously.  Hooray!

Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
---
 drivers/media/video/uvc/uvc_driver.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

Comments

Laurent Pinchart July 22, 2011, 10:03 p.m. UTC | #1
Hi Kirill,

On Friday 22 July 2011 16:47:22 Kirill Smelkov wrote:
>  [ Cc'ing Andrew Morton -- Andrew, could you please pick this patch, in
>    case there is no response from maintainers again? Thanks beforehand. ]
> 
> 
> Hello up there,
> 
> My first posting was 1 month ago, and a reminder ~ 2 weeks ago. All
> without a reply. v3.0 is out and they say the merge window will be
> shorter this time, so in oder not to miss it, I've decided to resend my
> patch on lowering USB periodic bandwidth allocation topic.

I'm very very sorry for missing the patch (and worse, twice :-/).

> Could this simple patch be please applied?

Yes it can. I see that Andrew already applied it to his tree. Mauro, should it 
go through there, or through your tree ? I've pushed it to my tree at 
git://linuxtv.org/pinchartl/uvcvideo.git uvcvideo-stable, so you can already 
pull.

> Thanks,
> Kirill
> 
> 
> P.S.
> 
> Referenced in the description cc62a7eb (USB: EHCI: Allow users to
> override 80% max periodic bandwidth) will be entering the mainline via
> Greg's usb tree.
> 
> ---- 8< ----
> From: Kirill Smelkov <kirr@mns.spb.ru>
> Subject: [PATCH] uvcvideo: Add FIX_BANDWIDTH quirk to HP Webcam found on HP
> Mini 5103 netbook
> 
> The camera there identifies itself as being manufactured by Cheng Uei
> Precision Industry Co., Ltd (Foxlink), and product is titled as "HP
> Webcam [2 MP Fixed]".

The device isn't listed in the supported devices list. Could you please send 
me its lsusb -v output ?

> I was trying to get 2 USB video capture devices to work simultaneously,
> and noticed that the above mentioned webcam always requires packet size
> = 3072 bytes per micro frame (~= 23.4 MB/s isoc bandwidth), which is far
> more than enough to get standard NTSC 640x480x2x30 = ~17.6 MB/s isoc
> bandwidth.
> 
> As there are alt interfaces with smaller MxPS
> 
>     T:  Bus=01 Lev=01 Prnt=01 Port=03 Cnt=01 Dev#=  2 Spd=480  MxCh= 0
>     D:  Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
>     P:  Vendor=05c8 ProdID=0403 Rev= 1.06
>     S:  Manufacturer=Foxlink
>     S:  Product=HP Webcam [2 MP Fixed]
>     S:  SerialNumber=200909240102
>     C:* #Ifs= 2 Cfg#= 1 Atr=80 MxPwr=500mA
>     A:  FirstIf#= 0 IfCount= 2 Cls=0e(video) Sub=03 Prot=00
>     I:* If#= 0 Alt= 0 #EPs= 1 Cls=0e(video) Sub=01 Prot=00 Driver=uvcvideo
>     E:  Ad=83(I) Atr=03(Int.) MxPS=  16 Ivl=4ms
>     I:* If#= 1 Alt= 0 #EPs= 0 Cls=0e(video) Sub=02 Prot=00 Driver=uvcvideo
>     I:  If#= 1 Alt= 1 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=uvcvideo
>     E:  Ad=81(I) Atr=05(Isoc) MxPS= 128 Ivl=125us
>     I:  If#= 1 Alt= 2 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=uvcvideo
>     E:  Ad=81(I) Atr=05(Isoc) MxPS= 512 Ivl=125us
>     I:  If#= 1 Alt= 3 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=uvcvideo
>     E:  Ad=81(I) Atr=05(Isoc) MxPS=1024 Ivl=125us
>     I:  If#= 1 Alt= 4 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=uvcvideo
>     E:  Ad=81(I) Atr=05(Isoc) MxPS=1536 Ivl=125us
>     I:  If#= 1 Alt= 5 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=uvcvideo
>     E:  Ad=81(I) Atr=05(Isoc) MxPS=2048 Ivl=125us
>     I:  If#= 1 Alt= 6 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=uvcvideo
>     E:  Ad=81(I) Atr=05(Isoc) MxPS=2688 Ivl=125us
>     I:  If#= 1 Alt= 7 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=uvcvideo
>     E:  Ad=81(I) Atr=05(Isoc) MxPS=3072 Ivl=125us
> 
> UVC_QUIRK_FIX_BANDWIDTH helps here and NTSC video can be served with
> MxPS=2688 i.e. 20.5 MB/s isoc bandwidth.
> 
> In terms of microframe time allocation, before the quirk NTSC video
> required 60 usecs / microframe and 53 usecs / microframe after.
> 
> 
> P.S.
> 
> Now with tweaked ehci-hcd to allow up to 90% isoc bandwidth (cc62a7eb
> "USB: EHCI: Allow users to override 80% max periodic bandwidth") I can
> capture two video sources -- PAL 720x576 YUV422 @25fps + NTSC 640x480
> YUV422 @30fps simultaneously.  Hooray!
> 
> Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/media/video/uvc/uvc_driver.c |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/media/video/uvc/uvc_driver.c
> b/drivers/media/video/uvc/uvc_driver.c index b6eae48..f633700 100644
> --- a/drivers/media/video/uvc/uvc_driver.c
> +++ b/drivers/media/video/uvc/uvc_driver.c
> @@ -2130,6 +2130,15 @@ static struct usb_device_id uvc_ids[] = {
>  	  .bInterfaceProtocol	= 0,
>  	  .driver_info 		= UVC_QUIRK_PROBE_MINMAX
> 
>  				| UVC_QUIRK_BUILTIN_ISIGHT },
> 
> +	/* Foxlink ("HP Webcam" on HP Mini 5103) */
> +	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
> +				| USB_DEVICE_ID_MATCH_INT_INFO,
> +	  .idVendor		= 0x05c8,
> +	  .idProduct		= 0x0403,
> +	  .bInterfaceClass	= USB_CLASS_VIDEO,
> +	  .bInterfaceSubClass	= 1,
> +	  .bInterfaceProtocol	= 0,
> +	  .driver_info		= UVC_QUIRK_FIX_BANDWIDTH },
>  	/* Genesys Logic USB 2.0 PC Camera */
>  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
> 
>  				| USB_DEVICE_ID_MATCH_INT_INFO,
Kirill Smelkov July 22, 2011, 10:25 p.m. UTC | #2
Hi Laurent, All,

On Sat, Jul 23, 2011 at 12:03:57AM +0200, Laurent Pinchart wrote:
> Hi Kirill,
> 
> On Friday 22 July 2011 16:47:22 Kirill Smelkov wrote:
> >  [ Cc'ing Andrew Morton -- Andrew, could you please pick this patch, in
> >    case there is no response from maintainers again? Thanks beforehand. ]
> > 
> > 
> > Hello up there,
> > 
> > My first posting was 1 month ago, and a reminder ~ 2 weeks ago. All
> > without a reply. v3.0 is out and they say the merge window will be
> > shorter this time, so in oder not to miss it, I've decided to resend my
> > patch on lowering USB periodic bandwidth allocation topic.
> 
> I'm very very sorry for missing the patch (and worse, twice :-/).

Nevermind. I'm curious though, whether I did something wrong or anything
else?  I mean how to avoid such long delays next time?


> > Could this simple patch be please applied?
> 
> Yes it can. I see that Andrew already applied it to his tree. Mauro, should it 
> go through there, or through your tree ? I've pushed it to my tree at 
> git://linuxtv.org/pinchartl/uvcvideo.git uvcvideo-stable, so you can already 
> pull.

You've applied the patch from my first posting, but actually in the
RESEND one I've added reference to EHCI-tweaking patch -- it is already
merged into Greg's USB tree (it was not when I first posted), so could you
please reapply? (sorry for confusion).


Thanks for replying and for uvcvideo,
Kirill
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Laurent Pinchart July 22, 2011, 11:12 p.m. UTC | #3
Hi Kirill,

On Saturday 23 July 2011 00:25:20 Kirill Smelkov wrote:
> On Sat, Jul 23, 2011 at 12:03:57AM +0200, Laurent Pinchart wrote:
> > On Friday 22 July 2011 16:47:22 Kirill Smelkov wrote:
> > >  [ Cc'ing Andrew Morton -- Andrew, could you please pick this patch, in
> > >  
> > >    case there is no response from maintainers again? Thanks beforehand.
> > >    ]
> > > 
> > > Hello up there,
> > > 
> > > My first posting was 1 month ago, and a reminder ~ 2 weeks ago. All
> > > without a reply. v3.0 is out and they say the merge window will be
> > > shorter this time, so in oder not to miss it, I've decided to resend my
> > > patch on lowering USB periodic bandwidth allocation topic.
> > 
> > I'm very very sorry for missing the patch (and worse, twice :-/).
> 
> Nevermind. I'm curious though, whether I did something wrong or anything
> else?  I mean how to avoid such long delays next time?

It was all my fault, mails piled up in my mailbox and for some reason I marked 
yours as processed while they were not. I certainly hope it won't happen 
again.

> > > Could this simple patch be please applied?
> > 
> > Yes it can. I see that Andrew already applied it to his tree. Mauro,
> > should it go through there, or through your tree ? I've pushed it to my
> > tree at git://linuxtv.org/pinchartl/uvcvideo.git uvcvideo-stable, so you
> > can already pull.
> 
> You've applied the patch from my first posting, but actually in the
> RESEND one I've added reference to EHCI-tweaking patch -- it is already
> merged into Greg's USB tree (it was not when I first posted), so could you
> please reapply? (sorry for confusion).

Sure. That should now be fixed.

> Thanks for replying and for uvcvideo,

You're more than welcome. Thank you for the patch, and thank you for keeping 
on pushing :-)
Kirill Smelkov July 23, 2011, 6:15 p.m. UTC | #4
Hi Laurent, All,

On Sat, Jul 23, 2011 at 01:12:11AM +0200, Laurent Pinchart wrote:
> Hi Kirill,
> 
> On Saturday 23 July 2011 00:25:20 Kirill Smelkov wrote:
> > On Sat, Jul 23, 2011 at 12:03:57AM +0200, Laurent Pinchart wrote:
> > > On Friday 22 July 2011 16:47:22 Kirill Smelkov wrote:
> > > >  [ Cc'ing Andrew Morton -- Andrew, could you please pick this patch, in
> > > >  
> > > >    case there is no response from maintainers again? Thanks beforehand.
> > > >    ]
> > > > 
> > > > Hello up there,
> > > > 
> > > > My first posting was 1 month ago, and a reminder ~ 2 weeks ago. All
> > > > without a reply. v3.0 is out and they say the merge window will be
> > > > shorter this time, so in oder not to miss it, I've decided to resend my
> > > > patch on lowering USB periodic bandwidth allocation topic.
> > > 
> > > I'm very very sorry for missing the patch (and worse, twice :-/).
> > 
> > Nevermind. I'm curious though, whether I did something wrong or anything
> > else?  I mean how to avoid such long delays next time?
> 
> It was all my fault, mails piled up in my mailbox and for some reason I marked 
> yours as processed while they were not. I certainly hope it won't happen 
> again.

I see, thanks. Yes let's hope mail won't do such "surprises" next time.



> > > > Could this simple patch be please applied?
> > > 
> > > Yes it can. I see that Andrew already applied it to his tree. Mauro,
> > > should it go through there, or through your tree ? I've pushed it to my
> > > tree at git://linuxtv.org/pinchartl/uvcvideo.git uvcvideo-stable, so you
> > > can already pull.
> > 
> > You've applied the patch from my first posting, but actually in the
> > RESEND one I've added reference to EHCI-tweaking patch -- it is already
> > merged into Greg's USB tree (it was not when I first posted), so could you
> > please reapply? (sorry for confusion).
> 
> Sure. That should now be fixed.

Thanks.


> > Thanks for replying and for uvcvideo,
> 
> You're more than welcome. Thank you for the patch, and thank you for keeping 
> on pushing :-)

:) Thanks again. I suppose it would be better for my patch to enter the
mainline through v4l tree then, because it's the normal path for uvc
bits.



Thanks,
Kirill


P.S.

And thanks Andrew for backing me up.
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/media/video/uvc/uvc_driver.c b/drivers/media/video/uvc/uvc_driver.c
index b6eae48..f633700 100644
--- a/drivers/media/video/uvc/uvc_driver.c
+++ b/drivers/media/video/uvc/uvc_driver.c
@@ -2130,6 +2130,15 @@  static struct usb_device_id uvc_ids[] = {
 	  .bInterfaceProtocol	= 0,
 	  .driver_info 		= UVC_QUIRK_PROBE_MINMAX
 				| UVC_QUIRK_BUILTIN_ISIGHT },
+	/* Foxlink ("HP Webcam" on HP Mini 5103) */
+	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
+				| USB_DEVICE_ID_MATCH_INT_INFO,
+	  .idVendor		= 0x05c8,
+	  .idProduct		= 0x0403,
+	  .bInterfaceClass	= USB_CLASS_VIDEO,
+	  .bInterfaceSubClass	= 1,
+	  .bInterfaceProtocol	= 0,
+	  .driver_info		= UVC_QUIRK_FIX_BANDWIDTH },
 	/* Genesys Logic USB 2.0 PC Camera */
 	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
 				| USB_DEVICE_ID_MATCH_INT_INFO,