[ALSA] Fix noisy output with shared channel mode with hd-audio
- Fix the wrong initialization of num_dacs when changing the channel mode between 2 and multi-channel modes. It must be evaluated after calling snd_hda_ch_mode_put() - Added the similar check of num_dacs fix in Realtek code. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
This commit is contained in:
committed by
Jaroslav Kysela
parent
35aec4e2af
commit
4e195a7b78
@@ -1647,10 +1647,12 @@ static int ad198x_ch_mode_put(struct snd_kcontrol *kcontrol,
|
||||
{
|
||||
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
|
||||
struct ad198x_spec *spec = codec->spec;
|
||||
if (spec->need_dac_fix)
|
||||
int err = snd_hda_ch_mode_put(codec, ucontrol, spec->channel_mode,
|
||||
spec->num_channel_mode,
|
||||
&spec->multiout.max_channels);
|
||||
if (! err && spec->need_dac_fix)
|
||||
spec->multiout.num_dacs = spec->multiout.max_channels / 2;
|
||||
return snd_hda_ch_mode_put(codec, ucontrol, spec->channel_mode,
|
||||
spec->num_channel_mode, &spec->multiout.max_channels);
|
||||
return err;
|
||||
}
|
||||
|
||||
/* 6-stack mode */
|
||||
|
Reference in New Issue
Block a user