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 766970 - aacparse: sticky event criticals with RTL HD mpeg-ts stream
aacparse: sticky event criticals with RTL HD mpeg-ts stream
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 1.8.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-05-28 16:42 UTC by Joe
Modified: 2016-07-25 10:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
keep event ordering (3.05 KB, patch)
2016-06-30 14:53 UTC, Vincent Penquerc'h
none Details | Review
push caps first (1.23 KB, patch)
2016-07-01 09:10 UTC, Vincent Penquerc'h
needs-work Details | Review
baseparse: Make sure to not create an invalid event order when generating the default CAPS event because of a GAP event (2.46 KB, patch)
2016-07-04 08:02 UTC, Sebastian Dröge (slomo)
committed Details | Review
fix for the fixate criticals (1.74 KB, patch)
2016-07-04 08:16 UTC, Vincent Penquerc'h
none Details | Review
fix for the fixate criticals (1.96 KB, patch)
2016-07-04 08:49 UTC, Vincent Penquerc'h
committed Details | Review

Description Joe 2016-05-28 16:42:29 UTC
When playing Teleboy.ch-streams with gstreamer on enigma2, sometimes audio isn't played.

Log shows:
(enigma2:647): GStreamer-WARNING **: ../../git/gst/gstpad.c:5066:store_sticky_event:<aacparse23:src> Sticky event misordering, got 'segment' before 'caps'

(enigma2:647): GStreamer-WARNING **: ../../git/gst/gstpad.c:5066:store_sticky_event:<'':decodepad111> Sticky event misordering, got 'segment' before 'caps'

(enigma2:647): GStreamer-WARNING **: ../../git/gst/gstpad.c:5066:store_sticky_event:<src_1:proxypad370> Sticky event misordering, got 'segment' before 'caps'

Example (recorded) file: http://www91.zippyshare.com/v/0UZHa7tY/file.html
Comment 1 Tim-Philipp Müller 2016-05-28 17:10:20 UTC
Thanks for the bug report.

I can confirm I get sticky event criticals and gst_structure_fixate_field_nearest_int criticals, but audio plays fine for me on the desktop with avdec_aac.
Comment 2 Vincent Penquerc'h 2016-06-30 14:53:32 UTC
Created attachment 330665 [details] [review]
keep event ordering
Comment 3 Vincent Penquerc'h 2016-06-30 14:56:16 UTC
I got those. I fixed the fixate ones first, but I can't find the patch for some reason, and I'm not getting them anymore, so it might have got fixed upstream since I updated yesterday. The patch is for the event ordering. It's a bit iffy as delaying the segment till we know caps causes a gap to cause a clock wait in the sink, as the segment in this file starts from non-zero, so we have to delay that too. So I delayed everything but stream-start, because reasons. Delaying gap and segment works too, but seems a wee bit more iffy to me.
Comment 4 Sebastian Dröge (slomo) 2016-06-30 20:25:30 UTC
Comment on attachment 330665 [details] [review]
keep event ordering

If anything, this should be in baseparse. The problem here is that we have no CAPS event from upstream and invent our own caps based on buffers (and had a SEGMENT event before the buffers of course)?

Shouldn't baseparse just delay all post-CAPS events (that it forwards) until caps are set (would need a new gst_base_parse_set_caps()) or a frame is finished?
Comment 5 Vincent Penquerc'h 2016-07-01 09:10:25 UTC
Created attachment 330705 [details] [review]
push caps first
Comment 6 Vincent Penquerc'h 2016-07-01 09:11:06 UTC
It turns out to be even simpler, since baseparse already does event delaying.
Comment 7 Sebastian Dröge (slomo) 2016-07-01 09:28:18 UTC
Review of attachment 330705 [details] [review]:

Erm that doesn't seem right. Why would you always push upstream caps downstream here? The subclass is responsible for creating caps, and usually they are not the same as the upstream ones.


