AR# 71163

|

2017.3/4 Zynq UltraScale+ MPSoC VCU: GStreamer OMX H.264 decoder timeout when transition from GST_STATE_PLAY to GST_STATE_NULL

Description

On Zynq UltraScale+ MPSoC VCU devices, when running the gstreamer pipeline (HDMI-RX --> H.264 Encode --> H.264 Decode --> DisplayPort or MP4 File --> H.264 Decode --> DisplayPort) I observe the gst_omx timeout as shown below.

When attempting to transition a GStreamer pipeline from GST_STATE_PLAY to GST_STATE_NULL, in which a H.264 decoder is a GStreamer Element, the transition clearly stalls because of a timeout within the H.264 decoder element.

When playing an H.264 stream from a file, if I stop the stream before it reaches the end of the clip, the H.264 GStreamer decoder element times out before the code in which the pipeline is executing can resume.

root@vcu-zcu106-2017_3:~# /sbin/devmem 0xfd370008 w 0xF
root@vcu-zcu106-2017_3:~# /sbin/devmem 0xfd37001C w 0x2
root@vcu-zcu106-2017_3:~# /sbin/devmem 0xfd380008 w 0x5
root@vcu-zcu106-2017_3:~# /sbin/devmem 0xfd38001c w 0x2
root@vcu-zcu106-2017_3:~# /sbin/devmem 0xfd390008 w 0x2
root@vcu-zcu106-2017_3:~# /sbin/devmem 0xfd39001c w 0x2
root@vcu-zcu106-2017_3:~# /sbin/devmem 0xfd3a0008 w 0x3
root@vcu-zcu106-2017_3:~# /sbin/devmem 0xfd3a001c w 0x2
root@vcu-zcu106-2017_3:~# /sbin/devmem 0xfd3b0008 w 0x2
root@vcu-zcu106-2017_3:~# /sbin/devmem 0xfd3b001c w 0x2
root@vcu-zcu106-2017_3:~#
root@vcu-zcu106-2017_3:~# /sbin/devmem 0xfd380004 w 0xF
root@vcu-zcu106-2017_3:~# /sbin/devmem 0xfd390004 w 0xF
root@vcu-zcu106-2017_3:~# /sbin/devmem 0xfd3A0004 w 0xF
root@vcu-zcu106-2017_3:~# /sbin/devmem 0xfd3B0004 w 0xF
root@vcu-zcu106-2017_3:~# /sbin/devmem 0xfd380018 w 0xF
root@vcu-zcu106-2017_3:~# /sbin/devmem 0xfd390018 w 0xF
root@vcu-zcu106-2017_3:~# /sbin/devmem 0xfd3A0018 w 0xF
root@vcu-zcu106-2017_3:~# /sbin/devmem 0xfd3B0018 w 0xF
root@vcu-zcu106-2017_3:~#
root@vcu-zcu106-2017_3:~# killall modetest
killall: modetest: no process killed
root@vcu-zcu106-2017_3:~#
root@vcu-zcu106-2017_3:~# export GST_DEBUG=3
root@vcu-zcu106-2017_3:~# cd /media/card/
root@vcu-zcu106-2017_3:/media/card# ls
BOOT.BIN                   autostart.sh    bbb_sunflower_2160p_30fps_normal.mp4  bin       play_example                sintel_trailer-1080p.mp4
System Volume Information  avc-gst-env.sh  bbb_sunflower_2160p_60fps_normal.mp4  image.ub  prepare_avc_environment.sh  vcu
root@vcu-zcu106-2017_3:/media/card#
root@vcu-zcu106-2017_3:/media/card# sleep 9999d | modetest -M xilinx_drm -s 29:1920x1080@AR24 -w 25:alpha:1 &
[1] 2472
root@vcu-zcu106-2017_3:/media/card# setting mode 1920x1080-60Hz@AR24 on connectors 29, crtc 27
root@vcu-zcu106-2017_3:/media/card#
root@vcu-zcu106-2017_3:/media/card# ./play_example sintel_trailer-1080p.mp4
0:00:00.142815122  2477     0x3d3956c0 WARN                 default gstsf.c:98:gst_sf_create_audio_template_caps: format 0x120000: 'AVR (Audio Visual Research)' is not mapped
0:00:00.142943484  2477     0x3d3956c0 WARN                 default gstsf.c:98:gst_sf_create_audio_template_caps: format 0x180000: 'CAF (Apple Core Audio File)' is not mapped
0:00:00.142973557  2477     0x3d3956c0 WARN                 default gstsf.c:98:gst_sf_create_audio_template_caps: format 0x100000: 'HTK (HMM Tool Kit)' is not mapped
0:00:00.143005781  2477     0x3d3956c0 WARN                 default gstsf.c:98:gst_sf_create_audio_template_caps: format 0xc0000: 'MAT4 (GNU Octave 2.0 / Matlab 4.2)' is not mapped
0:00:00.143033523  2477     0x3d3956c0 WARN                 default gstsf.c:98:gst_sf_create_audio_template_caps: format 0xd0000: 'MAT5 (GNU Octave 2.1 / Matlab 5.0)' is not mapped
0:00:00.143060986  2477     0x3d3956c0 WARN                 default gstsf.c:98:gst_sf_create_audio_template_caps: format 0x210000: 'MPC (Akai MPC 2k)' is not mapped
0:00:00.143090779  2477     0x3d3956c0 WARN                 default gstsf.c:98:gst_sf_create_audio_template_caps: format 0xe0000: 'PVF (Portable Voice Format)' is not mapped
0:00:00.143120612  2477     0x3d3956c0 WARN                 default gstsf.c:98:gst_sf_create_audio_template_caps: format 0x160000: 'SD2 (Sound Designer II)' is not mapped
0:00:00.143158636  2477     0x3d3956c0 WARN                 default gstsf.c:98:gst_sf_create_audio_template_caps: format 0x190000: 'WVE (Psion Series 3)' is not mapped
KiProH26x::InstantiateGStreamer: GStream Version:1.8
CreatePipeline: Ln:107 Setting to PLAYING state
0:00:00.535072397  2475     0x3e78e560 WARN                 basesrc gstbasesrc.c:3489:gst_base_src_start_complete:<File Source> pad not activated yet
CreatePipeline: Ln:109 PLAYING state set
0:00:00.541905731  2475     0x3e77eb70 WARN                 qtdemux qtdemux.c:2651:qtdemux_parse_trex:<QT Demux> failed to find fragment defaults for stream 1
0:00:00.542081748  2475     0x3e77eb70 WARN                 qtdemux qtdemux.c:2651:qtdemux_parse_trex:<QT Demux> failed to find fragment defaults for stream 2
0:00:00.542248215  2475     0x3e77eb70 WARN                 basesrc gstbasesrc.c:2396:gst_base_src_update_length:<File Source> processing at or past EOS
OnPadAdded: ==== Dynamic pad created -- Linking QT Demuxer to the H.26x Parser ====
OnPadAdded: ==== Dynamic pad created -- Linking QT Demuxer to the H.26x Parser ====
0:00:00.542855376  2475     0x3e77eb70 FIXME           videodecoder gstvideodecoder.c:946:gst_video_decoder_drain_out:<Decoder> Sub-class should implement drain()
0:00:00.718278658  2475     0x3e77e850 WARN            kmsallocator gstkmsallocator.c:550:gst_kms_allocator_dmabuf_import:<KMSMemory::allocator> Failed to close GEM handle: Invalid argument 22
0:00:00.750550115  2475     0x3e77e850 WARN            kmsallocator gstkmsallocator.c:550:gst_kms_allocator_dmabuf_import:<KMSMemory::allocator> Failed to close GEM handle: Invalid argument 22
0:00:00.767253035  2475     0x3e77e850 WARN            kmsallocator gstkmsallocator.c:550:gst_kms_allocator_dmabuf_import:<KMSMemory::allocator> Failed to close GEM handle: Invalid argument 22
0:00:00.783873397  2475     0x3e77e850 WARN            kmsallocator gstkmsallocator.c:550:gst_kms_allocator_dmabuf_import:<KMSMemory::allocator> Failed to close GEM handle: Invalid argument 22
0:00:00.800541014  2475     0x3e77e850 WARN            kmsallocator gstkmsallocator.c:550:gst_kms_allocator_dmabuf_import:<KMSMemory::allocator> Failed to close GEM handle: Invalid argument 22
0:00:00.817210741  2475     0x3e77e850 WARN            kmsallocator gstkmsallocator.c:550:gst_kms_allocator_dmabuf_import:<KMSMemory::allocator> Failed to close GEM handle: Invalid argument 22
0:00:00.833884199  2475     0x3e77e850 WARN            kmsallocator gstkmsallocator.c:550:gst_kms_allocator_dmabuf_import:<KMSMemory::allocator> Failed to close GEM handle: Invalid argument 22
0:00:00.850544065  2475     0x3e77e850 WARN            kmsallocator gstkmsallocator.c:550:gst_kms_allocator_dmabuf_import:<KMSMemory::allocator> Failed to close GEM handle: Invalid argument 22
0:00:00.867220862  2475     0x3e77e850 WARN            kmsallocator gstkmsallocator.c:550:gst_kms_allocator_dmabuf_import:<KMSMemory::allocator> Failed to close GEM handle: Invalid argument 22
0:00:00.883916912  2475     0x3e77e850 WARN            kmsallocator gstkmsallocator.c:550:gst_kms_allocator_dmabuf_import:<KMSMemory::allocator> Failed to close GEM handle: Invalid argument 22
0:00:00.900548575  2475     0x3e77e850 WARN            kmsallocator gstkmsallocator.c:550:gst_kms_allocator_dmabuf_import:<KMSMemory::allocator> Failed to close GEM handle: Invalid argument 22
0:00:00.917220432  2475     0x3e77e850 WARN            kmsallocator gstkmsallocator.c:550:gst_kms_allocator_dmabuf_import:<KMSMemory::allocator> Failed to close GEM handle: Invalid argument 22
0:00:00.933883669  2475     0x3e77e850 WARN            kmsallocator gstkmsallocator.c:550:gst_kms_allocator_dmabuf_import:<KMSMemory::allocator> Failed to close GEM handle: Invalid argument 22
0:00:00.950569927  2475     0x3e77e850 WARN            kmsallocator gstkmsallocator.c:550:gst_kms_allocator_dmabuf_import:<KMSMemory::allocator> Failed to close GEM handle: Invalid argument 22
0:00:00.967225623  2475     0x3e77e850 WARN            kmsallocator gstkmsallocator.c:550:gst_kms_allocator_dmabuf_import:<KMSMemory::allocator> Failed to close GEM handle: Invalid argument 22
0:00:00.983891719  2475     0x3e77e850 WARN            kmsallocator gstkmsallocator.c:550:gst_kms_allocator_dmabuf_import:<KMSMemory::allocator> Failed to close GEM handle: Invalid argument 22
0:00:01.000554786  2475     0x3e77e850 WARN            kmsallocator gstkmsallocator.c:550:gst_kms_allocator_dmabuf_import:<KMSMemory::allocator> Failed to close GEM handle: Invalid argument 22
0:00:01.017248655  2475     0x3e77e850 WARN            kmsallocator gstkmsallocator.c:550:gst_kms_allocator_dmabuf_import:<KMSMemory::allocator> Failed to close GEM handle: Invalid argument 22
0:00:01.033900080  2475     0x3e77e850 WARN            kmsallocator gstkmsallocator.c:550:gst_kms_allocator_dmabuf_import:<KMSMemory::allocator> Failed to close GEM handle: Invalid argument 22
0:00:01.050563167  2475     0x3e77e850 WARN            kmsallocator gstkmsallocator.c:550:gst_kms_allocator_dmabuf_import:<KMSMemory::allocator> Failed to close GEM handle: Invalid argument 22
0:00:01.067237234  2475     0x3e77e850 WARN            kmsallocator gstkmsallocator.c:550:gst_kms_allocator_dmabuf_import:<KMSMemory::allocator> Failed to close GEM handle: Invalid argument 22
0:00:01.117301140  2475     0x3e77e850 WARN            kmsallocator gstkmsallocator.c:550:gst_kms_allocator_dmabuf_import:<KMSMemory::allocator> Failed to close GEM handle: Invalid argument 22
CreatePipeline: Ln:114 Setting to PAUSED state
CreatePipeline: Ln:116 PAUSED state set
CreatePipeline: Ln:123 Setting to NULL state
0:00:08.279415216  2475     0x3e78e560 ERROR                    omx gstomx.c:1733:gst_omx_port_set_flushing:<Decoder> Timeout while flushing decoder port 1
CreatePipeline: Ln:125 NULL state set
root@vcu-zcu106-2017_3:/media/card#

Solution

This is a known issue in the 2017.3/4 TRD BSP which is fixed in the 2018.1 release (https://github.com/Xilinx/gst-omx/tree/xilinx-v2018.1).

In the 2017.3/4 TRD QT application (vcu_qt) we explicitly pass the GST_EVENT_EOS event in order to stop the pipeline.

When closing the pipeline without an EOS event, all elements have to flush data and come to a NULL state.

If the decoder does not flush within a certain amount of time, it will assert with a timeout message.

The work-around solution is to pass the GST_EVENT_EOS event.

AR# 71163
Date 05/30/2018
Status Active
Type General Article
Devices
Tools
IP
Boards & Kits
People Also Viewed