[alsa-devel] [PATCH] ALSA: hda - Fix error accessing non-existent node for Realtek codecs

David Henningsson david.henningsson at canonical.com
Mon Jul 15 10:20:52 CEST 2013


A recent commit caused my hda-emu based test tool to complain about
accessing nodes that don't exist. This simple test works around this.

Signed-off-by: David Henningsson <david.henningsson at canonical.com>
---
 sound/pci/hda/patch_realtek.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

I don't have ALC5505 hardware here, no alsa-info to look at, and I don't know
what it is. Therefore it would be good with some confirmation that this patch
does not break such hardware, which could be the case if the Realtek codec
breaks the HDA spec by having "hidden" nodes.

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 8bd2261..ca73f10 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -3844,7 +3844,8 @@ static int patch_alc269(struct hda_codec *codec)
 		break;
 	}
 
-	if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) {
+	if (codec->num_nodes > 0x51 &&
+	    snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) {
 		spec->has_alc5505_dsp = true;
 		spec->init_hook = alc5505_dsp_init;
 	}
-- 
1.7.9.5



More information about the Alsa-devel mailing list