Skip to contentSkip to conversation

ALSA: hda: Fix max PCM level to 0 dB for AD1981_HP

PATCH Applied Dan Chen 2 participants 2 messages Dec 13, 2009 – Dec 14, 2009 Sound

lore
Share & tools
lore

Dan Chen

author
#0 lore raw

PATCH 1/1 ALSA: hda: Fix max PCM level to 0 dB for AD1981_HP

Hi, Takashi,

Attached is a patch against sound-2.6 (master) HEAD capping PCM at 0 dB for the AD1981_HP model.

Thanks,
Dan

From 51c37454aeb16a7e6e454927c488e7a630760b41 Mon Sep 17 00:00:00 2001
From: Daniel T Chen <[email protected]>
Date: Sun, 13 Dec 2009 16:22:58 -0500
Subject: [PATCH] ALSA: hda: Fix max PCM level to 0 dB for AD1981_HP

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.

---
 sound/pci/hda/patch_analog.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
sound/pci/hda/patch_analog.c +8 -0
index 447eda1..1a36137 100644
@@ -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;
Signature · 1 line
1.6.3.3

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

Applied
#1 lore raw

At Sun, 13 Dec 2009 13:32:56 -0800 (PST),

Quoted 5 lines · Dan Chen

Hi, Takashi,

Attached is a patch against sound-2.6 (master) HEAD capping PCM at 0 dB for the AD1981_HP model.

Applied this one, too. Thanks.

Takashi