pavucontrol shows Line-out as unplugged when Headphones are plugged in
- Open up alsamixer. Then press F6 to select your sound card, most likely ending with PCH.
- Scroll right till you find the Auto-Mute option.
- Press up or down arrow to disable it. Press Esc to quit alsamixer.
Use the following script to automate it.
#!/bin/sh
NAME=$(basename -- "$0")
command -v amixer >/dev/null 2>&1 || { echo >&2 "amixer not installed"; exit 1; }
command -v pacmd >/dev/null 2>&1 || { echo >&2 "pacmd not installed"; exit 1; }
amixer -c1 sset "Auto-Mute Mode" Disabled > /dev/null
if [ -z $1 ]; then
echo -e "Usage:\nFront Speakers\t: $NAME 0\t\nHeadphones\t: $NAME 1\nBoth Speakers\t: $NAME 2"
exit 1
elif [ $1 -eq 0 ] 2> /dev/null; then
pacmd set-sink-port 1 analog-output-lineout
amixer -c1 set Headphone 0% > /dev/null
amixer -c1 set Front 100% > /dev/null
elif [ $1 -eq 1 ] 2> /dev/null; then
pacmd set-sink-port 1 analog-output-headphones
amixer -c1 set Front 0% > /dev/null
amixer -c1 set Headphone 100% > /dev/null
elif [ $1 -eq 2 ] 2> /dev/null; then
pacmd set-sink-port 1 analog-output-headphones
amixer -c1 set Front 100% > /dev/null
amixer -c1 set Headphone 100% > /dev/null
else
echo -e "Invalid argument"
exit 1
fi
This assumes that the card you are using is numbered 1. Also, it assumes that your PulseAudio ports are named analog-output-lineout and analog-output-headphones. Save it as something like speakers.sh and chmod to set execute bit.
Run speakers.sh 1
for Headphones and speakers.sh 0
for Speakers.
Related videos on Youtube
BenjiWiebe
My main job is cheese making. (Try some! It's really good!) I'm now a small engine mechanic. For hobbies, I write computer programs, fix other people's computers, and program AVR microcontrollers.
Updated on September 18, 2022Comments
-
BenjiWiebe almost 2 years
I have my speakers plugged in to the Line Out jack. When I plug my headphones into the front headphone jack, the speakers are muted and sound is played in my headphones, as expected. However, when I open up
pavucontrol
and manually select to send sound to Line Out (which is listed as unplugged) it mutes the headphones (as expected) but does NOT play audio out the speakers.I've tried many different permutations of
pactl
andpacmd
, withset-sink-port
and other commands, and every time, either nothing changes, or both the speakers and headphones are silent, as they are when I try to do it withpavucontrol
.TL;DR; I want to be able to switch between headphones and speakers while both are plugged in, but the speakers are ALWAYS silent when my headphones are plugged in.
I'm running up-to-date Fedora 23 with the KDE 5 desktop.
-
linuxdev2013 over 8 yearsin
alsamixer
set auto-mute to enabled ---problem solved -
BenjiWiebe over 8 years@linuxdev2013 I sure don't see any auto-mute option in alsamixer....
-
-
BenjiWiebe about 8 yearsWait...it doesn't quite work. Now audio plays out both, when headphones are chosen. i.e. it always plays out of speakers regardless of whether Line Out or Headphones are selected.
-
Vishal Biswas about 8 years@BenjiWiebe You could always mute the speakers through alsamixer.
-
BenjiWiebe about 8 yearsYes I could, but I don't want to have so many steps needed...I wish I could just quickly and easily toggle between two outputs!
-
Vishal Biswas about 8 yearscheck main post for automation script
-
EGurelli over 6 yearsThank you for answer , it saves me from some headaches .