[alsa-devel] [PATCH 00/19] Rework OMAP4+ HDMI audio support

Jyri Sarha jsarha at ti.com
Wed May 14 12:02:22 CEST 2014

On 05/13/2014 12:13 AM, Joachim Eastwood wrote:
> On 12 May 2014 11:12, Jyri Sarha <jsarha at ti.com> wrote:
> hey, this worked straight away :)
> But there seems to be something wrong with the channel mapping.
> For stereo (speaker-test -c 2) the mapping is correct.
> But for -c 4 and -c 8 it gets weird:
> speaker-test -c 4 -s X # where X is 1-4
> 1: Front Left is Rear Left
> 2: Front Right is Rear Right
> 3: Rear Right is Front Right
> 4: Rear Left is Front Left
> speaker-test -c 8 -s X # where X is 1-8
> 1: Front Left is Rear Left
> 2: Center is Rear Left
> 3: Front Right is Rear Right
> 4: Side Right is Front Right
> 5: Rear Right is silent
> 6: Rear Left is Center
> 7: Side Left is Front Left
> 8: LFE - Rear Right
> I think you need to check what channel order ALSA expects. I believe
> speaker-test does the right thing on my HTPC normally connected to my
> receiver.

I checked the implementation and there was indeed something weird there, 
but the implementation can not explain the FL and FR channels jumping 
around. FL and FL should always be the first two channels in all 
configurations and the implementation does not touch them.

The implementation uses 8ch HDMI setup for anything above 2ch with 
"Audio InfoFrame Data Byte 4" set to 0x13. According to CEA-861 specs 
this means following channel order: FL, FR, LFE, FC, RL, RR, RLC, RRC

This is a closest match to ALSA 8ch mapping (according to 
sound/core/pcm_lib.c) which is: FL, FR, FC, LFE, RL, RR, SL, SR

Current implementation has FLE and FC channels correctly swapped, but it 
shifts them to last two channels and RL, RR, SL, SR are shifted down to 
fill the place. This is all wrong and I'll try to come up with a fix for 
that. Unfortunately I can not test anything beyond 2 ch myself so I 
would need someone to volunteer to test my patch.

Best regards,

More information about the Alsa-devel mailing list