- Backport upstream fixes: 0001-ucm-substitution-remove-duplicate-allow_empty-assign.patch 0002-ucm-fix-parse_get_safe_name-safe-name-must-be-checke.patch 0003-ucm-substitute-the-merged-tree-completely.patch 0004-ctl-improve-documentation-for-identifier-of-control-.patch 0005-pcm-dmix-make-lockless-operation-optional.patch 0006-pcm-dmix-Fix-semaphore-usage-with-lockless-operation.patch 0007-pcm-iec958-implement-HDMI-HBR-audio-formatting.patch 0008-pcm-iec958-set-channel-status-bits-according-to-rate.patch 0009-conf-pcm-USB-Added-S-PDIF-fix-for-Asus-Xonar-SE.patch 0010-control-ctlparse-fix-enum-values-in-or.patch 0011-conf-USB-Audio-Disable-IEC958-on-Lenovo-ThinkStation.patch 0012-pcm-dmix-fix-access-to-sum-buffer-in-non-interleaved.patch 0014-control-Add-documentation-for-snd_ctl_elem_list_.patch 0015-conf-quote-also-strings-with-and-characters-in-strin.patch 0016-topology-decode-Fix-channel-map-memory-allocation.patch 0017-topology-decode-Fix-infinite-loop-in-decoding-enum-c.patch 0018-topology-decode-Remove-decoding-values-for-enum-cont.patch 0019-topology-decode-Add-enum-control-texts-as-separate-e.patch 0020-topology-decode-Fix-printing-texts-section.patch 0021-topology-decode-Change-declaration-of-enum-decoding-.patch 0022-topology-decode-Fix-decoding-PCM-formats-and-rates.patch 0023-topology-decode-Print-sig_bits-field-in-PCM-capabili.patch 0024-topology-decode-Add-DAI-name-printing.patch 0025-topology-Make-buffer-for-saving-dynamic-size.patch 0026-topology-return-correct-value-in-tplg_save_printf.patch 0027-topology-fix-some-gcc10-warnings-labs-signess.patch 0028-topology-fix-sort_config.patch 0029-topology-fix-the-unaligned-access.patch 0030-topology-improve-the-printf-buffer-management.patch OBS-URL: https://build.opensuse.org/request/show/836375 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa?expand=0&rev=281
112 lines
4.5 KiB
Diff
112 lines
4.5 KiB
Diff
From 84185b5c94ec8a214103b8ec02d272f0158c24e6 Mon Sep 17 00:00:00 2001
|
|
From: "Tanjeff-N. Moos" <tanjeff@cccmz.de>
|
|
Date: Wed, 2 Sep 2020 11:27:26 +0200
|
|
Subject: [PATCH 31/32] control: Improve general control interface
|
|
documentation.
|
|
|
|
Signed-off-by: Tanjeff-N. Moos <tanjeff@cccmz.de>
|
|
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
---
|
|
src/control/control.c | 72 ++++++++++++++++++++++++++++++++++++++++++++-------
|
|
1 file changed, 63 insertions(+), 9 deletions(-)
|
|
|
|
diff --git a/src/control/control.c b/src/control/control.c
|
|
index 1bcf1ab2e431..497a5399b7e6 100644
|
|
--- a/src/control/control.c
|
|
+++ b/src/control/control.c
|
|
@@ -31,7 +31,7 @@
|
|
/*! \page control Control interface
|
|
|
|
<P>Control interface is designed to access primitive controls. There is
|
|
-also interface notifying about control and structure changes.
|
|
+also an interface for notifying about control and structure changes.
|
|
|
|
\section control_general_overview General overview
|
|
|
|
@@ -43,20 +43,74 @@ are managed according to below model.
|
|
Some element sets can be added to a sound card by drivers in kernel and
|
|
userspace applications.
|
|
- element
|
|
- - An element can be identified by userspace applications. Each element has
|
|
- own identical information.
|
|
+ - A control element might be a master volume control, for example, or a
|
|
+ read-only indicator, such as a sync status. An element has a type (e.g.
|
|
+ INTEGER or BOOLEAN) and - depending on the type - min/max values, a step
|
|
+ size, a set of possible values (for enums), etc.
|
|
- member
|
|
- - An element includes some members to have a value. The value of each member
|
|
- can be changed by both of userspace applications and drivers in kernel.
|
|
|
|
-Each element can be identified by two ways; the numerical number (numid), or the
|
|
-combination of interface, device, subdevice, name, and index.
|
|
+ - An element includes one or more member(s) to have a value. For
|
|
+ example, a stereo volume control element has two members (for
|
|
+ left/right). The members share the same properties (e.g. both
|
|
+ volume controls have the same min/max values). The value of each
|
|
+ member can be changed by both of userspace applications and
|
|
+ drivers in kernel.
|
|
|
|
-The type of element set is one of integer, integerr64, boolean, enumerators,
|
|
+
|
|
+\section identifying_elements Identifying the Elements
|
|
+
|
|
+Each element has the following identifying properties:
|
|
+
|
|
+ - The numid (a numeric identifier, assigned when the sound card is
|
|
+ detected, constant while the sound card is kept connected)
|
|
+
|
|
+ - The interface type (e.g. MIXER, CARD or PCM)
|
|
+ - The device
|
|
+ - The subdevice
|
|
+ - Its name
|
|
+ - Its index
|
|
+
|
|
+An element can be identified either by its numid or by the tuple
|
|
+(interface type, device, subdevice, name, index). This tuple is always
|
|
+the same (driver updates can change it, but in practice this is
|
|
+rare). The numid can change on each boot. In case of an USB sound
|
|
+card, the numid can also change when it is reconnected.
|
|
+
|
|
+
|
|
+\section element_lists Element Lists
|
|
+
|
|
+An element list can be used to obtain a list of all elements of the
|
|
+sound card. The list contains generic information (e.g. how many
|
|
+elements the card has), and the identifying properties of the elements
|
|
+(numid, card, name, ...). See #snd_ctl_elem_list_t to learn more about
|
|
+element lists.
|
|
+
|
|
+
|
|
+\section working_with_elements Working with Elements
|
|
+
|
|
+It is possible to obtain information about an element using the
|
|
+snd_ctl_elem_info_*() functions. For enums, the allowed values can be
|
|
+obtained, for integers, the min/max values can be obtained, and so
|
|
+on. In addition, these functions can report the identifying
|
|
+properties. E.g. when the element is addressed using its numid, the
|
|
+functions complements the name, index, etc.
|
|
+
|
|
+To access the values of a control, use the snd_ctl_elem_value*()
|
|
+functions. These allow to get and set the actual values or
|
|
+settings. It is also possible to get and set the ID values (such as
|
|
+the numid or the name).
|
|
+
|
|
+
|
|
+\section element_sets Element Sets
|
|
+
|
|
+The type of element set is one of integer, integer64, boolean, enumerators,
|
|
bytes and IEC958 structure. This indicates the type of value for each member in
|
|
elements included in the element set.
|
|
|
|
-When the value of member is changed, corresponding events are transferred to
|
|
+
|
|
+\section events Events
|
|
+
|
|
+When the value of a member is changed, corresponding events are transferred to
|
|
userspace applications. The applications should subscribe any events in advance.
|
|
|
|
\section tlv_blob Supplemental data for elements in an element set
|
|
--
|
|
2.16.4
|
|
|