Help - Search - Members - Calendar
Full Version: Multichannel flac files, channels in wrong order?
Hydrogenaudio Forums > Lossless Audio Compression > FLAC
sammydee
Hi everyone.

Bit of an obscure question here, but not sure really where (or whom) to ask.

I've got some audio files from a 4.1 quad mix of a very famous album. I want to play these on my surround sound card, however:

The album songs are mixed with the channels in the following order:

FL, FR, LFE, RL, RR

(front left, front right, low frequency effects, rear left, rear right)

But when I try to play them with totem-gstreamer or mplayer it outputs the streams like:

FL, FR, RL, RR, CF

(cf is centre front)

So I get all the low frequency out of the rear left speaker, all the rear right out of the centre, and all the rear left out of the rear right.

How can I play these back with the channels in the right places? Is there a tool I can use to mux these flacs into an ogg stream and define the channels properly?

Sam
jcoalson
valid channel assignments are here: http://flac.sourceforge.net/format.html#frame_header (may have to scroll down a page)

FL, FR, LFE, RL, RR is not valid for flac but FL, FR, CF, RL, RR is. if there were no player bug then you should get the LFE out the center, so I think there are 2 things going wrong here.

you could try inserting a silent center channel and encode FL, FR, CF, LFE, RL, RR which is valid for flac. it won't take much extra space and the 5.1 mapping might not be buggy in your players.

did you encode with --channel-map=none to get it to work? that might be cueing the players to try reordering according microsoft order.
sammydee
QUOTE(jcoalson @ May 15 2008, 05:12) *

valid channel assignments are here: http://flac.sourceforge.net/format.html#frame_header (may have to scroll down a page)

FL, FR, LFE, RL, RR is not valid for flac but FL, FR, CF, RL, RR is. if there were no player bug then you should get the LFE out the center, so I think there are 2 things going wrong here.

you could try inserting a silent center channel and encode FL, FR, CF, LFE, RL, RR which is valid for flac. it won't take much extra space and the 5.1 mapping might not be buggy in your players.

did you encode with --channel-map=none to get it to work? that might be cueing the players to try reordering according microsoft order.


Hi Josh

Actually I tried reordering the channels using audacity, and exporting as flac then reordering the channels then. However, to make it work right, I had to add a silent centre channel, and reorder them like:

FL, FR, RL, RR, CF, LFE

Which isn't right either. The sound plays in the right channels with these flacs, but the other channels see far too quiet.

How do I reencode the flacs with the --channel-map=none option?

Sam
sammydee
I lied, the new flacs work well. The rear channels seemed too quiet because pulseaudio was downmixing to two channels, it's not doing that anymore and it sounds great. What I did was to open the files in audacity and rearrange them like so:

OLD: FL, FR, LFE, RL, RR

NEW: FL, FR, RL, RR, CF (silence), LFE

Then I exported them as flac. The new layout worked perfectly. Is there a way to add a silent centre channel with the command line tools, as it would be much quicker than opening with audacity and manually editing everything. The other question is, although these new flacs worked great in totem-gstreamer, are they compatible with other flac decoders?

Sam
jcoalson
unless audacity is reordering them before calling libFLAC (doubt it) then the file has an invalid channel ordering which it just happens to share with mplayer, etc. I went back and looked at WAVEFORMATEXTENSIBLE order and it's actually FL FR CF LFE BL BR ... so I'm not sure where audacity's order comes from, it doesn't match the vorbis/ac3/aac/aiff order either.

see also
http://www.microsoft.com/whdc/device/audio/multichaud.mspx
http://www.hydrogenaudio.org/forums/index....showtopic=16033
sammydee
QUOTE(jcoalson @ May 16 2008, 02:50) *

unless audacity is reordering them before calling libFLAC (doubt it) then the file has an invalid channel ordering which it just happens to share with mplayer, etc. I went back and looked at WAVEFORMATEXTENSIBLE order and it's actually FL FR CF LFE BL BR ... so I'm not sure where audacity's order comes from, it doesn't match the vorbis/ac3/aac/aiff order either.

see also
http://www.microsoft.com/whdc/device/audio/multichaud.mspx
http://www.hydrogenaudio.org/forums/index....showtopic=16033


Hmm... How can I reorder the channels without physically moving them (I assume there is some metadata which specifies which channels are which?)
tebasuna51
QUOTE(sammydee @ May 16 2008, 12:29) *

Hmm... How can I reorder the channels without physically moving them (I assume there is some metadata which specifies which channels are which?)


If you have a 4.1 encoded to flac, something is wrong because flac don't support this channel config.

If you open the flac file in Audacity and see the order FL, FR, LFE, RL, RR then you have Low Frequency Effects in the place reserved for Center channel (in flac default order for 5 channels).
But, if you have your audio equipment configured to filter Low Frequencies to Subwoofer, must play fine because LFE is all filtered to Subwoofer and the center channel remain mute.

If you want add a empty Center channel in Audacity you need:
1) Tracks -> Add new -> Audio Track
2) Click in created 'Audio Track' and 'Move Track Up' until you have the order FL,FR,CF(new empty),LFE,RL,RR
3) File -> Export -> Type: FLAC files

You don't need reorder nothing only set the empty CF at correct position.
sammydee
Hmm

It seems that I HAVE to order the channels like:

FL,FR,RL,RR,CEN,LFE in audacity and export like that, or they play the wrong way round in gstreamer or mplayer (xine, vlc and mpd don't play these files at all).

I've got the feeling I'm missing something here. What I really want to do is to find a way to add metadata to the file and label each channel with a bit of metadata that says "front right" or "lfe" etc, instead of faffing around with non-standard channel orders just to get it to work properly.

Any ideas why only mplayer and gstreamer can play the files? And how can I either:

a) Delete the metadata that is already there, telling the audio player the wrong channel order
b) Add new metadata for channels so that they are in the correct order and properly labelled or however it is done

Sam
sammydee
Well the problem has been found.

Both gstreamer and mplayer implement the flac channel spec wrongly. They use the wrong channel mappings for 5.1 surround sound, that's where all my problems are coming from. I reported a bug to the gstreamer team and apparently it will be fixed by monday, so that's one problem solved.

Sam
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.