No RTSP TEARDOWN if PlayerEndpoint is destroyed
KMS Version:
Kurento Media Server version: 6.7.1 Found modules: 'core' version 6.7.1 'elements' version 6.7.1 'filters' version 6.7.1
Other libraries versions:
ii gstreamer1.5-libav:amd64 1.8.2.1.xenial~20170725171352.96.493eee4 amd64 libav plugin for GStreamer ii gstreamer1.5-nice:amd64 0.1.13.1.xenial~20170725160546.81.eebfdab amd64 ICE library (GStreamer plugin) ii gstreamer1.5-plugins-bad:amd64 1.8.1.1.xenial~20170725164047.100.3db37b1 amd64 GStreamer plugins from the "bad" set ii gstreamer1.5-plugins-base:amd64 1.8.1.1.xenial~20170725154709.55.7b19cfd amd64 GStreamer plugins from the "base" set ii gstreamer1.5-plugins-good:amd64 1.8.1.1.xenial~20170725161537.112.9ee4248 amd64 GStreamer plugins from the "good" set ii gstreamer1.5-plugins-ugly:amd64 1.8.1.1.xenial~20170725170621.89.2685b0f amd64 GStreamer plugins from the "ugly" set ii gstreamer1.5-pulseaudio:amd64 1.8.1.1.xenial~20170725161537.112.9ee4248 amd64 GStreamer plugin for PulseAudio ii gstreamer1.5-x:amd64 1.8.1.1.xenial~20170725154709.55.7b19cfd amd64 GStreamer plugins for X11 and Pango ii kms-core 6.7.1.xenial.20180321183643.47e0370 amd64 Kurento Core module ii kms-elements 6.7.1.xenial.20180321184406.5aaf4a0 amd64 Kurento Elements module ii kms-filters 6.7.1.xenial.20180321185049.7f2d045 amd64 Kurento Filters module ii kms-jsonrpc 6.7.1.xenial~20180321183209.1.637bf2a amd64 Kurento JSON-RPC library ii kmsjsoncpp 1.6.3.xenial.20170725151047.d78deb7 amd64 Kurento jsoncpp library ii kurento-media-server 6.7.1.xenial.20180321185711.dd49a2c amd64 Kurento Media Server ii libgstreamer-plugins-bad1.5-0:amd64 1.8.1.1.xenial~20170725164047.100.3db37b1 amd64 GStreamer development files for libraries from the "bad" set ii libgstreamer-plugins-base1.5-0:amd64 1.8.1.1.xenial~20170725154709.55.7b19cfd amd64 GStreamer libraries from the "base" set ii libgstreamer1.5-0:amd64 1.8.1.1.xenial~20170725152356.170.0d6031b amd64 Core GStreamer libraries and elements ii libnice10:amd64 0.1.13.1.xenial~20170725160546.81.eebfdab amd64 ICE library (shared library) rc libreoffice-avmedia-backend-gstreamer 1:5.1.6~rc2-0ubuntu1~xenial4 amd64 GStreamer backend for LibreOffice ii openh264-gst-plugins-bad-1.5:amd64 1.8.1.1.xenial~20170725164047.100.3db37b1 amd64 GStreamer plugins from openh264
Client libraries
- Language: Java
- Version: 6.7.1
Browsers tested Not applicable
System description: Kurento runs at VM with Ubuntu Server 16.04. Kurento client located at another VM, running with Linux Mint and Wildfly 13
What steps will reproduce the problem?
- Create RTSP player endpoint
- Start streaming
- Execute "stop" and "destroy" functions for the player endpoint you created earlier
What is the expected result? "Stop" sends "PAUSE" to the camera, "destroy" sends TEARDOWN to the camera, transmission stops. No traffic from the camera to Kurento host detected.
What happens instead? A camera receives PAUSE only. If PAUSE is not supported, a camera continues streaming RTP over UDP, which is clearly seen, if you execute tcpdump at Kurento's host. Kurento rejects this traffic.
Does it happen with one of the tutorials? We modelled our situation using slightly modified one-to-many-call, but, I suppose, this issue affects all the tutorials with RTSP sources involved.
Please provide any additional information below. We did not test this situation using the latest version of Kurento, but we also did not find any information about this issue being fixed in changelogs or community. We can provide any sufficient source code, or our sniffer's output, if it would help.
We have retested this issue using clear installation of Kurento 6.8 (freshly installed Ubuntu server and local Kurento from repository). Still no TEARDOWN. We have analyzed sources - it seems to us that player endpoint just cannot send TEARDOWN at all. We really need such functionality, so, if you do not plan to resolve this issue shortly, we can make a pull request, but, to make sure it won't be waste of time, please confirm explicitly, whether you plan to resolve it yourselves, or you are fine with our contribution.
It is not in our priority work on this feature right now. But we are glad to know that you can implement it and provide a Pull Request. When we receive this Pull Request, we will analyze it a merge it if it looks good.
We had some further tests with different cameras from different vendors. Now, we have the full image. When we execute "stop" function for the player endpoint, the exact sequence of events is the following:
- Kurento sends PAUSE
- If camera replies OK, that is all.
- If camera replies on PAUSE request differently (in our case, the reply was 'command not supported'), Kurento sends TEARDOWN.
It seems to us that the main source of problem is in some of the cameras' firmware, but, I suppose, there is still a problem in Kurento: there should be the way to send TEARDOWN explicitly. Should it be "stop", or a new method, is a matter of discussion.
Another report here: https://groups.google.com/d/topic/kurento/ZE3FMjcaYDo/discussion
After some research it looks like this is a limitation in the "rtspsrc" element of GStreamer (that is used by Kurento). Seems the library is doing some quick state transitions and doesn't allow itself to actually send the TEARDOWN event, even though it is enqueued to be sent...
According to this, the issue was still present in GStreamer 1.8.2: https://bugzilla.gnome.org/show_bug.cgi?id=748360
Sadly, we use GStreamer 1.8.1 in Kurento :-(
Good news is that, after finishing the (currently ongoing) release of Kurento 6.13.0, the next immediate roadmap is to continue finishing upgrade to GStreamer 1.14, the version that comes by default with Ubuntu 18.04 Bionic. And from what I've been able to read in other bug reports and commit messages, this version already contains that and other fixes for the RTSP implementation, from which Kurento will benefit.