aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorAnssi Hannula <anssi.hannula@iki.fi>2010-12-07 11:41:35 -0500
committerTakashi Iwai <tiwai@suse.de>2010-12-07 14:12:58 -0500
commit4b0dbdb17f846a8887e5f7fbeea2deb0703236bd (patch)
treed95f36978e3dbb762c05ef4335327e45005418b5 /sound
parentdd5a089edfa51a74692604b4b427953d8e16bc35 (diff)
ALSA: hda - Do not wrongly restrict min_channels based on ELD
Commit bbbe33900d1f3c added functionality to restrict PCM parameters based on ELD info (derived from EDID data) of the audio sink. However, it wrongly assumes that the bits 0-2 of the first byte of CEA Short Audio Descriptors mean a supported number of channels. In reality, they mean the maximum number of channels (as per CEA-861-D 7.5.2). This means that the channel count can only be used to restrict max_channels, not min_channels. Restricting min_channels causes us to deny opening the device in stereo mode if the sink only has SADs that declare larger numbers of channels (like Primare SP32 AV Processor does). Fix that by not restricting min_channels based on ELD information. Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi> Reported-by: Jean-Yves Avenard <jyavenard@gmail.com> Tested-by: Jean-Yves Avenard <jyavenard@gmail.com> Cc: stable@kernel.org Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/hda_eld.c4
-rw-r--r--sound/pci/hda/patch_hdmi.c1
2 files changed, 0 insertions, 5 deletions
diff --git a/sound/pci/hda/hda_eld.c b/sound/pci/hda/hda_eld.c
index cb0c23a6b473..47ef8aa4a844 100644
--- a/sound/pci/hda/hda_eld.c
+++ b/sound/pci/hda/hda_eld.c
@@ -601,13 +601,10 @@ void hdmi_eld_update_pcm_info(struct hdmi_eld *eld, struct hda_pcm_stream *pcm,
601 pcm->rates = 0; 601 pcm->rates = 0;
602 pcm->formats = 0; 602 pcm->formats = 0;
603 pcm->maxbps = 0; 603 pcm->maxbps = 0;
604 pcm->channels_min = -1;
605 pcm->channels_max = 0; 604 pcm->channels_max = 0;
606 for (i = 0; i < eld->sad_count; i++) { 605 for (i = 0; i < eld->sad_count; i++) {
607 struct cea_sad *a = &eld->sad[i]; 606 struct cea_sad *a = &eld->sad[i];
608 pcm->rates |= a->rates; 607 pcm->rates |= a->rates;
609 if (a->channels < pcm->channels_min)
610 pcm->channels_min = a->channels;
611 if (a->channels > pcm->channels_max) 608 if (a->channels > pcm->channels_max)
612 pcm->channels_max = a->channels; 609 pcm->channels_max = a->channels;
613 if (a->format == AUDIO_CODING_TYPE_LPCM) { 610 if (a->format == AUDIO_CODING_TYPE_LPCM) {
@@ -635,7 +632,6 @@ void hdmi_eld_update_pcm_info(struct hdmi_eld *eld, struct hda_pcm_stream *pcm,
635 /* restrict the parameters by the values the codec provides */ 632 /* restrict the parameters by the values the codec provides */
636 pcm->rates &= codec_pars->rates; 633 pcm->rates &= codec_pars->rates;
637 pcm->formats &= codec_pars->formats; 634 pcm->formats &= codec_pars->formats;
638 pcm->channels_min = max(pcm->channels_min, codec_pars->channels_min);
639 pcm->channels_max = min(pcm->channels_max, codec_pars->channels_max); 635 pcm->channels_max = min(pcm->channels_max, codec_pars->channels_max);
640 pcm->maxbps = min(pcm->maxbps, codec_pars->maxbps); 636 pcm->maxbps = min(pcm->maxbps, codec_pars->maxbps);
641} 637}
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index d3e49aa5b9ec..31df7747990d 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -834,7 +834,6 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo,
834 return -ENODEV; 834 return -ENODEV;
835 } else { 835 } else {
836 /* fallback to the codec default */ 836 /* fallback to the codec default */
837 hinfo->channels_min = codec_pars->channels_min;
838 hinfo->channels_max = codec_pars->channels_max; 837 hinfo->channels_max = codec_pars->channels_max;
839 hinfo->rates = codec_pars->rates; 838 hinfo->rates = codec_pars->rates;
840 hinfo->formats = codec_pars->formats; 839 hinfo->formats = codec_pars->formats;