iFrameConsumer->acquireFrame(); nerver return after a long time run

I’m using
tx1 with four csi camera.
4 camera to dump yuv to ssd.

I try to use four thread to do the following job
but after about 10min. one of my camera can never acquireFrame.

IFrameConsumer *iFrameConsumer = interface_cast(m_consumer[devIndex]);
auto pframe = iFrameConsumer->acquireFrame();

IFrame *iFrame = interface_cast

NV::IImageNativeBuffer *iNativeBuffer = interface_castNV::IImageNativeBuffer(iFrame->getImage());

if (m_dmabuff[devIndex] == -1) {
m_dmabuff[devIndex] =
iNativeBuffer->createNvBuffer(Size(1280, 720), NvBufferColorFormat_YUV420, NvBufferLayout_Pitch);
} else {
iNativeBuffer->copyToNvBuffer(m_dmabuff[devIndex]);
}
NvBufferParams params;
NvBufferGetParams(m_dmabuff[devIndex], &params);

char path[256];
snprintf(path, sizeof(path), “%s%d_%llu.yuv”, dir_name, devIndex, static_cast(iFrame->getTime()));
FILE *fp = fopen(path, “wb”);

for (unsigned i = 0; i < params.num_planes; i++) {
size_t size = params.height[i] * params.pitch[i];
// size_t size = params.psize[i];
char *vptr = (char *)mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, m_dmabuff[devIndex], params.offset[i]);

for (unsigned j = 0; j < params.height[i]; j++) {
  fwrite(vptr + params.pitch[i] * j, params.width[i], 1, fp);
}

if (munmap(vptr, size)) {
  LOG(ERROR) << "unable to unmap " << devIndex;
}

}
fclose(fp);
pframe->destroy();
return 0;

hello yijie.zhang,

you may also share the more details,

  1. what’s the JetPack version you’re working with,
  2. please also check if there’s kernel failure introduced with.
    thanks

Hi JerryChang

  1. my JetPack Version is 2.3.1
  2. there is no message shows of dmesg,and other camera runs properly, how can I check if there’s kernel failure

hello yijie.zhang,

since JetPack-2.3.1 release was almost two years ago.
could you please update your works to the latest release.
thanks

Hi yijie.zhang,

Have you moved on the latest release? Any result can be shared?

Thanks

For some reason we can’t move to the latest release.
so we have to limit the read/write fps

I run ‘dd if=/dev/zero of=path-to-my-SSD bs=1M count=20000’ to write 200GB to SSD
at the same time when I do just read 4 camera.that error happens again.

I wander if your lib will catch some system error and shutdown one camera for me. can your tell me which limit is, and in what condition you will close one camera for me.

hello yijie.zhang,

I would like to know more details about your use-case,
did you mean launch 4-camera simultaneously and dump all these 4 yuv files into SSD?
0) please share your steps and commands.

  1. how about just launch 4-camera for streaming, is it works as expect?
  2. please try to dump these yuv files into eMMC
  3. had you tried your use-case with single camera
  4. you could check the kernel message with dmesg command.

hello Jerry

  1. I follow sample/one_shot.cpp to write a program.
    my use-case is 4 camera reading and dumping yuv file to SSD, we want to get 30fps,and yuv file. but
    that will fail each time we try .and the failure is iFrameConsumer->acquireFrame() never return
  2. 4-camera streaming works
  3. when writing images, it’s about 10G/min.
  4. one camera works, two camera works too. three or four will fail
  5. dmesg print nothing when error happends

but when we compress the image,(1.4M ----> 50 k ). it works with 4-camera
so we guess the I/O error of arugs.

hello yijie.zhang,

it seems the bandwidth bottleneck of I/O,
may I know what’s resolution and frame rate of your use-case.
could you please have a try to downscale the output resolution and frame rate to verify this.
thanks

Hi yijie.zhang,

Have you tried with our suggestion to downscale the output resolution and frame rate?
Any result can be shared?

Thanks