ALSA PulseAudio sound output when switching between headphones and laptop speaker

7,561

Edit the file /usr/share/pulseaudio/alsa-mixer/paths/analog-output-speaker.conf and locate the section:

[Element Headphone]

And comment the lines

switch = off
volume = off

The end result will be

[Element Headphone]
#switch = off
#volume = off

The problem, in my case was being caused because the channel "Headphones" was being muted, and for some reason, it needs not to be muted for the notebook's speakers to work.

With my change, the headphones don't mute nor get the volume set to zero when unplugging the headphones.

To "debug" which channel is being muted in your case, you can use alsamixer, and inside alsamixer you can press "C" to select your audiocard (the default is setting the volumes for pulseaudio main channels). Plug and unplug the headphones and check what changes.

Share:
7,561

Related videos on Youtube

mdt
Author by

mdt

Updated on September 18, 2022

Comments

  • mdt
    mdt over 1 year

    Since I installed PulseAudio on my Gentoo system I've been having no audio output from my laptop's speakers when un-plugging the headphones jack.

    I suppose the problem lies in how ALSA and PulseAudio manage the audio controls. When headphones are plugged everything is perfectly ok, alsa controls for the Intel HDA PCH are configured correctly so that 'Master' and 'Headphones' volume bars are correctly configured (I can tell this by looking at alsamixer with root privileges). When I un-plug the headphone jack, volume settings automatically change in a apparently correct way. That is, the 'Headphone' bar is muted and set to 0, while the 'Speaker' bar is un-muted and maxed out (while it gets muted when plugging the headphone jack). The 'Master' is always left un-muted and with the desired volume level. I can actually make the speakers output work by manually un-mute and pump-up the headphones output with alsamixer. But I would have to do this operation every time a plug/un-plug headphones. So is there some way to fix this? Maybe somehow decouple headphones output from speaker output in the ALSA system?

    My laptop is an HP Pavilion G6 from 2011.

    Thanks.

    • diogovk
      diogovk almost 9 years
      I'm with a similar problem where to use my notebook speakers I have to increase the volume in the channel "Headphones". And when I unplug the headphones, this channel goes to 0, and I have to bring it back up using alsamixer (I have to select the card because of pulseaudio).
  • mdt
    mdt almost 9 years
    Feels a bit like a workaround, but it solves the problem nonetheless so I'm accepting the answer :)
  • diogovk
    diogovk almost 9 years
    I have no idea what's the "proper" fix for this. Maybe you could try #alsa or the mailing list?
  • spinkus
    spinkus over 6 years
    Do you have to reboot, login/out, pulseaudio -k, for the setting change to get picked up or what?
  • Newton
    Newton over 4 years
    '/usr/share/pulseaudio/alsa-mixer/paths' is a directory. Edit the file 'analog-output-speaker.conf' as shown in the answer.