On Sun, Jun 19, 2005 at 10:38:32AM +0330, Hamed Ahmadi Nejad wrote:
> Hello!
>
> I am planning to use the PWC driver for a Logitech Sphere webcam on a
> robot we are building. The system is controlled by an 300mhz embedded
> processor running linux.
which family ? You can look to this page
http://saillard.org/linux/pwc/projects.php for projects that use the driver.
I would like (if possible) that every people that build a project using the
pwc driver post a mail about the project. Then i can add to this page, and
people can meet others that have the same problem.
> I have 2 questions:
> 1- Since we are limited in processing power, we need to be as optimal
> as possible.. What is the absolute fastest way to access the images in
> the camera? Would it be faster to access the data using the "read"
> function or if I did an "mmap"? If I use mmap, should I use multiple
> buffers? So far, I have it working OK on my laptop with "read", but
> when I open the camera, it takes almost a second to read the first
> frame. (Subsequent frames are fast; just the first one takes a long
> time)
mmap is the better solution, because when you do a read, data from the kernel
memory is copied to a buffer in user space (so we copy 640*480*1.5*15fps bytes).
Using mmap, kernel memory is shared between your process and the kernel
memory, so you don't have this copy. But you need to works with buffer.
kernel writes into the buffer 1, while you can read the previous frame in
buffer2. (You don't need to copy this data, but don't writes into it).
>
> 2- Is it true that the driver requires X? I saw written somewhere
Rule N°1: X is an user application likes any other application on the kernel,
and the kernel doesn't need X to works, so you can grab image from any
webcam, BTV cards, audio, ... without X. But because webcam is commonly used
for desktop computer, many programs is designed to use the X API to see
something. Just look for camE, webcam, ... for console applications. You can
write your own program, using the v4l2 sample code to grab image using mmap
or read.
Luc
_______________________________________________
pwc mailing list
http://lists.saillard.org/mailman/listinfo/pwc
|