All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Takashi Sakamoto <o-takashi@sakamocchi.jp>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Subject: Re: Some questions about userspace control elements
Date: Fri, 06 Feb 2015 10:38:48 +0100	[thread overview]
Message-ID: <54D48BA8.6060104@ladisch.de> (raw)
In-Reply-To: <54D2BD01.6020904@sakamocchi.jp>

Takashi Sakamoto wrote:
> On Feb 5 2015 08:51, Takashi Sakamoto wrote:
>> sound/core/control.c:1188
>> {{{
>> kctl.count = info->owner ? info->owner : 1;
>> }}}
>>
>> In this code, the value in struct snd_ctl_elem_info.owner is assigned to
>> struct snd_kcontrol.count. The meaning of these two member is completely
>> different but assigned.

There is hardware that has many identical controls.  To save memory,
ALSA treats controls with .count > 1 as if there were multiple controls.

This optimization is not visible in the userspace API.

The owner field is used because there is no other field to set the
count.

> When any userspace control element are added, the value of struct
> snd_ctl_elem_info.owner is zero because there's no API to set this
> member in userspace

So far, setting this field has not been needed.  An API could be added.

>> I guess that the reason is to limit the number of event generated when
>> the control element set is operated.

If a driver needs twenty identical controls, it could create one control
with count=20, or twenty controls with count=1.  In both cases, twenty
events are sent.


Regards,
Clemens

  reply	other threads:[~2015-02-06  9:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-01 11:41 Some questions about userspace control elements Takashi Sakamoto
2015-02-01 17:50 ` Clemens Ladisch
2015-02-02 14:14   ` Takashi Sakamoto
2015-02-04 23:51   ` Takashi Sakamoto
2015-02-05  0:44     ` Takashi Sakamoto
2015-02-06  9:38       ` Clemens Ladisch [this message]
2015-02-07  1:58         ` Takashi Sakamoto
2015-02-07 15:45           ` Clemens Ladisch
2015-02-08 10:57             ` Takashi Sakamoto

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=54D48BA8.6060104@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=o-takashi@sakamocchi.jp \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.