[alsa-devel] [PATCH 104/112] ALSA: hda - Clear path indices properly at each re-evaluation
Takashi Iwai
tiwai at suse.de
Tue Jan 8 12:39:37 CET 2013
The path indices must be reset at each evaluation of DAC assignment.
Otherwise the badness value will be wrongly calculated and mixers may
be inconsistently assigned.
Signed-off-by: Takashi Iwai <tiwai at suse.de>
---
sound/pci/hda/hda_generic.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index 7c76a00..990a79e 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -1138,6 +1138,16 @@ static int fill_and_eval_dacs(struct hda_codec *codec,
memset(spec->multiout.extra_out_nid, 0, sizeof(spec->multiout.extra_out_nid));
spec->multi_ios = 0;
snd_array_free(&spec->paths);
+
+ /* clear path indices */
+ memset(spec->out_paths, 0, sizeof(spec->out_paths));
+ memset(spec->hp_paths, 0, sizeof(spec->hp_paths));
+ memset(spec->speaker_paths, 0, sizeof(spec->speaker_paths));
+ memset(spec->aamix_out_paths, 0, sizeof(spec->aamix_out_paths));
+ memset(spec->digout_paths, 0, sizeof(spec->digout_paths));
+ memset(spec->loopback_paths, 0, sizeof(spec->loopback_paths));
+ memset(&spec->digin_path, 0, sizeof(spec->digin_path));
+
badness = 0;
/* fill hard-wired DACs first */
--
1.8.0.1
More information about the Alsa-devel
mailing list