Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jie Yang <yang.jie@intel.com>
To: tiwai@suse.de
Cc: alsa-devel@alsa-project.org, broonie@kernel.org,
	tanu.kaskinen@linux.intel.com, liam.r.girdwood@intel.com
Subject: [PATCH v8 7/7] ALSA: Docs: Add documentation for Jack kcontrols
Date: Wed, 22 Apr 2015 14:03:53 +0800	[thread overview]
Message-ID: <1429682633-10765-8-git-send-email-yang.jie@intel.com> (raw)
In-Reply-To: <1429682633-10765-1-git-send-email-yang.jie@intel.com>

Add documentation describing Jack embedded kcontrols, and how to
use it on HD-Audio and ASoC case.

Signed-off-by: Jie Yang <yang.jie@intel.com>
---
 Documentation/sound/alsa/Jack-Controls.txt | 48 ++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100644 Documentation/sound/alsa/Jack-Controls.txt

diff --git a/Documentation/sound/alsa/Jack-Controls.txt b/Documentation/sound/alsa/Jack-Controls.txt
new file mode 100644
index 0000000..9e93947
--- /dev/null
+++ b/Documentation/sound/alsa/Jack-Controls.txt
@@ -0,0 +1,48 @@
+Why we need kcontrols for Jack?
+===============================
+
+ALSA using kcontrols to export controlling(switch, volume, Mux, ...) to
+user space, e.g. pulseaudio can switch off headphone and switch on
+speaker when no heaphone is pluged in.
+
+For each physical jack, there may be dynamic pluged in/out status which
+upper layer may be interested in. Currently the ALSA jack core registers
+only input devices for each jack registered. These jack input devices
+are not readable by userspace devices that run as non root.
+
+So we create embeded kcontrols for each jack, report jack event via
+these kcontrols, userspace switch them to ack on these event, to
+implement what they are wanna to.
+
+Combining with ucm machanism, userpace can do fantasic controlling as
+they want to.
+
+Jack and kcontrols
+==================
+
+Each jack will have a kcontrol list, we can create a kcontrol and attach
+it to the jack, at jack creating stage. Also, we can add kcontrol to an
+exist jack, at anytime when you are happy.
+
+Those kcontrols will be freed automatically when the Jack is freed.
+
+How to create kcontrol embedded jack?
+=====================================
+
+To be compatible with previous HD-Audio jack and ASoC jack, we modify
+snd_jack_new() with adding two params:
+
+ - @phantom_jack: for phantom jack, only create needed kctl, won't create
+	real jack device.
+ - @jjack_kctl: create kctl if non-NULL pointer passed in, and provide
+	it to the caller. also add it to the non-phantom jack kctl list.
+
+For HDA jack, we can use phantom_jack = true for phantom jack creating,
+and the jack kctl pointer will be filled with the new created kcontrol.
+
+For ASoC jack, usually, we create kcontrols after jack is created, with
+calling snd_hda_jack_add_kctl() for each jack pins. And, the pin name
+will be assigned to the corresponding kcontrol name. So, to make
+userspace understand and recognize it, please assign proper name for
+each jack pin.
+
-- 
1.9.1

      parent reply	other threads:[~2015-04-22  6:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-22  6:03 [PATCH v8 0/7] ALSA: jack: Refactoring for jack kctls Jie Yang
2015-04-22  6:03 ` [PATCH v8 1/7] ALSA: jack: implement kctl creating for jack device Jie Yang
2015-04-22 11:27   ` Takashi Iwai
2015-04-22 12:08     ` Jie, Yang
2015-04-22  6:03 ` [PATCH v8 2/7] ALSA: Jack: refactoring snd_kctl_jack_new to support embedded kctl Jie Yang
2015-04-22 11:32   ` Takashi Iwai
2015-04-22 12:40     ` Jie, Yang
2015-04-22 12:58       ` Takashi Iwai
2015-04-22 13:23         ` Jie, Yang
2015-04-22 13:56         ` Jie, Yang
2015-04-22 14:08           ` Takashi Iwai
2015-04-22 14:19             ` Jie, Yang
2015-04-22  6:03 ` [PATCH v8 3/7] ALSA: jack: extend snd_jack_new to support phantom jack Jie Yang
2015-04-22 11:30   ` Takashi Iwai
2015-04-22 12:49     ` Jie, Yang
2015-04-22  6:03 ` [PATCH v8 4/7] ALSA: hda - Update to use the new jack kctls method Jie Yang
2015-04-22  6:03 ` [PATCH v8 5/7] ASoC: jack: create kctls according to jack pins info Jie Yang
2015-04-22  6:03 ` [PATCH v8 6/7] ALSA: jack: remove exporting ctljack functions Jie Yang
2015-04-22  6:03 ` Jie Yang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1429682633-10765-8-git-send-email-yang.jie@intel.com \
    --to=yang.jie@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=liam.r.girdwood@intel.com \
    --cc=tanu.kaskinen@linux.intel.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox