Clipping of line-in volume on Analog Devices codes due to an incorrect max_dB determination
Submitted by mrj..@..com.au
Assigned to pul..@..op.org
Description
On a machine with HDA Intel Audio and an AD1988 codec (ASUS P5B board), running Kernel 3.12.5 causes the line-in hardware volume to span its full 0-54 range over a Pulseaudio volume range of 0-20724, instead of being mapped to the full 0-65536 Pulseaudio volume range, as is the case when running Kernels 3.11.9 and earlier. This causes previously suitable line-in mixer volumes to clip severely.
The cause is a different max_dB determination under the two Kernel versions:
3.11.9:
[pulseaudio][modules/alsa/alsa-mixer.c:2789 pa_alsa_path_dump()] Path analog-input-linein (Line In), direction=2, priority=81, probed=yes, supported=yes, has_mute=yes, has_volume=yes, has_dB=yes, min_volume=0, max_volume=54, min_dB=-58.5, max_dB=22.5
3.12.5:
[pulseaudio][modules/alsa/alsa-mixer.c:2789 pa_alsa_path_dump()] Path analog-input-linein (Line In), direction=2, priority=81, probed=yes, supported=yes, has_mute=yes, has_volume=yes, has_dB=yes, min_volume=0, max_volume=54, min_dB=-58.5, max_dB=52.5
The 30dB difference in max_dB appears to be related to the "Line Boost Volume" control (0, 10dB, 20dB, 30dB) that's newly-exposed in Kernel 3.12 for Analog Devices codecs, which PA appears to not be taking account of.
Also unexpected on both Kernel versions: max_volume is reported as "3" for all microphone inputs on both Kernels, possibly reflecting the 3 boost settings rather than the correct 54 levels as reported for the line input. The mic max_dB calculations are however correct:
[pulseaudio][modules/alsa/alsa-mixer.c:2789 pa_alsa_path_dump()] Path analog-input-microphone-rear (Rear Microphone), direction=2, priority=82, probed=yes, supported=yes, has_mute=yes, has_volume=yes, has_dB=yes, min_volume=0, max_volume=3, min_dB=-58.5, max_dB=52.5