Bug 94111

Summary: Device found, mixer ok, but no sound from speaker (headphones work)
Product: Drivers Reporter: Jesús Guerrero Botella (jesus.guerrero.botella)
Component: Sound(ALSA)Assignee: Jaroslav Kysela (perex)
Status: RESOLVED CODE_FIX    
Severity: normal CC: superquad.vortex2, tiwai
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 3.18 and all above Subsystem:
Regression: No Bisected commit-id:
Attachments: alsa-info output for 3.17.7
alsa-info output for 4.0_rc1
Fix patch

Description Jesús Guerrero Botella 2015-03-02 07:15:33 UTC
Hello.

Up to 3.17.7 my sound has been working without problems in this Acer Aspire 9420 laptop.

But when trying to upgrade to 3.18 suddenly sound stopped coming out of my speakers.

The sound card seems to work ok since I can still hear everything if I plug my earphones. 

Of course, the first thing I checked was the mixer. I unmutted everything and turned the volumes all the way up. That didn't help though.

I have tried many 3.18 minor versions and I also tried 3.19 and 4 rc1. Same result, so I thought it's about time to report.

The amixer diff from 3.17.7 to 4rc1 is:

--- kernel-3.17.7       2015-03-01 20:16:55.122672458 +0100
+++ kernel-4.0.0-rc1    2015-03-01 20:50:05.547655331 +0100
@@ -70,6 +70,13 @@
   Capabilities: pswitch pswitch-joined
   Playback channels: Mono
   Mono: Playback [off]
+Simple mixer control 'Beep',0
+  Capabilities: pvolume pswitch
+  Playback channels: Front Left - Front Right
+  Limits: Playback 0 - 31
+  Mono:
+  Front Left: Playback 0 [0%] [-34.50dB] [off]
+  Front Right: Playback 0 [0%] [-34.50dB] [off]
 Simple mixer control 'Capture',0
   Capabilities: cvolume cswitch
   Capture channels: Front Left - Front Right

My device is:

# lspci|grep -i aud
00:1b.0 Audio device: Intel Corporation NM10/ICH7 Family High Definition Audio Controller (rev 02)


I tried unmutting that "beep" thing, whatever that is, and raising the volume for it. No change.

If you need something else just ask.

Thanks for taking a look :)
Comment 1 Raymond 2015-03-03 00:48:45 UTC
you have to post the output of alsa-info.sh

http://www.linuxquestions.org/questions/slackware-14/no-sound-in-any-browser-after-nvidia-install-779083/

you need to fix up pin default of some pin complex
Comment 2 Jesús Guerrero Botella 2015-03-03 07:37:05 UTC
Created attachment 168651 [details]
alsa-info output for 3.17.7
Comment 3 Jesús Guerrero Botella 2015-03-03 07:39:39 UTC
Hi.

