Patchwork Oneiric SRU (pre-stable): Fix Line out -> Speaker automute for Realtek

login
register
mail settings
Submitter David Henningsson
Date Dec. 1, 2011, 8:52 a.m.
Message ID <4ED74040.2060802@canonical.com>
Download mbox | patch
Permalink /patch/128666/
State New
Headers show

Comments

David Henningsson - Dec. 1, 2011, 8:52 a.m.
SRU Justification:

Fixes a blocks-hwcert bug.

Test case:

Take the Optiplex XE machine specified here:
http://bugs.launchpad.net/bugs/882693

Without this patch:
  - Internal Speaker is not muted when "Line Out" jack is plugged in
With this patch:
  - Internal Speaker is muted when "Line Out" jack is plugged in

Upstream status:
   Acked/reviewed by Takashi Iwai and on its way to 3.0 (and 3.1) stable.
Tim Gardner - Dec. 1, 2011, 1:52 p.m.
On 12/01/2011 01:52 AM, David Henningsson wrote:
> SRU Justification:
>
> Fixes a blocks-hwcert bug.
>
> Test case:
>
> Take the Optiplex XE machine specified here:
> http://bugs.launchpad.net/bugs/882693
>
> Without this patch:
> - Internal Speaker is not muted when "Line Out" jack is plugged in
> With this patch:
> - Internal Speaker is muted when "Line Out" jack is plugged in
>
> Upstream status:
> Acked/reviewed by Takashi Iwai and on its way to 3.0 (and 3.1) stable.
>

Have you also tried this laptop with Precise to make sure the 
"refactored automute for Realtek" still works ?

rtg
Tim Gardner - Dec. 1, 2011, 2:13 p.m.
On 12/01/2011 06:52 AM, Tim Gardner wrote:
> On 12/01/2011 01:52 AM, David Henningsson wrote:
>> SRU Justification:
>>
>> Fixes a blocks-hwcert bug.
>>
>> Test case:
>>
>> Take the Optiplex XE machine specified here:
>> http://bugs.launchpad.net/bugs/882693
>>
>> Without this patch:
>> - Internal Speaker is not muted when "Line Out" jack is plugged in
>> With this patch:
>> - Internal Speaker is muted when "Line Out" jack is plugged in
>>
>> Upstream status:
>> Acked/reviewed by Takashi Iwai and on its way to 3.0 (and 3.1) stable.
>>
>
> Have you also tried this laptop with Precise to make sure the
> "refactored automute for Realtek" still works ?
>
> rtg

_And_ have you tested this patch for regressions on other platforms with 
Realtek codecs ?
David Henningsson - Dec. 2, 2011, 8:38 a.m.
On 12/01/2011 03:13 PM, Tim Gardner wrote:
> On 12/01/2011 06:52 AM, Tim Gardner wrote:
>> On 12/01/2011 01:52 AM, David Henningsson wrote:
>>> SRU Justification:
>>>
>>> Fixes a blocks-hwcert bug.
>>>
>>> Test case:
>>>
>>> Take the Optiplex XE machine specified here:
>>> http://bugs.launchpad.net/bugs/882693
>>>
>>> Without this patch:
>>> - Internal Speaker is not muted when "Line Out" jack is plugged in
>>> With this patch:
>>> - Internal Speaker is muted when "Line Out" jack is plugged in
>>>
>>> Upstream status:
>>> Acked/reviewed by Takashi Iwai and on its way to 3.0 (and 3.1) stable.
>>>
>>
>> Have you also tried this laptop with Precise to make sure the
>> "refactored automute for Realtek" still works ?

No.

> _And_ have you tested this patch for regressions on other platforms with
> Realtek codecs ?

...and no.

Could you clarify whether or not this is a requirement for taking the patch?

