Bug 90972 - No sound when plugging in headphones, must unmute and raise Speker+LO to get sound
Summary: No sound when plugging in headphones, must unmute and raise Speker+LO to get ...
Status: RESOLVED MOVED
Alias: None
Product: PulseAudio
Classification: Unclassified
Component: alsa (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: pulseaudio-bugs
QA Contact: pulseaudio-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-14 03:16 UTC by Martin Erik Werner
Modified: 2018-07-30 09:41 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
alsa-info output with headphones (37.74 KB, text/plain)
2015-06-14 03:17 UTC, Martin Erik Werner
Details
alsa-info output without headphones (37.75 KB, text/plain)
2015-06-14 03:18 UTC, Martin Erik Werner
Details
amixer -c 0 contents output with headphones (12.62 KB, text/plain)
2015-06-14 03:19 UTC, Martin Erik Werner
Details
amixer -c 0 contents output without headphones (12.62 KB, text/plain)
2015-06-14 03:19 UTC, Martin Erik Werner
Details
pactl list sinks output with headphones (2.08 KB, text/plain)
2015-06-14 09:55 UTC, Martin Erik Werner
Details
pactl list sinks output without headphones (2.07 KB, text/plain)
2015-06-14 09:55 UTC, Martin Erik Werner
Details
LANG=C pulseaudio -vvvv --log-time=1 output starting with no headphones, then plugging in headphones, then unplugging them again (225.44 KB, text/plain)
2015-06-14 09:56 UTC, Martin Erik Werner
Details

Description Martin Erik Werner 2015-06-14 03:16:32 UTC
Recently (month back or so) I've discovered that headphone jack handling has started to misbehave:

Whenever I plug in my headphone jack:
* The Master slider is changed to a stored value specific to headphones
* The Headphone slider is unmuted and set to 100
* The Speaker+LO slider is muted and set to 0

And there is no sound output from the headphones, only if I unmute and increase the volume of Speaker+LO do I get output in the headphones, this is something I need to re-do each time plugging in headphones.

I've attached alsa-info and amixer output with and without headphones.

I originally believed this to be the same as https://bugs.freedesktop.org/show_bug.cgi?id=90491 forwarded to https://bugzilla.kernel.org/show_bug.cgi?id=99681 but after some discussion there it was concluded that this was likely a pulseaudio issue instead.
Comment 1 Martin Erik Werner 2015-06-14 03:17:58 UTC
Created attachment 116479 [details]
alsa-info output with headphones
Comment 2 Martin Erik Werner 2015-06-14 03:18:21 UTC
Created attachment 116480 [details]
alsa-info output without headphones
Comment 3 Martin Erik Werner 2015-06-14 03:19:04 UTC
Created attachment 116481 [details]
amixer -c 0 contents output with headphones
Comment 4 Martin Erik Werner 2015-06-14 03:19:24 UTC
Created attachment 116482 [details]
amixer -c 0 contents output without headphones
Comment 5 Martin Erik Werner 2015-06-14 03:24:19 UTC
Since this information does not seem to be present in alsa-info: This is with pulseaudio 6.0-2
Comment 6 Raymond 2015-06-14 07:32:18 UTC
how many pulseaudio  ports do your onboard sound card ?

your computer has internal speaker, headphone and dock line out

pactl list sinks

do the pulseaudio verbose log show three different ouput paths ?
Comment 7 Raymond 2015-06-14 07:46:59 UTC
numid=1,iface=MIXER,name='Speaker+LO Playback Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=127,step=0
  : values=0,0
  | dBscale-min=-95.25dB,step=0.75dB,mute=1



Simple mixer control 'Speaker+LO',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 127
  Mono:
  Front Left: Playback 0 [0%] [-99999.99dB] [off]
  Front Right: Playback 0 [0%] [-99999.99dB] [off]



state.PCH {
	control.1 {
		iface MIXER
		name 'Speaker+LO Playback Volume'
		value.0 0
		value.1 0
		comment {
			access 'read write'
			type INTEGER
			count 2
			range '0 - 127'
			dbmin -9999999
			dbmax 0
			dbvalue.0 -9999999
			dbvalue.1 -9999999
		}
	}


it is strange that different dB min reported by amixer and alsactl
Comment 8 Raymond 2015-06-14 07:53:54 UTC
you have to post pulseaudio verbose log to find out the value of dB min of speaker path / line out path
Comment 9 Martin Erik Werner 2015-06-14 09:54:22 UTC
(In reply to Raymond from comment #6)
> how many pulseaudio  ports do your onboard sound card ?
> 
> your computer has internal speaker, headphone and dock line out
> 
> pactl list sinks
> 
> do the pulseaudio verbose log show three different ouput paths ?

Physically I have two jacks on this machine, one for headphones (and lineout I am guessing) and one for microphone.
Comment 10 Martin Erik Werner 2015-06-14 09:55:11 UTC
Created attachment 116484 [details]
pactl list sinks output with headphones
Comment 11 Martin Erik Werner 2015-06-14 09:55:32 UTC
Created attachment 116485 [details]
pactl list sinks output without headphones
Comment 12 Martin Erik Werner 2015-06-14 09:56:35 UTC
Created attachment 116486 [details]
LANG=C pulseaudio -vvvv --log-time=1 output starting with no headphones, then plugging in headphones, then unplugging them again
Comment 13 Raymond 2015-06-14 12:20:02 UTC
you have to disable loopback mixing since driver assign the first dac node 0x13 to aamix_path

internal speaker, dock line out and headphone are using node 0x13 



Node 0x0b [Pin Complex] wcaps 0x400581: Stereo
  Control: name="Headphone Jack", index=0, device=0
  Pincap 0x0001001c: OUT HP EAPD Detect
  EAPD 0x2: EAPD
  Pin Default 0x0421101f: [Jack] HP Out at Ext Right
    Conn = 1/8, Color = Black
    DefAssociation = 0x1, Sequence = 0xf
  Pin-ctls: 0xc0: OUT HP
  Unsolicited: tag=01, enabled=1
  Power states: 
  Power: setting=D0, actual=D0
  Connection: 3
     0x13 0x14 0x1c*


do you need to add a new conf for dock line out jack for dock line out path ?


internal speaker are automuted when the notebook is docked
Comment 14 Martin Erik Werner 2015-06-14 12:29:58 UTC
(In reply to Raymond from comment #13)
> you have to disable loopback mixing since driver assign the first dac node
> 0x13 to aamix_path

How would do I do that? (and should I?)

> do you need to add a new conf for dock line out jack for dock line out path ?

I do not currently have a laptop dock available and thus have not tested how things work when docked, if that is what the question is?

This is the pulseaudio package in Debian without any further config changes.
Comment 15 Raymond 2015-06-14 12:34:17 UTC
   0.036|   0.000) D: [pulseaudio] alsa-mixer.c: Removing path 'analog-output-lineout' as it is a subset of 'analog-output-speaker'.

you need a dock lineout.conf or add jack dock line out to line.conf to prevent Removing path 'analog-output-lineout' 

 0.036|   0.000) D: [pulseaudio] alsa-mixer.c: Path analog-output-speaker (Speakers), direction=1, priority=100, probed=yes, supported=yes, has_mute=yes, has_volume=yes, has_dB=yes, min_volume=0, max_volume=127, min_dB=-200051, max_dB=0


  0.036|   0.000) D: [pulseaudio] alsa-mixer.c: Path analog-output-headphones (Headphones), direction=1, priority=90, probed=yes, supported=yes, has_mute=yes, has_volume=yes, has_dB=yes, min_volume=0, max_volume=127, min_dB=-200051, max_dB=0



-99999.99 dB represent -INF dB 

this mean  -Infinite dB   * 2  + 51 dB Softvol PCM playback volume
Comment 16 Raymond 2015-06-14 12:45:35 UTC
(In reply to Martin Erik Werner from comment #14)
> (In reply to Raymond from comment #13)
> > you have to disable loopback mixing since driver assign the first dac node
> > 0x13 to aamix_path
> 
> How would do I do that? (and should I?)

you can use 

amixer -c 0 set 'Loopback Mixing' Disabled


Simple mixer control 'Loopback Mixing',0
  Capabilities: enum
  Items: 'Disabled' 'Enabled'
  Item0: 'Enabled'


you have to open bug report at kernel bigzilla about the aamix path always use first DAC when aamix mixer can connect to more than one DAC 



Node 0x1b [Audio Mixer] wcaps 0x20050b: Stereo Amp-In

  Amp-In caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1
  Amp-In vals:  [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x17 0x17] [0x80 0x80] [0x80 0x80]
  Power states: 
  Power: setting=D0, actual=D0
  Connection: 6
     0x0c 0x0e 0x0f 0x13 0x14 0x0a

the driver need to change amp in vals when headphone is plugged when loopback mixing is enabled

Amp-In vals:  [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x17 0x17] [0x80 0x80]
Comment 17 Raymond 2015-06-14 12:57:31 UTC
the dirty workaround if you need loopback mixing 

http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/src/modules/alsa/mixer/paths/analog-output-headphones.conf?id=aec811798cd883a454b9b5cd82c77831906bbd2d

remove three lines from headphone.conf

since auto mute is performed by driver 


-[Element Speaker+LO]
-switch = off
-volume = off
Comment 18 Raymond 2015-06-14 13:03:10 UTC
Node 0x0d [Pin Complex] wcaps 0x400501: Stereo
  Control: name="Speaker Phantom Jack", index=0, device=0
  Pincap 0x00010050: OUT EAPD Balanced
  EAPD 0x2: EAPD
  Pin Default 0x90170110: [Fixed] Speaker at Int N/A
    Conn = Analog, Color = Unknown
    DefAssociation = 0x1, Sequence = 0x0
    Misc = NO_PRESENCE
  Pin-ctls: 0x00:
  Power states: 
  Power: setting=D0, actual=D0
  Connection: 3
     0x13 0x14 0x1c*


speaker is muted when driver change pin ctls of speaker pin from OUT to zero

it is redundant for pulseaudio to change the volume and switch at the audio output
Comment 19 Raymond 2015-06-14 13:16:02 UTC
Node 0x0a [Pin Complex] wcaps 0x400583: Stereo Amp-In
  Control: name="Dock Line Out Jack", index=0, device=0
  Amp-In caps: N/A
  Amp-In vals:  [0x00 0x00]
  Pincap 0x0001173c: IN OUT HP EAPD Detect
    Vref caps: HIZ 50 GRD 80
  EAPD 0x2: EAPD
  Pin Default 0x21011030: [Jack] Line Out at Sep Rear
    Conn = 1/8, Color = Black
    DefAssociation = 0x3, Sequence = 0x0
  Pin-ctls: 0x00: VREF_HIZ
  Unsolicited: tag=02, enabled=1
  Power states: 
  Power: setting=D0, actual=D0
  Connection: 3
     0x13 0x14 0x1c*


dock line out is also muted by driver 


Simple mixer control 'Auto-Mute Mode',0
  Capabilities: enum
  Items: 'Disabled' 'Speaker Only' 'Line Out+Speaker'
  Item0: 'Line Out+Speaker'

for idt codecs,
there is no way for pulseaudio disable driver 's auto mute and use dock line out jack to mute speaker
Comment 20 Martin Erik Werner 2015-06-14 13:31:05 UTC
(In reply to Raymond from comment #16)
> you can use 
> 
> amixer -c 0 set 'Loopback Mixing' Disabled
> 
> 
> Simple mixer control 'Loopback Mixing',0
>   Capabilities: enum
>   Items: 'Disabled' 'Enabled'
>   Item0: 'Enabled'

When doing this the result is that there is now no output from headphones even if Speaker+LO is manually unmuted and increased.

> 
> 
> you have to open bug report at kernel bigzilla about the aamix path always
> use first DAC when aamix mixer can connect to more than one DAC 
> 

I've opened https://bugzilla.kernel.org/show_bug.cgi?id=99931 for this.

(In reply to Raymond from comment #15)
>    0.036|   0.000) D: [pulseaudio] alsa-mixer.c: Removing path
> 'analog-output-lineout' as it is a subset of 'analog-output-speaker'.
> 
> you need a dock lineout.conf or add jack dock line out to line.conf to
> prevent Removing path 'analog-output-lineout' 

I still do not understand how to follow this instruction, I am guessing I should add something to the files in /usr/share/pulseaudio/alsa-mixer/paths/? Or should I create a new file named "lineout.conf" there, and what is the content to add?

(In reply to Raymond from comment #17)
> the dirty workaround if you need loopback mixing 
> 
> http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/src/modules/alsa/
> mixer/paths/analog-output-headphones.
> conf?id=aec811798cd883a454b9b5cd82c77831906bbd2d
> 
> remove three lines from headphone.conf
> 
> since auto mute is performed by driver 
> 
> 
> -[Element Speaker+LO]
> -switch = off
> -volume = off

Doing this stops the Speaker+LO volume from being lowered and muted thus headphones have sound when plugged in, but if internal speakers are muted before plugging in, it does not unmute Speaker+LO when plugging in.

I have tested using instead

[Element Speaker+LO]
switch = mute
volume = merge

Which seems to make it work and behave as I expect it to.
Comment 21 Raymond 2015-06-14 15:28:19 UTC
(In reply to Martin Erik Werner from comment #20)


as your don't have any dock station, you cannot verify any fix about the dock line out is correct or not



> 
> (In reply to Raymond from comment #17)
> > the dirty workaround if you need loopback mixing 
> > 
> > http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/src/modules/alsa/
> > mixer/paths/analog-output-headphones.
> > conf?id=aec811798cd883a454b9b5cd82c77831906bbd2d
> > 
> > remove three lines from headphone.conf
> > 
> > since auto mute is performed by driver 
> > 
> > 
> > -[Element Speaker+LO]
> > -switch = off
> > -volume = off
> 
> Doing this stops the Speaker+LO volume from being lowered and muted thus
> headphones have sound when plugged in, but if internal speakers are muted
> before plugging in, it does not unmute Speaker+LO when plugging in.
> 
> I have tested using instead
> 
> [Element Speaker+LO]
> switch = mute
> volume = merge
> 
> Which seems to make it work and behave as I expect it to.

it is because the driver only use speaker+lo playback volume when loopback mixing is enabled 


the headphone playback volume is useless until the driver bug is fixed if you really need to use loopback mixing
Comment 22 Raymond 2015-06-14 15:40:51 UTC
you better leave the dock line out mystery to the other user who has the dock line out playback switch and speaker playback switch

especially you don't have any dick station to test



Ports:
		analog-output-lineout: Line Out (priority: 9900, not available)
		analog-output-speaker: Speakers (priority: 10000)
		analog-output-headphones: Headphones (priority: 9000, not available)
Comment 23 Raymond 2015-06-14 16:11:28 UTC
When loopback mixing is diabled

speakers are connected to node 0x13 

headphones are directly connected to node 0x14


Node 0x0b [Pin Complex] wcaps 0x400581: Stereo
  Control: name="Headphone Jack", index=0, device=0
  Pincap 0x0001001c: OUT HP EAPD Detect
  EAPD 0x2: EAPD
  Pin Default 0x0421101f: [Jack] HP Out at Ext Right
    Conn = 1/8, Color = Black
    DefAssociation = 0x1, Sequence = 0xf
  Pin-ctls: 0xc0: OUT HP
  Unsolicited: tag=01, enabled=1
  Power states: 
  Power: setting=D0, actual=D0
  Connection: 3
     0x13 0x14* 0x1c

Node 0x0d [Pin Complex] wcaps 0x400501: Stereo
  Control: name="Speaker Phantom Jack", index=0, device=0
  Pincap 0x00010050: OUT EAPD Balanced
  EAPD 0x2: EAPD
  Pin Default 0x90170110: [Fixed] Speaker at Int N/A
    Conn = Analog, Color = Unknown
    DefAssociation = 0x1, Sequence = 0x0
    Misc = NO_PRESENCE
  Pin-ctls: 0x00:
  Power states: 
  Power: setting=D0, actual=D0
  Connection: 3
     0x13* 0x14 0x1c



do you mean this setting still not work ?
Comment 24 Raymond 2015-06-14 16:23:27 UTC
Node 0x0a [Pin Complex] wcaps 0x400583: Stereo Amp-In
  Control: name="Dock Line Out Jack", index=0, device=0
  Amp-In caps: N/A
  Amp-In vals:  [0x00 0x00]
  Pincap 0x0001173c: IN OUT HP EAPD Detect
    Vref caps: HIZ 50 GRD 80
  EAPD 0x2: EAPD
  Pin Default 0x21011030: [Jack] Line Out at Sep Rear
    Conn = 1/8, Color = Black
    DefAssociation = 0x3, Sequence = 0x0
  Pin-ctls: 0x00: VREF_HIZ
  Unsolicited: tag=02, enabled=1
  Power states: 
  Power: setting=D0, actual=D0
  Connection: 3
     0x13* 0x14 0x1c

both speaker and dock line out are connected to node 0x13 

you have to post alsa-info if disable loopback mixing won't work as expected
Comment 25 Martin Erik Werner 2015-06-14 19:07:29 UTC
(In reply to Raymond from comment #24)
> you have to post alsa-info if disable loopback mixing won't work as expected

I tested again now disabling loopback mixing and made sure to kill pulseaudio in between, and it seems to be working now, so I guess I did not restart pulse properly the last time.

So with this it also works as I expect it to.

Then I guess the driver bug is what remains then I guess, and this is not a bug in pulseaudio then?

(In the driver bug this is claimed to be "designed behaviour" though, so in that case would then pulseaudio have to be aware if loopback mixing is enabled and switch to using the common node then?)
Comment 26 Raymond 2015-06-14 23:51:37 UTC
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/tree/Documentation/sound/alsa/HD-Audio-Controls.txt

the topology of codecs of different vendor are different

realtek codecs does not has DAC input in aamix

some via codecs has only one DAC in aamix

some idt codecs has two DAC in aamix

desktop user prefer to use line playback volume to connect TV card input to use speakers connected to line out
Comment 27 Raymond 2015-06-15 00:49:25 UTC
(In reply to Martin Erik Werner from comment #25)
> 
> Then I guess the driver bug is what remains then I guess, and this is not a
> bug in pulseaudio then?
> 
> (In the driver bug this is claimed to be "designed behaviour" though, so in
> that case would then pulseaudio have to be aware if loopback mixing is
> enabled and switch to using the common node then?)


the loopback mixing is disabled by default since driver try to save more power by power down the audio mixer
Comment 28 Raymond 2015-06-15 01:24:46 UTC
sound hdaudioC0D0: autoconfig for 92HD81B1X5: line_outs=1 (0xa/0x0/0x0/0x0/0x0) type:line
sound hdaudioC0D0:    speaker_outs=1 (0xd/0x0/0x0/0x0/0x0)
sound hdaudioC0D0:    hp_outs=1 (0xb/0x0/0x0/0x0/0x0)
sound hdaudioC0D0:    mono: mono_out=0x0
sound hdaudioC0D0:    inputs:
sound hdaudioC0D0:      Mic=0xc
sound hdaudioC0D0:      Internal Mic=0x11
sound hdaudioC0D0:      Line=0xf


http://www.intel.com/support/motherboards/desktop/sb/CS-034206.htm


different audio stream can also sent to dock line out/speaker and headphone



https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/tree/Documentation/sound/alsa/HD-Audio.txt

independent hp is enabled by default for ADI and VIA codecs


for idt/realtek codecs, user  can also enabled by hint indep_hp=1 using early patching
Comment 29 Raymond 2015-06-15 01:42:50 UTC
A NaN (Not-a-Number) is a symbolic entity encoded in floating-point format. There are two types of NaNs: 

Signalling NaN 


 signals an invalid operation exception 

Quiet NaN 


 propagates through almost every arithmetic operation without signalling an exception 

 NaNs are produced by these operations: 

 ∞ − ∞,   −∞ + ∞,   0 × ∞,   0 ÷ 0,   ∞ ÷ ∞


how do pulseaudio treat −∞ - ∞  ?
Comment 30 Raymond 2015-06-15 02:13:43 UTC
(In reply to Martin Erik Werner from comment #25)
> (In reply to Raymond from comment #24)
> > you have to post alsa-info if disable loopback mixing won't work as expected
> 
> I tested again now disabling loopback mixing and made sure to kill
> pulseaudio in between, and it seems to be working now, so I guess I did not
> restart pulse properly the last time.
> 
> So with this it also works as I expect it to.

in theory, you do not need to restart pulseaudio unless you have changed those pulseaudio conf files
Comment 31 Raymond 2015-06-15 02:33:10 UTC
(In reply to Martin Erik Werner from comment #25)

> 
> (In the driver bug this is claimed to be "designed behaviour" though, so in
> that case would then pulseaudio have to be aware if loopback mixing is
> enabled and switch to using the common node then?)

you need to submit patch to update  the documentation about idt codecs

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/tree/Documentation/sound/alsa/HD-Audio-Controls.txt


 As a side-effect, when this mode is set, the
  individual volume controls will be no longer available for
  headphones and speakers because mixer widget is alway connect to primary DAC even when there are more than one DAC can be connected to mixer widget
Comment 32 GitLab Migration User 2018-07-30 09:41:27 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/94.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.