Re: [bisected] snd_hda_intel, 2.6.37: automuting on headphone connectbroken; headphone connecter no longer shown in userspace

From: Nirbheek Chauhan
Date: Mon Jan 10 2011 - 12:41:22 EST


On Mon, Jan 10, 2011 at 7:24 PM, Takashi Iwai <tiwai@xxxxxxx> wrote:
> At Wed, 5 Jan 2011 13:07:41 +0530,
> Nirbheek Chauhan wrote:
>> Upon upgrading to 2.6.37,
>> auto-muting-laptop-speakers-on-headphone-connect stopped working, and
>> the headphone connector completely disappeared from alsamixer as well
>> as the pulseaudio volume control panel. The headphone jack was still
>> transmitting sound, though.
>>
>> I bisected the problem, with 'good' being v2.6.36, and found the
>> commit below as the first bad commit. Reverting it on v2.6.37 fixes
>> the problem. I also tried the latest alsa-kernel master git tree,
>> which had the same problem.
>>
>> alsa-info when 'good':
>>
>> http://www.alsa-project.org/db/?f=a0b5c95f764a0b01746be46f989685996e1f9210
>>
>> alsa-info when 'bad':
>>
>> http://www.alsa-project.org/db/?f=30f30ca5461f03b98ab6c7c611cf24ea4526f537
>>
>> Note: both were taken without X running, before pulseaudio came up.
>>
>> ================
>> 03642c9a444079aa13f0864383a8f9ca04bfd198 is the first bad commit
>> commit 03642c9a444079aa13f0864383a8f9ca04bfd198
>> Author: Takashi Iwai <tiwai@xxxxxxx>
>> Date: Â Wed Sep 8 15:28:19 2010 +0200
>>
>> Â Â ALSA: hda - Clear left-over hp_pins in snd_hda_parse_pin_def_config()
>>
[snip]
>
> It seems that the driver worked casually in the earlier versions :)
> Does the patch below fix your problem?
>
> Note that the "Headphone" control will still not appear even with this
> patch, but these two outputs are controlled by "Front" and "Surround"
> controls. ÂThe lack of "Headphone" is no regression but simply it
> shouldn't have been there.
>

I tested it, and the patch below does exactly what you describe it's
supposed to do. Auto-muting and volume control is the way it used to
be -- somewhat weird, but not a regression from 2.6.36. As a humble
reporter, I agree that it's perfect for -stable.

Thank you!

> I'll work on 2.6.38 tree for better handling of multi headphone
> cases.
>

Results of the second patch are in a reply to the other email.

[snip]
> ===
> From b2d0576055bd1cafcd91a23cf85064815f1396cd Mon Sep 17 00:00:00 2001
> From: Takashi Iwai <tiwai@xxxxxxx>
> Date: Mon, 10 Jan 2011 14:47:35 +0100
> Subject: [PATCH] ALSA: hda - Fix multi-headphone handling for Realtek codecs
>
> When multiple headphone pins are defined without line-out pins, the
> driver takes them as primary outputs. ÂBut it forgot to set line_out_type
> to HP by assuming there is some rest of HP pins. ÂThis results in some
> mis-handling of these pins for Realtek codec parser. ÂIt takes as if
> these are pure line-out jacks.
>
> Signed-off-by: Takashi Iwai <tiwai@xxxxxxx>
> Cc: <stable@xxxxxxxxxx>
> ---
> Âsound/pci/hda/hda_codec.c | Â Â3 +++
> Â1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
> index 98b6d02..05e5ec8 100644
> --- a/sound/pci/hda/hda_codec.c
> +++ b/sound/pci/hda/hda_codec.c
> @@ -4571,6 +4571,9 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec,
> Â Â Â Â Â Â Â Â}
> Â Â Â Â Â Â Â Âmemset(cfg->hp_pins + cfg->hp_outs, 0,
> Â Â Â Â Â Â Â Â Â Â Â sizeof(hda_nid_t) * (AUTO_CFG_MAX_OUTS - cfg->hp_outs));
> + Â Â Â Â Â Â Â if (!cfg->hp_outs)
> + Â Â Â Â Â Â Â Â Â Â Â cfg->line_out_type = AUTO_PIN_HP_OUT;
> +
> Â Â Â Â}
>
> Â Â Â Â/* sort by sequence */
> --
> 1.7.3.4
>
>



--
~Nirbheek Chauhan

Gentoo GNOME+Mozilla Team
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/