[vlc-devel] Re: your vlc audio patch

Mark Wells mark.wells at oxsemi.com
Thu Jul 1 13:52:29 CEST 2004


Hello again

I have been working on 5.0 and 5.1 audio environments under OS X. you 
may remember that the 5-channel combination was incorrect, so I have 
taken the advice given by Jean-Alexis and changed the channel ordering 
array in vlc/modules/audio_filter/converter/a52tofloat32.c so that the 
correct audio channels come out. This is what I have found:

static const int translation[7][6] =
     {{ 0, 0, 0, 0, 0, 0 },      /* 0 channels (rarely used) */
     { 0, 0, 0, 0, 0, 0 },       /* 1 ch */
     { 0, 1, 0, 0, 0, 0 },       /* 2 */
     { 1, 2, 0, 0, 0, 0 },       /* 3 */
     { 1, 3, 2, 0, 0, 0 },       /* 4 */
     //{ 1, 3, 4, 2, 0, 0 },       /* 5 */ The incorrect old arrangement
     { 0, 2, 3, 4, 1, 0 },       /* 5 */
     { 1, 3, 4, 5, 2, 0 }};      /* 6 */


I now have a couple of questions regarding where to go from here:

a) I know that the 5.0 channel setup is now correct, but is it expected 
that the arrangement is so different to 5.1?

b) If I select the 5.1 audio option while my content only supports 5.0, 
all the channels get swapped around. However, if I do the reverse (ie 
select 5.0 audio but use some 5.1 content) then the results are what I 
would expect logically - the LFE channel is simply ignored and content 
effectively plays as 5.0. Why is this? Can I fix it so that 5.0 content 
plays correctly in a 5.1 environment?

c) The matrix above that determines channel allocation only goes up to 
6 channels. What happens for 7 or 8 channel audio and how do those 
channels get assigned?

Many thanks

Mark Wells

On 25 Jun 2004, at 22:39, Jean-Alexis Montignies wrote:

> Yes there is a "bug" (in fact more a non implemented yet feature) in 
> the AC3 filter in VLC.
> For testing your set up, you can use the .vob file at 
> http://www.matroxusers.com/Reviews/SoftwareDVD/AC3TEST.zip
>
> You'll see that by default, the channel order is set for a one rear, 
> one center, left and right setup. It looks like the channel order for 
> 5 channel includes LFE but only one rear channel.
>
> My patch I didn't release because it doesn't fix the problem, just 
> hide it in my particular case. It's not hard to fix, but I did not 
> have the time yet.
> This is all in vlc/modules/audio_filter/converter/a52tofloat32.c
>
> Index: a52tofloat32.c
> ===================================================================
> --- a52tofloat32.c      (revision 7893)
> +++ a52tofloat32.c      (working copy)
> @@ -247,7 +247,7 @@
>      { 0, 0, 0, 0, 0, 0 },       /* 1 ch */
>      { 0, 1, 0, 0, 0, 0 },       /* 2 */
>      { 1, 2, 0, 0, 0, 0 },       /* 3 */
> -    { 1, 3, 2, 0, 0, 0 },       /* 4 */
> +    { 0, 1, 2, 3, 0, 0 },       /* 4 */
>      { 1, 3, 4, 2, 0, 0 },       /* 5 */
>      { 1, 3, 4, 5, 2, 0 }};      /* 6 */
>
> Good WWDC :)
>
> Jean-Alexis Montignies
> http://www.sente.ch/
>
> On 24 juin 04, at 15:58, Mark Wells wrote:
>
>> Matt,
>>
>> Thanks for your reply, it helps to explain my situation pretty well. 
>> So if I isolate a specific audio format (eg 6-channel) by 
>> commenting-out all the other support (except mono) then the AC3 
>> stream plays perfectly. I *think* that once specific format selection 
>> works (ie once the menus successfully allow you to change between 
>> stereo, 5.1, 7.1 etc) then this problem will disappear.
>>
>> To answer your question, I'm testing using one of our own devices, 
>> the OXFW970 (http://www.oxsemi.com/press/jan04/index2.html).
>>
>> An update so far, for anyone interested.....
>>
>> I notice that in ChannelsToAoutVar there is a 5-channel support 
>> option (3 Front 2 Rear) however there is no initial 5 channel PCM 
>> support available to complement this! So I have added this, and 
>> opened the correct physical channels. The channel allocation seems to 
>> be all wrong tho, as main audio comes out of channel 1 (front left). 
>> 2&3 and 4&5 are the stereo pairs, but I havent figured out which pair 
>> is front/surround yet.
>>
>> Further, if I play 5-channel content in a 6-channel environment then 
>> channel 4 is empty, channel 5 plays what was in channel 4, and 
>> channel 6 plays what was in channel 5 (compared with the 5-channel 
>> environment). Playing 5-channel content in an 8-channel environment 
>> reverts back to the configuration in the 5-channel environment, but 
>> duplicates channels 1-3 on 6-8. Channel-duplication is annoying but 
>> tolerable. However channel-switching is not tolerable! im working on 
>> it!
>
>>
>> Mark
>>
>>
>> On 23 Jun 2004, at 03:37, Matthew Romaine wrote:
>>
>
> -- 
> This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
> To unsubscribe, please read http://developers.videolan.org/lists.html
> If you are in trouble, please contact <postmaster at videolan.org>
>
>
----------------------------------
Mark Wells
Oxford Semiconductor Ltd
25 Milton Park, Abingdon, OX14 4SH, UK


-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html
If you are in trouble, please contact <postmaster at videolan.org>



More information about the vlc-devel mailing list