All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Borg Onion <borg.onion@gmail.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: What's the deal with elements?
Date: Wed, 23 Nov 2011 09:03:21 +0100	[thread overview]
Message-ID: <4ECCA8C9.7050400@ladisch.de> (raw)
In-Reply-To: <CAAs5ODuE2MPa9WULW-rWSwcBxdPTJk35fUqPYsvMBzCv=QjK-g@mail.gmail.com>

Borg Onion wrote:
> Element used = 0, count = 7
> 
> Whenever I try to access the elements by their index though, I get errors.

It's hard to find out what you're talking about without the code, but
this looks as if you've called snd_ctl_elem_list_get_used/count() and
are now wondering why the other snd_ctl_elem_list_get_* functions don't
work.

> What's the meaning of "used" vs. "count"?

The count is the number of elements that the card has.
"used" is the number of elements that you have in the list.

To actually get element IDs, you have to allocate space for them with
snd_ctl_elem_list_alloc_space() (and then don't forget to call
snd_ctl_elem_list_free_space() afterwards), and call snd_ctl_elem_list()
again.  (All this is quite undocumented.)

> What are these elements used for?

Mixer controls.

> How does one do device discovery?

snd_device_name_hint(), or functions like snd_ctl_pcm_next_device().


Regards,
Clemens

  reply	other threads:[~2011-11-23  8:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-23  4:44 What's the deal with elements? Borg Onion
2011-11-23  8:03 ` Clemens Ladisch [this message]
2011-11-24  5:52   ` Borg Onion
2011-11-24 13:37     ` Clemens Ladisch

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=4ECCA8C9.7050400@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=borg.onion@gmail.com \
    /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.