Re: [libdc] multiple simultaneous calls to select() with multiple cameras - potential bug
Capture and control API for IIDC compliant cameras
Brought to you by:
ddouxchamps,
gordp
From: David M. <dcm@MIT.EDU> - 2008-03-10 20:52:43
|
On Mon, 2008-03-10 at 11:30 -0700, Andrew Straw wrote: > I'm trying to figure out whether there's a bug in my thinking or > somewhere in the libdc1394/linux firewire stack. I'm trying to use > select() on the fileno to block (with timeout) while waiting for new > frames. This seems to work fine for a single camera. With multiple > cameras, I'm having an issue with latency growing ever longer, > apparently because sometimes the select() call isn't returning that I > can read successfully from the fileno. Note that I'm not calling > select() in an optimal way -- I have one select() call per camera > waiting on a single fileno, each in its own thread (whereas I could make > a single fdset and block on all cameras at once -- I'm not doing this > currently). Nevertheless, I expect my approach should work. So, back to > my question -- is this behavior expected for some reason? (why?) or is > there likely to be a bug somewhere? I am using linux x64_64 as compiled > by Ubuntu Gutsy: 2.6.22-14-generic #1 SMP Tue Feb 12 02:46:46 UTC 2008 > x86_64 GNU/Linux. If there's appears to be bug, I'm happy to dig deeper > and attempt to find the source. > Okay, I think I've fixed this bug. Could you download the SVN version of libdc1394 and try again? On Linux, dc1394_capture_get_fileno() should now return a different value for each camera, and those fds should work correctly with select() -- either a single select(), or different select()s in different threads. Thanks, David |