Skip to content

Commit 39edac7

Browse files
anssihtiwai
authored andcommitted
ALSA: hda - hdmi: Fix channel map switch not taking effect
Currently hdmi_setup_audio_infoframe() reprograms the HDA channel mapping only when the infoframe is not up-to-date or the non-PCM flag has changed. However, when just the channel map has been changed, the infoframe may still be up-to-date and non-PCM flag may not have changed, so the new channel map is not actually programmed into the HDA codec. Notably, this failing case is also always triggered when the device is already in a prepared state and a new channel map is configured while changing only the channel positions (for example, plain "speaker-test -c2 -m FR,FL"). Fix that by always programming the channel map in hdmi_setup_audio_infoframe(). Tested on Intel HDMI. Signed-off-by: Anssi Hannula <[email protected]> Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent 338cae5 commit 39edac7

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

sound/pci/hda/patch_hdmi.c

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,14 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec,
936936
return;
937937
}
938938

939+
/*
940+
* always configure channel mapping, it may have been changed by the
941+
* user in the meantime
942+
*/
943+
hdmi_setup_channel_mapping(codec, pin_nid, non_pcm, ca,
944+
channels, per_pin->chmap,
945+
per_pin->chmap_set);
946+
939947
/*
940948
* sizeof(ai) is used instead of sizeof(*hdmi_ai) or
941949
* sizeof(*dp_ai) to avoid partial match/update problems when
@@ -947,20 +955,10 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec,
947955
"pin=%d channels=%d\n",
948956
pin_nid,
949957
channels);
950-
hdmi_setup_channel_mapping(codec, pin_nid, non_pcm, ca,
951-
channels, per_pin->chmap,
952-
per_pin->chmap_set);
953958
hdmi_stop_infoframe_trans(codec, pin_nid);
954959
hdmi_fill_audio_infoframe(codec, pin_nid,
955960
ai.bytes, sizeof(ai));
956961
hdmi_start_infoframe_trans(codec, pin_nid);
957-
} else {
958-
/* For non-pcm audio switch, setup new channel mapping
959-
* accordingly */
960-
if (per_pin->non_pcm != non_pcm)
961-
hdmi_setup_channel_mapping(codec, pin_nid, non_pcm, ca,
962-
channels, per_pin->chmap,
963-
per_pin->chmap_set);
964962
}
965963

966964
per_pin->non_pcm = non_pcm;

0 commit comments

Comments
 (0)