Skip to contentSkip to conversation

Fix automute issue on HP T5735

PATCH In review Lee Trager 2 participants 4 messages Jan 15, 2010 – Jan 20, 2010 Sound

lore
Share & tools
lore

Lee Trager

author
#0 lore raw

PATCH 1/1 Fix automute issue on HP T5735

The following patch fixes an issue where when you plug something into the headphone jack the internal speaker does not automute. This also will close alsa bug #0004766

Lee

--- alsa-driver-orig/alsa-kernel/pci/hda/patch_realtek.c 2009-08-28
07:41:39.000000000 -0400
+++ alsa-driver/alsa-kernel/pci/hda/patch_realtek.c 2009-10-13
14:24:40.000000000 -0400
@@ -10028,7 +10028,9 @@
struct alc_spec *spec = codec->spec;

spec->autocfg.hp_pins[0] = 0x15;
- spec->autocfg.speaker_pins[0] = 0x0c; /* HACK: not actually a pin */
+ spec->autocfg.speaker_pins[0] = 0x14;
+
+ alc_automute_amp(codec);
}

static struct snd_kcontrol_new alc262_hp_t5735_mixer[] = {

#1 lore raw

At Fri, 15 Jan 2010 11:56:19 -0500,

Quoted 4 lines · Lee Trager

The following patch fixes an issue where when you plug something into the headphone jack the internal speaker does not automute. This also will close alsa bug #0004766

Hm, the present quirk is already broken as its changing 0x15 with alc_automute_amp(). There are already mixer elements with these NIDs, and changing dynamically via unsol event conflicts with the mixers. Also, alc_automute_amp() shouldn't be called in setup callback but in init_hook callback instead.

I wonder whether the output pin control works with your device. If it does, it's much easier. For example, how about the patch below?

thanks,

Takashi

---

sound/pci/hda/patch_realtek.c +3 -3
index 7e0ea37..b0c8ae0 100644
@@ -10490,7 +10490,7 @@ static void alc262_hp_t5735_setup(struct hda_codec *codec)
 	struct alc_spec *spec = codec->spec;
 
 	spec->autocfg.hp_pins[0] = 0x15;
-	spec->autocfg.speaker_pins[0] = 0x0c; /* HACK: not actually a pin */
+	spec->autocfg.speaker_pins[0] = 0x14;
 }
 
 static struct snd_kcontrol_new alc262_hp_t5735_mixer[] = {
@@ -11919,9 +11919,9 @@ static struct alc_config_preset alc262_presets[] = {
 		.num_channel_mode = ARRAY_SIZE(alc262_modes),
 		.channel_mode = alc262_modes,
 		.input_mux = &alc262_capture_source,
-		.unsol_event = alc_automute_amp_unsol_event,
+		.unsol_event = alc_sku_unsol_event,
 		.setup = alc262_hp_t5735_setup,
-		.init_hook = alc_automute_amp,
+		.init_hook = alc_inithook,
 	},
 	[ALC262_HP_RP5700] = {
 		.mixers = { alc262_hp_rp5700_mixer },
author
#2 lore raw

The patch you sent works fine. The only reason I called alc_automute_amp was because if I didn't if headphones were plugged in at boot it wouldn't work. This doesn't happen on your patch however. If anything else is needed to get this patch in let me know.

Thanks,

Lee

Quoted 47 lines · Takashi Iwai

At Fri, 15 Jan 2010 11:56:19 -0500,

Quoted 4 lines · Lee Trager

The following patch fixes an issue where when you plug something into the headphone jack the internal speaker does not automute. This also will close alsa bug #0004766

Hm, the present quirk is already broken as its changing 0x15 with alc_automute_amp(). There are already mixer elements with these NIDs, and changing dynamically via unsol event conflicts with the mixers. Also, alc_automute_amp() shouldn't be called in setup callback but in init_hook callback instead.

I wonder whether the output pin control works with your device. If it does, it's much easier. For example, how about the patch below?

thanks,

Takashi

---

sound/pci/hda/patch_realtek.c +3 -3
index 7e0ea37..b0c8ae0 100644
@@ -10490,7 +10490,7 @@ static void alc262_hp_t5735_setup(struct hda_codec *codec)
 	struct alc_spec *spec = codec->spec;
 
 	spec->autocfg.hp_pins[0] = 0x15;
-	spec->autocfg.speaker_pins[0] = 0x0c; /* HACK: not actually a pin */
+	spec->autocfg.speaker_pins[0] = 0x14;
 }
 
 static struct snd_kcontrol_new alc262_hp_t5735_mixer[] = {
@@ -11919,9 +11919,9 @@ static struct alc_config_preset alc262_presets[] = {
 		.num_channel_mode = ARRAY_SIZE(alc262_modes),
 		.channel_mode = alc262_modes,
 		.input_mux = &alc262_capture_source,
-		.unsol_event = alc_automute_amp_unsol_event,
+		.unsol_event = alc_sku_unsol_event,
 		.setup = alc262_hp_t5735_setup,
-		.init_hook = alc_automute_amp,
+		.init_hook = alc_inithook,
 	},
 	[ALC262_HP_RP5700] = {
 		.mixers = { alc262_hp_rp5700_mixer },
#3 lore raw

At Tue, 19 Jan 2010 14:26:09 -0500,

Quoted 5 lines · Lee Trager

The patch you sent works fine. The only reason I called alc_automute_amp was because if I didn't if headphones were plugged in at boot it wouldn't work. This doesn't happen on your patch however. If anything else is needed to get this patch in let me know.

Thanks for checking. I applied the patch now for the next pull request.

Takashi

Quoted 55 lines

Thanks,

Lee

Quoted 47 lines · Takashi Iwai

At Fri, 15 Jan 2010 11:56:19 -0500,

Quoted 4 lines · Lee Trager

The following patch fixes an issue where when you plug something into the headphone jack the internal speaker does not automute. This also will close alsa bug #0004766

Hm, the present quirk is already broken as its changing 0x15 with alc_automute_amp(). There are already mixer elements with these NIDs, and changing dynamically via unsol event conflicts with the mixers. Also, alc_automute_amp() shouldn't be called in setup callback but in init_hook callback instead.

I wonder whether the output pin control works with your device. If it does, it's much easier. For example, how about the patch below?

thanks,

Takashi

---

sound/pci/hda/patch_realtek.c +3 -3
index 7e0ea37..b0c8ae0 100644
@@ -10490,7 +10490,7 @@ static void alc262_hp_t5735_setup(struct hda_codec *codec)
 	struct alc_spec *spec = codec->spec;
 
 	spec->autocfg.hp_pins[0] = 0x15;
-	spec->autocfg.speaker_pins[0] = 0x0c; /* HACK: not actually a pin */
+	spec->autocfg.speaker_pins[0] = 0x14;
 }
 
 static struct snd_kcontrol_new alc262_hp_t5735_mixer[] = {
@@ -11919,9 +11919,9 @@ static struct alc_config_preset alc262_presets[] = {
 		.num_channel_mode = ARRAY_SIZE(alc262_modes),
 		.channel_mode = alc262_modes,
 		.input_mux = &alc262_capture_source,
-		.unsol_event = alc_automute_amp_unsol_event,
+		.unsol_event = alc_sku_unsol_event,
 		.setup = alc262_hp_t5735_setup,
-		.init_hook = alc_automute_amp,
+		.init_hook = alc_inithook,
 	},
 	[ALC262_HP_RP5700] = {
 		.mixers = { alc262_hp_rp5700_mixer },