ALSA: hda: Fix max PCM level to 0 dB for AD1981_HP
authorDaniel T Chen <crimsun@ubuntu.com>
Sun, 13 Dec 2009 21:22:58 +0000 (16:22 -0500)
committerTakashi Iwai <tiwai@suse.de>
Mon, 14 Dec 2009 10:08:39 +0000 (11:08 +0100)
BugLink: https://bugs.launchpad.net/bugs/461062
The original reporter states that PCM maxes at +12 dB and results in
very bad distortion.  Cap PCM at 0 dB to resolve this symptom.

Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/patch_analog.c

index 447eda1f6770bb494101c7e1aba7ade9ef0a4596..1a36137e13eca5f3d488402da0084500fa4489bc 100644 (file)
@@ -1789,6 +1789,14 @@ static int patch_ad1981(struct hda_codec *codec)
 
                codec->patch_ops.init = ad1981_hp_init;
                codec->patch_ops.unsol_event = ad1981_hp_unsol_event;
+               /* set the upper-limit for mixer amp to 0dB for avoiding the
+                * possible damage by overloading
+                */
+               snd_hda_override_amp_caps(codec, 0x11, HDA_INPUT,
+                                         (0x17 << AC_AMPCAP_OFFSET_SHIFT) |
+                                         (0x17 << AC_AMPCAP_NUM_STEPS_SHIFT) |
+                                         (0x05 << AC_AMPCAP_STEP_SIZE_SHIFT) |
+                                         (1 << AC_AMPCAP_MUTE_SHIFT));
                break;
        case AD1981_THINKPAD:
                spec->mixers[0] = ad1981_thinkpad_mixers;