> From: James Courtier-Dutton [mailto:james.dutton@xxxxxxxxx] > > While you might think that the mixer control API would be simple, > unfortunately it is not. > A browse through the alsamixer source code will show you that. > A good start is to run > "amixer contents" > For each control is gives: > numid=1,iface=MIXER,name='Headphone Playback Volume' > ; type=INTEGER,access=rw---R--,values=2,min=0,max=87,step=0 > : values=87,87 > | dBscale-min=-65.25dB,step=0.75dB,mute=0 > > The hardware is written with INTEGER values. > There are 2 values (a stereo control, 1 for left, 1 for right) > The min value that is valid is 0. > The max value that is valid is 87 > The step size is not defined in this example. I.e. It is 1 so you can > wright values 0,1,2,3,...85,86,87 but not 88. > Some alsa drivers (not all yet) also provide metadata that allows one > to convert from the INTEGER value to dB value. > The dB values are mostly only used to display to the user as they are > better understood by the user. > There is an alsa API to convert from integer to db, and from > db to integer. > For the conversion, the STEP value is important. > For example, you can set a dB of -65.25 but you cannot set a > value of -65.00 > For the API, the dB values are > (integer_value_returned_from_the_API_call / 100) in order to avoid > floating point. > > Does this help? Yes. I'll have to copy amixer from my Ubuntu system to see this, because my embedded system only has alsamixer. -- Ciao, Paul D. DeRocco Paul mailto:pderocco@xxxxxxxxxxxxx ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev _______________________________________________ Alsa-user mailing list Alsa-user@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/alsa-user