Sound is not automatically switched back from headphones to speakers

Bug #1521987 reported by Björn Lindqvist
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
PulseAudio
Unknown
Medium
pulseaudio (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

When plugging in headphones, sound output is correctly switched from speakers (line out) to the headphones. When the headphones are unplugged, sound is NOT automatically switched back to the speakers.

This bug started happening on my system after I upgraded from 14.04 to 15.10 so it is a regression. Attached is pulseaudio log of what happens when I plug and unplug my headphones.

Tags: zesty
Revision history for this message
Björn Lindqvist (bjourne) wrote :
Revision history for this message
Björn Lindqvist (bjourne) wrote :

Likely source is pulseaudio or alsa.

affects: alsa-driver (Ubuntu) → pulseaudio (Ubuntu)
Revision history for this message
Raymond (superquad-vortex2) wrote :

   0.266| 0.000) D: [pulseaudio] module-alsa-card.c: Jack 'Line Out Front Jack' is now unplugged
( 0.266| 0.000) D: [pulseaudio] device-port.c: Setting port analog-output-lineout to status no
( 0.266| 0.000) D: [pulseaudio] core-subscribe.c: Dropped redundant event due to change event.
( 0.266| 0.000) D: [pulseaudio] module-alsa-card.c: Jack 'Line Out CLFE Jack' is now unplugged
( 0.266| 0.000) D: [pulseaudio] module-alsa-card.c: Jack 'Line Out Surround Jack' is now unplugged
( 0.266| 0.000) D: [pulseaudio] module-alsa-card.c: Jack 'Line Out Side Jack' is now plugged in

seem on line out jack plug, how do pulseaudio swtich port when headphone is unplugged ?

Changed in pulseaudio (Ubuntu):
status: New → Incomplete
Revision history for this message
Raymond (superquad-vortex2) wrote :

you only plug the grey line out jack

Revision history for this message
Björn Lindqvist (bjourne) wrote :

I don't know what you are talking about.

Revision history for this message
Raymond (superquad-vortex2) wrote :

Vt1708s is a 8 channel hda codec

If your motherboard have line out side jack (grey jack and side playback volume control),

Headphone can be connected to node 0x16 or node 0x25, either share front or side playback volume control

Node 0x1d [Pin Complex] wcaps 0x40058d: Stereo Amp-Out
Control: name="Headphone Playback Switch", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0
Control: name="Independent HP", index=0, device=0
Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
Amp-Out vals: [0x80 0x80]
Pincap 0x0000233c: IN OUT HP Detect Vref caps: HIZ 50 100
Pin Default 0x0221401f: [Jack] HP Out at Ext Front Conn = 1/8, Color = Green DefAssociation = 0x1, Sequence = 0xf
Pin-ctls: 0xc0: OUT HP VREF_HIZ Unsolicited: tag=05, enabled=1
Power states: D0 D1 D2 D3
Power: setting=D0, actual=D0

Connection: 2
0x16* 0x25

Revision history for this message
Björn Lindqvist (bjourne) wrote :

I understand that my motherboard has several ports. But why did you mark my bug as incomplete? What info do you want me to add?

Revision history for this message
Raymond (superquad-vortex2) wrote :
Download full text (6.3 KiB)

You have to file upstream bug report

You have front headphone jack and headphone playback switch but no headphone playback volume

 This mean that headphone and green line out share front playback volume control

0.089| 0.000) D: [pulseaudio] alsa-mixer.c: Path analog-output-lineout (Line Out), direction=1, priority=99, probed=yes, supported=yes, has_mute=yes, has_volume=yes, has_dB=yes, min_volume=0, max_volume=42, min_dB=-177, max_dB=0
( 0.089| 0.000) D: [pulseaudio] alsa-mixer.c: Element Master, direction=1, switch=1, volume=1, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x7ffffffffffff, n_channels=1, override_map=yes
 ( 0.089| 0.000) D: [pulseaudio] alsa-mixer.c: Element Headphone, direction=1, switch=2, volume=0, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x0, n_channels=0, override_map=no
 ( 0.089| 0.000) D: [pulseaudio] alsa-mixer.c: Element Front, direction=1, switch=1, volume=1, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x6, n_channels=2, override_map=yes
