NetBSD Problem Report #40607

From rafal@pobox.com  Wed Feb 11 03:07:02 2009
Return-Path: <rafal@pobox.com>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id A65E763C0C7
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 11 Feb 2009 03:07:02 +0000 (UTC)
Message-Id: <20090211023503.08B82445F8@cyclops.waterside.net>
Date: Tue, 10 Feb 2009 21:35:02 -0500 (EST)
From: rafal@netbsd.org
Reply-To: rafal@netbsd.org
To: gnats-bugs@gnats.NetBSD.org
Subject: uvideo(4) queues too many xfers to uhci / ohci
X-Send-Pr-Version: 3.95

>Number:         40607
>Category:       kern
>Synopsis:       uvideo(4) queues too many xfers to uhci / ohci
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Feb 11 03:10:01 +0000 2009
>Last-Modified:  Sun Jan 20 10:15:01 +0000 2019
>Originator:     Rafal Boni
>Release:        NetBSD 5.0_RC1
>Organization:
Wazzat?
>Environment:
System: NetBSD cyclops 5.0_RC1 NetBSD 5.0_RC1 (GENERIC) #2: Sun Feb 1 21:38:26 EST 2009 rafal@cyclops:/extra/netbsd-src/netbsd-5/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:
	I have a USB 2.0 compatible webcam (a Logitech QuickCam Communicate
	Deluxe) connected to a USB 1.1 HC, which attaches like so:

uhub0 at usb0: vendor 0x8086 UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
uvideo0 at uhub0 port 1 configuration 1 interface 0: vendor 0x046d product 0x09a2, rev 2.00/0.08, addr 2
video0 at uvideo0: vendor 0x046d product 0x09a2, rev 2.00/0.08, addr 2
uaudio0 at uhub0 port 1 configuration 1 interface 2: vendor 0x046d product 0x09a2, rev 2.00/0.08, addr 2
uaudio0: audio rev 1.00
audio1 at uaudio0: full duplex, independent

	Attempting to play the video stream with mplayer by invoking it as:

		# mplayer /dev/uvideo0

	causes the system to panic freeing memory as show in the following
	screenshot: ftp://ftp.netbsd.org/pub/NetBSD/misc/rafal/DSC00021.JPG

	Building a DIAGNOSTIC kernel and retrying the mplayer experiment
	spewed the following message onto the console, but did not crash
	the kernel:

		uhci_device_isoc_enter: overflow!

	Note that starting mplayer with different args, like below, also
	avoids the panic and even displays video, though it's broken up 
	and mplayer spews 'frame too small' and 'select timeout' errors
	fairly frequently:

		# mplayer -tv fps=25 tv://

>How-To-Repeat:
	Attempt to view video from a USB 2 / High-speed webcam on a ohci(4)
	or uhci(4) controller with default mplayer args.

>Fix:
	Unknown as of yet; Jeremy Morse suggested upping UHCI_VFRAMELIST_COUNT
	in src/sys/dev/usb/uhcivar.h from 128 -> 1024 as a fix.  I have not
	yet tried that.

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: kern-bug-people->jmorse
Responsible-Changed-By: jmorse@NetBSD.org
Responsible-Changed-When: Wed, 11 Feb 2009 11:21:32 +0000
Responsible-Changed-Why:
I'll take this


