Jack-Controls.txt 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. Why we need Jack kcontrols
  2. ==========================
  3. ALSA uses kcontrols to export audio controls(switch, volume, Mux, ...)
  4. to user space. This means userspace applications like pulseaudio can
  5. switch off headphones and switch on speakers when no headphones are
  6. pluged in.
  7. The old ALSA jack code only created input devices for each registered
  8. jack. These jack input devices are not readable by userspace devices
  9. that run as non root.
  10. The new jack code creates embedded jack kcontrols for each jack that
  11. can be read by any process.
  12. This can be combined with UCM to allow userspace to route audio more
  13. intelligently based on jack insertion or removal events.
  14. Jack Kcontrol Internals
  15. =======================
  16. Each jack will have a kcontrol list, so that we can create a kcontrol
  17. and attach it to the jack, at jack creation stage. We can also add a
  18. kcontrol to an existing jack, at anytime when required.
  19. Those kcontrols will be freed automatically when the Jack is freed.
  20. How to use jack kcontrols
  21. =========================
  22. In order to keep compatibility, snd_jack_new() has been modified by
  23. adding two params :-
  24. - @initial_kctl: if true, create a kcontrol and add it to the jack
  25. list.
  26. - @phantom_jack: Don't create a input device for phantom jacks.
  27. HDA jacks can set phantom_jack to true in order to create a phantom
  28. jack and set initial_kctl to true to create an initial kcontrol with
  29. the correct id.
  30. ASoC jacks should set initial_kctl as false. The pin name will be
  31. assigned as the jack kcontrol name.