Enabling metadata causes errors

I would like to enable metadata in order to access information about acquired frames. I adapted the code from the argus yuvJpeg sample in 32.1. However, if I call setMetdataEnable(true) on the IEGLOutputStreamSettings before creating the output stream I get the following set of error messages repeated a few times:

SCF: Error NotImplemented: Failed to set the metadata for the frame (propagating from src/services/gl/EGLStreamProducer.cpp, function setFrameMetadata(), line 478)
SCF: Error NotImplemented:  (propagating from src/services/gl/EGLStreamProducer.cpp, function presentBufferInternal(), line 543)
SCF: Error InvalidState: Buffer is not locked (in src/api/Buffer.cpp, function unlock(), line 448)
SCF: Error InvalidState: Element not found (in /media/jerry/Hitachi/L4T/T186/r32.x/camera/utils/nvcamerautils/inc/Vector.h, function remove(), line 172)
SCF: Error InvalidState:  (propagating from src/services/gl/EGLStreamProducer.cpp, function returnFrame(), line 394)

After which this is repeated until the program terminates:

SCF: Error InvalidState: Session has suffered a critical failure (in src/api/Session.cpp, function capture(), line 667)
(Argus) Error InvalidState:  (propagating from src/api/ScfCaptureThread.cpp, function run(), line 109)

If I don’t enable metadata (don’t call setMetadataEnable) then everything runs fine. I’m wondering what the issue could be?

Hi,
There is deviation between r28 and r32. You may refer to yuvJpeg of r32.1.

I was already using 32.1. I figured out that the problem only occurs when running as single process (linking against libnvargus). If I link against libnvargus_socketclient with nvargus-daemon running the issue no longer occurs. However, running as multiprocess has another issue… if metadata is enabled acquireFrame() hangs after getting ~10 frames.

Hi,
Please share a patch on yuvJpeg so that we can reproduce the issue. Thanks.

I actually don’t need to modify the yuvJpeg sample at all to produce these issues since it calls setMetadataEnable(true) already. For me the default version built by:

cmake …
make

Has the issue of acquiring only 10 frames regardless of the duration it is set to run for (after the tenth frame it goes into acquireFrame and just never returns). If I build it with:

cmake -DDISABLE_MULTIPROCESS=ON …
make

Then I get the error messages reported in my original post.

hello kes25c,

could you please help to narrow down the issue.
is the issue still happen by running with multi-process mode.
thanks

Hi kes25c,

We can’t reproduce your issue with r32.1/r32.2 on TX2 + default camera board.
Could you confirm your steps is the same with us?

List our steps:

Flash JetPack-4.2 (or JetPack-4.2.1) on TX2
cp /usr/src/tegra_multimedia_api/ .
cd /usr/src/tegra_multimedia_api/argus
mkdir build && cd build
cmake ..
make
sudo make install

Before building, please install requirements apps.
You can check README.txt from: tegra_multimedia_api/argus/README.txt

I went back and rebuilt everything, but still observe the same behavior for single (get the error messages show in the first post) and multi (captures 10 frames then hangs in acquireFrame) process cases. This is using 32.1, but using a custom board with six cameras. I will follow up with the supplier. Do you have any ideas on what the issue might be or what might be wrong based on the error messages? Thanks.

Kes25c & JerryChang,

We believe this is due to the patch for PWL decompression fix (D3 has included this in our firmware). Jerry knows about this and has already provided us a fix. We will send it to you Kes25c.

Thanks,
Jason