From: Raymond Yau [mailto:superquad.vortex2@gmail.com] Sent: Friday, March 27, 2015 8:39 AM To: Jie, Yang Cc: ALSA Development Mailing List; Liam Girdwood; Takashi Iwai; David Henningsson; Girdwood, Liam R; Tanu Kaskinen; broonie@kernel.org Subject: Re: [alsa-devel] [PATCH v2 1/2] ALSA: jack: create jack kcontrols for every jack input device
l
OK, then I am thinking we can add jack kctls creating code like below:
snd_jack_new(struct snd_card *card, const char *id, int type, struct snd_jack **jjack) { ... Switch(type | SND_JACK_HEADSET) { case SND_JACK_MICROPHONE: create "Mic Jack" kctl; break; case SND_JACK_HEADSET: if (id == "Headphone Mic Headset") { create " Headphone Mic Jack " kctl; create " Headset Mic Jack " kctl; } else { create " Headphone Jack " kctl; create " Headset Mic Jack " kctl; } break; case SND_JACK_HEADPHONE: if (id == "Headset Mic") { create " Headphone Jack " kctl; // create " Headset Mic Phantom Jack " kctl; } else if (id == "Headphone Mic") { create " Headphone Mic Jack " kctl; } else if (id == "Headset Headphone Mic") { create " Headphone Mic Jack " kctl; // create " Headset Mic Phantom Jack " kctl; } else { create " Headphone Jack " kctl; } break; default: create "Mic Jack" kctl; break; } ... }
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/tree/sound/pci/...
If you look at snd_hda_jack_add_kctl(struct hda_codec *codec, hda_nid_t nid, const char *name, int idx) which add kctl and call snd_jack_new if it is not phantom
[Keyon] it’s good that we don’t need handle phantom jack in snd_jack_new().
It is unlikely snd_jack_new() create those kctl
For mobile phone or tablet , there is one and only one input : headset
[Keyon] that’s OK.
for notebook and desktop, there are dual headphone jacks, four line out jacks for 7.1 surround, line in,
phantom jack for spdif, surround speakers , hp and mic for those desktop using ac97 front audio panel
[Keyon] we will create kctls for each headphone/mic/headset jacks, but not for line in/out and phantom
jacks, is this OK?