RTSP server reconnection failure

following the post gstreamer-rtsp-server-cannot-re-connection

Env: TX2, jp4.3, l4t-base:r32.3.1 based container

On the Jetson, I’m running the server (like required in the post I’ve linked above):
GST_DEBUG=4 ./test-launch ‘videotestsrc ! nvvidconv ! nvv4l2h264enc ! h264parse ! queue ! rtph264pay name=pay0 pt=96’

On my pc I’m running the client (vlc -vvv rtsp://10.9.0.6:8554/test)

The first time everything looks OK, but after the client disconnects, and tries to connect the 2nd (sometimes 3d,4th,…) time, it will no longer be able to connect.
At the server the log attached below appears.

Further details:

  1. The same happens with nvv4l2h265enc, nvv4l2vp8enc, nvv4l2vp9enc.
  2. The issue does not happen when using omxh264enc, however, if we try using it (omx) the quality (bitrate) seems to be very low (as if the bitrate argument for the element is ignored). Besides, the documentation clearly stated that it’s deprecated.
  3. The same code (with omxh264/265) runs without any issues with jp3.3 and jp3.1

0:00:11.260275485 13049 0x7f9c0aa4f0 INFO rtspstream rtsp-stream.c:2011:on_ssrc_active: 0x7f9c0a22b0: source 0x7f8808aee0 in transport 0x7f9c0949e0 is active
0:00:11.260341532 13049 0x7f9c0aa4f0 INFO rtspclient rtsp-client.c:1774:do_keepalive: keep session 0x7f9c07eec0 alive
0:00:11.260378588 13049 0x7f9c0aa4f0 INFO rtspstream rtsp-stream.c:2029:on_bye_ssrc: 0x7f9c0a22b0: source 0x7f8808aee0 bye
0:00:11.263120065 13049 0x55a90b8190 INFO rtspclient rtsp-client.c:3468:handle_request: client 0x55a90de100: received a request TEARDOWN rtsp://10.9.0.6:8554/live_video/ 1.0
0:00:11.263812026 13049 0x55a90b8190 INFO rtspmedia rtsp-media.c:4083:gst_rtsp_media_set_state: going to state NULL media 0x7f9c09c1f0, target state PLAYING
0:00:11.263916249 13049 0x55a90b8190 INFO rtspstream rtsp-stream.c:3761:update_transport: removing 10.9.255.195:54790-54791
0:00:11.264841104 13049 0x55a90b8190 INFO rtspmedia rtsp-media.c:4134:gst_rtsp_media_set_state: state 1 active 0 media 0x7f9c09c1f0 do_state 1
0:00:11.265474665 13049 0x55a90b8190 INFO rtspmedia rtsp-media.c:3431:gst_rtsp_media_unprepare: unprepare media 0x7f9c09c1f0
0:00:11.265520137 13049 0x55a90b8190 INFO rtspmedia rtsp-media.c:2632:set_target_state: set target state to NULL for media 0x7f9c09c1f0
0:00:11.266010980 13049 0x55a90b8190 INFO rtspmedia rtsp-media.c:2619:set_state: set state to NULL for media 0x7f9c09c1f0
0:00:11.266760413 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state: current PLAYING pending VOID_PENDING, desired next PAUSED
0:00:11.267284184 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2676:gst_element_continue_state: completed state change to PAUSED
0:00:11.267755347 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed: notifying about state-changed PLAYING to PAUSED (VOID_PENDING pending)
0:00:11.268204559 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func: child ‘multiudpsink1’ changed state to 3(PAUSED) successfully
0:00:11.268498060 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state: current PLAYING pending VOID_PENDING, desired next PAUSED
0:00:11.269584289 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2960:gst_bin_change_state_func: child ‘multiudpsink0’ is changing state asynchronously to PAUSED
0:00:11.269703616 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state: current PLAYING pending VOID_PENDING, desired next PAUSED
0:00:11.269856126 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2676:gst_element_continue_state: completed state change to PAUSED
0:00:11.270351705 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed: notifying about state-changed PLAYING to PAUSED (VOID_PENDING pending)
0:00:11.271078034 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func: child ‘tee1’ changed state to 3(PAUSED) successfully
0:00:11.271412431 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state: current PLAYING pending VOID_PENDING, desired next PAUSED
0:00:11.271597229 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2676:gst_element_continue_state: completed state change to PAUSED
0:00:11.271711628 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed: notifying about state-changed PLAYING to PAUSED (VOID_PENDING pending)
0:00:11.271808011 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func: child ‘tee0’ changed state to 3(PAUSED) successfully
0:00:11.272141192 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state: current PLAYING pending VOID_PENDING, desired next PAUSED
0:00:11.272396485 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state: current PLAYING pending VOID_PENDING, desired next PAUSED
0:00:11.272477668 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2676:gst_element_continue_state: completed state change to PAUSED
0:00:11.272894144 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed: notifying about state-changed PLAYING to PAUSED (VOID_PENDING pending)
0:00:11.274173620 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func: child ‘rtpstorage0’ changed state to 3(PAUSED) successfully
0:00:11.274572944 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state: current PLAYING pending VOID_PENDING, desired next PAUSED
0:00:11.274659151 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2676:gst_element_continue_state: completed state change to PAUSED
0:00:11.274788142 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed: notifying about state-changed PLAYING to PAUSED (VOID_PENDING pending)
0:00:11.274937964 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func: child ‘funnel0’ changed state to 3(PAUSED) successfully
0:00:11.275247529 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state: current PLAYING pending VOID_PENDING, desired next PAUSED
0:00:11.275357992 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2676:gst_element_continue_state: completed state change to PAUSED
0:00:11.275560230 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed: notifying about state-changed PLAYING to PAUSED (VOID_PENDING pending)
0:00:11.275818211 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func: child ‘rtpssrcdemux0’ changed state to 3(PAUSED) successfully
0:00:11.276445853 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state: current PLAYING pending VOID_PENDING, desired next PAUSED
0:00:11.277035991 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2676:gst_element_continue_state: completed state change to PAUSED
0:00:11.277251413 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed: notifying about state-changed PLAYING to PAUSED (VOID_PENDING pending)
0:00:11.277454035 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func: child ‘rtpsession0’ changed state to 3(PAUSED) successfully
0:00:11.277783024 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state: current PLAYING pending VOID_PENDING, desired next PAUSED
0:00:11.277925455 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2676:gst_element_continue_state: completed state change to PAUSED
0:00:11.278001902 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed: notifying about state-changed PLAYING to PAUSED (VOID_PENDING pending)
0:00:11.278243403 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func: child ‘funnel1’ changed state to 3(PAUSED) successfully
0:00:11.278529641 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2676:gst_element_continue_state: completed state change to PAUSED
0:00:11.278841670 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed: notifying about state-changed PLAYING to PAUSED (VOID_PENDING pending)
0:00:11.279086147 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func: child ‘rtpbin0’ changed state to 3(PAUSED) successfully
0:00:11.279201922 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state: current PLAYING pending VOID_PENDING, desired next PAUSED
0:00:11.279643838 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state: current PLAYING pending VOID_PENDING, desired next PAUSED
0:00:11.279922971 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2676:gst_element_continue_state: completed state change to PAUSED
0:00:11.280026490 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed: notifying about state-changed PLAYING to PAUSED (VOID_PENDING pending)
0:00:11.280143833 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func: child ‘pay0’ changed state to 3(PAUSED) successfully
0:00:11.280427510 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state: current PLAYING pending VOID_PENDING, desired next PAUSED
0:00:11.282732991 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2676:gst_element_continue_state: completed state change to PAUSED
0:00:11.282939837 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed: notifying about state-changed PLAYING to PAUSED (VOID_PENDING pending)
0:00:11.283141467 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func: child ‘queue0’ changed state to 3(PAUSED) successfully
0:00:11.283313625 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state: current PLAYING pending VOID_PENDING, desired next PAUSED
0:00:11.283424728 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2676:gst_element_continue_state: completed state change to PAUSED
0:00:11.283584951 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed: notifying about state-changed PLAYING to PAUSED (VOID_PENDING pending)
0:00:11.283706422 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func: child ‘h264parse0’ changed state to 3(PAUSED) successfully
0:00:11.283897268 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state: current PLAYING pending VOID_PENDING, desired next PAUSED
0:00:11.284956297 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2676:gst_element_continue_state: completed state change to PAUSED
0:00:11.284999273 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed: notifying about state-changed PLAYING to PAUSED (VOID_PENDING pending
)
0:00:11.285048872 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func: child ‘nvv4l2h264enc0’ changed state to 3(PAUSED) successfully
0:00:11.285093032 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state: current PLAYING pending VOID_PENDING, desired next PAUSED
0:00:11.285122888 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2676:gst_element_continue_state: completed state change to PAUSED
0:00:11.285212839 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed: notifying about state-changed PLAYING to PAUSED (VOID_PENDING pending)
0:00:11.285274342 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func: child ‘nvvconv0’ changed state to 3(PAUSED) successfully
0:00:11.285308614 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state: current PLAYING pending VOID_PENDING, desired next PAUSED
0:00:11.285336709 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2676:gst_element_continue_state: completed state change to PAUSED
0:00:11.285358597 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed: notifying about state-changed PLAYING to PAUSED (VOID_PENDING pending)
0:00:11.285390565 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func: child ‘videotestsrc0’ changed state to 3(PAUSED) successfully
0:00:11.285436420 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2676:gst_element_continue_state: completed state change to PAUSED
0:00:11.285460900 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed: notifying about state-changed PLAYING to PAUSED (VOID_PENDING pending)
0:00:11.285493124 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func: child ‘bin0’ changed state to 3(PAUSED) successfully
0:00:11.285533827 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state: current PLAYING pending VOID_PENDING, desired next PAUSED
0:00:11.285562147 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2676:gst_element_continue_state: completed state change to PAUSED
0:00:11.285584675 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed: notifying about state-changed PLAYING to PAUSED (VOID_PENDING pending)
0:00:11.285618915 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func: child ‘funnel2’ changed state to 3(PAUSED) successfully
0:00:11.285646082 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func: child ‘udpsrc0’ changed state to 3(PAUSED) successfully
0:00:11.285682530 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2981:gst_element_change_state: forcing commit state NULL <= READY
0:00:11.285734849 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2651:gst_element_continue_state: committing state from PLAYING to PAUSED, pending NULL, next READY
0:00:11.285760705 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed: notifying about state-changed PLAYING to PAUSED (NULL pending)
0:00:11.285795393 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2658:gst_element_continue_state: continue state change PAUSED to READY, final NULL
0:00:11.285862688 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state: current PAUSED pending VOID_PENDING, desired next READY
0:00:11.286061310 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2676:gst_element_continue_state: completed state change to READY
0:00:11.286097406 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed: notifying about state-changed PAUSED to READY (VOID_PENDING pending)
0:00:11.286159901 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func: child ‘multiudpsink1’ changed state to 2(READY) successfully
0:00:11.286218525 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state: current PAUSED pending VOID_PENDING, desired next READY
0:00:11.286447450 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2676:gst_element_continue_state: completed state change to READY
0:00:11.286535898 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed: notifying about state-changed PAUSED to READY (VOID_PENDING pending)
0:00:11.286589401 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func: child ‘multiudpsink0’ changed state to 2(READY) successfully
0:00:11.286610329 13049 0x7f94008de0 INFO task gsttask.c:316:gst_task_func:queue0:src Task going to paused
0:00:11.286631865 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state: current PAUSED pending VOID_PENDING, desired next READY
0:00:11.286691384 13049 0x7f94039720 INFO task gsttask.c:316:gst_task_func:nvv4l2h264enc0:src Task going to paused
0:00:11.286714840 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2676:gst_element_continue_state: completed state change to READY
0:00:11.286735864 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed: notifying about state-changed PAUSED to READY (VOID_PENDING pending)
0:00:11.286767607 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func: child ‘tee1’ changed state to 2(READY) successfully
0:00:11.286773047 13049 0x7f94039720 INFO task gsttask.c:318:gst_task_func:nvv4l2h264enc0:src Task resume from paused
0:00:11.286856374 13049 0x7f94008ed0 INFO basesrc gstbasesrc.c:2965:gst_base_src_loop: pausing after gst_pad_push() = flushing
0:00:11.286878518 13049 0x7f94008ed0 INFO task gsttask.c:316:gst_task_func:videotestsrc0:src Task going to paused
0:00:11.286877430 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state: current PAUSED pending VOID_PENDING, desired next READY
0:00:11.286956949 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2676:gst_element_continue_state: completed state change to READY
0:00:11.286996245 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed: notifying about state-changed PAUSED to READY (VOID_PENDING pending)
0:00:11.287041045 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func: child ‘tee0’ changed state to 2(READY) successfully
0:00:11.287083028 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state: current PAUSED pending VOID_PENDING, desired next READY
0:00:11.287150548 13049 0x55a90b8190 INFO rtspstream rtsp-stream.c:1878:caps_notify: stream 0x7f9c0a22b0 received caps (nil), (NULL)
0:00:11.287281970 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state: current PAUSED pending VOID_PENDING, desired next READY
0:00:11.287371249 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2676:gst_element_continue_state: completed state change to READY
0:00:11.287431633 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed: notifying about state-changed PAUSED to READY (VOID_PENDING pending)
0:00:11.287483888 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func: child ‘rtpstorage0’ changed state to 2(READY) successfully
0:00:11.287519920 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state: current PAUSED pending VOID_PENDING, desired next READY
0:00:11.287556943 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2676:gst_element_continue_state: completed state change to READY
0:00:11.287608399 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed: notifying about state-changed PAUSED to READY (VOID_PENDING pending)
0:00:11.287655695 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func: child ‘funnel0’ changed state to 2(READY) successfully
0:00:11.287700206 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state: current PAUSED pending VOID_PENDING, desired next READY
0:00:11.287740078 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2676:gst_element_continue_state: completed state change to READY
0:00:11.287763501 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed: notifying about state-changed PAUSED to READY (VOID_PENDING pending)
0:00:11.287790189 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func: child ‘rtpssrcdemux0’ changed state to 2(READY) successfully
0:00:11.287816685 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state: current PAUSED pending VOID_PENDING, desired next READY
0:00:11.287891660 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2676:gst_element_continue_state: completed state change to READY
0:00:11.288154442 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed: notifying about state-changed PAUSED to READY (VOID_PENDING pending)
0:00:11.288199657 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func: child ‘rtpsession0’ changed state to 2(READY) successfully
0:00:11.288225673 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state: current PAUSED pending VOID_PENDING, desired next READY
0:00:11.288260713 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2676:gst_element_continue_state: completed state change to READY
0:00:11.288276392 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed: notifying about state-changed PAUSED to READY (VOID_PENDING pending)
0:00:11.288386087 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func: child ‘funnel1’ changed state to 2(READY) successfully
0:00:11.288473062 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2676:gst_element_continue_state: completed state change to READY
0:00:11.288504934 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed: notifying about state-changed PAUSED to READY (VOID_PENDING pending)
0:00:11.288532902 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func: child ‘rtpbin0’ changed state to 2(READY) successfully
0:00:11.288553542 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state: current PAUSED pending VOID_PENDING, desired next READY
0:00:11.288613221 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state: current PAUSED pending VOID_PENDING, desired next READY
0:00:11.288672132 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2676:gst_element_continue_state: completed state change to READY
0:00:11.288693220 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed: notifying about state-changed PAUSED to READY (VOID_PENDING pending)
0:00:11.288800323 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func: child ‘pay0’ changed state to 2(READY) successfully
0:00:11.288929826 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state: current PAUSED pending VOID_PENDING, desired next READY
0:00:11.288987937 13049 0x7f94008de0 INFO task gsttask.c:318:gst_task_func:queue0:src Task resume from paused
0:00:11.289070881 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2676:gst_element_continue_state: completed state change to READY
0:00:11.289097056 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed: notifying about state-changed PAUSED to READY (VOID_PENDING pending)
0:00:11.289120288 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func: child ‘queue0’ changed state to 2(READY) successfully
0:00:11.289142528 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state: current PAUSED pending VOID_PENDING, desired next READY
0:00:11.289291262 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2676:gst_element_continue_state: completed state change to READY
0:00:11.289322718 13049 0x55a90b8190 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed: notifying about state-changed PAUSED to READY (VOID_PENDING pending)
0:00:11.289350974 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2954:gst_bin_change_state_func: child ‘h264parse0’ changed state to 2(READY) successfully
0:00:11.289438717 13049 0x55a90b8190 INFO GST_STATES gstbin.c:2506:gst_bin_element_set_state: current PAUSED pending VOID_PENDING, desired next READY
0:00:15.452093349 13049 0x55a8e96c00 INFO rtspclient rtsp-client.c:4132:gst_rtsp_client_set_connection: client 0x55a90de210 connected to server ip 10.9.0.6, ipv6 = 0
0:00:15.453265017 13049 0x55a8e96c00 INFO rtspclient rtsp-client.c:4135:gst_rtsp_client_set_connection: added new client 0x55a90de210 ip 10.9.255.195:50978
0:00:15.453447191 13049 0x55a8e96c00 INFO rtspclient rtsp-client.c:4631:gst_rtsp_client_attach: client 0x55a90de210: attaching to context 0x55a90ddc10
0:00:20.518022534 13049 0x55a8e96c00 INFO rtspclient rtsp-client.c:4132:gst_rtsp_client_set_connection: client 0x55a90de320 connected to server ip 10.9.0.6, ipv6 = 0
0:00:20.519138075 13049 0x55a8e96c00 INFO rtspclient rtsp-client.c:4135:gst_rtsp_client_set_connection: added new client 0x55a90de320 ip 10.9.255.195:50980
0:00:20.520382990 13049 0x55a8e96c00 INFO rtspclient rtsp-client.c:4631:gst_rtsp_client_attach: client 0x55a90de320: attaching to context 0x55a90ddc10

Please advise.
Regards.

Hi,
Are you able to try r32.4.3(Jwtpack4.4.1)? If you can upgrade to latest release, we suggest do the upgrade and try again.

Hi,
Unfortunately we can’t upgrade as this is a production unit, in the field.
Such an upgrade is too risky.
Is there a work-around for this issue?

1 Like

Hi,
On r32.3.1/TX2, we try the two pipelines and don’t observe the issue.

$ ./test-launch 'videotestsrc ! nvvidconv ! nvv4l2h265enc ! h265parse ! queue ! rtph265pay name=pay0 pt=96'
$ ./test-launch 'videotestsrc ! nvvidconv ! nvv4l2h264enc ! h264parse ! queue ! rtph264pay name=pay0 pt=96'

On a PC with Linux Ubuntu 18.04.2 LTS, we can run

vlc -vvv rtsp://10.19.107.68:8554/test

And on PC with Windows, we can open the stream in VLC player.

Not sure if it helps but you can try to clean the cache:

$ rm .cache/gstreamer-1.0/registry.aarch64.bin

And if you have installed plugins-ugly, you can remove it and try. It triggers a issue in decoding a RTSP stream:

Hi,
thanks for the suggestions.
Unfortunately, the issues persistes.
I will stress again that in some cases I will be able to reconnect several times (~10 at most) and then unable to until restarting the server process.

I tried to:

  • Run the line you provided outside the cointainer after removing the “ugly” plugins and clearing the cache as proposed
  • Check kernel diangostics messages (just in case) and saw nothing.
  • Try different output-io-mode and capture-io-mode (for nvv4l2h265enc)

Do you have other suggestions?

From the log below (GST_DEBUG=4,*v4l2*:6)
Seems like the encoder element is unable to transition to READY state

    0:01:01.151268901  2434   0x7f68004680 INFO              GST_STATES gstbin.c:2506:gst_bin_element_set_state:<queue9> current PAUSED pending VOID_PENDING, desired next READY
    0:01:01.149584113  2434   0x7f70037de0 DEBUG           v4l2videoenc gstv4l2videoenc.c:1079:gst_v4l2_video_enc_handle_frame:<nvv4l2h265enc9> Handling frame 84
    0:01:01.151435588  2434   0x7f70037de0 DEBUG           v4l2videoenc gstv4l2videoenc.c:1126:gst_v4l2_video_enc_handle_frame:<nvv4l2h265enc9> Starting encoding thread
    0:01:01.151485828  2434   0x7f70037de0 DEBUG         v4l2bufferpool gstv4l2bufferpool.c:2066:gst_v4l2_buffer_pool_process:<nvv4l2h265enc9:pool:sink> process buffer 0x7f6800c838
    0:01:01.151518467  2434   0x7f70037de0 LOG           v4l2bufferpool gstv4l2bufferpool.c:2254:gst_v4l2_buffer_pool_process:<nvv4l2h265enc9:pool:sink> alloc buffer from our pool
    0:01:01.151551267  2434   0x7f70037de0 DEBUG         v4l2bufferpool gstv4l2bufferpool.c:1633:gst_v4l2_buffer_pool_acquire_buffer:<nvv4l2h265enc9:pool:sink> acquire
    0:01:01.151581795  2434   0x7f70037de0 DEBUG         v4l2bufferpool gstv4l2bufferpool.c:2354:gst_v4l2_buffer_pool_process:<nvv4l2h265enc9:pool:sink> flushing
    0:01:01.151664002  2434   0x7f70037de0 INFO                 basesrc gstbasesrc.c:2965:gst_base_src_loop:<videotestsrc9> pausing after gst_pad_push() = flushing
    0:01:01.151712674  2434   0x7f70037de0 INFO                    task gsttask.c:316:gst_task_func:<videotestsrc9:src> Task going to paused
    0:01:01.151769154  2434   0x7f60021a80 INFO                    task gsttask.c:318:gst_task_func:<nvv4l2h265enc9:src> Task resume from paused
    0:01:01.151805249  2434   0x7f60021a80 LOG             v4l2videoenc gstv4l2videoenc.c:991:gst_v4l2_video_enc_loop:<nvv4l2h265enc9> Allocate output buffer
    0:01:01.151844833  2434   0x7f60021a80 LOG             v4l2videoenc gstv4l2videoenc.c:1004:gst_v4l2_video_enc_loop:<nvv4l2h265enc9> Process output buffer
    0:01:01.151879041  2434   0x7f60021a80 DEBUG         v4l2bufferpool gstv4l2bufferpool.c:2066:gst_v4l2_buffer_pool_process:<nvv4l2h265enc9:pool:src> process buffer 0x7f5fffe6e8
    0:01:01.151909441  2434   0x7f60021a80 LOG           v4l2bufferpool gstv4l2bufferpool.c:1412:gst_v4l2_buffer_pool_dqbuf:<nvv4l2h265enc9:pool:src> dequeueing a buffer
    0:01:01.151978272  2434   0x7f68003c00 INFO                    task gsttask.c:318:gst_task_func:<queue9:src> Task resume from paused
    0:01:01.152159519  2434   0x7f68004680 INFO              GST_STATES gstelement.c:2676:gst_element_continue_state:<queue9> completed state change to READY
    0:01:01.152204830  2434   0x7f68004680 INFO              GST_STATES gstelement.c:2579:_priv_gst_element_state_changed:<queue9> notifying about state-changed PAUSED to READY (VOID_PENDING pending)
    0:01:01.152262174  2434   0x7f68004680 INFO              GST_STATES gstbin.c:2954:gst_bin_change_state_func:<bin9> child 'queue9' changed state to 2(READY) successfully
    0:01:01.152310046  2434   0x7f68004680 INFO              GST_STATES gstbin.c:2506:gst_bin_element_set_state:<h265parse9> current PAUSED pending VOID_PENDING, desired next READY
    0:01:01.152429725  2434   0x7f68004680 INFO              GST_STATES gstelement.c:2676:gst_element_continue_state:<h265parse9> completed state change to READY
    0:01:01.152476796  2434   0x7f68004680 INFO              GST_STATES gstelement.c:2579:_priv_gst_element_state_changed:<h265parse9> notifying about state-changed PAUSED to READY (VOID_PENDING pending)
    0:01:01.152530332  2434   0x7f68004680 INFO              GST_STATES gstbin.c:2954:gst_bin_change_state_func:<bin9> child 'h265parse9' changed state to 2(READY) successfully
    0:01:01.152578588  2434   0x7f68004680 INFO              GST_STATES gstbin.c:2506:gst_bin_element_set_state:<nvv4l2h265enc9> current PAUSED pending VOID_PENDING, desired next READY
    0:01:01.152619547  2434   0x7f68004680 LOG                     v4l2 gstv4l2object.c:4343:gst_v4l2_object_unlock:<nvv4l2h265enc9:sink> start flushing
    0:01:01.152658587  2434   0x7f68004680 LOG                     v4l2 gstv4l2object.c:4343:gst_v4l2_object_unlock:<nvv4l2h265enc9:src> start flushing
    0:01:01.152692091  2434   0x7f68004680 DEBUG         v4l2bufferpool gstv4l2bufferpool.c:1224:gst_v4l2_buffer_pool_flush_start:<nvv4l2h265enc9:pool:src> start flushing

Hi,
We run it on TX2 developer kit flashed r32.3.1 through SDKManager. Could you reflash a TX2 developer kit to r32.3.1 for a try? We don’t observe the issue on the setup. A bit strange you hit the issue.

It is a known issue in r32.2.1 and r32.2.3. We have it listed in
https://elinux.org/Jetson/L4T/r32.2.x_patches
[GSTREAMER]Cannot use nvv4l2h264enc in test-launch
If your version is r32.3.1, it should be fixed.

Not sure at all for your case, but I’m wondering if this issue might be related to VLC.
I have noticed that when launching a second VLC client for a stream served by test-launch, it will make the test-launch RTSP server to get wrong, failing and sometime breaking the first client.
You may try to launch it from command line with verbose option and check if any error messages:

cvlc -v rtsp://10.9.0.6:8554/test

Also note, might be depending on VLC version, that closing the window may results in continuous logging of errors, and interrupting with Ctrl-C stops these.

May you try from a Linux host having gstreamer installed (or with Windows, but you would have to adapt for display sink) ?
The following pipeline should be able to start/stop many times, as well as many clients at same time from jetson itself (using here test-launch with H264 encoding):

gst-launch-1.0 rtspsrc location=rtsp://10.9.0.6:8554/test ! application/x-rtp, media=video, encoding-name=H264, payload=96, clock-rate=90000 ! rtph264depay ! h264parse ! nvv4l2decoder ! nvvidconv ! xvimagesink

or use this one from a Linux PC (having ffmpeg or at least libav_codec installed):

gst-launch-1.0 rtspsrc location=rtsp://10.9.0.6:8554/test ! application/x-rtp, media=video, encoding-name=H264, payload=96, clock-rate=90000 ! rtph264depay ! h264parse ! avdec_h264 ! xvimagesink

Hi again. Strange indeed.
We will try re-flashing it using the SDKManager and will keep you posted here.

Hi.
Thanks for your suggestion.
Unfortuntely, the same phenomenon happens if the client is run using a gstreamer pipeline.
On a side note, on jepack 3.3 we have the same code running with VLC without any issues.

Hi,
Could you check if there is deviation between your environment and ours?

Run the server on r32.3.1/TX2 developer kit:

$ ./test-launch 'videotestsrc ! nvvidconv ! nvv4l2h265enc ! h265parse ! queue ! rtph265pay name=pay0 pt=96'

Run the two cases:

  1. On a PC with Linux Ubuntu 18.04.2 LTS, we can run
vlc -vvv rtsp://10.19.107.68:8554/test
  1. And on PC with Windows, we can open the stream in VLC player.

Might be able to get some clues from the deviation. And could you also try r32.4.4/TX2 developer kit? We also see it working on r32.4.4/TX2 developer kit. Would like to know if you can run this version successfully.

Hi,
We’ve done the following

  1. Flashed a TX2 from scratch with jp4.3 using the SDK Manager (see image attached)
  2. Installed rtspserver
  3. compiled test-launch.c
  4. ran the line you provided for the server
  5. ran the client (connecting to localhost:8554)

And the issue persists.

I’m attaching a .txt file with all installation details.


Installations.txt (8.2 KB)

Hi,
So you install Jetson OS and don’t install SDK Components?

That’s correct.
We are installing all packages using apt
e.g

apt-get update && apt-get install --no-install-recommends -y libcudnn7 cuda-cublas-10-0 cuda-cudart-10-0 cuda-cufft-10-0 cuda-curand-10-0 cuda-cusolver-10-0
cuda-license-10-0 cuda-misc-headers-10-0
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev

Is this an issue?
In general, it doesn’t look like a missing package, but rather like some kind of deadlock.

Hi,
We try to flash Jetson OS(Jetpack4.3/r32.3.1) only and execute:

$ sudo apt update
$ sudo apt-get install libgstrtspserver-1.0 libgstreamer1.0-dev
$ gcc test-launch.c -o test-launch $(pkg-config --cflags --libs gstreamer-1.0 gstreamer-rtsp-server-1.0)
$ ./test-launch "videotestsrc ! nvvidconv ! nvv4l2h264enc ! h264parse ! rtph264pay name=pay0 pt=96"

And can make the connection:

  1. On a PC with Linux Ubuntu 18.04.2 LTS, we can run
vlc -vvv rtsp://10.19.107.68:8554/test
  1. And on PC with Windows, we can open the stream in VLC player.

Could you try this? Install only libgstrtspserver-1.0 libgstreamer1.0-dev

If the issue is still present, could you remove

nvidia/nvidia_sdk/JetPack_4.3_Linux_JETSON_TX2/

and re-download the image for a try.

Hi again,
I’d tried everything you suggested (reflashing with the latest SDK Manager, after removing all previous downloads, and only installing the packages you mentioned) and the issue was not resolved.
Just for validation I also tried flashing jp4.4.1 and it the issue was solved.
However, like I said, we have jp4.3 in the field and any further suggestions to solve this will be appreciated.
I will stress again: the first time the connection works find, but at the second (sometimes third or fourth) I try to connect, it stops working

Hi,
Do you run this command on TX2?

$ ./test-launch "videotestsrc ! nvvidconv ! nvv4l2h264enc ! h264parse ! rtph264pay name=pay0 pt=96"

Or you run other command? Probably we don’t run identical command so that we cannot observe the issue.

Hi,
We only have tx2 devices.
I did everything according to what you suggested. I flashed using the SDK as you suggested,
I installed only the packages you suggested, I copy-pasted the exact same lines (including the compilation) and the ./test_launch... command exactly as you suggested. No deviation whatsoever.
did you try connecting, disconnecting and then reconnecting multiple times?

Hi,
We do a few trials(< 5 times) and don’t observe the issue. This should be deviation between us. So it should be more stable in JP4.4.1. Please download the source code package:
https://developer.nvidia.com/embedded/L4T/r32_Release_v4.4/r32_Release_v4.4-GMC3/Sources/T186/public_sources.tbz2

And get gst-nvvideo4linux2_src.tbz2 to build/replace libgstnvvideo4linux2.so on r32.3.1. It is in

/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvvideo4linux2.so

Please clean the cache after the replacement:

$ rm .cache/gstreamer-1.0/registry.aarch64.bin

That fixed it.
Thank you!

1 Like