question about FrameConsumer acquireFrame

I am working with Jetson TX2 with jetpack3.2 and 3 cameras MIPI and trying to capture frames with acquireFrame() of libargus.
After several frames (varies from 50 to 15000 so far) one of the cameras enters the acquireFrame() function and never returns. I tried adding maximum timeout but everything under 1sec (100000000 ns) seems to not even load the first frame and always failing (eventhough the maximum interval I see when I run it without any arguments is 8-22ms).
I tried the methods mentioned in the forums like increasing the number of output streams in the create, and even busy-looping the acquireFrame() but that doesn’t seem to help. I’m adding the code for create and acquireFrame() + the prints I am using, and the log file (the important part at-least) that shows that the camera never finished the function.

iFrameConsumer create (note: the 2 if a method mentioned somewhere in the forum):

m_consumer = UniqueObj<FrameConsumer>(FrameConsumer::create(m_stream,2));
if (!m_consumer)
    ORIGINATE_ERROR("[%d] Failed to create FrameConsumer\n",m_id);

acquireFrame() function call with debug prints before and after
(note: there are 2 locations where i try to acquire frame, both have same 3 lines):

printf("(%d) attempting to acquire frame (%d) while loop \n", m_id, m_currentFrame);
Argus::UniqueObj<EGLStream::Frame> frame(iFrameConsumer->acquireFrame());
printf("(%d) successful acquire frame (%d) while loop", m_id, m_currentFrame);

the log file is pretty long, but the critical part is as follows:

//some log here
(0) attempting to acquire frame (8) while loop
(1) attempting to acquire frame (8) while loop
(0) successful acquire frame (8) while loop
(1) successful acquire fr---------#########-----------ame (8) while loop
(1) attempting to acquire frame (9) while loop
(1) successful acquire frame (9) while loop
(0) attempting to acquire frame (9) while loop
(0) successful acquire frame (9) while loop
(0) attempting to acquire frame (10) IntoMem
(0) successful acquire frame IntoMem (10)
(1) attempting to acquire frame (10) IntoMem
(1) successful acquire frame IntoMem (10)
(0) attempting to acquire frame (0) while loop
(1) attempting to acquire frame (0) while loop
(1) successful acquire frame (0) while loop
(1) attempting to acquire frame (1) while loop
(1) successful acquire frame (1) while loop
(1) attempting to acquire frame (2) while loop
(1) successful acquire frame (2) while loop
(1) attempting to acquire frame (3) while loop
(1) successful acquire frame (3) while loop
(1) attempting to acquire frame (4) while loop
(1) successful acquire frame (4) while loop
(1) attempting to acquire frame (5) while loop
//continues all the way down the same way

at the beginning of the section there are successful acquireFrame() calls, and then the camera with id 0 entered acquireFrame() and never exited.
as i wrote before there are 3 cameras, but the problem only occurs at cameras 0 and 1 (camera 2 has a different purpose and never seems to get stuck).
thank you for taking your time reading this, and I would appreciate the help.
Sincerely, David.

Are you able to try the argus_camera for multiple session?

I am able to record many frames in a row sometimes (can even get to 60k+ frames) on 1 session, and after the camera is stuck on acquireFrame() I have to restart the process in order to get another picture from that camera.

That being said, after the camera is stuck I kill the process and restart it and the cameras work again until 1 of them is stuck on acquireFrame() again

Did you check every sensor individually to confirm each of them are good?

The other cameras are still working after acquireFrame() blocks one of them. I can see that the cameras identify movement in their ROI.

Any error log?
Try to manual enable the argus_daemon to check if any error. Also did you try the argus_camera APP to launch multi session for multiple sensor?

sudo su
kill the process of argus_daemon
/usr/sbin/argus_daemon
launch camera from another console

Hi Shane, truly sorry for the very late reply.
I tried killing the argus_daemon and launching from another console but that didnt seem to have any effect. As mentioned before, once I receive the STATUS_TIMEOUT every call to acquireFrame returns with a timeout.
Below is the whole loop I am attempting to acquire a frame with, hopefully it will help us progress towards a solution:

Argus::Status status;
Argus::UniqueObj<EGLStream::Frame> frame;
printf("(%d) entering acquireFrame loop in threadExecute zzzz\n", m_id);
do{
     frame = (Argus::UniqueObj<EGLStream::Frame>)iFrameConsumer->acquireFrame(ACQUIRE_FRAME_TIME_OUT, &status);
     if (!frame) {
          switch(status){
                case STATUS_DISCONNECTED:{
                      printf("{%d} camera disconnected threadExecute zzzzzz\n", m_id);
                      requestShutdown();
                      break;
                }
                case STATUS_UNAVAILABLE:{
                      printf("(%d) release frame due to status unavailable threadExecute zzzzz\n", m_id);
                      exit(0);
                }
                case STATUS_TIMEOUT:{
                      printf("(%d) STATUS_TIMEOUT at threadExecute - calling frame reset zzzzz\n", m_id);
                      frame.reset();
                      printf("(%d) frame successfully restarted at threadExecute zzzzz\n", m_id);
                      break;
                }
                default: {
                      printf("(%d) entered default status. status = 0x%x zzzzz\n", m_id, status);
                      break;
                }
          }
     } else break;
} while (true);
printf("(%d) finished acquireFrame loop in threadExecute  zzzzz\n", m_id);

The result i get is as follows:

(1) STATUS_TIMEOUT at threadExecute - calling frame reset zzzzz
(1) frame successfully restarted at threadExecute zzzzz
(1) STATUS_TIMEOUT at threadExecute - calling frame reset zzzzz
(1) frame successfully restarted at threadExecute zzzzz
(1) STATUS_TIMEOUT at threadExecute - calling frame reset zzzzz
(1) frame successfully restarted at threadExecute zzzzz
(1) STATUS_TIMEOUT at threadExecute - calling frame reset zzzzz
(1) frame successfully restarted at threadExecute zzzzz
(1) STATUS_TIMEOUT at threadExecute - calling frame reset zzzzz
(1) frame successfully restarted at threadExecute zzzzz

As mentioned before, every time a different camera fails and receives the STATUS_TIMEOUT indefinitely.
I hope including the whole part of the code might help resolve the issue, and again thank you for taking the time reading this and replying.
Sincerely, David.

1 Like

@david
I would like you to verify the argus_camera to verify the problem is argus or sensor relative or even your implementation cause the problem.

Has there been any progress on this? I’m seeing the exact same problem. I also noticed that timeout values smaller than 1-second don’t seem to work well with acquireFrame() in libargus. What’s going on with it?

If we could just get access to the libargus source code, as a community, I’m sure that we could solve these problems, and do it quickly. I see lots of folks waiting months and months for responses from Nvidia on these forums, and rarely do I see solutions posted. Very frustrating.

BTW, I’m using a TX2.

1 Like

I meet the same problem.Have you did it?