Re: webcamd and cameras with Micron (MT9M0x1 and MT9T0x1) chips

2010-04-25 Thread Tiemen

Quoting Hans Petter Selasky :

On Saturday 24 April 2010 21:18:09 maill...@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=0 md=HOST spd=HIGH
>> (480Mbps) pwr=ON
>>
>> bLength = 0x0012
>> bDescriptorType = 0x0001
>> bcdUSB = 0x0200
>> bDeviceClass = 0x
>> bDeviceSubClass = 0x
>> bDeviceProtocol = 0x
>> bMaxPacketSize0 = 0x0040
>> idVendor = 0x04b4
>> idProduct = 0x0228
>> bcdDevice = 0x
>> iManufacturer = 0x0001  
>> iProduct = 0x0002  
>> iSerialNumber = 0x  
>> bNumConfigurations = 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+= -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. Try
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  
now I have pwcview working again. Below is the output of gdb with the  
MT9M001 camera, with the USB_DEVICE() added to sn9c20x.c


Maybe one more thing: I checked the hardware, and the bridge of (both)  
cameras is a CY7C68013(A) (a.k.a. Cypress FX2) microprocessor, not a  
SN9C20x. Its behaviour will depend on the firmware, so this may become  
difficult to get to work, and I guess this has more to do with v4l  
than with freebsd-usb. Yet, I noticed that this bridge is sometimes  
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  
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  
/usr/home/tc/ulinux/v4l-dvb/linux/drivers/media/video/gspca/gspca.c,  
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=0x285b82b4, id=0x813c020,
sd_desc=0x8139be0, dev_size=1808, module=0x0)
at  
/usr/home/tc/ulinux/v4l-dvb/linux/drivers/media/video/gspca/gspca.c:2290

2290struct usb_device *dev = interface_to_usbdev(intf);
(gdb) next
2293PDEBUG(D_PROBE, "probing %04x:%04x", id->idVendor,  
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
-
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: webcamd and cameras with Micron (MT9M0x1 and MT9T0x1) chips

2010-04-25 Thread Hans Petter Selasky
On Saturday 24 April 2010 21:18:09 maill...@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=0 md=HOST spd=HIGH
> >> (480Mbps) pwr=ON
> >>
> >> bLength = 0x0012
> >> bDescriptorType = 0x0001
> >> bcdUSB = 0x0200
> >> bDeviceClass = 0x
> >> bDeviceSubClass = 0x
> >> bDeviceProtocol = 0x
> >> bMaxPacketSize0 = 0x0040
> >> idVendor = 0x04b4
> >> idProduct = 0x0228
> >> bcdDevice = 0x
> >> iManufacturer = 0x0001  
> >> iProduct = 0x0002  
> >> iSerialNumber = 0x  
> >> bNumConfigurations = 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=0 md=HOST spd=HIGH (480Mbps)
> >> pwr=ON
> >>
> >> bLength = 0x0012
> >> bDescriptorType = 0x0001
> >> bcdUSB = 0x0200
> >> bDeviceClass = 0x
> >> bDeviceSubClass = 0x
> >> bDeviceProtocol = 0x
> >> bMaxPacketSize0 = 0x0040
> >> idVendor = 0x0634
> >> idProduct = 0x1007
> >> bcdDevice = 0x0021
> >> iManufacturer = 0x0001  
> >> iProduct = 0x0002  
> >> iSerialNumber = 0x  
> >> bNumConfigurations = 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(0x, 0x), .driver_info=X},
> >> such code is absent from the mt9.c files. Instead, there is a
> >> function data = 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
> > 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
> 
> Interestingly, the other (MT9T031) camera, for which nothing changed,
> only states `Cannot find USB device' without returning `Attached
> [...]'. The Logitech cam, which used to work, states `Attached [...]'
> and then `Creating /dev/video0'.
> 
> But for this Logitech cam, pwcview now complains `Failed to access
> webcam: Device not configured'. Note that I used the webcamd from
> ports before, so I must have messed something up. I updated to the
> latest svn version. I will update my ports too, as this doesn't appear
> 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
> the MT9M001 camera. Maybe simply adding the corresponding USB_DEVICE()
> entry was not what you meant?

After you add that USB_DEVICE() entry, the following code should be called.

Try adding

CFLAGS+= -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. Try 
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
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: webcamd and cameras with Micron (MT9M0x1 and MT9T0x1) chips

2010-04-24 Thread maillist

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=0 md=HOST spd=HIGH
(480Mbps) pwr=ON

bLength = 0x0012
bDescriptorType = 0x0001
bcdUSB = 0x0200
bDeviceClass = 0x
bDeviceSubClass = 0x
bDeviceProtocol = 0x
bMaxPacketSize0 = 0x0040
idVendor = 0x04b4
idProduct = 0x0228
bcdDevice = 0x
iManufacturer = 0x0001  
iProduct = 0x0002  
iSerialNumber = 0x  
bNumConfigurations = 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=0 md=HOST spd=HIGH (480Mbps) pwr=ON

bLength = 0x0012
bDescriptorType = 0x0001
bcdUSB = 0x0200
bDeviceClass = 0x
bDeviceSubClass = 0x
bDeviceProtocol = 0x
bMaxPacketSize0 = 0x0040
idVendor = 0x0634
idProduct = 0x1007
bcdDevice = 0x0021
iManufacturer = 0x0001  
iProduct = 0x0002  
iSerialNumber = 0x  
bNumConfigurations = 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(0x, 0x), .driver_info=X},
such code is absent from the mt9.c files. Instead, there is a
function data = 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 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

Interestingly, the other (MT9T031) camera, for which nothing changed,  
only states `Cannot find USB device' without returning `Attached  
[...]'. The Logitech cam, which used to work, states `Attached [...]'  
and then `Creating /dev/video0'.


But for this Logitech cam, pwcview now complains `Failed to access  
webcam: Device not configured'. Note that I used the webcamd from  
ports before, so I must have messed something up. I updated to the  
latest svn version. I will update my ports too, as this doesn't appear  
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  
the MT9M001 camera. Maybe simply adding the corresponding USB_DEVICE()  
entry was not what you meant?


Regards,

Tiemen
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: webcamd and cameras with Micron (MT9M0x1 and MT9T0x1) chips

2010-04-24 Thread 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=0 md=HOST spd=HIGH
> (480Mbps) pwr=ON
> 
> bLength = 0x0012
> bDescriptorType = 0x0001
> bcdUSB = 0x0200
> bDeviceClass = 0x
> bDeviceSubClass = 0x
> bDeviceProtocol = 0x
> bMaxPacketSize0 = 0x0040
> idVendor = 0x04b4
> idProduct = 0x0228
> bcdDevice = 0x
> iManufacturer = 0x0001  
> iProduct = 0x0002  
> iSerialNumber = 0x  
> bNumConfigurations = 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=0 md=HOST spd=HIGH (480Mbps) pwr=ON
> 
> bLength = 0x0012
> bDescriptorType = 0x0001
> bcdUSB = 0x0200
> bDeviceClass = 0x
> bDeviceSubClass = 0x
> bDeviceProtocol = 0x
> bMaxPacketSize0 = 0x0040
> idVendor = 0x0634
> idProduct = 0x1007
> bcdDevice = 0x0021
> iManufacturer = 0x0001  
> iProduct = 0x0002  
> iSerialNumber = 0x  
> bNumConfigurations = 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(0x, 0x), .driver_info=X},
> such code is absent from the mt9.c files. Instead, there is a
> function data = 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 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
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"