GNOME Bugzilla – Bug 631501
[faad] failed to dynamically switch from 2 audio channels to 6
Last modified: 2010-10-14 09:32:30 UTC
* Steps to reproduce: Try to play the attached mkv file with gsrteamer * Actual result: It fails when the stream switch from 2 audio channels to 6. ** Message: Error: Internal GStreamer error: negotiation problem. Please file a bug at http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer. gstfaad.c(1293): gst_faad_chain (): /GstPlayBin2:play/GstURIDecodeBin:uridecodebin0/GstDecodeBin2:decodebin20/GstFaad:faad0: Setting caps on source pad failed * Expected result: faad element should be able to decode the audio stream * Other informations: I have a source that output 'audio/x-raw-int, through the same src pad, any number of audio channels with 'channels' and 'channel-positions' correctly set in all cases. I recorded it with faac and matroskamux without any error. * log: GST_DEBUG=faad:4 gst-launch-0.10 filesrc location=capture.mkv ! matroskademux ! faad ! fakesink Setting pipeline to PAUSED ... Pipeline is PREROLLING ... 0:00:00.038127089 19771 0x95a5158 DEBUG faad gstfaad.c:565:gst_faad_drain:<faad0> draining 0:00:00.038180155 19771 0x95a5158 DEBUG faad gstfaad.c:688:gst_faad_sink_event:<faad0> Got NEWSEGMENT event in GST_FORMAT_TIME, passing on (0:00:00.000000000 - 0:00:33.320000000) 0:00:00.038350942 19771 0x95a5158 DEBUG faad gstfaad.c:365:gst_faad_setcaps:<faad0> codec_data: object_type=2, sample_rate=3, channels=2 0:00:00.038474743 19771 0x95a5158 DEBUG faad gstfaad.c:380:gst_faad_setcaps:<faad0> codec_data init: channels=2, rate=48000 0:00:00.038497354 19771 0x95a5158 DEBUG faad gstfaad.c:565:gst_faad_drain:<faad0> draining 0:00:00.038765568 19771 0x95a5158 DEBUG faad gstfaad.c:454:gst_faad_chanpos_to_gst:<faad0> stereo common case; won't set channel positions 0:00:00.038780433 19771 0x95a5158 DEBUG faad gstfaad.c:923:gst_faad_update_caps:<faad0> New output caps: audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)48000, channels=(int)2 Pipeline is PREROLLED ... Setting pipeline to PLAYING ... New clock: GstSystemClock 0:00:00.149052669 19771 0x95a5158 DEBUG faad gstfaad.c:460:gst_faad_chanpos_to_gst:<faad0> faad channel 0 as 2 0:00:00.149065064 19771 0x95a5158 DEBUG faad gstfaad.c:460:gst_faad_chanpos_to_gst:<faad0> faad channel 1 as 3 0:00:00.149070968 19771 0x95a5158 DEBUG faad gstfaad.c:460:gst_faad_chanpos_to_gst:<faad0> faad channel 2 as 0 0:00:00.149076214 19771 0x95a5158 DEBUG faad gstfaad.c:494:gst_faad_chanpos_to_gst:<faad0> unknown channel 0 at 2 0:00:00.149081460 19771 0x95a5158 DEBUG faad gstfaad.c:460:gst_faad_chanpos_to_gst:<faad0> faad channel 3 as 0 0:00:00.149086542 19771 0x95a5158 DEBUG faad gstfaad.c:494:gst_faad_chanpos_to_gst:<faad0> unknown channel 0 at 3 0:00:00.149091641 19771 0x95a5158 DEBUG faad gstfaad.c:460:gst_faad_chanpos_to_gst:<faad0> faad channel 4 as 0 0:00:00.149096661 19771 0x95a5158 DEBUG faad gstfaad.c:494:gst_faad_chanpos_to_gst:<faad0> unknown channel 0 at 4 0:00:00.149101781 19771 0x95a5158 DEBUG faad gstfaad.c:460:gst_faad_chanpos_to_gst:<faad0> faad channel 5 as 0 0:00:00.149106811 19771 0x95a5158 DEBUG faad gstfaad.c:494:gst_faad_chanpos_to_gst:<faad0> unknown channel 0 at 5 0:00:00.149111998 19771 0x95a5158 WARN faad gstfaad.c:515:gst_faad_chanpos_to_gst:<faad0> Unsupported FAAD channel position 0x4f encountered 0:00:00.149117537 19771 0x95a5158 DEBUG faad gstfaad.c:914:gst_faad_update_caps:<faad0> Could not map channel positions 0:00:00.149124068 19771 0x95a5158 WARN faad gstfaad.c:1293:gst_faad_chain:<faad0> error: Setting caps on source pad failed 0:00:00.149169138 19771 0x95a5158 DEBUG faad gstfaad.c:565:gst_faad_drain:<faad0> draining ERROR: from element /GstPipeline:pipeline0/GstFaad:faad0: Internal GStreamer error: negotiation problem. Please file a bug at http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer. Additional debug info: gstfaad.c(1293): gst_faad_chain (): /GstPipeline:pipeline0/GstFaad:faad0: Setting caps on source pad failed Execution ended after 110246627 ns. Setting pipeline to PAUSED ... Setting pipeline to READY ... Setting pipeline to NULL ... Freeing pipeline ...
Created attachment 171808 [details] mkv file that contains 2 audio channels then 6 (recorded with faac)
faad fails to renegotiate because faad reports the extra 4 channels as unknown channels. The semantics of the channels are conveyed by codec_data or the ADTS prefix, which is likely missing in this case for the 6-channels (second) part (as there is only 1 codec_data to store). You might have more luck/success trying to do these tricks with ADTS, but seems unlikely to work for a muxed format.
Created attachment 171894 [details] log testing outputformat raw or adts This tar contains 4 logs: log_sender_raw.txt (uses faac with outputformat=0) and log_receiver_raw.txt (uses faad) log_sender_adts.txt (uses faac with outputformat=1) and log_receiver_adts.txt (uses faad) According to the 2 sender logs, it seems that faac correctly switch from 2 channels to 6. (at least it seems to reconfigure stuffs). (go to 'Unexpected' in the logs). According to the 2 receiver logs, it seems to fails in a same behavior (go to'Unsupported' in the logs)
Following commit handles the ADTS case, the container/raw case is not quite likely (cfr earlier comment). ---- commit 7499f2b09ba79e7dbe3dfbb09eee5477252065e9 Author: Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> Date: Tue Oct 12 18:17:27 2010 +0200 faad: cater for renegotiation At least, whenever either stream (e.g. ADTS) or upstream provides necessary info for doing so. Fixes #631501.
Created attachment 172261 [details] ts file that contains severals switch between 2 and 6 audio channels (recorded with faac and its outputformat set to ADTS) Your patch fixed the first switch (from 2 to 6 channels), but faad fails when switching back to 2 audio channels.
commit 8a6c490962adacdf5438b02faa106004ba705874 Author: Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> Date: Thu Oct 14 11:24:42 2010 +0200 faad: reflow opening and closing decoder In particular, this reconfigures quite forcefully when renegotiation is needed. Fixes #631501.