Skip to content

Commit 56cac41

Browse files
anssihtiwai
authored andcommitted
ALSA: hda - hdmi: Fix reported channel map on common default layouts
hdmi_setup_fake_chmap() is supposed to set the reported channel map when the channel map is not specified by the user. However, the function indexes channel_allocations[] with a wrong value and extracts the wrong nibble from hdmi_channel_mapping[], causing wrong channel maps to be shown. Fix those issues. Tested on Intel HDMI to correctly generate various channel maps, for example 3,4,14,15,7,8,5,6 (instead of incorrect 3,4,8,7,5,6,14,0) for standard 7.1 channel audio. (Note that the side and rear channels are reported as RL/RR and RLC/RRC, respectively, as per the CEA-861 standard, instead of the more traditional SL/SR and RL/RR.) Note that this only fixes the layouts that only contain traditional 7.1 speakers (2.0, 2.1, 4.0, 5.1, 7.1, etc.). E.g. the rear center of 6.1 is still being shown wrongly due to an issue with from_cea_slot() which will be fixed in a later patch. Signed-off-by: Anssi Hannula <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent 05c79b7 commit 56cac41

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sound/pci/hda/patch_hdmi.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -740,9 +740,10 @@ static int hdmi_manual_setup_channel_mapping(struct hda_codec *codec,
740740
static void hdmi_setup_fake_chmap(unsigned char *map, int ca)
741741
{
742742
int i;
743+
int ordered_ca = get_channel_allocation_order(ca);
743744
for (i = 0; i < 8; i++) {
744-
if (i < channel_allocations[ca].channels)
745-
map[i] = from_cea_slot((hdmi_channel_mapping[ca][i] >> 4) & 0x0f);
745+
if (i < channel_allocations[ordered_ca].channels)
746+
map[i] = from_cea_slot(hdmi_channel_mapping[ca][i] & 0x0f);
746747
else
747748
map[i] = 0;
748749
}

0 commit comments

Comments
 (0)