0

tl;dr I want to change between headphones/amplifier without having to change any configuration. How to do that?

In Windows, every audio output was available at the same time, so I could send audio to an external amplifier (connected to the rear socket) and/or to headphones (connected to the front socket) without any configuration change.

In Debian, I needed to install pavucontrol and change the "Output Devices", "Built-in Audio Analog Stereo", "Port" to "Headphones (unplugged)" instead of the default "Line Out (plugged in)", to use headphones. With the default selection, sound only goes to the rear socket. After change to "Headphones (unplugged)", sound goes to both rear and front sockets. If sound may go to both, why isn't this the default option in every Linux system?

8
  • 1
    I don't understand your setup, but if I plugged in headphones and audio continued to blast from the speakers, I'd be pretty annoyed.
    – muru
    Commented Apr 8, 2020 at 2:21
  • @muru I have a PC. When I want headphones, I turn down the amp. When I want amp, I take off the headphones. What I don't want is to change settings every time for something as trivial as that.
    – Rodrigo
    Commented Apr 8, 2020 at 2:25
  • 1
    You say roughly "I could send audio to an external amp, and/or headphones".. how are you doing the and/or without configuration changes?
    – cutrightjm
    Commented Apr 8, 2020 at 3:08
  • 2
    This doesn’t answer your question but you could always plug your headphones into your amp, if it has a headphone out (that’s what I do). Commented Apr 8, 2020 at 7:15
  • 1
    I get your request, it’s something I used to do too (send audio to all available outputs). Your problem likely comes from the “unplugged” part: when PA detects that headphones have been plugged in, it automatically switches to them, but if your “plugged in” detection isn’t working, that won’t happen. (And yes, switching to the headphones isn’t what you’re asking for either, but it would solve your use case.) Commented Apr 8, 2020 at 12:33

2 Answers 2

1

If you have headphones actually plugged in while it says "Headphones (unplugged)", that indicates the plug detection is not working correctly. Either it's detecting your audio output as detection-capable when it actually is not, or it's failing to detect that your headphones are actually plugged in.

And why an unplugged output is disabled? That is most likely to achieve power savings on laptops. When working on battery, every bit of power counts. And it does no harm on desktops either, assuming that the plugged/unplugged information is correct, which is not true in your case.

The plug detection works using a firmware table that describes which input plug detection pins of the audio chip are associated with which physical connectors. Unfortunately, vendors sometimes have discrepancies between the firmware table and actual hardware wiring, which are then corrected in the released Windows drivers. Linux users will then need to determine the hardware-model-specific wiring errors and report it to the driver developers, so that the audio driver can apply a model-specific quirk to the information read from the firmware table.

While waiting for the driver quirk to be added to your distribution's kernel, there might be module options that can achieve the same effect if the wiring error is similar to another already existing case. Please specify your hardware model as accurately as possible, so we might be able to identify if this is a known issue with a module option workaround already available.

The HD-Audio audio chip may also have an auto-mute feature that will optionally mute the speaker/line outputs when it detects that headphones are plugged in. You can usually access the feature by using alsamixer -c 0 (you may need the -c 0 option to explicitly specify that you want the mixer of the actual audio chip and not the PulseAudio layer on top of it). If there is a toggleable setting labeled "Auto-Mute Mode", that's it. In Debian 10 it seems to be usually disabled by default, but you might want to check it.

If your chassis has an older AC-97 style audio output, that may have the mute-other-outputs-when-headphones-connected function implemented in hardware, in which case it cannot be easily disabled.

Debian's alsa-tools-gui package includes a hdajackretask tool that can be used to (among other things) manipulate the plug detection information. If you find the settings that make your plug detection work correctly (or just disables the non-working plug detection, if that's the best you can do) in your hardware, please report the fix and your system/motherboard model to the Linux audio developers so that your system's model-specific quirk can be added to the drivers and automatically compensated for.

There is one more thing with the headphone output: back when this was discussed in the alsa-developers mailing list, it was decided that requiring headphone users to go into the mixer settings and adjust the headphone output to a suitable volume and save the settings would be less bad that potentially sending out audio over the headphones at full, potentially hearing-damanging volume by default.

3
  • Yes, plug detection is not working correctly. Yes, there is a toggleable setting labeled "Auto-Mute Mode", and it's default was "Line Out+Speaker" (the other options being "Speaker Only" and "Disabled"). It seems that Speaker should be a laptop speaker, since pavucontrol has an option called "Speakers (unavailable)". Anyway, changing the Auto-Mute in alsamixer made no difference in the amp sound (connected to Line Out), which is always on, no matter what. My question is simple: if this problem has been around for at least 8 years, why not send audio to every available jacket as default?
    – Rodrigo
    Commented Apr 8, 2020 at 17:23
  • On laptops, you would want to disable anything that is not needed in order to save battery power. This includes output amplifier circuits for unplugged audio outputs. If everyone does their job correctly this does no harm in desktops either, since disabling an unplugged output is not a problem. And doing things differently whether on a laptop or not is one more decision that might go wrong. And enabling everything on full volume by default would have a risk of damaging some headphone user's hearing - it used to be that way until someone complained about it to the developers.
    – telcoM
    Commented Apr 9, 2020 at 7:25
  • laptop-detect is working here, it could help. Since this error has been around for years, and is really annoying, an easy solution was to prompt the user with a toggleable option, saved between sessions, like "are you on a laptop?" or something. And I said nothing about "full volume", I have no problem in turning the volume up after I installed Debian, and this could also be saved between sessions.
    – Rodrigo
    Commented Apr 10, 2020 at 16:40
1

You might be able to work around your problem by installing paprefs, then run that, go to the “Simultaneous Output” tab, and enable the virtual output device:

PulseAudio Preferences showing the Simultaneous Output tab

Close the preferences, restart PulseAudio (pulseaudio -k), and you should see a new output:

PulseAudio sound output device selection dialog

Select that, and your audio will be sent to all configured devices simultaneously. It’s possible this will still not send audio to headphone outputs if they are not detected as connected...

2
  • Seemed interesting. But it didn't work, not even after reboot. I still have to change the pavucontrol option.
    – Rodrigo
    Commented Apr 9, 2020 at 4:22
  • Worse, now the main volume control (close to settings and power off buttons) doesn't change the volume of the headphones :(
    – Rodrigo
    Commented Apr 15, 2020 at 4:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .