After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 790674 - gst-validate failures on RTSP tests
gst-validate failures on RTSP tests
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-rtsp-server
unspecified
Other Linux
: Normal blocker
: 1.13.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-11-21 17:24 UTC by Edward Hervey
Modified: 2018-03-14 08:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
rtsp-media: Fix ASYNC_DONE handling (1.68 KB, patch)
2017-11-22 13:55 UTC, Edward Hervey
rejected Details | Review
test-patch (4.01 KB, patch)
2017-11-23 08:53 UTC, Patricia Muscalu
none Details | Review
Corrected ASYNC_DONE handling (2.95 KB, patch)
2017-11-23 19:55 UTC, Patricia Muscalu
committed Details | Review
Removed fakesink elements (2.81 KB, patch)
2017-11-23 19:56 UTC, Patricia Muscalu
committed Details | Review
Fix thread pool leak (722 bytes, patch)
2017-11-23 19:57 UTC, Patricia Muscalu
committed Details | Review
Fix handling in default_unsuspend() (1.89 KB, patch)
2017-11-23 19:58 UTC, Patricia Muscalu
committed Details | Review
rtsp-media: Enable seeking query before pipeline is complete (3.49 KB, patch)
2017-11-24 16:36 UTC, Edward Hervey
none Details | Review
rtsp-media: Enable seeking query before pipeline is complete (4.71 KB, patch)
2017-11-25 06:54 UTC, Edward Hervey
committed Details | Review
check: Add seekability testing on medias (4.68 KB, patch)
2017-11-25 06:54 UTC, Edward Hervey
committed Details | Review
rtsp-media: Fix missing lock in gst_rtsp_media_seekable() (1.78 KB, patch)
2017-11-25 19:49 UTC, Patricia Muscalu
committed Details | Review
rtsp-stream: Do not reset 'blocking' if stream is already blocked (1.00 KB, patch)
2017-11-25 19:50 UTC, Patricia Muscalu
committed Details | Review
check/media: Add seekability test case: not all streams are active (3.38 KB, patch)
2017-11-25 19:51 UTC, Patricia Muscalu
committed Details | Review

Description Edward Hervey 2017-11-21 17:24:33 UTC
Since this commit, almost all RTSP-related tests have started failing:

https://cgit.freedesktop.org/gstreamer/gst-rtsp-server/commit/?id=a7732a68e8bc6b4ba15629c652056c240c624ff0

https://ci.gstreamer.net/job/GStreamer-master-validate/5591/testReport/

The failures all seem to be in the rtsp-server itself.
Comment 1 Edward Hervey 2017-11-21 17:26:07 UTC
To reproduce:
gst-validate-launcher -fs -j4 -m -t rtsp
Comment 2 Tim-Philipp Müller 2017-11-21 17:42:18 UTC
It can also be reproduced with just the rtsp-server examples:

Terminal 1:

  gst-rtsp-server/examples$ ./test-uri ~/foo.mp4
  stream ready at rtsp://127.0.0.1:8554/test

Terminal 2:

  $ gst-play-1.0 rtsp://127.0.0.1:8554/test

  => Error

Terminal 1:

  =>

0:00:10.406825269 ERROR    default rtsp-sdp.c:548:gst_rtsp_sdp_from_stream: stream 0x7faa4c0102b0 has no caps
0:00:10.406851797 ERROR    default rtsp-sdp.c:482:gst_rtsp_sdp_from_media: could not get SDP from stream 0x7faa4c0102b0
0:00:10.406857996 ERROR    default rtsp-sdp.c:521:gst_rtsp_sdp_from_media: could not get SDP from media 0x7faa68012210
0:00:10.406862290 ERROR rtspclient rtsp-client.c:2723:create_sdp: client 0x5647591b0180: could not create SDP
0:00:10.406870340 ERROR rtspclient rtsp-client.c:2858:handle_describe_request: client 0x5647591b0180: can't create SDP
Comment 3 Patricia Muscalu 2017-11-21 18:53:04 UTC
I'll have a look at this problem.
Comment 4 Edward Hervey 2017-11-22 11:35:33 UTC
Pushed a commit that adds extra checks to the media unit test (which now fail)
Comment 5 Patricia Muscalu 2017-11-22 12:12:30 UTC
This problem is related to the dynamic payloader case.
We should wait for GstRTSPStreamBlocking message before doing a position query.
Comment 6 Edward Hervey 2017-11-22 13:55:13 UTC
Created attachment 364190 [details] [review]
rtsp-media: Fix ASYNC_DONE handling

