eglstream with gstreamer pipe problem in TX1 28.2.1 with Jetpack 3.3

Hello Gentlemen

We force a camera problem in TX1 r28.2.1 with Jetpack 3.3.
Currently, we use the libargus to create a eglstream, and use the gstreamer pipe to get the frame by appsink.
And sometime we will get the error log and the pipe will freez, so we can’t capture the new frame.

BTW, we didn’t find this problem used the same pipe in TX1 r24.2.1.
Do you have information regarding this or maybe any knowledge regarding this issue?

NvRmChannelSubmit: NvError_IoctlFailed with error code 22
NvRmPrivFlush: NvRmChannelSubmit failed (err = 196623, SyncPointIdx = 52, SyncPointValue = 0)
0:04:01.276558564 20599 0x727680 ERROR nveglstream gstnveglstreamsrc.c:563:gst_nvconsumer_buffer_pool_ree EGLStream Frame.
NvRmPrivFlush: NvRmChannelSubmit failed (err = 196623, SyncPointIdx = 52, SyncPointValue = 0)
0:04:01.296291928 20599 0x727680 ERROR nveglstream gstnveglstreamsrc.c:563:gst_nvconsumer_buffer_pool_ree EGLStream Frame.
NvRmPrivFlush: NvRmChannelSubmit failed (err = 196623, SyncPointIdx = 52, SyncPointValue = 0)
0:04:01.304501151 20599 0x727680 ERROR nveglstream gstnveglstreamsrc.c:563:gst_nvconsumer_buffer_pool_ree EGLStream Frame.
NvRmPrivFlush: NvRmChannelSubmit failed (err = 196623, SyncPointIdx = 52, SyncPointValue = 0)
0:04:01.312578394 20599 0x727680 ERROR nveglstream gstnveglstreamsrc.c:563:gst_nvconsumer_buffer_pool_ree EGLStream Frame.

Hi,
Your gstreamer pipine is [nveglstreamsrc ! video/x-raw(memory:NVMM),format=NV12 ! appsink]? Please share the pipeline.

Hi DaneLLL,

Sorry bro.,
we used the “tegra_multimedia_api/argus/samples/gstVideoEncode” sample to modify.
Let me show the modified pipine:
nveglstreamsrc eglstream= display=xx ! ‘video/x-raw(memory:NVMM), width=1280, height=720, format=(string)NV12, framerate=(fraction)30/1’ ! queue ! nvvidconv ! ‘video/x-raw, width=1280, height=720, format=(string)BGRx, framerate=(fraction)30/1’ ! videoconvert ! ‘video/x-raw, width=1280, height=720, format=(string)BGR, framerate=(fraction)30/1’ ! appsink

Best Regards
Walker

Hi,
Please try to set output-buffers in nvvidconv:

nveglstreamsrc eglstream=<by argus> display=xx ! 'video/x-raw(memory:NVMM), width=1280, height=720, format=(string)NV12, framerate=(fraction)30/1' ! queue ! nvvidconv <b>output-buffers=10</b> ! 'video/x-raw, width=1280, height=720, format=(string)BGRx, framerate=(fraction)30/1' ! videoconvert ! 'video/x-raw, width=1280, height=720, format=(string)BGR, framerate=(fraction)30/1' ! appsink

Or try nvarguscamerasrc

$ gst-launch-1.0 <b>nvarguscamerasrc</b> ! 'video/x-raw(memory:NVMM), width=1280, height=720, format=(string)NV12, framerate=(fraction)30/1' ! queue ! nvvidconv ! 'video/x-raw, width=1280, height=720, format=(string)BGRx, framerate=(fraction)30/1' ! videoconvert ! 'video/x-raw, width=1280, height=720, format=(string)BGR, framerate=(fraction)30/1' ! appsink

Hi DaneLLL,

This process will be killed after a few moment.

nvidia@tegra-ubuntu:~/catkin_ws$ gst-launch-1.0 nvarguscamerasrc ! ‘video/x-raw(memory:NVMM), width=1280, height=720, format=(string)NV12, framerate=(fraction)30/1’ ! queue ! nvvidconv ! ‘video/x-raw, width=1280, height=720, format=(string)BGRx, framerate=(fraction)30/1’ ! videoconvert ! ‘video/x-raw, width=1280, height=720, format=(string)BGR, framerate=(fraction)30/1’ ! appsink
Setting pipeline to PAUSED …
Pipeline is live and does not need PREROLL …
0:00:00.196851327 24830 0x59f800 FIXME default gstutils.c:3766:gst_pad_create_stream_id_internal:nvarguscamerasrc0:src Creating random stream-id, consider implementing a deterministic way of creating a stream-id
Setting pipeline to PLAYING …
New clock: GstSystemClock
GST_ARGUS: Running with following settings:
Camera index = 0
Camera mode = 0
Output Stream W = 1280 H = 720
seconds to Run = 0
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected…
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
Killed

