* snd_kcontrol_new_t
@ 2003-05-16 2:55 Eliot Blennerhassett
2003-05-16 9:28 ` snd_kcontrol_new_t Takashi Iwai
2003-05-16 15:29 ` snd_kcontrol_new_t Paul Davis
0 siblings, 2 replies; 3+ messages in thread
From: Eliot Blennerhassett @ 2003-05-16 2:55 UTC (permalink / raw)
To: alsa-devel
typedef struct _snd_kcontrol_new {
snd_ctl_elem_iface_t iface; /* interface identifier */
unsigned int device; /* device/client number */
unsigned int subdevice; /* subdevice (substream) number */
unsigned char *name; /* ASCII name of item */
unsigned int index; /* index of item */
unsigned int access; /* access rights */
unsigned int count; /* count of same elements */
snd_kcontrol_info_t *info;
snd_kcontrol_get_t *get;
snd_kcontrol_put_t *put;
unsigned long private_value;
} snd_kcontrol_new_t;
I'd like some explanation (or pointer to where I can read about) the meaning/use
of some fields. (The comments say what they are, but not what they are FOR).
What is the effect of setting the device,subdevice or index number when creating
a control? It seems that I can leave them set to 0 as long as the name is
unique.
(as I mentioned in another post) I get trouble if I try to create two controls
with the same name and different indices (by two calls to snd_ctl_add)
Perhaps the only legal way to do this is to set count > 1 and create a set of
controls with one call to snd_ctl_add()?
Background:
I want to represent the control of this card
http://www.audioscience.com/internet/products/asi6244.htm
(The web page has a diagram on it, you won't have to download any document)
In the diagram, every input to every mixer has a separate attenuation control
"Volume" which is not explicitly shown for space reasons.
and others from
http://www.audioscience.com/internet/products
thanks
Eliot
Eliot Blennerhassett
AudioScience Inc.
--
Junk footer beyond this point. Read at your own risk.
-------------------------------------------------------------
Sign up for ICQmail at http://www.icq.com/icqmail/signup.html
-------------------------------------------------------
Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
The only event dedicated to issues related to Linux enterprise solutions
www.enterpriselinuxforum.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: snd_kcontrol_new_t
2003-05-16 2:55 snd_kcontrol_new_t Eliot Blennerhassett
@ 2003-05-16 9:28 ` Takashi Iwai
2003-05-16 15:29 ` snd_kcontrol_new_t Paul Davis
1 sibling, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2003-05-16 9:28 UTC (permalink / raw)
To: Eliot Blennerhassett; +Cc: alsa-devel
At Thu, 15 May 2003 19:55:44 -0700 (PDT),
Eliot Blennerhassett wrote:
>
> typedef struct _snd_kcontrol_new {
> snd_ctl_elem_iface_t iface; /* interface identifier */
> unsigned int device; /* device/client number */
> unsigned int subdevice; /* subdevice (substream) number */
> unsigned char *name; /* ASCII name of item */
> unsigned int index; /* index of item */
> unsigned int access; /* access rights */
> unsigned int count; /* count of same elements */
> snd_kcontrol_info_t *info;
> snd_kcontrol_get_t *get;
> snd_kcontrol_put_t *put;
> unsigned long private_value;
> } snd_kcontrol_new_t;
>
> I'd like some explanation (or pointer to where I can read about) the meaning/use
> of some fields. (The comments say what they are, but not what they are FOR).
>
> What is the effect of setting the device,subdevice or index number when creating
> a control? It seems that I can leave them set to 0 as long as the name is
> unique.
yes.
the device and subdevice are used to specify the corresponding
device. they are for pcm or other interfaces. in the case of mixer,
they are only zero because there is only one mixer (although you are
allowed to set them).
the index is used for multiple controls with the same name, e.g.
multiple ac97 codecs. this field is used also for accessing the
matrix-type control. you need to convert multi-dimension to a linear
address by yourself, though.
> (as I mentioned in another post) I get trouble if I try to create two controls
> with the same name and different indices (by two calls to snd_ctl_add)
> Perhaps the only legal way to do this is to set count > 1 and create a set of
> controls with one call to snd_ctl_add()?
no, calling snd_ctl_add() twice is ok. (in fact, snd_ctl_add()
even doesn't check the double entries :)
the counts > 1 is used when there are really identical controls with
different indices. that means, the same callback is used with the
same private_data and private_value closures but with a different
index. so it's suitable for a matrix-mixer style control, or controls
bundled with the (multi-channel/play) pcm streams.
Takashi
-------------------------------------------------------
Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
The only event dedicated to issues related to Linux enterprise solutions
www.enterpriselinuxforum.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: snd_kcontrol_new_t
2003-05-16 2:55 snd_kcontrol_new_t Eliot Blennerhassett
2003-05-16 9:28 ` snd_kcontrol_new_t Takashi Iwai
@ 2003-05-16 15:29 ` Paul Davis
1 sibling, 0 replies; 3+ messages in thread
From: Paul Davis @ 2003-05-16 15:29 UTC (permalink / raw)
To: Eliot Blennerhassett; +Cc: alsa-devel
>(The web page has a diagram on it, you won't have to download any document)
>In the diagram, every input to every mixer has a separate attenuation control
>"Volume" which is not explicitly shown for space reasons.
eliot - i think you should probably track the approach in the hdsp
driver. although its not necessarily the correct one long term, it has
the same mixer design (a matrix, in essence) and whatever solution
is used for the hdsp will be the best one at any given point in time
for your card too. that solution may change over time, of course.
-------------------------------------------------------
Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
The only event dedicated to issues related to Linux enterprise solutions
www.enterpriselinuxforum.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-05-16 15:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-16 2:55 snd_kcontrol_new_t Eliot Blennerhassett
2003-05-16 9:28 ` snd_kcontrol_new_t Takashi Iwai
2003-05-16 15:29 ` snd_kcontrol_new_t Paul Davis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox