2011/2/7 Vincent Meserette vmeserette@aldebaran-robotics.com
I found from where came my problem with the capture gains by adding some logs in the hda_codec.c file. When I set one of the capture gain, the put_vol_mute function well write in the AMP_GAIN_MUTE verb of the corresponding ADC selector (0x0c, 0x0d or 0x0e widget) but the mute bit is always set to 1. Indeed, the value associated to the AMP_GAIN_MUTE verb is formated as folow : bits 0 to 6 : gain bit 7 : mute bits 8 to 11 : index bit 12 : set right amp bit 13 : set left amp bit 14 : set input amp bit 15 : set output amp
and alsa sets the value of this register from a080 / b080 to a0b6 / b0b6 when i change the gain from -58.5 dB to 22.5dB
Do you know how alsa and thus the alsamixer determine the minimum and maximum values for the capture gain, and how to say to alsa the the gain is only a 7bits step value ?
Take a look at HDA Specification 7.3.4.10 Amplifier Capabilities
StepSize (7 bits) indicates the size of each step in the gain range. Each individual step may be 0-32 dB specified in 0.25-dB steps. A value of 0 indicates 0.25-dB steps, while a value of 127d indicates a 32-dB step. NumSteps (7 bits) indicates the number of steps in the gain range. There may be from 1 to 128 steps in the amplifier gain range. (0d means 1 step, 127d means 128 steps). A value of 0 (1 step) means that the gain is fixed and may not be changed. Offset (7 bits) indicates which step is 0 dB. If there are two or more steps, one of the step values must correspond to a value of 0 dB. The “Offset” value reflects the value which, if programmed in to the Amplifier Gain control, would result in a gain of 0 dB. Mute Capable (1 bit) reports if the respective amplifier is capable of muting. Muting implies a –infinity gain (no sound passes), but the actual performance is determined by the hardware.
Node 0x0c [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Control: name="Capture Volume", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Capture Switch", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Input Source", index=0, device=0 Amp-Out caps: ofs=0x27, nsteps=0x36, stepsize=0x05, mute=1 Amp-Out vals: [0x25 0x25] Connection: 10 0x38 0x39* 0x3a 0x3b 0x3c 0x18 0x24 0x25 0x3d 0x20 Node 0x0d [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Control: name="Capture Volume", index=1, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Capture Switch", index=1, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Input Source", index=1, device=0 Amp-Out caps: ofs=0x27, nsteps=0x36, stepsize=0x05, mute=1 Amp-Out vals: [0xa7 0xa7] Connection: 10 0x38 0x39* 0x3a 0x3b 0x3c 0x18 0x24 0x25 0x3d 0x20 Node 0x0e [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Control: name="Capture Volume", index=2, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Capture Switch", index=2, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Input Source", index=2, device=0 Amp-Out caps: ofs=0x27, nsteps=0x36, stepsize=0x05, mute=1 Amp-Out vals: [0xa7 0xa7] Connection: 10 0x38 0x39* 0x3a 0x3b 0x3c 0x18 0x24 0x25 0x3d 0x20