[alsa-devel] [RFC][PATCH 0/3] ALSA: control: delegate TLV eventing to each driver

Takashi Sakamoto o-takashi at sakamocchi.jp
Tue Aug 22 01:42:19 CEST 2017


Hi,

This patchset is to avoid a trouble on ALSA control core, kernel API of
ALSA control component and ALSA control interface/protocol to handle TLV
operations from user space.

In a design of ALSA control core, a set of elements is represented by
'struct snd_kcontrol' to share common attributes. The set of elements
shares TLV (Type-Length-Value) data, too.

On the other hand, in ALSA control interface/protocol for applications,
a TLV operation is committed to an element. Totally, the operation can
have sub-effect to the other elements in the set. For example, TLV_WRITE
operation is expected to change TLV data, which returns to applications.
Applications attempt to change the TLV data per element, but in the above
design, they can effect to elements in the same set.

As a default, ALSA control core has no implementation except for TLV_READ
operation. Thus, the above design looks to have no issue. However, in
kernel APIs of ALSA control component, developers can program a handler
for any request of the TLV operation. Therefore, for elements in a set
which has the handler, applications can commit TLV_WRITE and TLV_COMMAND
requests.

For the above scenario, ALSA control core assist notification. When the
handler returns positive value, the core queueing an event for a requested
element. However, this includes design defects that the event is not
queued for the other element in a set. Actually, developers can program
the handlers to keep per-element TLV data, but it depends on each driver.

In this patchset, I attempts to solve the above issue, by delegating the
event notification to each driver of ALSA control component.

Additionally, this patchset includes a solution against an issue in below
message thread:

[alsa-devel] snd_ctl_add_enumerated_elem_set and TLV
http://mailman.alsa-project.org/pipermail/alsa-devel/2017-July/123364.html


Takashi Sakamoto (3):
  ALSA: control: delegate TLV eventing to each driver
  ALSA: control: queue TLV event for all of elements in an user-defined
    set
  ALSA: control: disable TLV data at initial state of user-defined
    element set

 sound/core/control.c | 34 ++++++++++++++++++++++------------
 1 file changed, 22 insertions(+), 12 deletions(-)

-- 
2.11.0



More information about the Alsa-devel mailing list