aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorAnssi Hannula <anssi.hannula@iki.fi>2013-10-07 12:24:52 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-18 10:45:43 -0400
commit43d3dd157aa81407473c416234c94abcd13c4fc8 (patch)
tree06d8c5cfe1c2668bb6fb871de5e5b9bec1a2e542 /sound/pci
parent044dde0ae7ea37140b31c5068c7517b49b141aae (diff)
ALSA: hda - hdmi: Fix channel map switch not taking effect
commit 39edac70e9aedf451fccaa851b273ace9fcca0bd upstream. 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 <anssi.hannula@iki.fi> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/patch_hdmi.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index b5375ed022d7..aecf088f40af 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -930,6 +930,14 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec,
930 } 930 }
931 931
932 /* 932 /*
933 * always configure channel mapping, it may have been changed by the
934 * user in the meantime
935 */
936 hdmi_setup_channel_mapping(codec, pin_nid, non_pcm, ca,
937 channels, per_pin->chmap,
938 per_pin->chmap_set);
939
940 /*
933 * sizeof(ai) is used instead of sizeof(*hdmi_ai) or 941 * sizeof(ai) is used instead of sizeof(*hdmi_ai) or
934 * sizeof(*dp_ai) to avoid partial match/update problems when 942 * sizeof(*dp_ai) to avoid partial match/update problems when
935 * the user switches between HDMI/DP monitors. 943 * the user switches between HDMI/DP monitors.
@@ -940,20 +948,10 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec,
940 "pin=%d channels=%d\n", 948 "pin=%d channels=%d\n",
941 pin_nid, 949 pin_nid,
942 channels); 950 channels);
943 hdmi_setup_channel_mapping(codec, pin_nid, non_pcm, ca,
944 channels, per_pin->chmap,
945 per_pin->chmap_set);
946 hdmi_stop_infoframe_trans(codec, pin_nid); 951 hdmi_stop_infoframe_trans(codec, pin_nid);
947 hdmi_fill_audio_infoframe(codec, pin_nid, 952 hdmi_fill_audio_infoframe(codec, pin_nid,
948 ai.bytes, sizeof(ai)); 953 ai.bytes, sizeof(ai));
949 hdmi_start_infoframe_trans(codec, pin_nid); 954 hdmi_start_infoframe_trans(codec, pin_nid);
950 } else {
951 /* For non-pcm audio switch, setup new channel mapping
952 * accordingly */
953 if (per_pin->non_pcm != non_pcm)
954 hdmi_setup_channel_mapping(codec, pin_nid, non_pcm, ca,
955 channels, per_pin->chmap,
956 per_pin->chmap_set);
957 } 955 }
958 956
959 per_pin->non_pcm = non_pcm; 957 per_pin->non_pcm = non_pcm;