Anyway, I'm cc:ing Anthony here as I don't have physical access to the 
hardware. Anthony, if you feel it's worth the effort of doing such 
testing to make this machine get certified faster (instead of waiting 
for this patch to come through upstream stable), could you organise such 
testing? There is a dkms package for easy testing in the bug.
Tim Gardner - Dec. 2, 2011, 7:01 p.m.
On 12/02/2011 01:38 AM, David Henningsson wrote:
> On 12/01/2011 03:13 PM, Tim Gardner wrote:
>> On 12/01/2011 06:52 AM, Tim Gardner wrote:
>>> On 12/01/2011 01:52 AM, David Henningsson wrote:
>>>> SRU Justification:
>>>>
>>>> Fixes a blocks-hwcert bug.
>>>>
>>>> Test case:
>>>>
>>>> Take the Optiplex XE machine specified here:
>>>> http://bugs.launchpad.net/bugs/882693
>>>>
>>>> Without this patch:
>>>> - Internal Speaker is not muted when "Line Out" jack is plugged in
>>>> With this patch:
>>>> - Internal Speaker is muted when "Line Out" jack is plugged in
>>>>
>>>> Upstream status:
>>>> Acked/reviewed by Takashi Iwai and on its way to 3.0 (and 3.1) stable.
>>>>
>>>
>>> Have you also tried this laptop with Precise to make sure the
>>> "refactored automute for Realtek" still works ?
>
> No.
>
>> _And_ have you tested this patch for regressions on other platforms with
>> Realtek codecs ?
>
> ...and no.
>
> Could you clarify whether or not this is a requirement for taking the
> patch?
>
> Anyway, I'm cc:ing Anthony here as I don't have physical access to the
> hardware. Anthony, if you feel it's worth the effort of doing such
> testing to make this machine get certified faster (instead of waiting
> for this patch to come through upstream stable), could you organise such
> testing? There is a dkms package for easy testing in the bug.
>

The prime objective of the SRU policy is to cause no regression(s). Your 
patch could potentially affect every platform with a Realtek codec that 
has (board_config == ALC880_AUTO). So, yes, I think you should test on 
some other laptops with Realtek codecs.

I'm not as concerned about automute working in Precise, that was merely 
idle curiosity. However, if it doesn't work then you should likely take 
steps now to prevent regressions when folks upgrade from Oneiric to Precise.

rtg

Patch

From d494dd1f0689328b2c9a62fa168ff774928becc6 Mon Sep 17 00:00:00 2001
From: David Henningsson <david.henningsson@canonical.com>
Date: Tue, 29 Nov 2011 09:19:45 +0100
Subject: [PATCH] ALSA: HDA: Fix Realtek automute Line Out -> Internal Speaker

In kernels 3.0 and 3.1, no automute control was created unless
Headphone pins were present. This patch enables automute for the
case where there are just Line Out and Speaker pins.

BugLink: http://bugs.launchpad.net/bugs/882693
Cc: stable@kernel.org (3.0 and 3.1)
Tested-by: Marc Legris <marc.legris@canonical.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
---
 sound/pci/hda/patch_realtek.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index e7dc034..c85ce60 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -1605,7 +1605,7 @@  static void alc_init_auto_hp(struct hda_codec *codec)
 		spec->automute = 1;
 		spec->automute_mode = ALC_AUTOMUTE_PIN;
 	}
-	if (spec->automute && cfg->line_out_pins[0] &&
+	if (cfg->line_out_pins[0] &&
 	    cfg->speaker_pins[0] &&
 	    cfg->line_out_pins[0] != cfg->hp_pins[0] &&
 	    cfg->line_out_pins[0] != cfg->speaker_pins[0]) {
@@ -1619,6 +1619,10 @@  static void alc_init_auto_hp(struct hda_codec *codec)
 					AC_VERB_SET_UNSOLICITED_ENABLE,
 					AC_USRSP_EN | ALC880_FRONT_EVENT);
 			spec->detect_line = 1;
+			if (!spec->automute) {
+				spec->automute = 1;
+				spec->automute_mode = ALC_AUTOMUTE_PIN;
+			}
 		}
 		spec->automute_lines = spec->detect_line;
 	}
-- 
1.7.5.4