[alsa-devel] [PATCH v2 1/2] ALSA: jack: create jack kcontrols for every jack input device

Raymond Yau superquad.vortex2 at gmail.com
Fri Mar 27 01:39:10 CET 2015


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/hda/hda_jack.c

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

It is unlikely snd_jack_new() create those kctl

For mobile phone or tablet , there is one and only one input : headset

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


More information about the Alsa-devel mailing list