[alsa-devel] Bug in setting channels, related to recent ELD/EDID changes?

Takashi Iwai tiwai at suse.de
Mon Jan 10 20:51:18 CET 2011


At Sun, 02 Jan 2011 12:16:44 +0200,
Anssi Hannula wrote:
> 
> Hi!
> 
> Takashi, it seems the "allow all when not plugged in" behaviour you
> implemented in bbbe3390 is not enough to allow applications to open the
> device before the output device is ready. Switched-off A/V receivers may
> provide the information of the plugged-in television which usually
> restricts the max_channels to 2, causing applications to fail opening
> the device with more channels when a the A/V receiver is switched off.
> 
> Also, even if the application can gracefully fallback to stereo, AFAIK
> there is no method for an application to get informed when the
> limitation is lifted, so it can't automatically resume multichannel
> output when the A/V receiver is switched on again.
> 
> Based on this info, I guess the restrictions based on ELD should be
> removed :/
> Unless you have some other ideas to fix the issue, of course.

What about the patch below?  If it's unplugged, the valid flag should
be cleared, so the next open fall backs to the default state (i.e.
allows all).


Takashi

---
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index d1b1b57..27e8597 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -827,7 +827,7 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo,
 		*codec_pars = *hinfo;
 
 	eld = &spec->sink_eld[idx];
-	if (eld->sad_count > 0) {
+	if (eld->eld_valid && eld->sad_count > 0) {
 		hdmi_eld_update_pcm_info(eld, hinfo, codec_pars);
 		if (hinfo->channels_min > hinfo->channels_max ||
 		    !hinfo->rates || !hinfo->formats)


More information about the Alsa-devel mailing list