[alsa-devel] [PATCH] ALSA: hda - Make path_has_mixer() tristate
Raymond Yau
superquad.vortex2 at gmail.com
Wed Mar 4 15:08:56 CET 2015
2015-03-03 19:20 GMT+08:00 Ingo Brückl <ib at wupperonline.de>:
> ... in order to distinguish whether there is no ctl or no path at all.
>
> It is used as !path_has_mixer() which means that it is true even if
> there is no path at all. For headphone or speaker outs without path,
> because they don't have a DAC assign to them, this would give a false
> positive result.
>
>
> your previous patch which ignore BAD_NO_PRIMARY_DAC is not enough, you
need to assign DAC to speaker path
e.g. for hda codec with single DAC with internal speaker, headphone and
lineout , the three paths contain same DAC node 0x03
http://git.kernel.org/cgit/linux/kernel/git/tiwai/hda-emu.git/tree/codecs/ad1983-dell-optiplex-745
seem snd_hda_multi_out_analog_prepare() and
snd_hda_multi_out_analog_cleanup() can handle same DAC in three paths
/* front */
snd_hda_codec_setup_stream(codec, nids[HDA_FRONT], stream_tag,
0, format);
if (!mout->no_share_stream &&
mout->hp_nid && mout->hp_nid != nids[HDA_FRONT])
/* headphone out will just decode front left/right (stereo) */
snd_hda_codec_setup_stream(codec, mout->hp_nid, stream_tag,
0, format);
/* extra outputs copied from front */
for (i = 0; i < ARRAY_SIZE(mout->hp_out_nid); i++)
if (!mout->no_share_stream && mout->hp_out_nid[i])
snd_hda_codec_setup_stream(codec,
mout->hp_out_nid[i],
stream_tag, 0, format);
/* surrounds */
for (i = 1; i < mout->num_dacs; i++) {
if (chs >= (i + 1) * 2) /* independent out */
snd_hda_codec_setup_stream(codec, nids[i], stream_tag,
i * 2, format);
else if (!mout->no_share_stream) /* copy front */
snd_hda_codec_setup_stream(codec, nids[i], stream_tag,
0, format);
}
/* extra surrounds */
for (i = 0; i < ARRAY_SIZE(mout->extra_out_nid); i++) {
int ch = 0;
if (!mout->extra_out_nid[i])
break;
if (chs >= (i + 1) * 2)
ch = i * 2;
else if (!mout->no_share_stream)
break;
snd_hda_codec_setup_stream(codec, mout->extra_out_nid[i],
stream_tag, ch, format);
}
More information about the Alsa-devel
mailing list