( 0.089| 0.000) D: [pulseaudio] alsa-mixer.c: Element Surround, direction=1, switch=1, volume=1, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x60, n_channels=2, override_map=yes
( 0.089| 0.000) D: [pulseaudio] alsa-mixer.c: Element Side, direction=1, switch=1, volume=1, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0xc00, n_channels=2, override_map=yes
( 0.089| 0.000) D: [pulseaudio] alsa-mixer.c: Element Center, direction=1, switch=1, volume=1, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x4900000000018, n_channels=1, override_map=yes
( 0.089| 0.000) D: [pulseaudio] alsa-mixer.c: Element LFE, direction=1, switch=1, volume=1, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x80, n_channels=1, override_map=yes
( 0.089| 0.000) D: [pulseaudio] alsa-mixer.c: Element PCM, direction=1, switch=0, volume=1, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x3600000000f66, n_channels=2, override_map=yes
( 0.089| 0.000) D: [pulseaudio] alsa-mixer.c: Element IEC958, direction=1, switch=2, volume=0, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x0, n_channels=0, override_map=no
( 0.089| 0.000) D: [pulseaudio] alsa-mixer.c: Jack Line Out, alsa_name='Line Out Jack', detection unavailable
( 0.089| 0.000) D: [pulseaudio] alsa-mixer.c: Jack Line Out Phantom, alsa_name='Line Out Phantom Jack', detection unavailable ( 0.089| 0.000) D: [pulseaudio] alsa-mixer.c: Jack Headphone, alsa_name='Headphone Jack', detection unavailable
( 0.089| 0.000) D: [pulseaudio] alsa-mixer.c: Jack Line Out Front, alsa_name='Line Out Front Jack', detection possible ( 0.089| 0.000) D: [pulseaudio] alsa-mixer.c: Jack Line Out Front Phantom, alsa_name='Line Out Front Phantom Jack', detection unavailable
( 0.089| 0.000) D: [pulseaudio] alsa-mixer.c: Jack Line Out CLFE, alsa_name='Line Out CLFE Jack', detection possible ( 0.089| 0.000) D: [pulseaudio] alsa-mixer.c: Jack ...

Read more...

Revision history for this message
Raymond (superquad-vortex2) wrote :

Post output of alsa-info.sh

independent headphone should not be created if there is no headphone playback volume control

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

Revision history for this message
Björn Lindqvist (bjourne) wrote :
Revision history for this message
Raymond (superquad-vortex2) wrote :
Download full text (3.2 KiB)

Both HP and Line Out jack are using same Audio Node 0x10 ( share Front Playback Volume)

if you want Headphone Playback Volume Control, you need to give up grey jack to force driver to use node 0x25

Node 0x10 [Audio Output] wcaps 0x41d: Stereo Amp-Out
  Control: name="Front Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Device: name="VT1708S Analog", type="Audio", device=0
  Amp-Out caps: ofs=0x2a, nsteps=0x2a, stepsize=0x05, mute=0
  Amp-Out vals: [0x1d 0x1d]
  Converter: stream=5, channel=0
  PCM:
    rates [0x5e0]: 44100 48000 88200 96000 192000
    bits [0xe]: 16 20 24
    formats [0x1]: PCM
  Power states: D0 D1 D2 D3
  Power: setting=D0, actual=D0

Node 0x16 [Audio Mixer] wcaps 0x20050b: Stereo Amp-In
  Control: name="Rear Mic Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=2, ofs=0
  Control: name="Rear Mic Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=2, ofs=0
  Control: name="Front Mic Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=4, ofs=0
  Control: name="Front Mic Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=4, ofs=0
  Control: name="Line Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=3, ofs=0
  Control: name="Line Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=3, ofs=0
  Amp-In caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1
  Amp-In vals: [0x17 0x17] [0x80 0x80] [0x80 0x80] [0x00 0x00] [0x00 0x00] [0x80 0x80] [0x80 0x80]
  Power states: D0 D1 D2 D3
  Power: setting=D0, actual=D0
  Connection: 7
     0x10 0x1f 0x1a 0x1b 0x1e 0x1d 0x25

