The issue that I'm having is that headphones plugged into the 3.5mm jack on the front of my desktop computer are not always detected. I'm running Ubuntu 20.04 on a custom built computer with a B450 Tomahawk motherboard. I'm certain that the issue is with Ubuntu 20.04 because the issue was not occurring (as far as I'm aware) when the same computer was running 18.04.

The steps to create my problem are:

  1. Be running computer with headphones disconnected using another audio output.
  2. Simply plug headphones into computer but headphones don't appear in sound settings.
  3. By suspending and unsuspending the computer, the problem is usually fixed and headphones will now appear in sound settings.

Some things that I've tried:

Any help would be greatly appreciated!

  • Sometimes it happens to me, that the choose screen (headphones, headset, ...) is not displayed at all, but it is displayed somehow "in the background" on the login screen - so I locked/or suspended PC, then wake it and click it there and then it started to work normally in the logged-in system GUI :-)
    – jave.web
    Commented Aug 9, 2023 at 12:16

7 Answers 7


Open your terminal and run these

pulseaudio --kill 
pulseaudio --start

This solved my problem in Ubuntu 20.04. But unfortunately there should be automatic detection, which is not working. Slightly disappointed

  • 1
    wow thank you. 🙏, tried several other solutions and this is the one that worked for me on my mid 2015 mbp running archlinux circa 2024
    – ipatch
    Commented Feb 9 at 1:49

On ubuntu 20.04 below steps worked

1) Alsa and timidity-daemon

More here.

sudo apt-get install --reinstall alsa-base pulseaudio
sudo alsa force-reload
sudo apt purge timidity-daemon

2) Auto set output and mic based on Jack events

sudo apt install alsa-tools-gui
sudo hdajackretask

On the right, under Options, enable the Parser hints checkbox. Then set

  • jack_detect = yes
  • trigger_sense = yes
  • primary_hp = yes
  • multi_io = yes
  • add_hp_mic = yes

then Press >> "Apply now" & Press >> "Install boot override".


Read on all option of Hint Strings here.

  • hdajackretask freeze when click on "applhy now". Is there a way to edit config file manually?. Thanks Commented May 16, 2023 at 9:31
  • Finally! This works after trying so many things. I got an error saying tee: /sys/class/sound/hwC0D2/reconfig: Device or resource busy. But after applying the boot override and restarting it does work! Except that sound is only coming from the left ear phone, but it's better than nothing. Thanks!
    – Bono
    Commented Apr 25 at 15:12
  • Actually after visiting the sound settings it turns out the balance for the headphones was almost completely set to the left ear phone. After setting it to the middle it works perfectly fine
    – Bono
    Commented Apr 25 at 15:15

Be aware that the problem might not be software-related — it could be hardware-related.

Many headphones have inbuilt microphones and, as a result, the headphone jack has one more contact than those that do not have inbuilt microphones.

headphone jacks with and without microphone support

If the socket on your computer is expecting one type of jack, and you plug in the other type of jack, then you may not end up with a 'clean' contact. If there is no clean contact, then the OS (via the audio subsystem) may either not recognise what you have inserted, or not recognise that you have inserted anything at all.

In the majority of cases where hardware is at fault, folks plug in a jack with two central bands (headphones with microphone support) into a socket expecting only one central band (headphones only). To test to see if this is your problem, find a plain headphone jack (only one central band) and plug/unplug that sucker repeatedly. If that behaves normally, but your two-band jack doesn't, then you know what the problem is.

PS: Whether or not you actually use the microphone is irrelevant. The issue is simply one of electrical metal-on-metal connections when you physically plug the jack into the socket. Due to manufacturers adhering to standards to varying degrees, and manufacturing tolerances being all over the place, we do not live in a perfect world where these things 'just work' as they are supposed to.

  • 2
    Bingo! this was my issue
    – Felipe
    Commented Mar 18, 2023 at 2:51

Using alsactrl you can reload the driver state from configuration file using :

sudo alsactl restore

This solution is only temporary, meaning you will need to do this every time you plug-in your headphones.


Ubuntu 20.04 MSI B450 Gaming Plus: I have the same issue. When I unplug the microphone and/or headphones it disappears from the sound settings. When I plug in again, it is not recognized anymore. As a workaround I need to logout and then login again. And voilà the connected headphones and microphone are recognized again.

Strangely in the sound settings, the self test of the speakers doesn't work. No sound at all. But if click further below on the various options for alert sound, then it works.

Conclusion: I need to use zoom an similar services quite often and it's such a pain that after using Ubuntu for more than 10 years I was seriously considering a return back to Windows (I won't of course). In my humble view, everything related to sound settings in Ubuntu is quite cumbersome and sort of anti intuitive - often broken.

  • Is logging out and back in again your answer to the question? Or did you find something else? Your answer does not provide much help if not.
    – Natolio
    Commented Dec 21, 2021 at 18:44
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Dec 21, 2021 at 18:44
  • Thanks, that did help on my MSI board as well.
    – Force
    Commented Mar 30, 2022 at 11:41
  • Hi, I just read through the comments here. How does it address the issue? The topic of this thread is that the headphone jack isn't reliably detected. And that's the problem that I'm dealing with as well. When I am inside a session, plug out the headphone jack and then plug in again, the headphone jack wouldn't be reliably detected. Logging out and logging in again "fixes" that, so at least I can use my earphones. I'm using the MSI B450 Gaming Plus mainboard and a fairly recent BIOS version 7B86v1D (Ubuntu 20.04.4 LTS). Commented May 17, 2022 at 13:22

im using an imac 2011 model with AMD processor, kubuntu 22, everything works as a charm, BUT im having trouble with getting sound out of the 3.5 jack, the internal speakers does work fine and loud, but whenever i plug in the 3.5 mm jack the sound goes violently down, there IS sound but its very very very low, though i´ve turned it all the way to 150 percent, its still very very low sound, when i pull out the 3.5 jack it goes back to internal speakers as it should and the sound comes back loud and clear, i also have the same issue with and macbook pro either if running windows or linux, it seems to be an general thing with macs appearantly.. can someone here help me? im so frustrated that everything works but the sound output.


In my case it is solved by the following way though not very good:

sudo alsactl restore

With this command headphone sound is recovered. But the problem is that speaker was giving sound at the same time. So I decreased the volume of the speaker using alsamixer.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .