From owner-freebsd-usb@FreeBSD.ORG Sat Apr 24 19:43:57 2010 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96D99106566C for ; Sat, 24 Apr 2010 19:43:57 +0000 (UTC) (envelope-from maillist@diode.be) Received: from out2.stone-is.org (ns1bru.stone-is.net [87.238.161.121]) by mx1.freebsd.org (Postfix) with ESMTP id 2638D8FC1A for ; Sat, 24 Apr 2010 19:43:56 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by out2.stone-is.org (Postfix) with ESMTP id 5543E1580003 for ; Sat, 24 Apr 2010 19:10:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at out2.stone-is.org Received: from out2.stone-is.org ([127.0.0.1]) by localhost (out2.stone-is.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0Lkwy5AWRV6a for ; Sat, 24 Apr 2010 21:10:41 +0200 (CEST) Received: from be11.1-eurohost.com (vz02.stone-is.net [87.238.162.138]) by out2.stone-is.org (Postfix) with ESMTP id 1C8731580004 for ; Sat, 24 Apr 2010 21:10:41 +0200 (CEST) Received: (qmail 32349 invoked by uid 48); 24 Apr 2010 21:18:09 +0200 Received: from 5355025E.cable.casema.nl (5355025E.cable.casema.nl [83.85.2.94]) by webmail.diode.be (Horde MIME library) with HTTP; Sat, 24 Apr 2010 21:18:09 +0200 Message-ID: <20100424211809.fgn1vc5qaswkg8kk@webmail.diode.be> Date: Sat, 24 Apr 2010 21:18:09 +0200 From: maillist@diode.be To: freebsd-usb@freebsd.org References: <20100424140902.4b7meoicg084g04g@webmail.diode.be> <201004241701.34223.hselasky@c2i.net> In-Reply-To: <201004241701.34223.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Internet Messaging Program (IMP) H3 (4.1.4) Subject: Re: webcamd and cameras with Micron (MT9M0x1 and MT9T0x1) chips X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2010 19:43:57 -0000 Quoting Hans Petter Selasky : > Hi, > >> For both Micron cameras, #webcamd -B just gives `Cannot find USB device'. > > This usually happens when the webcamd is not listed. > >> >> dmesg output for the Mightex camera (MT9M001 chip): >> ugen3.2: at usbus3 >> >> and usbconfig -d ugen3.2 dump_device_desc gives: >> ugen3.2: at usbus3, cfg=3D0 md=3DHOST spd=3DHIGH >> (480Mbps) pwr=3DON >> >> bLength =3D 0x0012 >> bDescriptorType =3D 0x0001 >> bcdUSB =3D 0x0200 >> bDeviceClass =3D 0x0000 >> bDeviceSubClass =3D 0x0000 >> bDeviceProtocol =3D 0x0000 >> bMaxPacketSize0 =3D 0x0040 >> idVendor =3D 0x04b4 >> idProduct =3D 0x0228 >> bcdDevice =3D 0x0000 >> iManufacturer =3D 0x0001 >> iProduct =3D 0x0002 >> iSerialNumber =3D 0x0000 >> bNumConfigurations =3D 0x0001 >> >> >> For the MT9T031 camera (likely prototype), dmesg gives: >> ugen3.2: at usbus3 >> >> and usbconfig -d ugen3.2 dump_device_desc: >> ugen3.2: at usbus3, cfg=3D0 md=3DHOST spd=3DHIGH (480Mbps= ) pwr=3DON >> >> bLength =3D 0x0012 >> bDescriptorType =3D 0x0001 >> bcdUSB =3D 0x0200 >> bDeviceClass =3D 0x0000 >> bDeviceSubClass =3D 0x0000 >> bDeviceProtocol =3D 0x0000 >> bMaxPacketSize0 =3D 0x0040 >> idVendor =3D 0x0634 >> idProduct =3D 0x1007 >> bcdDevice =3D 0x0021 >> iManufacturer =3D 0x0001 >> iProduct =3D 0x0002 >> iSerialNumber =3D 0x0000 >> bNumConfigurations =3D 0x0001 >> >> >> >> >> Now, I have no coding skills, but thought it would be good to have a >> look into the driver code. I hoped I would find Vendor and Product >> id's that differed from how the camera identified, this explaining the >> refusal to associate. But while some other v4l drivers appear to >> contain things like {USB_DEVICE(0xXXXX, 0xXXXX), .driver_info=3DXXXXX}, >> such code is absent from the mt9xxxx.c files. Instead, there is a >> function data =3D reg_read(client, MT9M001_CHIP_VERSION) that does some >> sort of identification. But this is on the i2c level, reading the chip >> version number. I thought that for doing this, the system would >> already need to know what Micron chip it is dealing with. >> >> Any thoughts would be appreciated. > > Hi, > > I did a little bit of grepping, and I think you need to patch the followin= g > file to get your webcam working: > > v4l-dvb/linux/drivers/media/video/gspca/sn9c20x.c > > You can use this entry as an example: > > {USB_DEVICE(0x0c45, 0x6240), SN9C20X(MT9M001, 0x5d, 0)}, > > The iProduct dump indicates this is the right place to hack for the MT9M00= 1 > one :-) > > --HPS > I added {USB_DEVICE(0x04b4, 0x0228), SN9C20X(MT9M001, 0x5d, 0)}, to the list, with 0x5d as i2c address as the other two MT9M001 entries =20 have it too. After re-making ulinux and using the new webcamd from =20 that directory, I get Attached ugen3.2[0] to cuse init 0 Cannot find USB device Interestingly, the other (MT9T031) camera, for which nothing changed, =20 only states `Cannot find USB device' without returning `Attached =20 [...]'. The Logitech cam, which used to work, states `Attached [...]' =20 and then `Creating /dev/video0'. But for this Logitech cam, pwcview now complains `Failed to access =20 webcam: Device not configured'. Note that I used the webcamd from =20 ports before, so I must have messed something up. I updated to the =20 latest svn version. I will update my ports too, as this doesn't appear =20 to have anything to do with the change to the code I made. On the other hand, webcamd still returns `Cannot find USB device' for =20 the MT9M001 camera. Maybe simply adding the corresponding USB_DEVICE() =20 entry was not what you meant? Regards, Tiemen