You are not logged in.

#1 2016-10-20 16:42:37

quxs
Member
Registered: 2016-10-20
Posts: 1

PulseAudio doesn't auto switch headphones to internal speakers

This works fine with just ALSA, but after installing PulseAudio I have this issue.

I start with headphones plugged in. In pavucontrol->"Output Devices"->"Built-in Audio Analog Stereo" the port is "Headphones (plugged in)", and in the drop down the other option is "Speakers (unavailable)".  When I unplug my headphones the port switches to "Speakers". But no audio comes from the speakers. If I manually change the port to "Headphones (unplugged)" from the drop down menu the audio comes out from my internal speakers. Afterwards, plugging in my headphones plays sound from my headphones and we're back to the start.

Without PulseAudio, in alsamixer, I would see this work as expected, where unplugging headphones would automatically let sound play from the speakers. Any ideas? Laptop is an HP Envy 4 Ultrabook.

Offline

#2 2016-10-21 08:23:34

Inixi
Member
Registered: 2016-10-15
Posts: 54

Re: PulseAudio doesn't auto switch headphones to internal speakers

I do not use `pavucontrol` but I have edited `/etc/pulse/default.pa` and added these two lines in the end:

#In order to auto-connect a2dp for some devices
load-module module-switch-on-connect

Also I use GDM and to ake sure that it won't catch pulseaudio sink on the system start I added these lines to `/var/lib/gdm/.config/pulse/client.conf ` file:

autospawn = no
daemon-binary = /bin/true

and also make sure that this file has proper permissions

-rw-r--r-- 1 gdm gdm 41 Oct  3 13:28 /var/lib/gdm/.config/pulse/client.conf

With this setup Pulseaudio will auto switch when you connect speakers (no matter if they are bluetooth speakers or wired ones) and switch back when you disconnect them.

Last edited by Inixi (2016-10-21 08:24:55)


2020 ASUS Zephyrus G14

Offline

#3 2016-10-21 08:54:52

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,616

Re: PulseAudio doesn't auto switch headphones to internal speakers

Disable/comment module-switch-on-port-available in your /etc/pulse/default.pa If any playback is restricted to the headphone port regardless, you might want to add at the end of that same file

set-sink-port $sinkname $portname #Use pacmd list-sinks to find the correct identifiers to fill in here

@Inixi Not quite, module-switch-on-connect only reacts to sources that make a new sink appear/disappear (bluetooth or usb soundcards most of the time), however in this case we are still on the same sink, simply the port switches, therefore this line will not help in this case.

Offline

Board footer

Powered by FluxBB