Webcam woes

Bas Huisman bhuism@cs.utwente.nl
Wed, 18 Aug 1999 12:21:30 +0200


first of all, sorry for my late reply, been busy (no excuse :)

> I have had a _very_ close look at the reading back data problem. Basically,
> I am out of ideas now. I cross-checked most of your handshakes, etc. with
> the dos-implementation and the specifications. It seems you followed the
> dos-implementation and not the specification? I have noticed the following:

I've done exactly that, when it didn't worked for the first time, I began to
slowly
migrate my code to the dos code until they were exactly the same.
 
> - the camera seems to return 0xff if there is no data, basically
>   one can read as many bytes as one wants, if the camera has
>   nothing to say it returns 0xff

yes, I've noticed that to.

> - the read back works also for another command that
>   also returns exactly 8 bytes (GetCameraExposure?), what
>   makes me think is that that one returns 0xff if the
>   camera is not in HI_POWER mode, is there a mode
>   the camera has to be in eg. for GetCPIAVersion?

can't find anything on that, maybe this helps: when I made
the driver, I've accused the guys at vision for wrong doc's
when I switched the last to bytes of a message
(within the 2 byte wLength field) it worked for about half the times
on all messages (also getpnpid for example) (If I remember correctly).

so I thought: how can this work ?, the doc's are probably wrong, but they
weren't
the thing just happend to work with this illegal message, I do believe
that there I something more, maybe It receives the requested amount of bytes
(to be sent back) wrongly ? 

> - You use SimECPReadBuffer instead of ECPReadBuffer but
>   if I understand things correct they are the same for
>   reads of less than fifo-len bytes?

I use SimECPread()/write() for If_TranferMsg() (for messages (these are just 8
bytes and return very
little data) and ECPreadBuffer for images (if_StreamRead() )

to answer your question: could be....
 
> Do you have any idea on how to proceed? All the status lines, handshakes
> seem to be correct but the camera does not send anything. MY ideas for the
> cause of the problem are:

> - there is some timing problem, so maybe rewrite the handshakes according
>   to the spec instead of the sample program might help (Forward2Reverse,
>   Negotiate2Setup, ...)?

I did in the first case, but It's worth the try, will take you an evening I
guess.

> - what is the difference between parport_read_data and parport_read_fifo?

see /usr/include/linux/parport.h and get familiar with the parport ...

see /usr/src/linux/drivers/misc/parport_pc.c

parport_pc_read_data() &
parport_pc_read_fifo()

> - did you test the example program with a M$ compiler? does that code
>   really work?

good question, I didn't, I've got no M$ compiler (no shame)

> - is it possible that I miss some data bytes somewhere?

you mean my driver missing some bytes ? I double checked at the time
everyting, but everything is possible. I don't know where to look anymore.

> - do you have a protocol analyser to check if the camera really does not
>   send anything? :) [just a rhetoric quetion]

nope :) ... you ?
 
> BTW, I made a quick shot at a blocking read (sleep in if_StreamRead) using
> the interrupt handler to wake it up. That seems to work fine but needs some
> tweaking. If that works I would use it to implement an overlay-mode and do
> the format-conversions in kernel-space. From there it is only a short way
> to a usable v4l-module since I have the framework for that one already
> running.

Ah.
 
> One more question, the CPU-utilization is quite high for me. It consumes
> about 70% cpu in _kernel_ mode. I do the test on a PII at 350MHz. So this
> worries me a bit. Do you have any idea where this could come from? I see
> no busy wait in the code. So I am a bit surprised. Is the ECPReadBuffer
> routine really that expensive?

see other mail,

I'm glad you're looking into things,

Bas
-- 
                          .eeree$$              eee
                       .d$"   e$"                z$$
                      J$" .  $$"                 $$%
                      $$  4 $$F                 $$P
                      $$..P$$P  .ePb...  z$$$. J$$ ..
                       """d$$  $$" $$$ .$$ $$%.$$d $$
                         4$$".$$P 4$$ .$$%   .$$$e$"  
                         $$$P $$ .$$%z"$$   e3$$ $$$.
                   ..e="$$$   "$$"*$@  "$$d".$$  *$$"
                 e$P   .$$
                 $$   .$$    bhuism@cs.utwente.nl
                 *$. z$"
-----------------------------------------------------------------------------
To unsubscribe from this mailinglist, send the line "unsubscribe vision-webcam" in the
body of a message to "majordomo@errors.no".