[alsa-devel] Some questions on snd_kontrol_new

Clemens Ladisch clemens at ladisch.de
Mon Nov 10 09:56:05 CET 2008


LCID Fire wrote:
> Could someone get me some insight into the snd_kontrol_new?
> I'm especially interested in the "private_value" and "index" field. At
> least in usb_mixer.c it seems to me like private_value is used as the
> index!? If that's the case, when should index be used and when
> private_value?

The index field is used when several controls have the same name.

The private_value field can be used by drivers for any purpose.

The functions for the Audigy 2 NX's LEDs store the LED number in the
private_value field so that the same function can be used for all three
LEDs without having to look at the control name.

> Is there any special convention for the string of "name" field?

linux/Documentation/sound/alsa/ControlNames.txt


HTH
Clemens


More information about the Alsa-devel mailing list