This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4VEN-Q1: The gstreamer pipeline containing the tiovxisp plugin encountered an error while switching states

Part Number: TDA4VEN-Q1

Tool/software:

Hi TI experts,

We are conducting an experiment on the state switching of the gstreamer pipeline in the following environment:
1、 TDA4VEN EVM
2、10.01 EdgeAI SDK.https://www.ti.com.cn/tool/PROCESSOR-SDK-AM67A

3、HDMI monitor

4、imx219 camera
What we hope to achieve is to initialize the pipeline first, then set the pipeline status to PLAYING, set the pipeline status to READY after a few seconds, and then switch the pipeline status back to PLAYING after a few seconds. When using an imx219->tiovxisp ->tiovxmultiscaler ->kmssink pipeline and switching back from READY state to PLAYING state, the program reports the following error:

APP: Init ... !!!
    43.156919 s: MEM: Init ... !!!
    43.157022 s: MEM: Initialized DMA HEAP (fd=10) !!!
    43.157350 s: MEM: Init ... Done !!!
    43.157398 s: IPC: Init ... !!!
    43.227239 s: IPC: Init ... Done !!!
REMOTE_SERVICE: Init ... !!!
REMOTE_SERVICE: Init ... Done !!!
    43.239583 s: GTC Frequency = 200 MHz
APP: Init ... Done !!!
    43.243848 s:  VX_ZONE_INFO: Globally Enabled VX_ZONE_ERROR
    43.243908 s:  VX_ZONE_INFO: Globally Enabled VX_ZONE_WARNING
    43.243918 s:  VX_ZONE_INFO: Globally Enabled VX_ZONE_INFO
    43.245788 s:  VX_ZONE_INFO: [tivxPlatformCreateTargetId:134] Added target MPU-0
    43.246050 s:  VX_ZONE_INFO: [tivxPlatformCreateTargetId:134] Added target MPU-1
    43.246285 s:  VX_ZONE_INFO: [tivxPlatformCreateTargetId:134] Added target MPU-2
    43.246510 s:  VX_ZONE_INFO: [tivxPlatformCreateTargetId:134] Added target MPU-3
    43.246538 s:  VX_ZONE_INFO: [tivxInitLocal:126] Initialization Done !!!
    43.246600 s:  VX_ZONE_INFO: Globally Disabled VX_ZONE_INFO
    53.459114 s:  VX_ZONE_ERROR: [vxGetStatus:1178] Reference is NULL

** (gst_test:1449): CRITICAL **: 17:55:56.763: gst_tiovx_get_size_from_exemplar: assertion 'VX_SUCCESS == vxGetStatus (exemplar)' failed

The phenomenon observed is that the monitor continues to display the last frame of the camera. If you use GST_DEBUG=3 to view the detailed error. The 21st line points out errors related to ISP:

0:00:00.210281570  3083     0x16139670 WARN                 kmssink gstkmssink.c:2101:_validate_and_set_external_fd:<kmssink0> Can't set fd... driver-name already set.
0:00:00.339272370  3083 0xffff90000b70 WARN                 v4l2src gstv4l2src.c:987:gst_v4l2src_query:<v4l2src0> Can't give latency since framerate isn't fixated !
0:00:00.339396670  3083 0xffff90000b70 WARN              aggregator gstaggregator.c:2159:gst_aggregator_query_latency_unlocked:<tiovxisp0> Latency query failed
0:00:00.340113440  3083 0xffff90000f70 WARN                    v4l2 gstv4l2object.c:4666:gst_v4l2_object_get_crop_rect:<v4l2src0:src> VIDIOC_CROPCAP failed
0:00:00.340265730  3083 0xffff90000b70 WARN                 v4l2src gstv4l2src.c:987:gst_v4l2src_query:<v4l2src0> Can't give latency since framerate isn't fixated !
0:00:00.340329825  3083 0xffff90000b70 WARN              aggregator gstaggregator.c:2159:gst_aggregator_query_latency_unlocked:<tiovxisp0> Latency query failed
0:00:00.342638440  3083 0xffff90000b70 WARN                 v4l2src gstv4l2src.c:987:gst_v4l2src_query:<v4l2src0> Can't give latency since framerate isn't fixated !
0:00:00.342719370  3083 0xffff90000f70 WARN                    v4l2 gstv4l2object.c:4666:gst_v4l2_object_get_crop_rect:<v4l2src0:src> VIDIOC_CROPCAP failed
0:00:00.342742460  3083 0xffff90000b70 WARN              aggregator gstaggregator.c:2159:gst_aggregator_query_latency_unlocked:<tiovxisp0> Latency query failed
0:00:00.417617115  3083 0xffff90000f70 WARN          v4l2bufferpool gstv4l2bufferpool.c:1334:gst_v4l2_buffer_pool_dqbuf:<v4l2src0:pool0:src> Driver should never set v4l2_buffer.field to ANY
0:00:00.419119580  3083 0xffff90000b70 FIXME               basesink gstbasesink.c:3399:gst_base_sink_default_event:<kmssink0> stream-start event without group-id. Consider implementing group-id handling in the upstream elements
0:00:00.448987640  3083 0xffff90000b70 WARN            kmsallocator gstkmsallocator.c:526:gst_kms_allocator_dmabuf_import:<KMSMemory::allocator> Failed to close GEM handle: Invalid argument 22
0:00:00.451454290  3083 0xffff90000f70 WARN                    v4l2 gstv4l2object.c:4666:gst_v4l2_object_get_crop_rect:<v4l2src0:src> VIDIOC_CROPCAP failed
0:00:00.469899205  3083 0xffff90000b70 FIXME             aggregator gstaggregator.c:1448:gst_aggregator_aggregate_func:<tiovxisp0> Subclass should call gst_aggregator_selected_samples() from its aggregate implementation.
0:00:00.481082960  3083 0xffff90000b70 WARN            kmsallocator gstkmsallocator.c:526:gst_kms_allocator_dmabuf_import:<KMSMemory::allocator> Failed to close GEM handle: Invalid argument 22
0:00:05.345807770  3083 0xffff90000b70 WARN               tiovxsimo gsttiovxsimo.c:1385:gst_tiovx_simo_push_buffers:<tiovxmultiscaler0> Error pushing to pad: <tiovxmultiscaler0:src_0>
0:00:10.408638685  3083 0xffff90000b70 WARN                    v4l2 gstv4l2object.c:4666:gst_v4l2_object_get_crop_rect:<v4l2src0:src> VIDIOC_CROPCAP failed
   328.651388 s:  VX_ZONE_ERROR: [vxGetStatus:1178] Reference is NULL

** (gst_test:3083): CRITICAL **: 18:00:31.955: gst_tiovx_get_size_from_exemplar: assertion 'VX_SUCCESS == vxGetStatus (exemplar)' failed
0:00:10.411360450  3083 0xffff90001170 ERROR              tiovxmiso gsttiovxmiso.c:866:gst_tiovx_miso_propose_allocation:<tiovxisp0> Failed to get size from exemplar
0:00:10.411538560  3083 0xffff90000b70 WARN                    v4l2 gstv4l2object.c:4666:gst_v4l2_object_get_crop_rect:<v4l2src0:src> VIDIOC_CROPCAP failed
0:00:10.412045970  3083 0xffff90000b70 WARN                    v4l2 gstv4l2object.c:5471:gst_v4l2_object_decide_allocation:<v4l2src0> error: No downstream pool to import from.
0:00:10.412098380  3083 0xffff90000b70 WARN                    v4l2 gstv4l2object.c:5471:gst_v4l2_object_decide_allocation:<v4l2src0> error: When importing DMABUF or USERPTR, we need a pool to import from
0:00:10.412254215  3083 0xffff90000b70 WARN                 basesrc gstbasesrc.c:3354:gst_base_src_prepare_allocation:<v4l2src0> Subclass failed to decide allocation
0:00:10.412346040  3083 0xffff90000b70 WARN                 basesrc gstbasesrc.c:3134:gst_base_src_loop:<v4l2src0> error: Internal data stream error.
0:00:10.412378110  3083 0xffff90000b70 WARN                 basesrc gstbasesrc.c:3134:gst_base_src_loop:<v4l2src0> error: streaming stopped, reason not-negotiated (-4)
0:00:10.413021135  3083 0xffff90001170 FIXME               basesink gstbasesink.c:3399:gst_base_sink_default_event:<kmssink0> stream-start event without group-id. Consider implementing group-id handling in the upstream elements

If we do not use the imx219 camera and ISP and instead use testsrc, we can successfully switch the pipeline state.

Both gstreamer pipelines are included in the source code of the attachment. The attachment source code we provide can be compiled and run directly on the EVM board through cmake. When input parameter 1, the testsrc pipeline is executed, and when input parameter 2, the imx219 pipeline is executed. This way, TI experts can reproduce the problems we encountered on the EVM board. We want to know if the ISP plugin in the pipeline does not support such state switching.

best regards

yangtian

ti_gst.zip