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 795397 - audiomixer caps negotiation broken
audiomixer caps negotiation broken
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
1.14.0
Other All
: Normal blocker
: 1.14.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 777915 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2018-04-20 10:33 UTC by Jan Alexander Steffens (heftig)
Modified: 2018-05-06 09:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
audioaggregator: fix filtered getcaps (1.91 KB, patch)
2018-04-23 14:37 UTC, Mathieu Duponchelle
committed Details | Review

Description Jan Alexander Steffens (heftig) 2018-04-20 10:33:15 UTC
This pipeline fails on 1.14:

gst-launch-1.0 audiotestsrc ! audio/x-raw,rate=48000 ! audiomixer ! audioresample ! audio/x-raw,rate=44100 ! fakesink


Some logs:

INFO         audioaggregator gstaudioaggregator.c:671:gst_audio_aggregator_sink_getcaps:<audiomixer0:sink_0> Getting caps with filter audio/x-raw, rate=(int)48000, format=(string){ S16LE, S16BE, U16LE, U16BE, S24_32LE, S24_32BE, U24_32LE, U24_32BE, S32LE, S32BE, U32LE, U32BE, S24LE, S24BE, U24LE, U24BE, S20LE, S20BE, U20LE, U20BE, S18LE, S18BE, U18LE, U18BE, F32LE, F32BE, F64LE, F64BE, S8, U8 }, layout=(string)interleaved, channels=(int)[ 1, 2147483647 ]
DEBUG        audioaggregator gstaudioaggregator.c:673:gst_audio_aggregator_sink_getcaps:<audiomixer0:sink_0> sink template caps : audio/x-raw, format=(string){ S8, U8, S16LE, S16BE, U16LE, U16BE, S24_32LE, S24_32BE, U24_32LE, U24_32BE, S32LE, S32BE, U32LE, U32BE, S24LE, S24BE, U24LE, U24BE, S20LE, S20BE, U20LE, U20BE, S18LE, S18BE, U18LE, U18BE, F32LE, F32BE, F64LE, F64BE }, rate=(int)44100, channels=(int)[ 1, 2147483647 ], layout=(string)interleaved
DEBUG        audioaggregator gstaudioaggregator.c:674:gst_audio_aggregator_sink_getcaps:<audiomixer0:sink_0> downstream caps audio/x-raw, format=(string){ S32LE, U32LE, S16LE, U16LE, S8, U8, F32LE, F64LE }, rate=(int)44100, channels=(int)[ 1, 2147483647 ], layout=(string)interleaved; audio/x-raw, format=(string){ S32LE, U32LE, S16LE, U16LE, S8, U8, F32LE, F64LE }, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ], layout=(string)interleaved
INFO         audioaggregator gstaudioaggregator.c:675:gst_audio_aggregator_sink_getcaps:<audiomixer0:sink_0> returned sink caps : EMPTY


I guess the mixer now fixates its internal format before considering the sink caps?
Comment 1 Sebastian Dröge (slomo) 2018-04-21 10:32:18 UTC
Did this work before 1.14 or why did you mark it as blocker? When was it last known to work?
Comment 2 Jan Alexander Steffens (heftig) 2018-04-21 10:39:24 UTC
Yes; this regressed after an update from 1.12.4 to 1.14.0.
Comment 3 Sebastian Dröge (slomo) 2018-04-21 10:45:32 UTC
Did one of you bisect this already?
Comment 4 Jan Alexander Steffens (heftig) 2018-04-21 12:26:33 UTC
gst-plugins-bad 536cb125773f36ecc46815e72ffa7ae2bba783d7 is the first bad commit

commit 536cb125773f36ecc46815e72ffa7ae2bba783d7
Author: Mathieu Duponchelle <mathieu.duponchelle@opencreed.com>
Date:   Sat Jul 22 20:32:20 2017 +0200

    audioaggregator: implement input conversion
    
    https://bugzilla.gnome.org/show_bug.cgi?id=786344
Comment 5 Mathieu Duponchelle 2018-04-23 14:37:50 UTC
Created attachment 371277 [details] [review]
audioaggregator: fix filtered getcaps

In the situation described in
https://bugzilla.gnome.org/show_bug.cgi?id=795397,

downstream_caps consists of two structures, the first with
the preferred rate, if at all possible (44100), the second
containing the full range of allowed rates, as audioresample
correctly tries to negotiate passthrough caps.

As audioaggregator cannot perform rate conversion, it wants
to return a fixated rate in its getcaps implementation,
however it previously directly used the first structure in
the caps allowed downstream, without taking the filter into
consideration, to determine the rate to fixate to.

With this, we first intersect our downstream caps with the
filter, in order not to fixate to an unsupported rate.
Comment 6 Sebastian Dröge (slomo) 2018-04-23 14:59:48 UTC
Comment on attachment 371277 [details] [review]
audioaggregator: fix filtered getcaps

This gets the order of the filter caps mixed up. You should use GST_CAPS_INTERSECT_FIRST

Otherwise good to go
Comment 7 Mathieu Duponchelle 2018-04-23 15:13:41 UTC
Attachment 371277 [details] pushed as 83939c8 - audioaggregator: fix filtered getcaps
Comment 8 Sebastian Dröge (slomo) 2018-05-06 09:32:51 UTC
*** Bug 777915 has been marked as a duplicate of this bug. ***