If the problem is that post-caps events are sent before the subclass has created the caps event, then the solution would be to delay the post-caps events until finish_frame() or a new gst_base_parse_set_caps().
Comment 8 Vincent Penquerc'h 2016-07-01 09:31:27 UTC
I just ensure the order of push is caps first in what's already being pushed.
Comment 9 Sebastian Dröge (slomo) 2016-07-01 09:32:52 UTC
Caps should never ever be in that delayed events list as they are created by the subclass and just pushed downstream.
Comment 10 Vincent Penquerc'h 2016-07-01 09:38:37 UTC
Ah, I see. They're pushed by default caps genrated when it's getting GAP event.
So I guess that too has to be delayed, then. That delaying sounds like a huge hack in the first place tbh.
Comment 11 Sebastian Dröge (slomo) 2016-07-01 09:52:11 UTC
It's not a hack but required :)

Why would the default caps generated by the GAP event need to be delayed? At the moment you have a GAP event, you can immediately send CAPS. And all delayed events (post-CAPS events) can then be sent.
Comment 12 Vincent Penquerc'h 2016-07-01 09:54:45 UTC
I meant delaying the gap event. Since aacparse wants to nose about in the data to create caps, a gap event isn't enough for that. If the gap is not delayed, and if the segment (which must come after caps) would start at > 0, the sink will wait from 0 to the gap timestamp, as it doesn't yet know the real segment won't start at 0. So we miss that amount of audio.
Comment 13 Sebastian Dröge (slomo) 2016-07-01 09:59:59 UTC
The point of the default caps with the GAP event is that it should be as complete as possible and immediately go downstream. It's a fallback for the case where we don't have any actual data yet but need to produce caps and preroll.

You need to send the SEGMENT event (which must come before GAP) after the default caps and before the GAP event in the default caps handling. Basically you must forward all delayed events (post-CAPS events) after the default caps were sent and before forwarding the GAP.
Comment 14 Sebastian Dröge (slomo) 2016-07-04 08:02:00 UTC
Created attachment 330828 [details] [review]
baseparse: Make sure to not create an invalid event order when generating the default CAPS event because of a GAP event

There must be a SEGMENT event before the GAP event, and SEGMENT events must
come after any CAPS event. We however did not produce any CAPS yet, so we need
to ensure to insert the CAPS event before the SEGMENT event into the pending
events list.
Comment 15 Sebastian Dröge (slomo) 2016-07-04 08:05:13 UTC
Can someone who has the file in question check if this solves all the problems?
Comment 16 Vincent Penquerc'h 2016-07-04 08:13:08 UTC
(In reply to Sebastian Dröge (slomo) from comment #15)
> Can someone who has the file in question check if this solves all the
> problems?

It does :)
Comment 17 Vincent Penquerc'h 2016-07-04 08:16:22 UTC
Created attachment 330829 [details] [review]
fix for the fixate criticals

And this is for the fixate criticals too.
Comment 18 Sebastian Dröge (slomo) 2016-07-04 08:36:30 UTC
Attachment 330828 [details] pushed as 8e8b8a8 - baseparse: Make sure to not create an invalid event order when generating the default CAPS event because of a GAP event
Comment 19 Sebastian Dröge (slomo) 2016-07-04 08:37:42 UTC
Review of attachment 330829 [details] [review]:

::: gst-libs/gst/audio/gstaudiodecoder.c
@@ +2018,3 @@
+    if (gst_structure_has_field (structure, "rate"))
+      gst_structure_fixate_field_nearest_int (structure,
+          "rate", GST_AUDIO_DEF_RATE);

It will have to invent these fields if they are not there, i.e.

  if (has)
    fixate
  else
    set
Comment 20 Vincent Penquerc'h 2016-07-04 08:49:12 UTC
Created attachment 330835 [details] [review]
fix for the fixate criticals
Comment 21 Vincent Penquerc'h 2016-07-04 09:08:52 UTC
Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Date:   Mon Jul 4 09:15:03 2016 +0100

    audiodecoder: fix criticals fixating a non existent field
    
    https://bugzilla.gnome.org/show_bug.cgi?id=766970
Comment 22 Sebastian Dröge (slomo) 2016-07-04 09:17:32 UTC
commit e18a9d9b5fb535e52310189b794f787533c2880b
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Mon Jul 4 11:16:55 2016 +0200

    videodecoder: fix criticals fixating a non existent field
    
    https://bugzilla.gnome.org/show_bug.cgi?id=766970