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 534570 - Gstreamer plays flac files with the wrong channel mapping
Gstreamer plays flac files with the wrong channel mapping
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: dont know
0.10.7
Other All
: Normal normal
: 0.10.9
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-05-24 00:14 UTC by Sam Davies
Modified: 2008-05-25 19:51 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22



Description Sam Davies 2008-05-24 00:14:46 UTC
Please describe the problem:
Title says it all really. The flac spec defines what the channel order should be for various assorted channel configurations, it is available here: http://flac.sourceforge.net/format.html#frame_header.

This is how flac defines channels:

    *  1 channel: mono
    * 2 channels: left, right
    * 3 channels: left, right, center
    * 4 channels: left, right, back left, back right
    * 5 channels: left, right, center, back/surround left, back/surround right
    * 6 channels: left, right, center, LFE, back/surround left, back/surround right
    * 7 channels: not defined
    * 8 channels: not defined


Gstreamer seems to get this wrong, notably for 5.1 audio. Where it should be reading the channels as FL,FR,CEN,LFE,RL,RR it actually reads the channels as FL,FR,RL,RR,CEN,LFE which of course is the wrong way round. 

Steps to reproduce:
1. Play multichannel flac encoded according to actual flac standards
2. Hear sound come out of the wrong speakers


Actual results:
It depends on the number of channels I suppose it just results in sound coming out of all the wrong channels.

Expected results:
It should come out of the correct channels!

Does this happen every time?
Yup!

Other information:
A test flac file made with audacity and alsa sample sounds is available here:

http://137.222.225.69:8008/Multichannel_test_flac_standard_6.flac

This has the channel ordering FL,FR,CEN,LFE,RL,RR which is the standard. Each speaker should say in order which channel it is coming out of, except the lfe channel, which plays a 60 hz tone for two seconds. Here is an 8 channel flac made in a similar way except that the channels were jigged around to workaround the bad channel mapping get it to play properly:

http://137.222.225.69:8008/Multichannel_test_flac_nonstandard_8.flac
Comment 1 Sebastian Dröge (slomo) 2008-05-25 16:08:46 UTC
flacdec doesn't set any channel positions at all it seems... fixed in CVS now.

2008-05-25  Sebastian Dröge  <slomo@circular-chaos.org>

        * ext/flac/Makefile.am:
        * ext/flac/gstflacdec.c: (gst_flac_dec_write):
        Set the channel layout when decoding FLAC files with more than 2
        channels as defined by the FLAC spec. Fixes bug #534570.