When receiving ASYNC_DONE in PREPARING state, we only want to switch
to PREPARED if:
* We weren't currently blocking waiting for data
* Or if we were, all streams are currently blocking

Fixes some initial issues, but there are still failures with
seeking
Comment 7 Edward Hervey 2017-11-22 14:36:09 UTC
The above patch fixes *simple* playback cases.

It completely fails once we start doing slightly more advanced uses (the various seek validate tests for example).

The problem seems to be some big confusion when "unsuspending" after a PAUSE. I never see the pipeline being set to PLAYING.
Comment 8 Patricia Muscalu 2017-11-23 08:53:00 UTC
Created attachment 364262 [details] [review]
test-patch
Comment 9 Patricia Muscalu 2017-11-23 19:55:42 UTC
Created attachment 364287 [details] [review]
Corrected ASYNC_DONE handling
Comment 10 Patricia Muscalu 2017-11-23 19:56:33 UTC
Created attachment 364288 [details] [review]
Removed fakesink elements
Comment 11 Patricia Muscalu 2017-11-23 19:57:43 UTC
Created attachment 364292 [details] [review]
Fix thread pool leak
Comment 12 Patricia Muscalu 2017-11-23 19:58:28 UTC
Created attachment 364293 [details] [review]
Fix handling in default_unsuspend()
Comment 13 Patricia Muscalu 2017-11-23 20:04:26 UTC
All validate.rtsp tests pass with the above patch fixes.
There are still some problems with validate.rtsp2.playback.seek_* tests.
Comment 14 Edward Hervey 2017-11-24 14:44:38 UTC
The remaining problems with RTSP2 is because for some reason the server is *not* reporting those streams as seekable.
Comment 15 Edward Hervey 2017-11-24 14:58:32 UTC
Commited all other patches in the time being.

Remaining issue is that rtsp2 corner case.

commit bb29d2e2ee46a1e1b3ffc52a3c0da91e42d82e0b (HEAD -> master, origin/master, origin/HEAD)
Author: Patricia Muscalu <patricia@axis.com>
Date:   Thu Nov 23 20:34:03 2017 +0100

    rtsp-media: Fix handling in default_unsuspend()
    
    Handle the case when streams are not blocked and media
    is suspended from PAUSED.
    
    Change-Id: I2f3d222ea7b9b20a0732ea5dc81a32d17ab75040
    
    https://bugzilla.gnome.org/show_bug.cgi?id=790674

commit de930f2e4d74f1cbf1679aa03ff6f603a5eff5ef
Author: Patricia Muscalu <patricia@axis.com>
Date:   Thu Nov 23 18:51:21 2017 +0100

    check/media: Fix thread pool leak.
    
    Change-Id: I0f92b1caca0ee518ae64a7dacfbd28a214c3eea1
    
    https://bugzilla.gnome.org/show_bug.cgi?id=790674

commit 132e00adfd0333be082594bf7e64d3b96d95d263
Author: Patricia Muscalu <patricia@axis.com>
Date:   Thu Nov 23 18:39:44 2017 +0100

    rtsp-media: Removed fakesink elements
    
    There is not need of adding fakesink elements to the media
    pipeline in the dynamic-payloader case.
    The media pipeline itself is dynamically updated with
    the receiver and sender parts that are based on the client
    transport information known after SETUP has been received.
    
    Change-Id: I4e88c9b500c04030669822f0d03b1842913f6cb9
    
    https://bugzilla.gnome.org/show_bug.cgi?id=790674

commit ac6169d50a6e1bf03323b7bada4bd43f4126b012
Author: Patricia Muscalu <patricia@axis.com>
Date:   Thu Nov 23 09:10:54 2017 +0100

    rtsp-media: Corrected ASYNC_DONE handling
    
    Media is complete when all the transport based parts are
    added to the media pipeline. At this point ASYNC_DONE is
    posted by the media pipeline and media is ready to enter
    the PREPARED state.
    
    Change-Id: I50fb8dfed88ebaf057d9a35fca2d7f0a70e9d1fa
    
    https://bugzilla.gnome.org/show_bug.cgi?id=790674
Comment 16 Edward Hervey 2017-11-24 16:36:12 UTC
Created attachment 364344 [details] [review]
rtsp-media: Enable seeking query before pipeline is complete

