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 770455 - fdkaacdec: asserts on HE-AAC v2 sample
fdkaacdec: asserts on HE-AAC v2 sample
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 1.9.90
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-08-26 20:00 UTC by Olivier Crête
Modified: 2016-09-30 07:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
totally incorrect patch that prevents the crash (1.09 KB, patch)
2016-09-24 02:13 UTC, Olivier Crête
none Details | Review
final fix (973 bytes, patch)
2016-09-26 10:45 UTC, Vincent Penquerc'h
committed Details | Review

Description Olivier Crête 2016-08-26 20:00:33 UTC
Some more more samples here:
https://www2.iis.fraunhofer.de/AAC/stereo.html

At least the one named "AOT 29, mixed signalling" just causes the decoder to fail.

$ gst-launch-1.0 souphttpsrc location=https://www2.iis.fraunhofer.de/AAC/SBRtestStereoAot5SigusePS.mp4 ! qtdemux ! aacparse !  fdkaacdec ! fakesink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
gst-launch-1.0: libSBRdec/src/sbrdecoder.cpp:1383: SBR_ERROR sbrDecoder_DecodeElement(HANDLE_SBRDECODER, INT_PCM*, int, const UCHAR*, int, int, int*, int): Assertion `strideOut > 1' failed.
Aborted (core dumped)
Comment 1 Sebastian Dröge (slomo) 2016-08-30 13:13:57 UTC
That would seem like a bug in the library itself, can you report it to Fraunhofer?
Comment 2 Olivier Crête 2016-09-07 23:08:18 UTC
Oh indeed, probably actually through google as this lib is from AOSP.. I wonder if I can reproduce this through Android.. as I assume they won't accept the patch otherwise...
Comment 3 Olivier Crête 2016-09-24 01:29:02 UTC
Actually, this is a GStreamer bug.. Using the exact same library from ffmpeg decodes the file correctly! Our aacparse doesn't support HE-AAC, so this may be why?

With ffmpeg "ffmpeg -c:a libfdk_aac -i 12min-48khz-16bit-2ch-48kbps.aac test.wav" it works fine, with gstreamer, it asserts...
Comment 4 Olivier Crête 2016-09-24 01:33:32 UTC
You can create more HE-AACv2 files using ffmpeg, this profile is also missing from our encoder plugin.

 ffmpeg -i 12min-48khz-16bit-2ch.wav -c:a libfdk_aac -profile:a aac_he_v2 -b:a 48k 12min-48khz-16bit-2ch-48kbps.aac
Comment 5 Olivier Crête 2016-09-24 02:13:22 UTC
Created attachment 336181 [details] [review]
totally incorrect patch that prevents the crash

Disabling AAC_PCM_OUTPUT_INTERLEAVED fixes the problem.. so we may need to leave it off and move the things around ourselves!
Comment 6 Sebastian Dröge (slomo) 2016-09-24 13:40:51 UTC
(In reply to Olivier Crête from comment #4)
> You can create more HE-AACv2 files using ffmpeg, this profile is also
> missing from our encoder plugin.

Yes, it's trivial to add... except for the missing support for the profile in general which would be needed for proper negotiation via caps :) And adding that requires some research.

(In reply to Olivier Crête from comment #5)
> Created attachment 336181 [details] [review] [review]
> totally incorrect patch that prevents the crash
> 
> Disabling AAC_PCM_OUTPUT_INTERLEAVED fixes the problem.. so we may need to
> leave it off and move the things around ourselves!

That seems like a bug in the library still. Especially because INTERLEAVED is the default, so it shouldn't even have any effect at all!
Comment 7 Vincent Penquerc'h 2016-09-26 10:10:43 UTC
The original call is passing 0 though, it's disabling interleaved AFAICT.
Comment 8 Sebastian Dröge (slomo) 2016-09-26 10:35:05 UTC
Indeed, that should always be 1 instead. Please merge with that change (and fix the GST_ERROR_OBJECT() in the line below while at it)
Comment 9 Vincent Penquerc'h 2016-09-26 10:44:56 UTC
Pushed:

commit 1b0cdcdf3ee83b6293317b7d921a061f8bba8cbf
Author: Olivier Crête <olivier.crete@ocrete.ca>
Date:   Mon Sep 26 11:41:42 2016 +0100

    fdkaac: fix mixup setting interleaved output
    
    https://bugzilla.gnome.org/show_bug.cgi?id=770455
Comment 10 Vincent Penquerc'h 2016-09-26 10:45:44 UTC
Created attachment 336256 [details] [review]
final fix
Comment 11 Olivier Crête 2016-09-26 16:14:05 UTC
Sorry, still doesn't work!

$ gst-launch-1.0 filesrc location=12min-48khz-16bit-2ch-48kbps.aac ! aacparse ! fdkaacdec ! fakesink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
0:00:00.030299214 13006      0x2120230 ERROR              fdkaacdec gstfdkaacdec.c:243:gst_fdkaacdec_handle_frame:<fdkaacdec0> Channel type 0 not supported
ERROR: from element /GstPipeline:pipeline0/GstAacParse:aacparse0: Internal data stream error.
Additional debug info:
gstbaseparse.c(3608): gst_base_parse_loop (): /GstPipeline:pipeline0/GstAacParse:aacparse0:
streaming stopped, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...



I created the sample file with:
ffmpeg -i 45s-48khz-16bit-2ch.wav -c:a libfdk_aac -profile:a aac_he_v2 -b:a 48k 45s-48khz-16bit-2ch-48kbps.aac

Sample file:
https://bugzilla.gnome.org/attachment.cgi?id=336277

I also filed tangentially related bug #771994 about our parser not recognizing HE-AACv2 files as such.
Comment 12 Olivier Crête 2016-09-26 16:34:28 UTC
Arg, it seems that it's a bug in fdk-aac 1.4 .. maybe we should bump our dep... Buliding against git master hits the next problem that "AOT_MP2_AAC_LC" is not there anymore. Removing that makes the encoder "work" as in avdec_aac can still decode the stream. But this fails "audiotestsrc ! fdkaacenc ! fdkaacdec ! pulsesink"
Comment 13 Vincent Penquerc'h 2016-09-27 15:22:35 UTC
I fixed that one in https://bugzilla.gnome.org/show_bug.cgi?id=772067
Comment 14 Tim-Philipp Müller 2016-09-27 16:25:07 UTC
I guess we can close this one again then..