Skip to contentSkip to conversation

ALSA: hda: Fix 0 dB offset for HP laptops using CX20551 (Waikiki)

PATCH In review Daniel Chen 3 participants 4 messages Mar 21, 2010 – Mar 22, 2010 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: hda: Fix 0 dB offset for HP laptops using CX20551 (Waikiki)

Hi,

Attached is a patch to fix distortion at max PCM setting for HP laptops using CX20551 (Waikiki).

Best,
-Dan

From 8442bd67f25ab5df43c99549480d5011fa3cb9c1 Mon Sep 17 00:00:00 2001
From: Daniel T Chen <[email protected]>
Date: Sun, 21 Mar 2010 18:34:43 -0400
Subject: [PATCH] ALSA: hda: Fix 0 dB offset for HP laptops using CX20551 (Waikiki)

The OR has verified that his hardware distorts because of the 0 dB offset not corresponding to the highest PCM level. Fix this by capping said PCM level to 0 dB similarly to what we do for CX20549 (Venice).

---
 sound/pci/hda/patch_conexant.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
sound/pci/hda/patch_conexant.c +15 -0
index 194a28c..61682e1 100644
@@ -1591,6 +1591,21 @@ static int patch_cxt5047(struct hda_codec *codec)
 #endif	
 	}
 	spec->vmaster_nid = 0x13;
+
+	switch (codec->subsystem_id >> 16) {
+	case 0x103c:
+		/* HP laptops have really bad sound over 0 dB on NID 0x10.
+		 * Fix max PCM level to 0 dB (originally it has 0x1e steps
+		 * with 0 dB offset 0x17)
+		 */
+		snd_hda_override_amp_caps(codec, 0x10, 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;
+	}
+
 	return 0;
 }
 
Signature · 1 line
1.7.0

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

#1 lore raw

2010/3/22 Daniel Chen <[email protected]>

Quoted 9 lines

Hi,

Attached is a patch to fix distortion at max PCM setting for HP laptops using CX20551 (Waikiki).

Best,
-Dan

how did he verifty the 0dB ? using hw device or pulseaudio

#2 lore raw
Quoted 1 line · Raymond Yau

how did he verifty the 0dB ? using hw device or pulseaudio

He's in the recipient list; I checked with him on IRC using PulseAudio (latest stable-queue, flat volume disabled) running the patch applied to the latest daily alsa-driver stable snap.

#3 lore raw
In reply to Daniel Chen

At Sun, 21 Mar 2010 19:01:18 -0400,

Quoted 5 lines · Daniel Chen

Hi,

Attached is a patch to fix distortion at max PCM setting for HP laptops using CX20551 (Waikiki).

Applied now. Thanks.

Takashi

Quoted 52 lines

Best,
-Dan
[2 0001-ALSA-hda-Fix-0-dB-offset-for-HP-laptops-using-CX2055.patch <text/x-patch; US-ASCII (base64)>] From 8442bd67f25ab5df43c99549480d5011fa3cb9c1 Mon Sep 17 00:00:00 2001
From: Daniel T Chen <[email protected]>
Date: Sun, 21 Mar 2010 18:34:43 -0400
Subject: [PATCH] ALSA: hda: Fix 0 dB offset for HP laptops using CX20551 (Waikiki)

The OR has verified that his hardware distorts because of the 0 dB offset not corresponding to the highest PCM level. Fix this by capping said PCM level to 0 dB similarly to what we do for CX20549 (Venice).

---
 sound/pci/hda/patch_conexant.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
sound/pci/hda/patch_conexant.c +15 -0
index 194a28c..61682e1 100644
@@ -1591,6 +1591,21 @@ static int patch_cxt5047(struct hda_codec *codec)
 #endif	
 	}
 	spec->vmaster_nid = 0x13;
+
+	switch (codec->subsystem_id >> 16) {
+	case 0x103c:
+		/* HP laptops have really bad sound over 0 dB on NID 0x10.
+		 * Fix max PCM level to 0 dB (originally it has 0x1e steps
+		 * with 0 dB offset 0x17)
+		 */
+		snd_hda_override_amp_caps(codec, 0x10, 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;
+	}
+
 	return 0;
 }
 
Signature · 1 line
1.7.0