(In reply to Raymond from comment #1)
> you have to post the output of alsa-info.sh

Done. I did for 3.17.7. Should I also post it for 4.0-rc1?

> 
> http://www.linuxquestions.org/questions/slackware-14/no-sound-in-any-browser-
> after-nvidia-install-779083/

That thread doesn't seem related, besides it's old, and I am not using the nvidia driver at all.


> 
> you need to fix up pin default of some pin complex

I have no idea what that means, sorry for my noobness. It always worked and I didn't do anything to make it work. I don't use an asoundrc, just the defaults.
Comment 4 Raymond 2015-03-03 08:57:40 UTC
you need to use 

hdajacksensetest -a

to find out headphone and mic jack 


use hda-analyzer to change the volume slider to find out internal speaker and mic

use hdajackretask to fix the pin default of headphone, internal speaker , mic and internal mic

change pin default of node 0x1d from [Fixed] to [N/A] 


Node 0x14 [Pin Complex] wcaps 0x40018f: Stereo Amp-In Amp-Out
  Control: name="Front Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Control: name="Line Out Phantom Jack", index=0, device=0
  Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x27, mute=0
  Amp-In vals:  [0x00 0x00]
  Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
  Amp-Out vals:  [0x00 0x00]
  Pincap 0x0000003e: IN OUT HP Detect Trigger
  Pin Default 0x01011110: [Jack] Line Out at Ext Rear
    Conn = 1/8, Color = Black
    DefAssociation = 0x1, Sequence = 0x0
    Misc = NO_PRESENCE
  Pin-ctls: 0x40: OUT
  Unsolicited: tag=00, enabled=0
  Connection: 5
     0x0c* 0x0d 0x0e 0x0f 0x26


Node 0x18 [Pin Complex] wcaps 0x40018f: Stereo Amp-In Amp-Out
  Control: name="Center Playback Switch", index=0, device=0
    ControlAmp: chs=1, dir=Out, idx=0, ofs=0
  Control: name="LFE Playback Switch", index=0, device=0
    ControlAmp: chs=2, dir=Out, idx=0, ofs=0
  Control: name="Mic Boost Volume", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=0, ofs=0
  Control: name="Mic Phantom Jack", index=0, device=0
  Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x27, mute=0
  Amp-In vals:  [0x00 0x00]
  Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
  Amp-Out vals:  [0x00 0x00]
  Pincap 0x0000173e: IN OUT HP Detect Trigger
    Vref caps: HIZ 50 GRD 80
  Pin Default 0x01a19930: [Jack] Mic at Ext Rear
    Conn = 1/8, Color = Pink
    DefAssociation = 0x3, Sequence = 0x0
    Misc = NO_PRESENCE
  Pin-ctls: 0x21: IN VREF_50
  Unsolicited: tag=00, enabled=0
  Connection: 5
     0x0c* 0x0d 0x0e 0x0f 0x26

Node 0x1a [Pin Complex] wcaps 0x40018f: Stereo Amp-In Amp-Out
  Control: name="Surround Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Control: name="Line Boost Volume", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=0, ofs=0
  Control: name="Line Phantom Jack", index=0, device=0
  Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x27, mute=0
  Amp-In vals:  [0x02 0x02]
  Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
  Amp-Out vals:  [0x00 0x00]
  Pincap 0x0000173e: IN OUT HP Detect Trigger
    Vref caps: HIZ 50 GRD 80
  Pin Default 0x0181313f: [Jack] Line In at Ext Rear
    Conn = 1/8, Color = Blue
    DefAssociation = 0x3, Sequence = 0xf
    Misc = NO_PRESENCE
  Pin-ctls: 0x20: IN VREF_HIZ
  Unsolicited: tag=00, enabled=0
  Connection: 5
     0x0c* 0x0d 0x0e 0x0f 0x26


Node 0x1d [Pin Complex] wcaps 0x400000: Mono
  Pincap 0x00000020: IN
  Pin Default 0x99830131: [Fixed] Line In at Int ATAPI
    Conn = ATAPI, Color = Unknown
    DefAssociation = 0x3, Sequence = 0x1
    Misc = NO_PRESENCE
  Pin-ctls: 0x00:
Comment 5 Jesús Guerrero Botella 2015-03-03 13:45:17 UTC
Thanks for all the advise. 

Unfortunately I can't get anything clear out of this.

After searching a bit I see that hdajacksensetest is a recent addition to alsa-tools so I downloaded the source package and compiled just that tool. I can run it and it shows:

Pin 0x14 (Black Line Out, Rear side): present = No
Pin 0x15 (Not connected): present = No
Pin 0x16 (Not connected): present = No
Pin 0x17 (Not connected): present = No
Pin 0x18 (Pink Mic, Rear side): present = No
Pin 0x19 (Not connected): present = No
Pin 0x1a (Blue Line In, Rear side): present = No
Pin 0x1b (Not connected): present = No
Pin 0x1c (Not connected): present = No
Pin 0x1d (Internal Line In, ATAPI): present = No
Pin 0x1e (Black SPDIF Out, Rear side): present = No
Pin 0x1f (Not connected): present = No

So 14 and 18 are headphones and mic. 

I downloaded hda-analyzer from some other random place since it doesn't seem to be present in my gentoo install either, and it shows a GUI where I can see not only those nodes listed above, but a lot more. 

In any case, I went from 0x14 to 0x1f, un-checking all mute boxes and then turning all the val[0] and val[1] sliders to the right.

All of this while playing an mp3 file in a terminal. I can hear thru the earphones when I plug them, but there's no sound at all coming out of my speakers.

Please, forgive me if I am missing something obvious, I have no idea what those "nodes" are and I have no idea if I have to do something else (sort of clicking an "apply" button or whatever) to put the changes to good use.

As said, just moving the sliders in those nodes listed above changes nothing.


Oh, one thing that I noticed in dmesg is this:

[  253.017035] CE: hpet increased min_delta_ns to 20115 nsec
[  253.380178] snd_hda_intel 0000:00:1b.0: IRQ timing workaround is activated for card #0. Suggest a bigger bdl_pos_adj.
[  646.112078] kworker/dying (502) used greatest stack depth: 11856 bytes left
[  762.883051] CE: hpet increased min_delta_ns to 30172 nsec


I have no idea if it might be related or not.

Again, thanks.
Comment 6 Raymond 2015-03-03 14:26:01 UTC
Pin 0x14 (Black Line Out, Rear side): present = No
Pin 0x15 (Not connected): present = No
Pin 0x16 (Not connected): present = No
Pin 0x17 (Not connected): present = No
Pin 0x18 (Pink Mic, Rear side): present = No
Pin 0x19 (Not connected): present = No
Pin 0x1a (Blue Line In, Rear side): present = No
Pin 0x1b (Not connected): present = No
Pin 0x1c (Not connected): present = No
Pin 0x1d (Internal Line In, ATAPI): present = No
Pin 0x1e (Black SPDIF Out, Rear side): present = No
Pin 0x1f (Not connected): present = No

Have you plugged headphone or mic ?

present = Yes when you plugged and no when unplugged headphone and mic
Comment 7 Raymond 2015-03-04 05:48:04 UTC
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pci/hda/patch_realtek.c?id=22b530e0287724f00dde9a15a94d408c3334e86c


you need to post the output of alsa-info.sh using the previous version of livecd which still have sound from speaker

the previous alc883_acer_aspire assume 

hp at node 0x14

and speaker at node 0x15 and node 0x16
Comment 8 Jesús Guerrero Botella 2015-03-04 07:50:54 UTC
(In reply to Raymond from comment #6)
> Pin 0x14 (Black Line Out, Rear side): present = No
> Pin 0x15 (Not connected): present = No
> Pin 0x16 (Not connected): present = No
> Pin 0x17 (Not connected): present = No
> Pin 0x18 (Pink Mic, Rear side): present = No
> Pin 0x19 (Not connected): present = No
> Pin 0x1a (Blue Line In, Rear side): present = No
> Pin 0x1b (Not connected): present = No
> Pin 0x1c (Not connected): present = No
> Pin 0x1d (Internal Line In, ATAPI): present = No
> Pin 0x1e (Black SPDIF Out, Rear side): present = No
> Pin 0x1f (Not connected): present = No
> 
> Have you plugged headphone or mic ?
> 
> present = Yes when you plugged and no when unplugged headphone and mic

None of them was plugged when I ran this command, I didn't think it necessary since I understood that that command was aimed at identifying the "pins", whatever they are. I take 14 is my headphones out, and 18 is my mic in.

One thing that might or might not be important, is that in my laptop case I can see and "SPDIF" label next to the same hole where the earphones are plugged, which means that SPDIF out (0x1e) and line out (0x14) share the same physical port.

Just to clear out any possible confussion: I haven't a problem with any of these. My problem is that the laptop integrated speakers doesn't make any sound since kernel 3.18. That doesn't change if I plug or unplug earphones.

3.17.7 and below is fine. It's always been fine.
Comment 9 Jesús Guerrero Botella 2015-03-04 08:11:30 UTC
(In reply to Raymond from comment #7)
> https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/
> pci/hda/patch_realtek.c?id=22b530e0287724f00dde9a15a94d408c3334e86c
> 
> 
> you need to post the output of alsa-info.sh using the previous version of
> livecd which still have sound from speaker
> 

The output I posted *is* from 3.17.7, which is the kernel where sound works.

The internal speaker is not listed (at least to my untrained eye), but it works.
Comment 10 Jesús Guerrero Botella 2015-03-04 08:14:03 UTC
I tinkered around a bit after looking at that simple patch. But I can't find that concrete chunck of code in sound/pci/hda/patch_realtek.c (I looked at 3.17.7 and 4.0_rc1).

I don't think it matters though, because my laptop doesn't seem to be using that chip (lsmod output below).

$ lsmod
Module                  Size  Used by
fuse                   75314  2 
iptable_nat             2670  0 
nf_nat_ipv4             3360  1 iptable_nat
nf_nat                 11634  2 nf_nat_ipv4,iptable_nat
vboxnetadp             17606  0 
vboxnetflt             15538  0 
vboxdrv               319582  2 vboxnetadp,vboxnetflt
nvidia              11296014  43 
snd_hda_codec_si3054     3294  1 
snd_hda_codec_realtek    52890  1 
snd_hda_codec_generic    50451  1 snd_hda_codec_realtek
snd_hda_intel          17131  0 
snd_hda_controller     20002  1 snd_hda_intel
sdhci_pci              10913  0 
snd_hda_codec          92542  5 snd_hda_codec_realtek,snd_hda_codec_si3054,snd_hda_codec_generic,snd_hda_intel,snd_hda_controller
sdhci                  24909  1 sdhci_pci
mmc_core               86012  1 sdhci
snd_hwdep               6188  1 snd_hda_codec
snd_pcm                77082  4 snd_hda_codec_si3054,snd_hda_codec,snd_hda_intel,snd_hda_controller
iwl3945                51173  0 
acer_wmi               12331  0 
iwlegacy               45721  1 iwl3945
coretemp                5860  0 
snd_timer              17678  1 snd_pcm
tifm_7xx1               4217  0 
drm                   237840  2 nvidia
i2c_i801                9589  0 
tifm_core               4505  1 tifm_7xx1
r8169                  57710  0 
acpi_cpufreq            6666  0 
snd                    55612  8 snd_hda_codec_realtek,snd_hda_codec_si3054,snd_hwdep,snd_timer,snd_pcm,snd_hda_codec_generic,snd_hda_codec,snd_hda_intel
soundcore               5066  2 snd,snd_hda_codec
Comment 11 Raymond 2015-03-04 09:57:35 UTC
Pincap 0x0000003e: IN OUT HP Detect Trigger

Pin-ctls: 0x40: OUT

only node 0x14 pin-ctls has OUT

but it is strange that HP is not enabled if it is headphone



Pin Default 0x01011110: [Jack] Line Out at Ext Rear
    Conn = 1/8, Color = Black
    DefAssociation = 0x1, Sequence = 0x0
    Misc = NO_PRESENCE



you need to clear bit 8 of pin default and set it to Headphone by hdajackretask 



http://voices.canonical.com/david.henningsson/2011/11/29/turn-your-mic-jack-into-a-headphone-jack/


https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/log/sound/pci/hda/patch_realtek.c?qt=grep&q=acer


try changing node 0x15 to speaker



https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pci/hda/patch_realtek.c?id=676a9b53dcb0843a98f7339a492e42baf4b9a734
Comment 12 Jesús Guerrero Botella 2015-03-04 10:11:10 UTC
Thanks. I'll try. Is there a way to compile hdajackretask without gtk3?
Comment 13 Jesús Guerrero Botella 2015-03-04 10:55:54 UTC
Nevermind, I compiled it and it didn't take that long.

I started that little tools and ticked "show unconnected pins".

Ticked override pin 14, then selected headphones.

Ticked override pin 15, then selected internal speaker, clicked apply, tested and no sound.

Then iterated that same procedure for all the unconnected pins, same result.

On each iteration, I ran alsamixer and unmutted the master channel and raised vol to 100%, because it kept mutting itself and setting to 0%. But still no sound came out of the internal speakers.
Comment 14 Jesús Guerrero Botella 2015-03-04 10:56:26 UTC
Created attachment 168901 [details]
alsa-info output for 4.0_rc1
Comment 15 Raymond 2015-03-04 13:31:50 UTC
have you set boot default and reboot ?

since you have change lineout to headphone, the channel mode control should not appear. since it require three jack (line out, mic and line in)






you can retask four pin complex  which pincap support OUT as speaker with same def assoc and ascending sequence number

since hda-intel use copy front which sound will copy to 7.1 speaker and you can know which node if the corresponding volume control
Comment 16 Jesús Guerrero Botella 2015-03-05 16:22:27 UTC
(In reply to Raymond from comment #15)
> have you set boot default and reboot ?

You mean click the button to "install boot override"?

I thought that button was intended to make the changes permanent across reboots, but that changes are instant and should work without the need for a reboot, don't they?

If you truly need to reboot for the changes to take effect then I don't understand at all how this little tool does the job (but then I know nothing about this particular topic at all and, in general, about ALSA internals).


> 
> since you have change lineout to headphone, the channel mode control should
> not appear. since it require three jack (line out, mic and line in)

I see controls changing in the mixer (as I told you, I use alsamixer after each change to see what's happening and rise the volume if needed).

> you can retask four pin complex  which pincap support OUT as speaker with
> same def assoc and ascending sequence number
> 
> since hda-intel use copy front which sound will copy to 7.1 speaker and you
> can know which node if the corresponding volume control

You'll have to forgive me but I don't really follow you here.

It's just a set of stereo internal speakers in a laptop. And hdajacksentest seems to detect the same pins with 3.17.7 (which works) and with 3.18, 3.19 and 4.0_rc1 (which do not work).

I have tried assigning the "internal speaker" to every possible pin, and with each change I ran alsamixer to unmute and raise everything. But haven't managed to get a sound from my laptop speakers.

So I'm stuck at kernel 3.17.7 which works right out of the box.

I'll make some more tests later if I manage to get some free time. If I find anything I'll report back.

Again, thanks for all the help.
Comment 17 Raymond 2015-03-05 16:46:08 UTC
seem you are using dynamic reconfig since control id jump from 44 to 1016

but init pin cfg and usert pin cfg are the same and the channel mode control still exist

you info did not show how you retasked those pins

control.43 {
		iface MIXER
		name 'PCM Playback Volume'
		value.0 255
		value.1 255
		comment {
			access 'read write user'
			type INTEGER
			count 2
			range '0 - 255'
			tlv '0000000100000008ffffec1400000014'
			dbmin -5100
			dbmax 0
			dbvalue.0 0
			dbvalue.1 0
		}
	}
	control.44 {
		iface MIXER
		name 'Digital Capture Volume'
		value.0 60
		value.1 60
		comment {
			access 'read write user'
			type INTEGER
			count 2
			range '0 - 120'
			tlv '0000000100000008fffff44800000032'
			dbmin -3000
			dbmax 3000
			dbvalue.0 0
			dbvalue.1 0
		}
	}
	control.1016 {
		iface MIXER
		name 'Channel Mode'
		value '2ch'
		comment {
			access 'read write'
			type ENUMERATED
			count 1
			item.0 '2ch'
			item.1 '4ch'
			item.2 '6ch'
		}
	}
	control.1017 {
		iface MIXER
		name 'Front Playback Volume'
		value.0 31
		value.1 31
		comment {
			access 'read write'
			type INTEGER
			count 2
			range '0 - 31'
			dbmin -4650
			dbmax 0
			dbvalue.0 0
			dbvalue.1 0
		}
	}


/sys/class/sound/hwC0D0/init_pin_configs:
0x14 0x01011110
0x15 0x411111f0
0x16 0x411111f0
0x17 0x411111f0
0x18 0x01a19930
0x19 0x411111f0
0x1a 0x0181313f
0x1b 0x411111f0
0x1c 0x411111f0
0x1d 0x99830131
0x1e 0x01451120
0x1f 0x411111f0

/sys/class/sound/hwC0D0/driver_pin_configs:

/sys/class/sound/hwC0D0/user_pin_configs:
0x14 0x01011110
0x15 0x411111f0
0x16 0x411111f0
0x17 0x411111f0
0x18 0x01a19930
0x19 0x411111f0
0x1a 0x0181313f
0x1b 0x411111f0
0x1c 0x411111f0
0x1d 0x99830131
0x1e 0x01451120
0x1f 0x411111f0

/sys/class/sound/hwC0D0/init_verbs:
Comment 18 Jesús Guerrero Botella 2015-03-20 17:03:43 UTC
Sorry for taking so long to come back. I have been experimenting as time permitted, but I must confess I just haven't had any luck regarding this issue.

Quite frustrating.

I will definitely need some spoon feeding if this is to be sorted out at all, otherwise I will have to discard this laptop which is a pitty since it works ok.

I have some doubts.

First, I have no clear idea what those pins are so I have no idea if they are completely arbitrary or if I need to take something into account when overriding them. I have no idea if there's anything that I shouldn't override Or if I can just override all of them to whatever in or out I please.

Secondly, I have no idea what the option to install the boot override does. Whether it depends on the tools being installed (as said, Gentoo doesn't provide hdajackretask and I am compiling it at $HOME and running it from there) or if that override depends upon a concrete init system or whatever else (how it loads, whatever it is).

Thirdly, I would really like to know if I truly need that just to test the settings. If you ask me, I would assume that the apply button serves the purpose of applying the damn thing, and that the boot override is only intended to make the thing persistent across reboots. But I might be wrong.

I want to clear these out just to ease the tests as much as possible.

Thanks.
Comment 19 Jesús Guerrero Botella 2015-03-23 17:19:46 UTC
Hi again.

I can't comment on the details right now. But it seems to work if I pass model=acer-aspire to the module snd-hda-intel.

It used to work without this until 3.18.
Comment 20 Takashi Iwai 2015-06-02 17:59:35 UTC
OK, I'm going to queue the fix to apply the model automatically.  It'll be backported to stable kernels eventually later.
Comment 21 Takashi Iwai 2015-06-02 17:59:51 UTC
Created attachment 178601 [details]
Fix patch
Comment 22 Takashi Iwai 2015-06-02 18:01:38 UTC
The patch was queued to sound git tree.  Let's close.