Node 0x1c [Pin Complex] wcaps 0x40058d: Stereo Amp-Out
  Control: name="Front Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
  Amp-Out vals: [0x00 0x00]
  Pincap 0x0001001c: OUT HP EAPD Detect
  EAPD 0x2: EAPD
  Pin Default 0x01014010: [Jack] Line Out at Ext Rear
    Conn = 1/8, Color = Green
    DefAssociation = 0x1, Sequence = 0x0
  Pin-ctls: 0x00:
  Unsolicited: tag=01, enabled=1
  Power states: D0 D1 D2 D3
  Power: setting=D0, actual=D0
  Connection: 1
     0x16
Node 0x1d [Pin Complex] wcaps 0x40058d: Stereo Amp-Out
  Control: name="Headphone Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
  Amp-Out vals: [0x00 0x00]
  Pincap 0x0000233c: IN OUT HP Detect
    Vref caps: HIZ 50 100
  Pin Default 0x0221401f: [Jack] HP Out at Ext Front
    Conn = 1/8, Color = Green
    DefAssociation = 0x1, Sequence = 0xf
  Pin-ctls: 0xc0: OUT HP VREF_HIZ
  Unsolicited: tag=05, enabled=1
  Power states: D0 D1 D2 D3
  Power: setting=D0, actual=D0
  Connection: 2
     0x16* 0x25

Node 0x25 [Audio Output] wcaps 0x41d: Stereo Amp-Out
  Control: name="Side Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Amp-Out caps: ofs=0x2a, nsteps=0x2a, stepsize=0x05, mute=0
  Amp-Out vals: [0x00 0x00]
  Converter: stream=5, channel=0
  PCM:
    rates [0x5e0]: 44100 48000 88200 96000 192000
    bits [0xe]: 16 20 24
   ...

Read more...

Revision history for this message
Raymond (superquad-vortex2) wrote :