SDP are now provided *before* the pipeline is fully complete. In order
to know whether a media is seekable or not therefore requires asking
the invididual streams.
Comment 17 Edward Hervey 2017-11-24 16:36:58 UTC
This latest commit fixes the remaining RTSP2 problems *but* causes weird errors in the unit test.
Comment 18 Patricia Muscalu 2017-11-24 19:11:45 UTC
The problem is that when gst_rtsp_media_create_stream() is called, the src pad of the payloader is linked and it shouldn't be.
Just unref pad in gst_rtsp_stream_seekable() to solve this problem.
Comment 19 Edward Hervey 2017-11-25 06:54:35 UTC
Created attachment 364376 [details] [review]
rtsp-media: Enable seeking query before pipeline is complete

SDP are now provided *before* the pipeline is fully complete. In order
to know whether a media is seekable or not therefore requires asking
the invididual streams.

API: gst_rtsp_stream_seekable
Comment 20 Edward Hervey 2017-11-25 06:54:40 UTC
Created attachment 364377 [details] [review]
check: Add seekability testing on medias

Make sure that once GstRTSPMedia are prepared they returned
the expected seekability results
Comment 21 Edward Hervey 2017-11-25 07:15:54 UTC
(In reply to Patricia Muscalu from comment #18)
> The problem is that when gst_rtsp_media_create_stream() is called, the src
> pad of the payloader is linked and it shouldn't be.
> Just unref pad in gst_rtsp_stream_seekable() to solve this problem.

Well spotted :) Last patches fix the validate regression. Thanks !
Comment 22 Patricia Muscalu 2017-11-25 16:22:51 UTC
(In reply to Edward Hervey from comment #21)
> (In reply to Patricia Muscalu from comment #18)
> > The problem is that when gst_rtsp_media_create_stream() is called, the src
> > pad of the payloader is linked and it shouldn't be.
> > Just unref pad in gst_rtsp_stream_seekable() to solve this problem.
> 
> Well spotted :) Last patches fix the validate regression. Thanks !

Great work! Thank you very much for your help.
Comment 23 Patricia Muscalu 2017-11-25 19:12:52 UTC
I've found some other issues:

1. media->priv->seekable is not protected in gst_rtsp_media_seekable (bug 
   introduced before the mega-patch)
   => I'll send a patch
2. priv->blocking is incorrectly reset in set_blocked (rtsp-stream.c).
   I have written a unittest that actually exposes this issue.
   => I'll send a patch
3. I think that query_position() on media that contains only one active stream 
   returns an incorrect value (I think that we have the same behavior in 1.12 as 
   well).
   The same unittest from 2. can catch this problem.
   Should this problem be reported in a separate ticket?
Comment 24 Patricia Muscalu 2017-11-25 19:49:44 UTC
Created attachment 364391 [details] [review]
rtsp-media: Fix missing lock in gst_rtsp_media_seekable()
Comment 25 Patricia Muscalu 2017-11-25 19:50:13 UTC
Created attachment 364392 [details] [review]
rtsp-stream: Do not reset 'blocking' if stream is already blocked
Comment 26 Patricia Muscalu 2017-11-25 19:51:03 UTC
Created attachment 364393 [details] [review]
check/media: Add seekability test case: not all streams are active
Comment 27 Edward Hervey 2017-11-27 08:25:35 UTC
Thanks for the additional patches ! For new/other issues, please open a different bugzilla entry.

commit abeb896232be1aad8867093f0dbeed3a95f56200 (HEAD -> master, origin/master, origin/HEAD)
Author: Patricia Muscalu <patricia@dovakhiin.com>
Date:   Sat Nov 25 20:34:16 2017 +0100

    check/media: Add seekability test case: not all streams are active
    
    Media contains two streams but only one is complete and prepared
    for playing.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=790674

commit caa3f1caac3d3ce43a86e27c06d3c4c7da15473c
Author: Patricia Muscalu <patricia@dovakhiin.com>
Date:   Sat Nov 25 20:32:02 2017 +0100

    rtsp-stream: Do not reset 'blocking' if stream is already blocked
    
    https://bugzilla.gnome.org/show_bug.cgi?id=790674

commit 0015791f8fe72e648cef264f49f6e3c9c224caf7
Author: Patricia Muscalu <patricia@dovakhiin.com>
Date:   Sat Nov 25 20:45:44 2017 +0100

    rtsp-media: Fix missing lock in gst_rtsp_media_seekable()
    
    https://bugzilla.gnome.org/show_bug.cgi?id=790674
Comment 28 Patricia Muscalu 2018-03-14 08:35:38 UTC
(In reply to Patricia Muscalu from comment #23)

> 3. I think that query_position() on media that contains only one active
> stream 
>    returns an incorrect value (I think that we have the same behavior in
> 1.12 as 
>    well).
>    The same unittest from 2. can catch this problem.
>    Should this problem be reported in a separate ticket?

We will report this specific problem in a new bugzilla ticket.