Headphones not detected if plugged in before boot Ubuntu 18.04

12,883

Solution 1

I just faced a similar problem.

I also have an HDMI monitor plugged in, so PulseAudio chose it instead of the headphones. After unplugging and plugging the headphone in the audio jack, I can only guess it gave priority back to the headphone and set it as the default.

So the issue for me is that PulseAudio is setting up the wrong profile by default due to my HDMI monitor being present. The headphones are still being detected, just not being used due to the wrong profile.

Solution: Remove any configuration files auto-generated at ~/.config/pulse

rm -r ~/.config/pulse

Then restart pulseaudio

pulseaudio --kill && pulseaudio --start

If you open pavucontrol, it should be correctly set to a profile matching the headphones.

For example:

example

Then go to the Devices tab and check if Headphones (plugged in) is selected as the default device.

Solution 2

We do have a similar issue with the TV monitor. When we exit TV, we must set sound back to PC otherwise will not get sound at all after. Must go back to TV and set sound back to PC.

The given command lines, restore normal behavior. Thanks!

sudo apt install pavucontrol 

rm -r ~/.config/pulse

pulseaudio --kill && pulseaudio –start

Nice app:)

pavucontrol

This tweak works for live streaming, no need to close the browser when closing the external monitor. It also fixes an abnormal behavior, where the Display app and the Sound app cannot be open at the same time.

This bug is gone now. @ reaysawa, thank you!

Solution 3

If as it happened to me the other answers doesn't work for you, re-installing alsa-base and pulseaudio worked:

sudo apt remove --purge alsa-base pulseaudio
sudo apt install alsa-base pulseaudio
Share:
12,883

Related videos on Youtube

Elisey Ozerov
Author by

Elisey Ozerov

Updated on September 18, 2022

Comments

  • Elisey Ozerov
    Elisey Ozerov over 1 year

    So my problem is basically in the title. If my headphones are plugged in before I boot (I'm using Dell XPS 15 9560, Ubuntu 18.04), they aren't detected. I've gotta unplug them and plug them back in for them to be recognized.

    I saw the question regarding Ubuntu 16.04 and tried that solution, but it didn't work for me. I also didn't find anything regarding this issue of the sound troubleshooting page at help.ubuntu.

    What should I do? Thanks :)

  • antisa
    antisa over 3 years
    I'd like to add an update to this for Xubuntu 20.04.1. Had the same problem, but I didn't need to remove .config/pulse directory nor restart the pulseaudio. It was enough to select Analog Stereo Duplex and the issue was resolved.
  • FantomX1
    FantomX1 over 3 years
    reinstall did not work for me, had to still remove configuration as in other answer