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 608892 - DCA/AAC/AC-3 decoders broken in gst-libav
DCA/AAC/AC-3 decoders broken in gst-libav
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-libav
git master
Other Linux
: Normal major
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-02-03 14:47 UTC by rosenstand
Modified: 2018-11-03 12:55 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description rosenstand 2010-02-03 14:47:56 UTC
In most of my videos, I only get some of the channels (usually the background music, sometimes sound effects) on my stereo setup. Non-gstreamer players grok them fine though, including mplayer, vlc, and xine.

I have all the gst-plugins-* packages installed, with most external dependencies installed. I have tried to build gst-ffmpeg with internal ffmpeg, external ffmpeg 0.5 and svn (several snapshots from 0.5 to now) with no luck. I just found out that installing libdca and the associated (-bad) plugin seems to work.

I'm using the onboard sound on an Asus M4A785G HTPC motherboard[0], which is a VIA VT2020 (snd-hda-codec-via), connected to an amplifier using the two RCA outputs on the back.

[0] http://www.asus.com/product.aspx?P_ID=uypox45wza0j3kz6
Comment 1 Bastien Nocera 2010-02-03 14:52:29 UTC
The problem seems to be with ffdec_dca's handling of multi-channel files.

Using the native plugin in gst-plugins-bad would work. Either the gst-ffmpeg glue code should be fixed to handle multi-channel properly, or simply be disabled.
Comment 2 Sebastian Dröge (slomo) 2010-02-05 16:31:50 UTC
ffdec_dca has the correct channel layout on the srcpads here. Maybe the problem is the downmixing to stereo. If you use dtsdec for decoding, is the downmixing in dtsdec used or the downmixing in audioconvert or pulseaudio?
Comment 3 Tobias Mueller 2010-08-06 00:57:48 UTC
Closing this bug report as no further information has been provided. Please feel free to reopen this bug if you can provide the information asked for.
Thanks!
Comment 4 Tim-Philipp Müller 2010-08-14 19:38:43 UTC
Just for the record: as Sebastian said, the problem is the downmixing.

The decoder needs to do the downmixing to stereo, and ffdec_* doesn't do that yet (see bug #587570). Until they do that, the ffdec_* AAC, DTS, AC3 decoders are not really useful and should not have a rank, so they are not autoplugged. Marking bug as blocker for this.

A secondary problem may be in the audiosinks, especially alsasink may advertise more channels and then either downmix internally or just drop channels without downmixing. This you need to work around by making alsasink use the right device (e.g. device=front) or forcing it to 2 channels by putting this into your gconf musicaudiosink key: "capsfilter caps='audio/x-raw-int,channels=2' ! alsasink".

Alsasink needs to do things differently so this isn't a problem any longer (there are bugs for that elsewhere).
Comment 5 Robert Swain 2010-11-02 11:33:02 UTC
I discussed the issue of why FAAD is still preferred over ffdec_aac with some FFmpeg colleagues and it seems that no one has seen any AAC samples anywhere that make use of the matrix mixing method from the specification. In fact, the specification itself states that the method is not allowed with LC AAC objects. I'm not certain, but that may perhaps extend to HE AAC as well as HE AAC might be LC AAC objects with SBR and PS objects as well.

AC-3 and DTS both use matrices though. DTS has standard matrices and the possibility to create custom ones too.

For each format, I believe that in most cases the output channel order from the decoder will follow the channels as described in their specifications in WAVEFORMATEXTENSIBLE order. Apologies if this link disappears or anything, but the order can be found in libavcodec/avcodec.h [1]. The convenience layout definitions that follow the channel order list don't cover all the different layouts in the different decoders so don't rely on just those. One can see which layouts are supported for each decoder in the AVCodec.channel_layouts member.

Perhaps the AC-3 and DTS matrices can be passed out of band (buffer metadata? :B) to audioconvert for external downmixing. Either that or one will have to implement generic channel mixing in FFmpeg and make it be performed to adhere to request_channels or whatever the current desired usage is in the libavcodec APIs, with DTS and AC-3 making use of matrices as appropriate.

[1] http://git.ffmpeg.org/?p=ffmpeg;a=blob;f=libavcodec/avcodec.h;h=96d7987bdde2751956dab6719aed60ae8f75cd47;hb=HEAD#l426
Comment 6 Tim-Philipp Müller 2011-06-30 11:14:12 UTC
This still needs to be handled for the release. In their current state, ffdec_dca and ffdec_ac3 are not fit for autoplugging, so should either get RANK_NONE or be restricted to channels=[1,2].
Comment 7 Edward Hervey 2011-06-30 19:38:45 UTC
Setting to RANK_NONE for 0.10.12 release
==================
	/* TEMPORARILY DISABLING AC3/EAC3/DTS for 0.10.12 release
	 * due to downmixing failure.
	 * See Bug #608892 for more details */
    case CODEC_ID_EAC3:
    case CODEC_ID_AC3:
    case CODEC_ID_DTS:
      rank = GST_RANK_NONE;
      break;
Comment 8 Edward Hervey 2011-06-30 19:40:39 UTC
commit 37f5d70332296c53bf6d9c1d012f53c67a8f91f0
Author: Edward Hervey <bilboed@bilboed.com>
Date:   Thu Jun 30 21:38:57 2011 +0200

    ffmpegdec: Setting AC3/EAC3/DTS decoders to rank NONE for release
    
    This still causes issues with bad (missing?) downmixing.
    
    They can be handled by existing a52dec/dtsdec
    
    See Bug #608892
Comment 9 Sebastian Dröge (slomo) 2011-11-24 07:49:13 UTC
Any news on this? Updating target milestone to 0.10.14 as 0.10.13 was released already.
Comment 10 Wim Taymans 2012-12-12 09:43:55 UTC
AVCodecContext has a request_channel_layout to make it force downmixing. It seems that only AC3 uses this field and DCA, AC3, MLP use the old deprecated request_channels fields.
Comment 11 Edward Hervey 2013-07-17 12:23:56 UTC
Still applies in git. Demoting severity to major.
Comment 12 GStreamer system administrator 2018-11-03 12:55:21 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-libav/issues/4.