Best Regards,
Walker

Hi,
Running appsink in gst-launch-1.0 seems not good on gstreamer 1.8.3. You should not hit it if you adapt nvarguscamerasrc into your code.

Hi DaneLLL,

Thanks for your friendly support! :)

In fact, we also found the error when we used the eglstream with gstreamer rtmpsink,
so, could you have any idea to avoid this error?
because we need use these camera features for demonstration.

Best Regards,
Walker

Hi,
Do you mean you cannot use nvarguscamerasrc?

Hi DaneLLL,

Yup, i can’t use nvarguscamerasrc, and we prefer use the "nveglstreamsrc " in source code level develop.

Because we have multi-feature with camera (like: recording, streaming, and frame capturing),
and the argus could provide multi-output-streaming at the same time,
so do you have any idea about the error log?

Because we found the error was occurred not only frame capturing but also streaming/recording some time.

NvRmChannelSubmit: NvError_IoctlFailed with error code 22
NvRmPrivFlush: NvRmChannelSubmit failed (err = 196623, SyncPointIdx = 52, SyncPointValue = 0)
0:04:01.276558564 20599 0x727680 ERROR nveglstream gstnveglstreamsrc.c:563:gst_nvconsumer_buffer_pool_ree EGLStream Frame.
NvRmPrivFlush: NvRmChannelSubmit failed (err = 196623, SyncPointIdx = 52, SyncPointValue = 0)
0:04:01.296291928 20599 0x727680 ERROR nveglstream gstnveglstreamsrc.c:563:gst_nvconsumer_buffer_pool_ree EGLStream Frame.
NvRmPrivFlush: NvRmChannelSubmit failed (err = 196623, SyncPointIdx = 52, SyncPointValue = 0)
0

Best Regards,
Walker

Hi,
We need to reproduce the issue so that we can debug further. The reference sample is gstVideoEncode. Please give a patch on it so that we can reproduce it with default camera ov5693.

Hi DaneLLL,

I have upload the source file in google driver, please refer the link:


We could reproduce this issue randomly with the sample.
Thank you very much. :)

nvidia@tegra-ubuntu:~/tegra_multimedia_api/argus/build/samples/gstVideoEncode$ ./argus_gstvideoencode
[Walker]Executing Argus Sample: argus_gstvideoencode
Argus Version: 0.96.2 (multi-process)
[gstreamer] gstreamer pass to cast GstElement into GstPipeline
[gstreamer] gstreamer transitioning pipeline to GST_STATE_PLAYING
PREVIEW CONSUMER: Creating OpenGL context.
PREVIEW CONSUMER: Connecting to EGLStream(s).
PREVIEW CONSUMER: Connected to stream(s).
PREVIEW CONSUMER: Waiting until producer(s) connect…
PREVIEW CONSUMER: Producer(s) connected; continuing.
PREVIEW CONSUMER: Acquired frame 1. Rendering.
PREVIEW CONSUMER: Acquired frame 2. Rendering.
PREVIEW CONSUMER: Acquired frame 3. Rendering.
PREVIEW CONSUMER: Acquired frame 4. Rendering.
PREVIEW CONSUMER: Acquired frame 5. Rendering.
[gstreamer] gstreamer decoder on_preroll
PREVIEW CONSUMER: Acquired frame 6. Rendering.
PREVIEW CONSUMER: Acquired frame 7. Rendering.
NvRmChannelSubmit: NvError_IoctlFailed with error code 22
NvRmPrivFlush: NvRmChannelSubmit failed (err = 196623, SyncPointIdx = 51, SyncPointValue = 0)
PREVIEW CONSUMER: Acquired frame 8. Rendering.
PREVIEW CONSUMER: Acquired frame 9. Rendering.
PREVIEW CONSUMER: Acquired frame 10. Rendering.
NvRmPrivFlush: NvRmChannelSubmit failed (err = 196623, SyncPointIdx = 51, SyncPointValue = 0)
PREVIEW CONSUMER: Acquired frame 11. Rendering.
NvRmPrivFlush: NvRmChannelSubmit failed (err = 196623, SyncPointIdx = 51, SyncPointValue = 0)
PREVIEW CONSUMER: Acquired frame 12. Rendering.
PREVIEW CONSUMER: Acquired frame 13. Rendering.