but you only plug the speaker to grey jack instead of green jack

 control.34 {
  iface CARD
  name 'Line Out Front Jack'
  value false
  comment {
   access read
   type BOOLEAN
   count 1
  }
 }
 control.35 {
  iface CARD
  name 'Line Out Surround Jack'
  value false
  comment {
   access read
   type BOOLEAN
   count 1
  }
 }
 control.36 {
  iface CARD
  name 'Line Out CLFE Jack'
  value false
  comment {
   access read
   type BOOLEAN
   count 1
  }
 }
 control.37 {
  iface CARD
  name 'Line Out Side Jack'
  value true
  comment {
   access read
   type BOOLEAN
   count 1
  }
 }
 control.38 {
  iface CARD
  name 'Front Headphone Jack'
  value true
  comment {
   access read
   type BOOLEAN
   count 1
  }

Revision history for this message
Raymond (superquad-vortex2) wrote :

your pulseaudio log did not show the sink port after you unplugged headphone

do pulseaudio change to line out , SPDIF or HDMI ?

( 38.730| 7.351) D: [pulseaudio] module-alsa-card.c: Jack 'Front Headphone Jack' is now unplugged
( 38.730| 0.000) D: [pulseaudio] device-port.c: Setting port analog-output-headphones to status no
( 45.179| 6.448) I: [pulseaudio] main.c: Got signal SIGINT.

Revision history for this message
Björn Lindqvist (bjourne) wrote :

It doesn't change at all. The sound settings say that the output is "Headphones" even when they are unplugged.

Yes you are right that my speakers are connected to the gray jack on the backplane. They have always been connected that way and failover between speakers and headphones has worked in previous versions of Ubuntu. Now I changed so that the speakers are on the green jack instead and failover now works correctly. So thanks for that tip. But since plugging them into the gray jack has worked before I still think there is a bug here.

Revision history for this message
Raymond (superquad-vortex2) wrote :

you need to file upstream bug report as VT1708S support independent HP in previous version by sharing volume control with SIde jack

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pci/hda/patch_via.c?id=e5e14681404ec27a422d635284bf564dabde3f81

Revision history for this message
Raymond (superquad-vortex2) wrote :

The volume control at those audio outputs should be named as "Front+HP" or "Side+HP"

or give up grey jack by hdajackretask to get back Headphone Playback Volume

Revision history for this message
Raymond (superquad-vortex2) wrote :
Revision history for this message
Björn Lindqvist (bjourne) wrote :

I thought the point of filing launchpad bugs was that you would take it upstream if it is confirmed that it is a real bug? Ok I'll see if I can find the pulseaudio bug tracker and file a new bug there.

Revision history for this message
Raymond (superquad-vortex2) wrote :

the availablitiy of line out depend on headphone jack,
the status of line out is unknown after headphone is unplugged
this does not imply it will switch back to line out since digitail out is also unknown

[Jack Line Out]
required-any = any

[Jack Line Out Phantom]
state.plugged = unknown
state.unplugged = unknown
required-any = any

[Jack Headphone]
state.plugged = no
state.unplugged = unknown

[Jack Front Headphone]
state.plugged = no
state.unplugged = unknown

[Jack Front Line Out]
required-any = any

Revision history for this message
Björn Lindqvist (bjourne) wrote :

What is the upstream bug tracker for PulseAudio?

Revision history for this message
Raymond (superquad-vortex2) wrote :
Revision history for this message
Raymond (superquad-vortex2) wrote :

Try hdajackretask to change grey jack as not connected, the driver will create the headphone volume control but only support surround51 instead of surround71

http://git.alsa-project.org/?p=alsa-tools.git;a=tree;f=hdajackretask;hb=HEAD

Revision history for this message
In , 89c51 (barz621) wrote :

After the update to Pulseaudio 8.0 i get the below behavior.

Plugging in headphones changes the Build in Analog stereo out from Line Out to Headphones. (as it should)

Unplugging it makes the Build in Analog stereo out disappear and changes it to Build in Digital stereo with SPDIF as an out option.

The only way to fix it -have sound again since there is nothing connected to spdif- is to change the configuration from pavucontrol Configuration > Build in Audio profile or log out and log in again in case you don't have pavucontrol installed.

Revision history for this message
In , Tanu Kaskinen (tanuk) wrote :

That sounds like a pretty bad regression. I'll mark this as a release blocker for 9.0.

Revision history for this message
In , 89c51 (barz621) wrote :

Is this something that can be fixed in a point/bugfix release or it is something more difficult to solve?

Revision history for this message
In , Tanu Kaskinen (tanuk) wrote :

It's not obvious to me how to fix this. It might turn out to be simple or it might be complex. I don't promise to start working on this quickly (there are other important bugs on my list first), but maybe David would be interested to work on this.

Revision history for this message
In , David Henningsson (diwic) wrote :

Thanks for the bug report, I will need a PulseAudio verbose log to research further. Could you attach one?

https://wiki.ubuntu.com/PulseAudio/Log

Please both plug and unplug headphones while the log is active. Thanks!

Revision history for this message
In , 89c51 (barz621) wrote :

Created attachment 121383
log file

Not sure the method on the link gives the results you would expect but here goes.

Revision history for this message
In , David Henningsson (diwic) wrote :

(In reply to Apostolos B. from comment #5)
> Created attachment 121383 [details]
> log file
>
> Not sure the method on the link gives the results you would expect but here
> goes.

No, apparently pulseaudio either failed to kill or respawned for some reason. Not sure how ARCH spawns pulseaudio, but make sure pulseaudio is not running before starting the log. Thanks!

Revision history for this message
In , Tanu Kaskinen (tanuk) wrote :

This should stop pulseaudio and prevent respawns on Arch:

systemctl --user stop pulseaudio.socket pulseaudio.service

To restore the system back to normal functioning, run this:

systemctl --user start pulseaudio.socket

Revision history for this message
In , 89c51 (barz621) wrote :

Created attachment 121389
correct log

That will do it i believe.

Revision history for this message
In , David Henningsson (diwic) wrote :

( 0.178| 0.000) D: [pulseaudio] module-alsa-card.c: Jack 'Line Out Front Jack' is now unplugged
( 0.178| 0.000) D: [pulseaudio] module-alsa-card.c: Jack 'Line Out CLFE Jack' is now unplugged
( 0.178| 0.000) D: [pulseaudio] module-alsa-card.c: Jack 'Line Out Surround Jack' is now unplugged
( 0.178| 0.000) D: [pulseaudio] module-alsa-card.c: Jack 'Front Headphone Jack' is now unplugged

Since your line-out jack (the front/main one) is unplugged, I believe we're doing the right thing by switching to something else (i e, in your case the digital output, for which do not know the jack status).

Do you actually have something plugged into your line out jack, or why do you want analog line out to be selected?

Revision history for this message
In , 89c51 (barz621) wrote :

I have nothing connected true but if i unplug and plug the headphones again it stays to the digital out (which also has nothing connected to it) and i have no sound on the headphones.

Revision history for this message
In , David Henningsson (diwic) wrote :

Ah, so the problem is that it does not switch to headphones rather than it switches from them; although this happened to be less of a problem in earlier versions because it stayed on the same profile.

I'm going to attach a patch now, can you test it? And if it does not work, could you submit another pulseaudio log which also includes you plugging in headphones while on the digital profile?

Thanks!

Revision history for this message
In , David Henningsson (diwic) wrote :

Created attachment 121395
Routing change patch

Revision history for this message
In , Sarnex (commendsarnex) wrote :

(In reply to David Henningsson from comment #12)
> Created attachment 121395 [details] [review]
> Routing change patch

This patch fixes the issue for me.

Tested-by: Nick Sarnie <email address hidden>

Revision history for this message
In , Björn Lindqvist (bjourne) wrote :

Can you please note my bug report filed here: https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1521987 ?

It is supposedly about the same problem, and I've produced a lot of logs and description of how the problem works.

Revision history for this message
In , 89c51 (barz621) wrote :

@David

I can't test right now on the system i get the bug (its my stable one) and on my other system i don't have HW (digital out) to test.

@sarnes reported it fixed his issue (assuming it was the same as mine) so it believe it works.

Maybe others can chime in.

Revision history for this message
In , Tanu Kaskinen (tanuk) wrote :

*** Bug 93986 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Benjarobin+freedesktop (benjarobin+freedesktop) wrote :

The patch (Routing change patch) https://bugs.freedesktop.org/attachment.cgi?id=121395 fixes the problem (at least for my reported bug: sorry for the duplicate...)

Revision history for this message
In , Tanu Kaskinen (tanuk) wrote :

The fix is now in master.

Changed in pulseaudio:
importance: Unknown → Medium
status: Unknown → Fix Released
Revision history for this message
In , Tanu Kaskinen (tanuk) wrote :

*** Bug 96237 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Htd-c (htd-c) wrote :

Just to let you know:

I had a similar bug with Fedora 24 which drove me nuts. Analog output was always switched back to digital, losing sound. Changing it in pavucontrol didn't last longer than a few seconds. With the patch from comment 12, my problem is fixed!

Revision history for this message
In , Eugene Crosser (crosser) wrote :

I am not sure that the suggested patch is a good fix for the problem.
As I understand it, with the patch, when the currently active destination becomes unavailable, new destination is chosen on the basis of its priority.

Now consider my own use case:
I have S/PDIF and Analog outputs on the chip, but S/PDIF is not connected to anywhere (there is no connector on the box). I have speakers permanently connected to the analog "line out" socket. And I use headphones intermittently. Normally, desktop's audio widget configures "line out" as active, which is what I want. When I plug the headphones, they automatically become active, and speakers are muted, which is what I want, again. But, when I unplug the headphones, (unconnected) S/PDIF becomes active instead of the speakers, and I lose sound until I manually reconfigure the output via the audio widget.

I think that my scenario is quite typical (it happens both on my desktop and notebook computers), and should be addressed better.

Thank you.

Revision history for this message
In , Tanu Kaskinen (tanuk) wrote :

I believe PulseAudio 9.0 will handle your use case well. Please report back if it doesn't.

Revision history for this message
In , Eugene Crosser (crosser) wrote :

(In reply to Tanu Kaskinen from comment #22)
> I believe PulseAudio 9.0 will handle your use case well. Please report back
> if it doesn't.

It does not.
Version: 1:9.0-2ubuntu2
Same behavior: after plugging and unplugging the headset some nonexistent device becomes active, and I have no sound until I manually select "line out".

Revision history for this message
In , Tanu Kaskinen (tanuk) wrote :

Do you happen to have the audio settings application open? If you do, it can mess up the device selection: https://bugzilla.gnome.org/show_bug.cgi?id=762932

Revision history for this message
In , Eugene Crosser (crosser) wrote :

(In reply to Tanu Kaskinen from comment #24)
> Do you happen to have the audio settings application open? If you do, it can
> mess up the device selection:
> https://bugzilla.gnome.org/show_bug.cgi?id=762932

It happens when audio control application running and not running likewise, but desktop's audio widget in the panel is indeed running (Cinnamon and Unity, same manifestations). It is possible that this audio widget is indeed the culprit.

Revision history for this message
In , Tanu Kaskinen (tanuk) wrote :

(In reply to Eugene Crosser from comment #25)
> It happens when audio control application running and not running likewise,
> but desktop's audio widget in the panel is indeed running (Cinnamon and
> Unity, same manifestations). It is possible that this audio widget is indeed
> the culprit.

It's possible, but I don't think it's likely.

Can you attach a log file that shows what happens when you start with analog output selected and headphones plugged in, and then unplug them and plug them back in? Instructions for getting the log: https://wiki.ubuntu.com/PulseAudio/Log

Revision history for this message
In , Ken (flatisjustice) wrote :

Created attachment 128797
Pulse Log incorrect switching

Log that should show pulse incorrectly switching to digital when it should switch back to the previous configuration for speakers.

Revision history for this message
In , Ken (flatisjustice) wrote :

In my case speakers should be set to Analog Surround 5.1 Output + Analog Stereo Input, however after unplugging headphones they are switched to digital out.

Revision history for this message
In , Tanu Kaskinen (tanuk) wrote :

The log doesn't match your problem description. The digital profile is not activated at all. The log shows switching between headphones and lineout in 2.1 mode. You wanted to use 5.1, so is your problem actually that you get 2.1 audio instead of 5.1?

Revision history for this message
In , Ken (flatisjustice) wrote :

Created attachment 128999
digital/5.1 - stereo out/digital

Sorry, this bug isn't consistent so that last log may not have reflected the issue. This _should_ show that it starts my headphones as digital out, upon unplugging the line out should be switched to 5.1. Again plugging in headphones changes the output to digital. After setting the headphones to stereo out via pulse audio volume control, unplugging the headphones sets the configuration back to digital.

Revision history for this message
In , Tanu Kaskinen (tanuk) wrote :

Thanks, the log is interesting. At line 5943 the headphones are plugged in. Pulseaudio then decides to switch from the 5.1 profile to the analog stereo profile, as expected. After switching the profile, however, pulseaudio decides to immediately switch to digital output instead. Unfortunately the log doesn't show why this happens.

If I write a patch that adds better logging, will you be able to apply and test it? Here are some instructions for building and installing pulseaudio from source: https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/Developer/PulseAudioFromGit/

Revision history for this message
In , Ken (flatisjustice) wrote :

Sure, if you write a patch I will compile and test it.

Changed in pulseaudio:
status: Fix Released → Confirmed
Revision history for this message
In , Tanu Kaskinen (tanuk) wrote :

Created attachment 129175
0001-card-log-the-reason-for-profile-changes.patch

Here's the patch. It's written against the git master branch. If you need it for some other PulseAudio version, let me know and I'll rebase it.

Revision history for this message
In , Ken (flatisjustice) wrote :

Created attachment 129184
pulse verbose log with 0001-card-log-the-reason-for-profile-changes.patch

So interestingly enough I can't reproduce the issue using git master. Attached are two logs as one attachment. The second log starts at line 5308 (Didn't want to spam attachments). The first log shows pulse crashing upon disconnecting the headphones. The second log shows pulse switching between 5.1-stereo and Analog Stereo working fine. If you rebase the patch on 10.0 I can try it again to see what was going on. Version 10.0 is the current version from Arch Linux's repos. I assume a commit since then must have fixed something either intentionally or unintentionally.

Revision history for this message
In , Tanu Kaskinen (tanuk) wrote :

(In reply to flat from comment #34)
> Created attachment 129184 [details]
> pulse verbose log with 0001-card-log-the-reason-for-profile-changes.patch
>
> So interestingly enough I can't reproduce the issue using git master.

The first log with the crash shows a switch to the digital profile. Unfortunately, the crash happens before the log message I added is printed.

The first log shows four "audio-volume-change" sounds being played in quick succession during the crash. The volume changes are initiated by gnome-settings-daemon. Did you change the volume manually while disconnecting the headphones, or is this something that gnome-settings-daemon does automatically?

> Attached are two logs as one attachment. The second log starts at line 5308
> (Didn't want to spam attachments). The first log shows pulse crashing upon
> disconnecting the headphones. The second log shows pulse switching between
> 5.1-stereo and Analog Stereo working fine. If you rebase the patch on 10.0 I
> can try it again to see what was going on. Version 10.0 is the current
> version from Arch Linux's repos. I assume a commit since then must have
> fixed something either intentionally or unintentionally.

I don't think it's fixed in master, but I can anyway make a patch for 10.0. I'll change it so that the profile change reason is printed in an earlier phase. I'll also add some logging in an attempt to make it easier to track down the reason for the crash if it happens again.

Revision history for this message
In , Tanu Kaskinen (tanuk) wrote :

Created attachment 129226
0001-card-log-the-reason-for-profile-changes.patch (for 10.0)

Here's the updated patch.

Revision history for this message
In , Ken (flatisjustice) wrote :

Created attachment 129265
pulse audio verbose log with 0001-card-log-the-reason-for-profile-changes.patch 10.0

Here is the log from the new rebased patch. The bug did occur in git master but not as often.

>The first log shows four "audio-volume-change" sounds being played in quick
>succession during the crash. The volume changes are initiated by gnome-settings-daemon.
>Did you change the volume manually while disconnecting the headphones, or is this something that gnome-settings-daemon does automatically?

I'm not sure if that was me or not. I usually tap the volume key a couple times to see what output configuration it is set on because it's quick. This time I didn't touch the volume manually.

The log should show it switching from 5.1 to digital then digital to 5.1 and then 5.1 to stereo duplex and then stereo duplex to digital.

Revision history for this message
In , Tanu Kaskinen (tanuk) wrote :

The new log doesn't seem to have the patch applied. Can you try again? You can check that pulseaudio is running with the patch by searching the log for messages that contain "XXX" that are printed whenever the card profile changes.

Revision history for this message
In , Ken (flatisjustice) wrote :

Created attachment 129322
pulse audio verbose log with 0001-card-log-the-reason-for-profile-changes.patch 10.0

Sorry it took a couple days for it to happen again. Guess it helps when you compile to actually apply the patch... haha. Here's a log from it switching between digital and normal, even after I set it to the correct configurations it seems to switch. Looking through the log I think it might have to do with budgie-panel, but I'm not sure. Also got another crash so that's the first log. Second log starts on line 4424

Revision history for this message
In , Ken (flatisjustice) wrote :

Same issue on xfce4, so it's not budgie.

Revision history for this message
In , Tanu Kaskinen (tanuk) wrote :

Sorry for the long delay, I have trouble keeping up with all email...

(In reply to flat from comment #39)
> Created attachment 129322 [details]
> pulse audio verbose log with
> 0001-card-log-the-reason-for-profile-changes.patch 10.0
>
> Sorry it took a couple days for it to happen again. Guess it helps when you
> compile to actually apply the patch... haha. Here's a log from it switching
> between digital and normal, even after I set it to the correct
> configurations it seems to switch. Looking through the log I think it might
> have to do with budgie-panel, but I'm not sure.

Yes, "Budgie Volume Control" changes the profile to digital.

> Also got another crash so
> that's the first log. Second log starts on line 4424

It's not a crash, it's a failure to start the daemon. module-esound-protocol-unix can't setup itself, because the socket it needs is reserved by some other process (probably another pulseaudio instance). I'm not sure why this happens, but you can safely remove module-esound-protocol-unix from /etc/pulse/default.pa. It's extremely unlikely that you have any applications that still use esound.

Revision history for this message
In , Tanu Kaskinen (tanuk) wrote :

(In reply to flat from comment #40)
> Same issue on xfce4, so it's not budgie.

It certainly was Budgie according to the log. Maybe xfce4 has a similar bug in its volume control thingy.

Revision history for this message
In , Ken (flatisjustice) wrote :

(In reply to Tanu Kaskinen from comment #42)
> (In reply to flat from comment #40)
> > Same issue on xfce4, so it's not budgie.
>
> It certainly was Budgie according to the log. Maybe xfce4 has a similar bug
> in its volume control thingy.

No problem on the delay, thanks for taking the time to look into this. I'll file a bug report with budgie.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thank you for reporting this bug to Ubuntu.
Ubuntu 15.10 (wily) reached end-of-life on July 28, 2016.

See this document for currently supported Ubuntu releases:
https://wiki.ubuntu.com/Releases

We appreciate that this bug may be old and you might not be interested in discussing it any more. But if you are then please upgrade to the latest Ubuntu version and re-test.

Revision history for this message
Eugene Crosser (crosser) wrote :

The problem still exists in zesty (despite is says "fix released" in a comment above).

tags: added: zesty
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Eugene: If a bug has been closed in error or prematurely and you're not the original reporter then it's still easier and cleaner to resolve by opening a new bug yourself. So please feel free...

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

That said, upstream is open too. So let's use this bug.

Changed in pulseaudio (Ubuntu):
status: Incomplete → Confirmed
importance: Undecided → Medium
Revision history for this message
In , Pablow-1422 (pablow-1422) wrote :

Created attachment 131569
pulse audio verbose log

Same problem and use case: analog line-out speakers, headphone plugged-in, headphone unplugged, digital output profile set instead of analog line-out (Analog Duplex to be precise).

It happens on Fedora 25 (10.0-2.fc25) and openSUSE tumbleweed (can't have access to that PC right now), both running KDE Plasma desktop (5.9.5).

KDE devs said it should be reported here [https://bugs.kde.org/show_bug.cgi?id=380316#add_comment]

Revision history for this message
In , Pablow-1422 (pablow-1422) wrote :

(In reply to pablow.1422 from comment #44)
> Created attachment 131569 [details]
> pulse audio verbose log
>
> Same problem and use case: analog line-out speakers, headphone plugged-in,
> headphone unplugged, digital output profile set instead of analog line-out
> (Analog Duplex to be precise).
>
> It happens on Fedora 25 (10.0-2.fc25) and openSUSE tumbleweed (can't have
> access to that PC right now), both running KDE Plasma desktop (5.9.5).
>
> KDE devs said it should be reported here
> [https://bugs.kde.org/show_bug.cgi?id=380316#add_comment]

Never mind. Something in the miniplug speaker contact was preventing the detection of the port as being connected. Sorry for the useless reply.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thank you for reporting this bug to Ubuntu.
Ubuntu 17.04 (zesty) reached end-of-life on January 13, 2018.

See this document for currently supported Ubuntu releases:
https://wiki.ubuntu.com/Releases

We appreciate that this bug may be old and you might not be interested in discussing it any more. But if you are then please upgrade to the latest Ubuntu version and re-test.

If you then find the bug is still present in the newer Ubuntu version, please add a comment here telling us which new version it is in and change the bug status to Confirmed.

Changed in pulseaudio (Ubuntu):
status: Confirmed → Incomplete
Changed in pulseaudio (Ubuntu):
status: Incomplete → Invalid
Revision history for this message
In , Gitlab-migration (gitlab-migration) wrote :

-- 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/390.

Changed in pulseaudio:
status: Confirmed → Unknown
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.