Hi, On Wed, Mar 07, 2007 at 08:34:48AM -0800, Allyn, Mark A wrote: > Folks: > > I am trying to figure out how the mixer control structurs are done for > each of the > codecs in the patch_sigmatel file for the Sigmatel codecs. > > A sample of one is as follows: > > ==================== > static struct snd_kcontrol_new stac925x_mixer[] = { > HDA_CODEC_VOLUME("Master Playback Volume", 0xe, 0, HDA_OUTPUT), > HDA_CODEC_MUTE("Master Playback Switch", 0xe, 0, HDA_OUTPUT), > { > .iface = SNDRV_CTL_ELEM_IFACE_MIXER, > .name = "Input Source", > .count = 1, > .info = stac92xx_mux_enum_info, > .get = stac92xx_mux_enum_get, > .put = stac92xx_mux_enum_put, > }, > HDA_CODEC_VOLUME("Capture Volume", 0x09, 0, HDA_OUTPUT), > HDA_CODEC_MUTE("Capture Switch", 0x09, 0, HDA_OUTPUT), > HDA_CODEC_VOLUME("Capture Mux Volume", 0x0f, 0, HDA_OUTPUT), > { } /* end */ > }; > ==================== > > I am having a hard time seeing the connection between the widgets that > have a volume > control and the entries in the stac mixer structure above. Where are the > NID's for each > entry of this structure? The NIDs are the second parameter to HDA_CODEC_VOLUME and HDA_CODEC_MUTE. In the example above, they are 0x0e, 0x09, 0x0f. > > Also, the value HAD_OUTPUT is used apparently for both a capture node as > well as an > output node. Where would HDA_INPUT be used? HDA_OUTPUT means that the output amplifier of the widget will be controlled by the mixer control. Some widgets may have only input amplifiers, others only output amplifiers, some may have both. Having amplifiers on its input and/or output doesn't mean it is used for audio capture or playback. It just means that it has amplifier(s) connected at its input or output. In short, the macro parameters are all the information necessary to "address" an amplifier: - Widget NID - Amplifier index, for widgets that have multiple input amplifiers, such as Sum Widget - HDA_OUTPUT or HDA_INPUT, telling if it is at the input or output of the widget > > Is there any documentation on just how this structure is composed for a > new device? I don't know if there is any documentation on those strucutures. But basically you need to know which amplifiers you want to control, by looking at the widget connections in the codec. Looking at /proc/asound/card*/codec#* should be enough. I use a small script to generate a graphviz output from the codec information on /proc, to make this task easier. Maybe it helps. It is in a GIT repository at: http://raisama.net/gitweb?p=hda-tools.git;a=summary git clone http://git.raisama.net/hda-tools.git -- Eduardo
Attachment:
pgpacCoBDQT5h.pgp
Description: PGP signature
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ Alsa-devel mailing list Alsa-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/alsa-devel