2

When I connect my headphones into the front jack, my speakers (line-out) get muted. I would like to switch to speakers without disconnecting my headphones. I see two possible options in gnome-control-center and pavucontrol: Headphones and Line-out. But when I switch to line-out, I hear nothing. How can I set correct behaviour?

I have Realtek ALC1150 with Alsa and PulseAudio installed.

5

1. Software switching support

Check, if your sound card supports software switching for the front audio panel. Some older motherboards don't support software switching at all. Some sound cards have connectors for both variants on the motherboard: software and hardware switching. In this case, make sure from your motherboard manual, that you use the connector with software switching.

2. Alsamixer Auto-Mute

Auto-Mute is a feature of Alsa. It ensures that when you connect your headphones, the other audio outputs are automatically muted. You can find and disable this in alsamixer. Open AlsaMixer, choose your sound card with F6 then move with < and > and find Auto-Mute. If it's enabled, disable it with the down arrow key.

3. PulseAudio configuration

This was the most problematic part for me because PulseAudio is poorly documented. When I disabled AutoMute in the previous step, speakers played in both cases. No matter, if I switched to Headphones or Line-out.

So what I had to do was look into AlsaMixer again and understand, how the volume bars react to audio switching in settings or pavucontrol.

Line-out: AlsaMixer Line-out

Headphones: AlsaMixer Headphones

As you can see, after switching to headphones, almost all volume bars got muted. But as I found out after a while, the volume of my speakers is for some reason controlled by Front bar. So now the last thing I had to do, was to configure PulseAudio to mute this Front volume-bar after switching to headphones.

PulseAudio configuration files we need to edit are stored in /usr/share/pulseaudio/alsa-mixer/paths/. In my case, I only edited the file analog-output-headphones.conf but this may vary depending on the configuration. You have to edit the file as root to contain these lines:

[Element Front]
switch = off
volume = off

Once you are done, save the file and restart PulseAudio with pulseaudio -k.

Output switching should now work as expected.

0

You can toggle with a shortcut using this on-liner:

[[ $(pacmd list-cards | grep "active profile" | cut -d " " -f 3-) = "<output:hdmi-stereo-extra1+input:analog-stereo>" ]] && pacmd set-card-profile 0 "output:analog-stereo+input:analog-stereo" || pacmd set-card-profile 0 "output:hdmi-stereo-extra1+input:analog-stereo"

In this case the alternatives are hdmi-stereo-extra1+input:analog-stereo and output:analog-stereo+input:analog-stereo. List your profiles available with:

pacmd list-cards | grep "output:" | grep -v "available: no"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.