<div dir="ltr"><div dir="ltr">Hi all,<div>I have the issue when webrtcbin hangs when I remove it from pipeline and move to NULL state. </div><div>I log I see it hangs when it's switching to READY state. </div><div><br></div><div>What I do:</div><div>My pipeline looks like this:</div><div>videosource -> tee -> queue -> rtppay -> capsfilter -> webrtcbin</div><div>audiosource -> tee -> queue -> opusenc -> rtppay -> capsfilter -> webrtcbin</div><div><br></div><div>1. I block tee src pad for video and audio branch</div><div>2. I unlink all elements for both video and audio branches starting from tee (via unlink_many call for tee, queue, rtppay, capfilter, webrtc)</div><div>3. I remove unlinked elements and set state to NULL (I start from queues and end by webrtcbin)</div><div>4. All elements are removed and switched to NULL successfully. But webrtcbin is removed with no error but when it switches to NULL state it hangs</div><div><br></div><div>My log is below:</div><div><div>on_server_message: </div><div>BYE</div><div>[CAMERA_DEBUG]  iterate pipeline</div><div>[CAMERA_DEBUG] element: webrtc[transportreceivebin1]</div><div>[CAMERA_DEBUG] element: transportreceivebin1[funnel9]</div><div>[CAMERA_DEBUG] element: transportreceivebin1[funnel8]</div><div>[CAMERA_DEBUG] element: transportreceivebin1[funnel7]</div><div>[CAMERA_DEBUG] element: transportreceivebin1[nicesrc3]</div><div>[CAMERA_DEBUG] element: transportreceivebin1[capsfilter5]</div><div>[CAMERA_DEBUG] element: transportreceivebin1[queue7]</div><div>[CAMERA_DEBUG] element: transportreceivebin1[dtlssrtpdec3]</div><div>[CAMERA_DEBUG] element: dtlssrtpdec3[srtpdec3]</div><div>[CAMERA_DEBUG] element: dtlssrtpdec3[dtlsdec3]</div><div>[CAMERA_DEBUG] element: dtlssrtpdec3[dtlssrtpdemux3]</div><div>[CAMERA_DEBUG] element: transportreceivebin1[nicesrc2]</div><div>[CAMERA_DEBUG] element: transportreceivebin1[capsfilter4]</div><div>[CAMERA_DEBUG] element: transportreceivebin1[queue6]</div><div>[CAMERA_DEBUG] element: transportreceivebin1[dtlssrtpdec2]</div><div>[CAMERA_DEBUG] element: dtlssrtpdec2[srtpdec2]</div><div>[CAMERA_DEBUG] element: dtlssrtpdec2[dtlsdec2]</div><div>[CAMERA_DEBUG] element: dtlssrtpdec2[dtlssrtpdemux2]</div><div>[CAMERA_DEBUG] element: webrtc[transportsendbin1]</div><div>[CAMERA_DEBUG] element: transportsendbin1[nicesink3]</div><div>[CAMERA_DEBUG] element: transportsendbin1[dtlssrtpenc3]</div><div>[CAMERA_DEBUG] element: dtlssrtpenc3[funnel6]</div><div>[CAMERA_DEBUG] element: dtlssrtpenc3[srtpenc3]</div><div>[CAMERA_DEBUG] element: dtlssrtpenc3[dtlsenc3]</div><div>[CAMERA_DEBUG] element: transportsendbin1[nicesink2]</div><div>[CAMERA_DEBUG] element: transportsendbin1[dtlssrtpenc2]</div><div>[CAMERA_DEBUG] element: dtlssrtpenc2[clocksync_0]</div><div>[CAMERA_DEBUG] element: dtlssrtpenc2[funnel5]</div><div>[CAMERA_DEBUG] element: dtlssrtpenc2[srtpenc2]</div><div>[CAMERA_DEBUG] element: dtlssrtpenc2[dtlsenc2]</div><div>[CAMERA_DEBUG] element: transportsendbin1[outputselector1]</div><div>[CAMERA_DEBUG] element: webrtc[transportreceivebin0]</div><div>[CAMERA_DEBUG] element: transportreceivebin0[funnel4]</div><div>[CAMERA_DEBUG] element: transportreceivebin0[funnel3]</div><div>[CAMERA_DEBUG] element: transportreceivebin0[funnel2]</div><div>[CAMERA_DEBUG] element: transportreceivebin0[nicesrc1]</div><div>[CAMERA_DEBUG] element: transportreceivebin0[capsfilter3]</div><div>[CAMERA_DEBUG] element: transportreceivebin0[queue5]</div><div>[CAMERA_DEBUG] element: transportreceivebin0[dtlssrtpdec1]</div><div>[CAMERA_DEBUG] element: dtlssrtpdec1[srtpdec1]</div><div>[CAMERA_DEBUG] element: dtlssrtpdec1[dtlsdec1]</div><div>[CAMERA_DEBUG] element: dtlssrtpdec1[dtlssrtpdemux1]</div><div>[CAMERA_DEBUG] element: transportreceivebin0[nicesrc0]</div><div>[CAMERA_DEBUG] element: transportreceivebin0[capsfilter2]</div><div>[CAMERA_DEBUG] element: transportreceivebin0[queue4]</div><div>[CAMERA_DEBUG] element: transportreceivebin0[dtlssrtpdec0]</div><div>[CAMERA_DEBUG] element: dtlssrtpdec0[srtpdec0]</div><div>[CAMERA_DEBUG] element: dtlssrtpdec0[dtlsdec0]</div><div>[CAMERA_DEBUG] element: dtlssrtpdec0[dtlssrtpdemux0]</div><div>[CAMERA_DEBUG] element: webrtc[transportsendbin0]</div><div>[CAMERA_DEBUG] element: transportsendbin0[nicesink1]</div><div>[CAMERA_DEBUG] element: transportsendbin0[dtlssrtpenc1]</div><div>[CAMERA_DEBUG] element: dtlssrtpenc1[funnel1]</div><div>[CAMERA_DEBUG] element: dtlssrtpenc1[srtpenc1]</div><div>[CAMERA_DEBUG] element: dtlssrtpenc1[dtlsenc1]</div><div>[CAMERA_DEBUG] element: transportsendbin0[nicesink0]</div><div>[CAMERA_DEBUG] element: transportsendbin0[dtlssrtpenc0]</div><div>[CAMERA_DEBUG] element: dtlssrtpenc0[clocksync_0]</div><div>[CAMERA_DEBUG] element: dtlssrtpenc0[funnel0]</div><div>[CAMERA_DEBUG] element: dtlssrtpenc0[srtpenc0]</div><div>[CAMERA_DEBUG] element: dtlssrtpenc0[dtlsenc0]</div><div>[CAMERA_DEBUG] element: transportsendbin0[outputselector0]</div><div>[CAMERA_DEBUG] element: webrtc[rtpbin]</div><div>[CAMERA_DEBUG] element: rtpbin[rtpptdemux1]</div><div>[CAMERA_DEBUG] element: rtpbin[rtpjitterbuffer1]</div><div>[CAMERA_DEBUG] element: rtpbin[rtpptdemux0]</div><div>[CAMERA_DEBUG] element: rtpbin[rtpjitterbuffer0]</div><div>[CAMERA_DEBUG] element: rtpbin[rtpstorage1]</div><div>[CAMERA_DEBUG] element: rtpbin[rtpssrcdemux1]</div><div>[CAMERA_DEBUG] element: rtpbin[rtpsession1]</div><div>[CAMERA_DEBUG] element: rtpbin[rtpstorage0]</div><div>[CAMERA_DEBUG] element: rtpbin[rtpssrcdemux0]</div><div>[CAMERA_DEBUG] element: rtpbin[rtpsession0]</div><div>[CAMERA_DEBUG]  restart webrtc async</div><div>[CAMERA_DEBUG] webrtcbin sink pad: sink_0</div><div>0:00:24.226477004  2600  0x30d6b20 LOG                webrtcbin gst-plugins-bad-1.18.2/ext/webrtc/gstwebrtcbin.c:1354:_check_if_negotiation_is_needed:<webrtc> checking if negotiation is needed</div><div>0:00:24.226687545  2600  0x30d6b20 LOG                webrtcbin gst-plugins-bad-1.18.2/ext/webrtc/gstwebrtcbin.c:1504:_check_if_negotiation_is_needed:<webrtc> no negotiation needed</div><div>0:00:24.228415793  2600  0x3199bb0 INFO               webrtcbin gst-plugins-bad-1.18.2/ext/webrtc/gstwebrtcbin.c:5640:on_rtpbin_sender_ssrc_active:<webrtc> session 0 ssrc 1503644076 sender ssrc active</div><div>0:00:24.228859750  2600  0x3199bb0 INFO               webrtcbin gst-plugins-bad-1.18.2/ext/webrtc/gstwebrtcbin.c:5624:on_rtpbin_timeout:<webrtc> session 0 ssrc 1503644076 timeout</div><div>[CAMERA_DEBUG] webrtcbin sink pad: sink_1</div><div>0:00:24.229811082  2600  0x30d6b20 LOG                webrtcbin gst-plugins-bad-1.18.2/ext/webrtc/gstwebrtcbin.c:1354:_check_if_negotiation_is_needed:<webrtc> checking if negotiation is needed</div><div>0:00:24.230393290  2600  0x30d6b20 LOG                webrtcbin gst-plugins-bad-1.18.2/ext/webrtc/gstwebrtcbin.c:1504:_check_if_negotiation_is_needed:<webrtc> no negotiation needed</div><div>[CAMERA_DEBUG] block tee pads</div><div>[CAMERA_DEBUG]  block pad with name: src_1</div><div>[CAMERA_DEBUG]  block pad with name: src_2</div><div>[CAMERA_DEBUG] unlink incomming audio</div><div>[CAMERA_DEBUG] unlink video branch</div><div>[CAMERA_DEBUG] unlink audio branch</div><div>[CAMERA_DEBUG] remove element: videoqueue</div><div>[CAMERA_DEBUG] set state NULL for element: videoqueue</div><div>0:00:24.236387073  2600  0x3103290 INFO               webrtcbin gst-plugins-bad-1.18.2/ext/webrtc/gstwebrtcbin.c:5640:on_rtpbin_sender_ssrc_active:<webrtc> session 1 ssrc 1609958542 sender ssrc active</div><div>0:00:24.236876739  2600  0x3103290 INFO               webrtcbin gst-plugins-bad-1.18.2/ext/webrtc/gstwebrtcbin.c:5624:on_rtpbin_timeout:<webrtc> session 1 ssrc 1609958542 timeout</div><div>0:00:24.237587780  2600  0x3199bb0 INFO               webrtcbin gst-plugins-bad-1.18.2/ext/webrtc/gstwebrtcbin.c:5632:on_rtpbin_new_sender_ssrc:<webrtc> session 0 ssrc 1503644076 new sender ssrc</div><div>0:00:24.238524487  2600  0x3199bb0 INFO               webrtcbin gst-plugins-bad-1.18.2/ext/webrtc/gstwebrtcbin.c:5640:on_rtpbin_sender_ssrc_active:<webrtc> session 0 ssrc 1503644076 sender ssrc active</div><div>[CAMERA_DEBUG] remove element: vrtp</div><div>[CAMERA_DEBUG] set state NULL for element: vrtp</div><div>[CAMERA_DEBUG] remove element: vrtpcaps</div><div>[CAMERA_DEBUG] set state NULL for element: vrtpcaps</div><div>[CAMERA_DEBUG] remove element: audioqueue</div><div>[CAMERA_DEBUG] set state NULL for element: audioqueue</div><div>[CAMERA_DEBUG] remove element: aconvert</div><div>[CAMERA_DEBUG] set state NULL for element: aconvert</div><div>[CAMERA_DEBUG] remove element: opusenc</div><div>[CAMERA_DEBUG] set state NULL for element: opusenc</div><div>[CAMERA_DEBUG] remove element: artp</div><div>[CAMERA_DEBUG] set state NULL for element: artp</div><div>[CAMERA_DEBUG] remove element: artpcaps</div><div>[CAMERA_DEBUG] set state NULL for element: artpcaps</div><div>[CAMERA_DEBUG] remove element: decodebin1</div><div>[CAMERA_DEBUG] set state NULL for element: decodebin1</div><div>[CAMERA_DEBUG] remove element: queue8</div><div>[CAMERA_DEBUG] set state NULL for element: queue8</div><div>[CAMERA_DEBUG] remove element: audioconvert0</div><div>[CAMERA_DEBUG] set state NULL for element: audioconvert0</div><div>[CAMERA_DEBUG] remove element: audioresample0</div><div>[CAMERA_DEBUG] set state NULL for element: audioresample0</div><div>[CAMERA_DEBUG] remove element: autoaudiosink0</div><div>[CAMERA_DEBUG] set state NULL for element: autoaudiosink0</div><div>0:00:24.391078814  2600  0x3103290 INFO               webrtcbin gst-plugins-bad-1.18.2/ext/webrtc/gstwebrtcbin.c:5632:on_rtpbin_new_sender_ssrc:<webrtc> session 1 ssrc 1609958542 new sender ssrc</div><div><=== [tvv777/get/discovery]: []</div><div>===> [tvv777/get/discovery/response/0]: [type=doorbell_zrt_t30</div><div>device_id=tvv777</div><div>ip=192.168.1.14</div><div>state=1</div><div>]</div><div>[CAMERA_DEBUG] remove element: webrtc</div><div>[CAMERA_DEBUG] set state NULL for element: webrtc</div><div>0:00:24.490655175  2600  0x30d6b20 DEBUG              webrtcbin gst-plugins-bad-1.18.2/ext/webrtc/gstwebrtcbin.c:5737:gst_webrtc_bin_change_state: changing state: PLAYING => PAUSED</div><div>0:00:24.490904258  2600  0x30d6b20 DEBUG   webrtctransportsendbin gst-plugins-bad-1.18.2/ext/webrtc/transportsendbin.c:195:transport_send_bin_change_state:<transportsendbin1> changing state: PLAYING => PAUSED</div><div>0:00:24.491645632  2600  0x30d6b20 DEBUG   webrtctransportsendbin gst-plugins-bad-1.18.2/ext/webrtc/transportsendbin.c:195:transport_send_bin_change_state:<transportsendbin0> changing state: PLAYING => PAUSED</div><div>0:00:24.492981046  2600  0x30d6b20 DEBUG   webrtctransportreceivebin gst-plugins-bad-1.18.2/ext/webrtc/transportreceivebin.c:236:transport_receive_bin_change_state: changing state: PLAYING => PAUSED</div><div>0:00:24.493846087  2600  0x30d6b20 DEBUG   webrtctransportreceivebin gst-plugins-bad-1.18.2/ext/webrtc/transportreceivebin.c:236:transport_receive_bin_change_state: changing state: PLAYING => PAUSED</div><div>0:00:24.494728002  2600  0x30d6b20 DEBUG              webrtcbin gst-plugins-bad-1.18.2/ext/webrtc/gstwebrtcbin.c:5737:gst_webrtc_bin_change_state: changing state: PAUSED => READY</div></div><div>================ Here it hangs ================================</div><div><br></div></div></div>