BRs,
Walker

Hi,
Please try attachment. We have verified it with the test code. However, it looks to be an issue in the test code. It hangs in termination with 2/5 failure rate.
Fro double confirmation, we try argus_gstvideoencode with the attachment and do not hit the hang issue.
r28_2_libgstnveglstreamsrc.zip (14.1 KB)

Hi DaneLLL,

Thanks for your help.

We had tested the attached library with replaced the file at this path:
/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnveglstreamsrc.so
md5sum: 4cabc936b09f705b3be9f98efef161ef

But the problem still occurred randomly,
Do you have any suggestion for running safe with the test code?

nvidia@tegra-ubuntu:~/tegra_multimedia_api/argus/build$ md5sum /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnveglstreamsrc.so 
4cabc936b09f705b3be9f98efef161ef  /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnveglstreamsrc.so
nvidia@tegra-ubuntu:~/tegra_multimedia_api/argus/build$ ./samples/gstVideoEncode/argus_gstvideoencode 
[Walker]Executing Argus Sample: argus_gstvideoencode
Argus Version: 0.96.2 (multi-process)
[gstreamer] gstreamer pass to cast GstElement into GstPipeline
[gstreamer] gstreamer transitioning pipeline to GST_STATE_PLAYING
PREVIEW CONSUMER: Creating OpenGL context.
PREVIEW CONSUMER: Connecting to EGLStream(s).
PREVIEW CONSUMER: Connected to stream(s).
PREVIEW CONSUMER: Waiting until producer(s) connect...
PREVIEW CONSUMER: Producer(s) connected; continuing.
PREVIEW CONSUMER: Acquired frame 1. Rendering.
PREVIEW CONSUMER: Acquired frame 2. Rendering.
PREVIEW CONSUMER: Acquired frame 3. Rendering.
PREVIEW CONSUMER: Acquired frame 4. Rendering.
PREVIEW CONSUMER: Acquired frame 5. Rendering.
[gstreamer] gstreamer decoder on_preroll
PREVIEW CONSUMER: Acquired frame 6. Rendering.
PREVIEW CONSUMER: Acquired frame 7. Rendering.
NvRmChannelSubmit: NvError_IoctlFailed with error code 22
NvRmPrivFlush: NvRmChannelSubmit failed (err = 196623, SyncPointIdx = 51, SyncPointValue = 0)
PREVIEW CONSUMER: Acquired frame 8. Rendering.
PREVIEW CONSUMER: Acquired frame 9. Rendering.
PREVIEW CONSUMER: Acquired frame 10. Rendering.
NvRmPrivFlush: NvRmChannelSubmit failed (err = 196623, SyncPointIdx = 51, SyncPointValue = 0)
PREVIEW CONSUMER: Acquired frame 11. Rendering.
NvRmPrivFlush: NvRmChannelSubmit failed (err = 196623, SyncPointIdx = 51, SyncPointValue = 0)
PREVIEW CONSUMER: Acquired frame 12. Rendering.
PREVIEW CONSUMER: Acquired frame 13. Rendering.
NvRmPrivFlush: NvRmChannelSubmit failed (err = 196623, SyncPointIdx = 51, SyncPointValue = 0)

Best Regards,
Walker

Hi,
we will try to reproduce the issue. What is the failure rate in your tests?

Hi DaneLLL,

The failure rate is almost 60%.

Best Regards,
Walker

Hi,
We do not hit the issue in 30+ runs. Probably you do not overwrite the prebuilt lib successfully?

Hi DaneLLL,

Got it, we will try again later.

As comment #14, Are the library folder and md5sum same with your platform?
and did you test the library with the test code in #11 (appsink)?

Best Regards,
Walker

Hi,

md5sum is identical

danel@ce-tw-daneliu:~/Public$ md5sum libgstnveglstreamsrc.so
4cabc936b09f705b3be9f98efef161ef  libgstnveglstreamsrc.so

Yes, we run the test code in #11

Hi DaneLLL,

Sorry bro., we had reproduced this issue again.
Could you try to increase the program time with modify the DEFAULT_CAPTURE_TIME in test code?
Because we have trying the overnight test, and we found the issue occurred when program is running nearly 10 minutes.

Best Regards,
Walker

Hi,
we tried to reproduce it but did not hit the issue in 10+ hour run. Do you observe it on default carrier board + camera ov5693?