From owner-freebsd-usb@FreeBSD.ORG Sun Apr 25 13:21:03 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 B142A106566B for ; Sun, 25 Apr 2010 13:21:03 +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 41D0E8FC0A for ; Sun, 25 Apr 2010 13:21:02 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by out2.stone-is.org (Postfix) with ESMTP id A75EA15800B2 for ; Sun, 25 Apr 2010 13:13:30 +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 tWwsHXJfmpCO for ; Sun, 25 Apr 2010 15:13:23 +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 1F11D1580098 for ; Sun, 25 Apr 2010 15:13:23 +0200 (CEST) Received: (qmail 5929 invoked by uid 48); 25 Apr 2010 15:20:54 +0200 Received: from 5355025E.cable.casema.nl (5355025E.cable.casema.nl [83.85.2.94]) by webmail.diode.be (Horde MIME library) with HTTP; Sun, 25 Apr 2010 15:20:53 +0200 Message-ID: <20100425152053.biben250qokssw40@webmail.diode.be> Date: Sun, 25 Apr 2010 15:20:53 +0200 From: Tiemen To: freebsd-usb@freebsd.org References: <20100424140902.4b7meoicg084g04g@webmail.diode.be> <201004241701.34223.hselasky@c2i.net> <20100424211809.fgn1vc5qaswkg8kk@webmail.diode.be> <201004250944.24898.hselasky@c2i.net> In-Reply-To: <201004250944.24898.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: Sun, 25 Apr 2010 13:21:03 -0000 Quoting Hans Petter Selasky : > On Saturday 24 April 2010 21:18:09 maillist@diode.be wrote: >> 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=3DHI= GH >> >> (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 >> >> >> >> >> > >> > Hi, >> > >> > I did a little bit of grepping, and I think you need to patch the >> > following 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 >> > MT9M001 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 >> have it too. After re-making ulinux and using the new webcamd from >> that directory, I get >> >> Attached ugen3.2[0] to cuse init 0 >> Cannot find USB device >> > > After you add that USB_DEVICE() entry, the following code should be called= . > > Try adding > > CFLAGS+=3D -g > > in the Makefile. > > Then run webcamd via gdb. > > In gdb type: > > break gspca_dev_probe > run > > at first break: > > next > > If you don't get the break, you're running an older version of webcamd. Tr= y > svn up! You might have to do: > > make fetch_clean > make fetch > > cd patches/ > ./do_patch.sh > > After svn up. > > /* -- device connect -- */ > static int sd_probe(struct usb_interface *intf, > const struct usb_device_id *id) > { > return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd), > THIS_MODULE); > } > > --HPS > Thanks. I updated ports and svn upped the webcamd code once more, and =20 now I have pwcview working again. Below is the output of gdb with the =20 MT9M001 camera, with the USB_DEVICE() added to sn9c20x.c Maybe one more thing: I checked the hardware, and the bridge of (both) =20 cameras is a CY7C68013(A) (a.k.a. Cypress FX2) microprocessor, not a =20 SN9C20x. Its behaviour will depend on the firmware, so this may become =20 difficult to get to work, and I guess this has more to do with v4l =20 than with freebsd-usb. Yet, I noticed that this bridge is sometimes =20 integrated in webcams functioning as an OV511 replacement: http://ovcam.org/ov511/cameras.html I will try to find out more about what `language' it speaks in my =20 specific cameras. ------------------------ testdoos# gdb ./webcamd GNU gdb 6.1.1 [FreeBSD] Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions= . Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-marcel-freebsd"... (gdb) break gspca_dev_probe Breakpoint 1 at 0x806e4a9: file =20 /usr/home/tc/ulinux/v4l-dvb/linux/drivers/media/video/gspca/gspca.c, =20 line 2290. (gdb) run Starting program: /usr/home/tc/ulinux/webcamd [New LWP 100114] [New Thread 28401140 (LWP 100114)] [New Thread 28419140 (LWP 100102)] [New Thread 28418ec0 (LWP 100115)] [New Thread 28418d80 (LWP 100132)] Attached ugen3.2[0] to cuse unit 0 [New Thread 28418c40 (LWP 100139)] [Switching to Thread 28401140 (LWP 100114)] Breakpoint 1, gspca_dev_probe (intf=3D0x285b82b4, id=3D0x813c020, sd_desc=3D0x8139be0, dev_size=3D1808, module=3D0x0) at =20 /usr/home/tc/ulinux/v4l-dvb/linux/drivers/media/video/gspca/gspca.c:2290 2290 struct usb_device *dev =3D interface_to_usbdev(intf); (gdb) next 2293 PDEBUG(D_PROBE, "probing %04x:%04x", id->idVendor, =20 id->idProduct); (gdb) c Continuing. Program received signal SIGHUP, Hangup. [Switching to Thread 28418c40 (LWP 100139)] 0x28288f3f in poll () from /lib/libc.so.7 (gdb) c Continuing. [Thread 28418c40 (LWP 100139) exited] [New Thread 28418c40 (LWP 100139)] Cannot find USB device Program exited with code 01. (gdb) quit ---------------------------------