Re: two CPIA cameras at once

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On 9 Oct 2001 at 9:16, Rich Drewes wrote:

> Philipp Ineichen wrote:
> 
> >Hi Peter
> >
> >In the meantime I changed the alternate setting from 3 to 1 in the
> >cpia_usb_open function. Now, both cameras are able to set the alternate
> >setting (interface = 1), but xawtv (gqcam as well) is still not able to
> >display both streams!
> >I think that there is enough USB bandwidth since I changed the alternate
> >setting to 1. Am I right? That means that video4linux has troubles handling
> >both cameras simultaneously?
> >


> As I indicated in an earlier post, there is a fairly simple userland 
solution to this problem:  using semaphores to enforce exclusive 
access to the read system calls as I have done in my modification to 
the 'motion' V4L program (http://interstice.com/drewes/motion-2.6.2-
with-semaphore.tgz). This doesn't reduce the total capture speed for 
all cameras though of course each camera captures at about half 
the speed it did individually.  I have used this method to keep two 
USB cameras working simultaneously in a >  security application for 
weeks at a stretch without any problems.  

> 
> I agree that a system level solution would be desirable, so if anyone
> knows how to make that work, by all means, please advise.  In the
> meantime, my advice:  use semaphores. 

Are you running two instances of motion?  I'm attempting to do the 
same with a bttv card with 4 inputs, and up to 4 copies of motion..

I've hacked-up the example invert.c program (that came with 
vloopback, from the motion page) to go through each input, grab a 
frame, and output that frame to a loopback, like so:
/dev/video i0 -> /dev/video1
/dev/video i1 -> /dev/video3
/dev/video i2 -> /dev/video5
/dev/video i3 -> /dev/video7

At this point, I'm only using 2 inputs, and the frame rate isn't too bad, 
but I think if it were to read a frame from each input, into it's own 
seperate bufffer, and have a seperate thread writing those buffers 
each loopback, it would be a little quicker. 

Now I'm not a programmer, I have no clue how to implement this.
If you're interested, I've placed my (ugly) code at 
www.havokmon.com/stuff/multiout.c

Rick







-- 
Rick Romero
IT Manager	Valeo, Inc.
ph 262.695-4841  fax 262-695-4850
rick@xxxxxxxxxxxx






[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux