A Weird Imagination

PulseAudio headphone jack troubles

Posted in

The problem#

Since I got a new motherboard (and therefore new audio hardware as I'm using the basic one built into the motherboard) sometimes after I unplugged my headphones, my speakers would not output any sound.

pavucontrol showed the only available output as "Built-in Audio Digital Stereo" with a port of "S/PDIF", which does not describe any audio device I had ever used. If I plugged my headphones back in, they would work fine, and usually after unplugging and plugging back in my headphones enough times, my computer would eventually acknowledge that my speakers were connected by showing the expected "Built-in Audio Analog Stereo" with a port of "Line Out".

The solution#

In /usr/share/pulseaudio/alsa-mixer/paths/analog-output-lineout.conf change

[Jack Front Headphone]
state.plugged = no
state.unplugged = unknown

to

[Jack Front Headphone]
state.plugged = no
state.unplugged = yes       # changed from unknown

This forces PulseAudio to consider there to be speakers plugged into the "Line Out" port, so it may cause strange behavior if that is not the case.

To apply the change, run

pulseaudio --kill
pulseaudio --start

to restart PulseAudio.

Read more…

PulseAudio

Posted in

PulseAudio is what most modern Linux distributions use as a sound server, the part of the sound subsystem that sits between applications and the sound driver supporting features like allowing multiple applications to output sound simultaneously. PulseAudio adds various features not present in other Linux sound servers like per-application volume controls and easily outputting to different audio devices (for instance, using HDMI audio instead of the normal audio jack).

PulseAudio can be controlled using pavucontrol, which is a GUI audio mixer. It shows a volume meter and control for every application producing sound as well as an option to choose which audio device it is outputting to. It additionally lists all of the hardware input and output devices, as you would expect from an audio mixer.

Fixing problems#

Restarting PulseAudio#

If PulseAudio is not working properly, you can restart it by running

$ killall -9 pulseaudio

No, really, that's what Debian's PulseAudio page says to do.

When I initially installed PulseAudio, it didn't have my sound cards listed and just had the default null outuput, making it not very useful. Running that command to restart it fixed it.

Muted devices#

PulseAudio seems to mute my sound card all by itself. Currently, I just go into pavucontrol and unmute it.