Hi Bilbo
You need to tell us about your webcam, we need this info
https://groups.google.com/group/microdia/web/howto-get-information-on-your-webcam
-JoJo
Hi Bilbo
seems like your webcam is the same as 0c45:624f,
please try the init/start/stop sequences of 0c45:624f,
in order to make it work on 045e:00f4.
-JoJo
What does that even mean?,
is 045e:00f4 working correctly ?
In which application its not working correctly ?
(post screenshot whereever applicable.)
-JoJo
Well you asked for it, try out the attached patch and let us know.
The ideal way would be to handle it like a normal model,
(but its the same model, why keep different pieces of code, it will
just introduce more bugs)
a penny for your(Devs) thoughts .....
-JoJo
GWater
patch please ;-)
(or better wait and let them test it out before you commit the patch
with Doxygen, thanks)
-JoJo
Why not just add the real vendor and product IDs to the big case statement?
case USB_UDIA_624F_PRODUCT_ID:
case USB_UDIA_MICROSOFT_PRODUCT_ID:
.. do init for 624f
break;
Dave
GWater
OK, I like the switch case
(as is the case with 0c45:62bb, which is 627b again)
..but we will need a seperate switch case for each vendor_id
(example 045e & 145f)
-JoJo
We can just put a comment above the relevant functions to accomplish
the former. My main point was, we shouldn't obscure the real vendor
and product IDs.
We'd need to change the UDIA_INFO() at the top of that case block to
take a format string for the vendor & product, too, so people aren't
confused when they look at their dmesg.
Dave
Why?
Dave
Because in switch case
vendor_id == USB_MICRODIA_VENDOR_ID
vendor_id == 045e/145f
so the big switchcase only works for 0c45 ones and not 045e/145f
But I agreee with you in principle, if a webcam says its 045e/145f
then it must be recognized as
045e/145f and not 0c45: 624f/627b
(which is why I added the "Read Vendor/Product ID" to kernel log via UDIA_INFO)
-JoJo
BTW, wouldn't it be interesting to replace the big switch case with
some sort of hashtable mapping device ids to an array (or struct) of
function pointers ?
Cheers,
Jerome
if (vendor_id == USB_MICRODIA_VENDOR_ID
|| vendor_id == USB_MICROSOFT_VENDOR_ID)
works, right?
Or even better:
int device_id = le16_to_cpu(udev->descriptor.idVendor) << 16
& le16_to_cpu(udev->descriptor.idProduct);
switch (device_id) {
Then again, perhaps we've reached that magic point in time when it
makes sense to break things out by sensor and bridge?
Furthermore, is it time to change the name of the driver? Clearly, our
driver is more accurately termed the sn9c201 driver than the Microdia
driver (and has the added benefit that it's less likely to get us into
trademark trouble)?
Dave
Problem with splitting is for me that I don't have a sensor datasheet
like everybody else seems to have.
GWater
So we want to change
http://repo.or.cz/w/microdia.git?a=blob;f=microdia-usb.c;h=01d0db128b7ba22ddfc50901b2643caa82599cd1;hb=e32db588aa1782d110b42c7c29178e12be759373#l756
// Detect device
if (vendor_id == USB_MICRODIA_VENDOR_ID) {
switch (product_id) {
case USB_UDIA_6027_PRODUCT_ID:
TO
// Detect device
if ((vendor_id == USB_MICRODIA_VENDOR_ID) || (vendor_id == 0x045e) ||
(vendor_id == 0x145f))
{
switch (product_id) {
case USB_UDIA_6027_PRODUCT_ID:
and add the product_ids again ?
(what if we have exact same product_id under both microdia & microsoft
vendor_ids ?
see !! you haven't thought it through ;-)
>
> works, right?
>
> Or even better:
>
> int device_id = le16_to_cpu(udev->descriptor.idVendor) << 16
> & le16_to_cpu(udev->descriptor.idProduct);
>
> switch (device_id) {
>
soln. is either separate switch, or hack to force it to identify is as
another model.
> Then again, perhaps we've reached that magic point in time when it
> makes sense to break things out by sensor and bridge?
>
Yes Nicolas seems to think so too, his Syntek Driver is very big,
so it has a facility to just build the kernel module for a single
vendor_id: product_id combo.
Syntek has capabilities to build for a single (vendor:product ID).
This helps keep the kernel module size small, which in turn keeps the
kernel memory from
fragmenting, which in turn perhaps gets you that extra 1 mSeconds
faster response.
More VROOOM !!!!!
> Furthermore, is it time to change the name of the driver? Clearly, our
> driver is more accurately termed the sn9c201 driver than the Microdia
> driver (and has the added benefit that it's less likely to get us into
> trademark trouble)?
I did some considerable research. Microdia is a biological term.
Trademark is never given on a generic term(which means you can't
trademark Microdia).
But trademark has been given on a specific color, font & design on a
particular Microdia logo
(which is different from our logo, if we ever have one)
So the armchair lawyer in me says, such a situation will never arise.
(if SONiX starts to come out with their own opensource Microdia driver
even in that case the trademark will be on SONiX and not on microdia).
furthermore its impossible to infringe a trademark, if there are two
competing trademarks
which aren't in the same product category(causing confusion for the consumer)
>
>
>
> Dave
</armchair>
The second solution I posted, namely:
> >
> > Or even better:
> >
> > int device_id = le16_to_cpu(udev->descriptor.idVendor) << 16
> > & le16_to_cpu(udev->descriptor.idProduct);
> >
> > switch (device_id) {
Solves that, by having the high 16 bits be the vendor ID, effectively
creating a namespace.
> >
> soln. is either separate switch, or hack to force it to identify is as
> another model.
Or the second solution, posted above again for emphasis.
>
>
> > Then again, perhaps we've reached that magic point in time when it
> > makes sense to break things out by sensor and bridge?
> >
>
> Yes Nicolas seems to think so too, his Syntek Driver is very big,
> so it has a facility to just build the kernel module for a single
> vendor_id: product_id combo.
> Syntek has capabilities to build for a single (vendor:product ID).
But I'm saying vendors don't matter. The Microsoft cam that spawned
this thread is essentially the same exact cam as my Microdia cam. What
I'm saying is that we should base the software on bridge + sensor. The
only thing we need the vendor and product ID's for in this case is to
lookup the chip + sensor combo.
>
> > Furthermore, is it time to change the name of the driver? Clearly, our
> > driver is more accurately termed the sn9c201 driver than the Microdia
> > driver (and has the added benefit that it's less likely to get us into
> > trademark trouble)?
>
> I did some considerable research. Microdia is a biological term.
Got links? I can't find any references other than to the company on
google or Wikipedia:
http://en.wikipedia.org/wiki/Special:Search/Microdia
Trademark analysis aside, I'm less concerned with violating trademarks
than accurately representing what our driver is and does. The fact is
that we support cams from more vendors than Microdia; we support any
combination of a Sonix SN9C201/2 bridge and a bunch of sensors. Seems
more appropriate in this case to call it the sn9c20x driver or some
such (and it's fairly consistent with the naming of other drivers in
the kernel).
Dave
GWater
Well, we could save the renaming for the push to get into the kernel
(we could do the rename in a branch off the main code and keep the
name Microdia for the out-of-tree version).
However, does anyone have any reason to believe that the simple stream
format stuff we're doing wouldn't be accepted in the kernel? I know
JPEG decompression cannot, and I've heard people here mention bayer
demosaicing too -- though I've seen contradictory things about that on
LKML since it's linear complexity. But we're not even doing Bayer
demosaicing, are we -- I thought the bridge was doing that for us?
Dave