Bug 75041 - No sound from speakers on ASUS A8Jn
Summary: No sound from speakers on ASUS A8Jn
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Sound(ALSA) (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Jaroslav Kysela
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-29 06:10 UTC by Mike Crash
Modified: 2014-05-30 13:55 UTC (History)
2 users (show)

See Also:
Kernel Version: 3.12, 3.13, 3.14
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Output of alsa-info for kernel 3.11 on ASUS A8Jn (34.31 KB, text/plain)
2014-04-29 22:33 UTC, Mike Crash
Details
Output of alsa-info for kernel 3.14 on ASUS A8Jn (29.61 KB, text/plain)
2014-04-29 22:34 UTC, Mike Crash
Details
Fix patch (681 bytes, patch)
2014-05-23 07:20 UTC, Takashi Iwai
Details | Diff

Description Mike Crash 2014-04-29 06:10:12 UTC
On kernels 3.12 and up there is no sound from speakers on notebook ASUS A8Jn. The last working kernel is 3.11. It seems it is caused by last changes to AD1986A stackups (commit a8015c470e1119a47d55bab83a9c01480714609e) or EAPD. Or may be commit 632408adfe70be6706cb89522b0d5b3dce188d84?

Last commits to AD1986A:
https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/log/?id=refs%2Ftags%2Fv3.12.18&qt=grep&q=ad1986a

On very old kernels it worked with config 
options snd-hda-intel index=0 model=asus

Tested with 3.12, 3.13 and 3.14 kernels, no sound, but headphones are OK.
Comment 1 Raymond 2014-04-29 11:28:53 UTC
you have to post output of alsa-info.sh

 it was using ad1986a_3stack

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/?id=658fba0efe93fdef44f65cff391ae2a881e30d90
Comment 2 Mike Crash 2014-04-29 22:32:05 UTC
Yes, but it was removed here:
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pci/hda/patch_analog.c?id=0f7dbda0ec3bc4d778d7acf741b220fbf4318a20

I am attaching output from alsa-info for kernel 3.14 and also working kernel 3.11.
Also I was wrong, that headphones works in 3.12-3.14. After power up, speakers are silent, but headphones produce strange clicks only at maximum volume. If I reboot to 3.11, sound works OK, after restart to 3.14, headphones work OK, no sound from speakers. It seems, there is something not initialized correctly. May be "Most of ASUS laptops and Lenovo N100 provide proper BIOS pin-configs." is not correct for ASUS A8Jn.

Also I have tried to set model to 3stack and laptop-eapd, none of them works. If I compare previous code 
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/tree/sound/pci/hda/patch_analog.c?id=cf30f46acde1f84fbf603bba6540cbb40cc6c954
with the last one
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/tree/sound/pci/hda/patch_analog.c?id=c5eda4c1bf6214332c46fb2f4e7c42a85e5e5643
It was rewritten and some init seems to be missing, look at lines 1320- for example need_dac_fix, also AD1986A_FIXUP_3STACK seems different, but I have not studied it deeply.

Comparing output from alsa-info, in 3.11:

Node 0x1b [Pin Complex] wcaps 0x400185: Stereo Amp-Out
  Control: name="Front Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Control: name="Front Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1
  Amp-Out vals:  [0x1f 0x1f]
  Pincap 0x0001001f: OUT HP EAPD Detect Trigger ImpSense
  EAPD 0x2: EAPD
  Pin Default 0x9117f110: [Fixed] Speaker at Int Rear
    Conn = Analog, Color = Other
    DefAssociation = 0x1, Sequence = 0x0
    Misc = NO_PRESENCE
  Pin-ctls: 0x40: OUT
  Unsolicited: tag=00, enabled=0
  Connection: 1
     0x0b

And in 3.14:
Node 0x1b [Pin Complex] wcaps 0x400185: Stereo Amp-Out
  Control: name="Speaker Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Control: name="Speaker Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Control: name="Speaker Phantom Jack", index=0, device=0
  Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1
  Amp-Out vals:  [0x00 0x00]
  Pincap 0x0001001f: OUT HP EAPD Detect Trigger ImpSense
  EAPD 0x0:
  Pin Default 0x9117f110: [Fixed] Speaker at Int Rear
    Conn = Analog, Color = Other
    DefAssociation = 0x1, Sequence = 0x0
    Misc = NO_PRESENCE
  Pin-ctls: 0x40: OUT
  Unsolicited: tag=00, enabled=0
  Connection: 1
     0x0b

Difference is missing EAPD and Amp-Out vals is zero instead of 0x1f.
Comment 3 Mike Crash 2014-04-29 22:33:29 UTC
Created attachment 134291 [details]
Output of alsa-info for kernel 3.11 on ASUS A8Jn
Comment 4 Mike Crash 2014-04-29 22:34:04 UTC
Created attachment 134301 [details]
Output of alsa-info for kernel 3.14 on ASUS A8Jn
Comment 5 Raymond 2014-04-30 07:36:02 UTC
the original quirk was removed by this patch

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pci/hda/patch_analog.c?id=0f7dbda0ec3bc4d778d7acf741b220fbf4318a20


The 3stack model was designed for desktop with 3 audio jacks at rear panel

the latest alsa driver seem still using mic mix 

https://bugzilla.kernel.org/show_bug.cgi?id=66621
Comment 6 Raymond 2014-04-30 08:56:13 UTC
the main difference is unsolicited event is not enabled in the static ad1986a_3stack


try hda-jack-sense-test to check whether you need inv Jack detect



Node 0x1a [Pin Complex] wcaps 0x400185: Stereo Amp-Out
  Control: name="Headphone Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Control: name="Headphone Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1
  Amp-Out vals:  [0x1f 0x1f]
  Pincap 0x0000001f: OUT HP Detect Trigger ImpSense
  Pin Default 0x0121401f: [Jack] HP Out at Ext Rear
    Conn = 1/8, Color = Green
    DefAssociation = 0x1, Sequence = 0xf
  Pin-ctls: 0xc0: OUT HP
  Unsolicited: tag=00, enabled=0
  Connection: 1
     0x0a
Comment 7 Mike Crash 2014-05-22 18:06:32 UTC
The output from hda-jack-sense-test is only:

Pin 0x1a (Green HP Out): present = No
Pin 0x1f (Pink Mic): present = No

But I found, that in hda_analyzer, under Node[0x1b] PIN, if I check EAPD, the sound comes from speakers! So it acknowledges what I wrote earlier - missing EAPD.

Here is Text dump from hda_analyzer with working setup:

Node 0x1b [Pin Complex] wcaps 0x400185: Stereo Amp-Out
  Control: name="Speaker Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=1, idx=0, ofs=0
  Control: name="Speaker Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=1, idx=0, ofs=0
  Control: iface="card", name="Speaker Phantom Jack", index=0, device=0
  Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1
  Amp-Out vals: [0x1f 0x1f]
  Pincap 0x0001001f: OUT HP EAPD Detect Trigger ImpSense
  EAPD 0x2: EAPD
  Pin Default 0x9117f110: [Fixed] Speaker at Int Rear
    Conn = Analog, Color = Other
    DefAssociation = 0x1, Sequence = 0x0
    Misc = NO_PRESENCE
  Pin-ctls: 0x40: OUT
  Unsolicited: tag=0x00, enabled=0
  Connection: 1
     0x0b
Comment 8 Takashi Iwai 2014-05-23 07:19:31 UTC
Could you try the patch below?
Comment 9 Takashi Iwai 2014-05-23 07:20:03 UTC
Created attachment 137211 [details]
Fix patch
Comment 10 Mike Crash 2014-05-29 04:27:20 UTC
I have recompiled kernel 3.14.4 with the provided patch and also added 
spec->gen.own_eapd_ctl = 1;
to function ad1986a_fixup_eapd, so it looks like:

static void ad1986a_fixup_eapd(struct hda_codec *codec,
			       const struct hda_fixup *fix, int action)
{
	struct ad198x_spec *spec = codec->spec;

	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
		codec->inv_eapd = 0;
		spec->gen.keep_eapd_on = 1;
		spec->gen.own_eapd_ctl = 1;
		spec->eapd_nid = 0x1b;
	}
}

Now it works. I will check, if own_eapd_ctl is needed.
Comment 11 Mike Crash 2014-05-30 09:57:59 UTC
I can confirm, that provided patch by Takashi Iwai works. Parameter own_eapd_ctl is not needed. Is it possible to merge it to kernel and mark bug as resolved?
Comment 12 Takashi Iwai 2014-05-30 10:07:53 UTC
Great, I'll merge it to sound git tree.  Maybe it's too late for 3.15-rc8 (or -final), but it'll be in the next pull request.
Comment 13 Mike Crash 2014-05-30 10:44:55 UTC
OK, thank you!
Comment 14 Takashi Iwai 2014-05-30 13:55:25 UTC
Now merged to sound git tree (with Cc to stable).  Let's close.

Note You need to log in before you can comment on or make changes to this bug.