From: Rafal Boni <rafal@pobox.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/40607: uvideo(4) queues too many xfers to uhci / ohci
Date: Wed, 11 Feb 2009 09:37:32 -0500

 As a follow-up, taking Jeremy's suggestion to up UHCI_VFRAMELIST_COUNT
 in src/sys/dev/usb/uhcivar.h from 128 -> 1024 seems to make my machine
 not crash -- the following happens instead:
 	* running 'mplayer /dev/video0' or 'mplayer tv://' complains about
 	  a bunch of ioctls (EINVALs IIRC) and then exits.
 	* running 'mplayer -tv fps=25 tv://' produces a good video stream
 	  which is no longer broken up; I think mplayer still complains
 	  about a bunch of ioctls being rejected with EINVALs (have to
 	  double-check this).
 	* ekiga is now able to open the device and render video, which
 	  it didn't do before.  The video stream is good without breakup
 	  or other artifacts.
 	* cheese still doesn't recognize a camera for some reason.

 	(Note that along with this change I updated my source tree to
 	 5.0_RC2, so it isn't exactly an apples-to-apples comparison,
 	 but I don't think in this area much has changed).

 Anyway, it seems like a net win.  However, ohci(4) probably needs some
 similar love, and I suspect both uhci(4) and ohci(4) need some bounds-
 checking on queued xfers.

 (I presume the errors from mplayer are artifacts of our incomplete v4l
  implementation / emulation and unrelated to any of the rest of this,
  but if those are of interest I'll collect them the next time I'm at
  the machine and append them here).

 --rafal

From: "Jared D. McNeill" <jmcneill@invisible.ca>
To: gnats-bugs@NetBSD.org
Cc: jmorse@NetBSD.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, 
 rafal@netbsd.org
Subject: Re: kern/40607: uvideo(4) queues too many xfers to uhci / ohci
Date: Wed, 11 Feb 2009 10:12:15 -0500

 On 2/11/2009 9:45 AM, Rafal Boni wrote:
 >   	* cheese still doesn't recognize a camera for some reason.

 Jeremy checked in a patch to the cheese package to fix this one.

From: Jeremy Morse <jeremy.morse@gmail.com>
To: gnats-bugs@NetBSD.org
Cc: jmorse@NetBSD.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, 
 rafal@netbsd.org
Subject: Re: kern/40607: uvideo(4) queues too many xfers to uhci / ohci
Date: Wed, 11 Feb 2009 15:53:10 +0000

 This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
 --------------enig6EEE757C8442FAB0E475A909
 Content-Type: text/plain; charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable

 The *_VFRAMELIST_COUNT constructs appear to be a memory saving method,
 two solutions are either remove all of the vframelist code, or fix
 uvideo to not schedule so many xfers.

 Currently uvideo doesn't make any decisions based on whether it's
 attached to a high speed or full/low speed bus, I'll fix that first.

 >  	* cheese still doesn't recognize a camera for some reason.

 Are you using cheese-2.24.3nb1? It got patched a couple of days ago to
 work properly with hal.

 --=20
 Thanks,
 Jeremy


 --------------enig6EEE757C8442FAB0E475A909
 Content-Type: application/pgp-signature; name="signature.asc"
 Content-Description: OpenPGP digital signature
 Content-Disposition: attachment; filename="signature.asc"

 -----BEGIN PGP SIGNATURE-----

 iQEcBAEBAgAGBQJJkvRrAAoJEF93OTEVsi2VChsH/iXSqm1gCICDZv8MnWnq6wWT
 i93vD9br/+jsNPmM9cQNVabM1osYnFeegY8BmTmwvb0j+YYAaWSS/CVnwHO3Yv/B
 +/RMiAjzzvfeKJ2pHy0ZQtNsTJjFEmhjjfheDswaQhIwgxJ79SLWo7hPq8hW9v8+
 Li5I0RK19NfKOpn3sEv7yLnGLR+yZ5TVYsh9jvpTllvqvqMekxvEXbFUhkSwh4PP
 5DxSgkiDtGx5EabpJCluFsuOABrzsF3SbhzQgMH9RWNwTCTdcfV1SvOmdfJCYuIE
 dN5i7Uae8Q9w/XoxTYc1Qb+vpjc4coTuflyblyaeqSVXQ+4cLSp0ecsmrm8I+4A=
 =6tSf
 -----END PGP SIGNATURE-----

 --------------enig6EEE757C8442FAB0E475A909--

Responsible-Changed-From-To: jmorse->kern-bug-people
Responsible-Changed-By: dholland@NetBSD.org
Responsible-Changed-When: Sun, 20 Jan 2019 07:44:39 +0000
Responsible-Changed-Why:
Reset responsible field for retired developer.
(also, is this still an issue?)


From: Nick Hudson <nick.hudson@gmx.co.uk>
To: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org,
 netbsd-bugs@netbsd.org, gnats-admin@netbsd.org, dholland@NetBSD.org
Cc: 
Subject: Re: kern/40607 (uvideo(4) queues too many xfers to uhci / ohci)
Date: Sun, 20 Jan 2019 10:10:11 +0000

 On 20/01/2019 07:44, dholland@NetBSD.org wrote:

 > (also, is this still an issue?)

 This is almost certainly still an issue.

 Nick

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.