简体   繁体   中英

PointGrey SDK hangs on StartCapture

I have 4 Point Grey Chameleon cameras connected to my laptop with Ubuntu 14.04. Point Grey SDK 2.7 and 2.8. I wrote simple program:

    #include <iostream>
#include <vector>

#include "Camera.h"
#include "FlyCapture2Defs.h"
#include "FlyCapture2.h"
#include "FlyCapture2GUI.h"

#include <unistd.h>

using namespace FlyCapture2;

bool GetCameras( PGRGuid* pGuids, unsigned int* pSize )
{
    bool ok;
    CameraSelectionDlg camSlnDlg;
    camSlnDlg.ShowModal( &ok, pGuids, pSize );

    return ok;
}

int main(int /*argc*/, char** /*argv*/)
{
    BusManager bus;

    PGRGuid guid[64];
    unsigned int size = 64;
    bool ok = GetCameras( &guid[0], &size );
    if ( ok != true || size <= 0 )
        return -1;

    for ( unsigned int i = 0; i < size; i++ )
    {
        Error error;

        Camera* cam = new Camera();

        unsigned int serial=0;
        bus.GetCameraSerialNumberFromIndex(i, &serial);

        std::cerr << "Connecting cam " << i << " serial=" << serial << std::endl;
        error = cam->Connect( &guid[i] );

        std::cerr <<" ... and starting capture: start..." << std::endl;
        error = cam->StartCapture();

        std::cerr << "Cam " << i << " started ok "<< std::endl;
    }

    std::cerr <<"All cams started OK! "<< std::endl;

    return 0;
}

I run FlyCap2 application, and set VideoSettings for all cameras to 640*480, 7 fps. Then I run this program, and everything works OK.

After that, I change VideoFormat to any other (1920*940, or change packet size), and this program hangs on the last call to StartCapture().

It does not depend on how many cameras are connected: if I connect 2 cameras, it would hang on the second call to StartCapture().

Here is the typical gdb backtrace:

(gdb) bt
#0 0xb64df5f4 in __libc_do_syscall () from /lib/arm-linux-gnueabihf/libpthread.so.0
#1 0xb64db1d8 in pthread_cond_wait@@GLIBC_2.4 () from /lib/arm-linux-gnueabihf/libpthread.so.0
#2 0xb6bfb6e0 in ?? () from /opt/flycam/lib/libflycapture.so.2
#3 0xb6c0abbe in ?? () from /opt/flycam/lib/libflycapture.so.2
#4 0xb6c38124 in ?? () from /opt/flycam/lib/libflycapture.so.2
#5 0xb6bf1b18 in FlyCapture2::Camera::StartCapture(void (*)(FlyCapture2::Image*, void const*), void const*) () from /opt/flycam/lib/libflycapture.so.2
#6 0x0002fcfa in FlycapWindow::Start(FlyCapture2::PGRGuid) ()
#7 0x00030dfc in FlycapWindow::Run(FlyCapture2::PGRGuid) ()
#8 0x0002c9ce in main ()
(gdb)

Calling StartCapture in callback mode changes nothing.

Windows version of Point Grey SDK works OK.

Could you please help me to solve this problem?

Were you able to figure this out? I'm guessing it is due to "The USBFS buffer size is too small (16 MB by default). The following command can be used to check usbfs_memory_mb size." as mentioned on the Streaming Point Grey Cameras on Embedded Systems app note. I haven't tried it yet so I was curious if you had.

UPDATE: I happen to be running Ubuntu 14.04 on an Odroid XU4 so updating usbfs_memory_mb was as easy as editing /media/boot/boot.ini and adding usbcore.usbfs_memory_mb=1000 to bootargs toward the end. Now I am able to capture at the full resolution. I hope this works for you as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM