Skip to content

Commit b84b531

Browse files
HiassofTbroonie
authored andcommitted
ASoC: hdmi-codec: Fix broken channel map reporting
Commit 4e08713 ("ASoC: hdmi-codec: fix channel info for compressed formats") accidentally changed hcp->chmap_idx from ca_id, the CEA channel allocation ID, to idx, the index to the table of channel mappings ordered by preference. This resulted in wrong channel maps being reported to userspace, eg for 5.1 "FL,FR,LFE,FC" was reported instead of the expected "FL,FR,LFE,FC,RL,RR": ~ # speaker-test -c 6 -t sine ... 0 - Front Left 3 - Front Center 1 - Front Right 2 - LFE 4 - Unknown 5 - Unknown ~ # amixer cget iface=PCM,name='Playback Channel Map' | grep ': values' : values=3,4,8,7,0,0,0,0 Switch this back to ca_id in case of PCM audio so the correct channel map is reported again and set it to HDMI_CODEC_CHMAP_IDX_UNKNOWN in case of non-PCM audio so the PCM channel map control returns "Unknown" channels (value 0). Fixes: 4e08713 ("ASoC: hdmi-codec: fix channel info for compressed formats") Cc: [email protected] Signed-off-by: Matthias Reichl <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent dd9f9cc commit b84b531

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sound/soc/codecs/hdmi-codec.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,10 @@ static int hdmi_codec_fill_codec_params(struct snd_soc_dai *dai,
531531
hp->sample_rate = sample_rate;
532532
hp->channels = channels;
533533

534-
hcp->chmap_idx = idx;
534+
if (pcm_audio)
535+
hcp->chmap_idx = ca_id;
536+
else
537+
hcp->chmap_idx = HDMI_CODEC_CHMAP_IDX_UNKNOWN;
535538

536539
return 0;
537540
}

0 commit comments

Comments
 (0)