Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Foobar problem with channel mapping when playing 4.1 or 5.0 files. (Read 1626 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Foobar problem with channel mapping when playing 4.1 or 5.0 files.

Hi, I already described my problem here:
https://hydrogenaud.io/index.php/topic,123098.msg1016922/topicseen.html#new
but now I think that it is not an encoding problem but Foobars problem with proper channel mapping of "uncommon" channels, like 5.0 and 4.1.
The problem is that whenever I play such files (5.0 or 4.1) with foobar (1.6.12, windows10) with exclusive "wasapi" via HDMI to my Onkyo AVR, front left, front right, back left and back right channels play properly but the LFE channel (of 4.1 stream) plays improperly in both Center and SUB speakers (simulaneously). The same goes to Center channel (of 5.0 stream) - it plays both in Center and SUB speakers simulatneously.
There is no problem with "common" channels - such as 2.0, 4.0 and 5.1.
The problem does not depend on file extension nor codec - I tried MPL, WAV, FLAC and WavPack. All of those files play wrong when the files are 4.1 or 5.0. Those files (except for WAVs) play properly in MPC-HC player - Center is only in Center and LFE is only in SUB.
Could this be fixed in Foobar?

Re: Foobar problem with channel mapping when playing 4.1 or 5.0 files.

Reply #1
According to xiph.org the flac standard says:

Channel assignment
0000-0111 : (number of independent channels)-1. Where defined, the channel order follows SMPTE/ITU-R recommendations. The assignments are as follows:
1 channel: mono
2 channels: left, right
3 channels: left, right, center
4 channels: front left, front right, back left, back right
5 channels: front left, front right, front center, back/surround left, back/surround right
6 channels: front left, front right, front center, LFE, back/surround left, back/surround right
7 channels: front left, front right, front center, LFE, back center, side left, side right
8 channels: front left, front right, front center, LFE, back left, back right, side left, side right
1000 : left/side stereo: channel 0 is the left channel, channel 1 is the side(difference) channel
1001 : right/side stereo: channel 0 is the side(difference) channel, channel 1 is the right channel
1010 : mid/side stereo: channel 0 is the mid(average) channel, channel 1 is the side(difference) channel
1011-1111 : reserved

Using this info you can add silent front center/LFE channels to your 4.1 and 5.0 sound files using a sound editor like Audiacity for getting 6 channels sound files accepted by your receiver. Foobar2000 does not have information for doing this correct.

You might also be able to use Foobar2000 Matrix Mixer component.

Re: Foobar problem with channel mapping when playing 4.1 or 5.0 files.

Reply #2
This is not a "FLAC problem", that has already been sorted out in the thread linked to.
* The OP's problem also manifests itself in WavPack, a format which natively supports the channel mappings in question.
* fb2k should be able to handle the WAVEFORMATEXTENSIBLE_CHANNEL_MASK tag, which instructs a different channel ordering than the channel bits.

Re: Foobar problem with channel mapping when playing 4.1 or 5.0 files.

Reply #3
This entire issue is weird. I know my own output WASAPI Shared component sends the channel map to the OS and thus sound drivers and I'm positive the native audio output does the same. And the outputs sound the same here. Also I see no difference in output behavior between foobar2000 and MPC-HC or any other audio software.

Also I tried the built-in 5.1 channel upmix DSP with Converter. There is no output to the center speaker in the written wav.

But since you mentioned that sub and center channel play the same audio I see that happening in my audio device's control software. It allows testing individual speakers by clicking on their icons. Pressing either the sub woofer or the center speaker has the same result - both speakers play a test tone.

Re: Foobar problem with channel mapping when playing 4.1 or 5.0 files.

Reply #4
The problem is that whenever I play such files (5.0 or 4.1) with foobar (1.6.12, windows10) with exclusive "wasapi" via HDMI
What happens if you don't use exclusive mode? Several combinations possible, including assigning this output as the system default.

Re: Foobar problem with channel mapping when playing 4.1 or 5.0 files.

Reply #5
Ok, I replicated the issue with WASAPI exclusive output. Easy to workaround for now by adding "Upmix to 5.1" DSP to the DSP chain.

Re: Foobar problem with channel mapping when playing 4.1 or 5.0 files.

Reply #6
Problem noted, thanks for reporting.
Microsoft Windows: We can't script here, this is bat country.

Re: Foobar problem with channel mapping when playing 4.1 or 5.0 files.

Reply #7
The problem is that whenever I play such files (5.0 or 4.1) with foobar (1.6.12, windows10) with exclusive "wasapi" via HDMI
What happens if you don't use exclusive mode? Several combinations possible, including assigning this output as the system default.


When I use non-exclusive mode (with speakers set to 5.1 in windows config) both files (4.1 and 5.0) play properly. So it seems like it is exclusive  mode problem.
By the way what is the difference bteween:
Default: Primary Sound Device and
Default: "my AVR name" (Audio for Intel (R))
(this "audio for Intel" is my own translation beauce I do not use English in Windows, so I might be little different in reality but I thin everybody should know what it is).
The Primary Sound device is always there (in foobar) and the other one is only active when I turn my AVR on (which is understandable) but are those two different outputs or the same (but duplicated) and if different what is the difference?

Re: Foobar problem with channel mapping when playing 4.1 or 5.0 files.

Reply #8
Ok, I replicated the issue with WASAPI exclusive output. Easy to workaround for now by adding "Upmix to 5.1" DSP to the DSP chain.

I just used the Upmix do 5.1 dsp and it sounded horrible. That is not an option for me. Surely the center played some music (probably some mix of fronts or fronts and backs or even SUB) but it was not good.
If the problem can't be solved within foobar what I would need is to be able to add a perfectly silent channel (either SUB or Center) to make foobar think it plays 5.1 and not 4.1 or 5.0.
Maybe someone could write such a plugin - that would let user add an additional fake (totally silent) channel to real audio stream without any changes to real channels. With option to apply it only in needed situations (not always but ex. only 6th channel to 4.1 or 5.0)

Edit: I just installed Peters WASAPI 3.4 plugin and it plays 4.1 properly. So the problem is in built-in  "new" WASAPI-exclusive.

Re: Foobar problem with channel mapping when playing 4.1 or 5.0 files.

Reply #9
It turns out that there's a bug in foobar2000 v1.6 series that causes wrong remapping of 4.1 or 5.0 channels to 5.1 for exclusive output - a channel that should be silent instead duplicates content of another channel.
I fixed it for 2.0 a while ago but forgot to backport the fix.
Version 1.6.13 with a fix for this issue will be out next week. In meanwhile, you can try v2.0 beta.
Microsoft Windows: We can't script here, this is bat country.

Re: Foobar problem with channel mapping when playing 4.1 or 5.0 files.

Reply #10
It turns out that there's a bug in foobar2000 v1.6 series that causes wrong remapping of 4.1 or 5.0 channels to 5.1 for exclusive output - a channel that should be silent instead duplicates content of another channel.
I fixed it for 2.0 a while ago but forgot to backport the fix.
Version 1.6.13 with a fix for this issue will be out next week. In meanwhile, you can try v2.0 beta.

Thanks,
I confirm that my 4.1 and 5.0 flac files play properly in FB v2 beta12.